colorBlock/build/wechatgame/cocos/cocos2d-js-min.js
YZ\249929363 4ca3daaa48 提交
2025-06-26 14:44:43 +08:00

1 line
1.3 MiB

(function(t,e,i){function n(i){var r=e[i];if(!r){var a=t[i];if(!a)return;var s={};r=e[i]={exports:s},a[0]((function(t){return n(a[1][t]||t)}),r,s)}return r.exports}for(var r=0;r<i.length;r++)n(i[r])})({1:[(function(t){"use strict";t("../core/platform/CCClass");var e=t("../core/utils/misc");cc.Action=cc.Class({name:"cc.Action",ctor:function(){this.originalTarget=null,this.target=null,this.tag=cc.Action.TAG_INVALID},clone:function(){var t=new cc.Action;return t.originalTarget=null,t.target=null,t.tag=this.tag,t},isDone:function(){return!0},startWithTarget:function(t){this.originalTarget=t,this.target=t},stop:function(){this.target=null},step:function(){cc.logID(1006)},update:function(){cc.logID(1007)},getTarget:function(){return this.target},setTarget:function(t){this.target=t},getOriginalTarget:function(){return this.originalTarget},setOriginalTarget:function(t){this.originalTarget=t},getTag:function(){return this.tag},setTag:function(t){this.tag=t},retain:function(){},release:function(){}}),cc.Action.TAG_INVALID=-1,cc.FiniteTimeAction=cc.Class({name:"cc.FiniteTimeAction",extends:cc.Action,ctor:function(){this._duration=0},getDuration:function(){return this._duration*(this._timesForRepeat||1)},setDuration:function(t){this._duration=t},reverse:function(){return cc.logID(1008),null},clone:function(){return new cc.FiniteTimeAction}}),cc.Speed=cc.Class({name:"cc.Speed",extends:cc.Action,ctor:function(t,e){this._speed=0,this._innerAction=null,t&&this.initWithAction(t,e)},getSpeed:function(){return this._speed},setSpeed:function(t){this._speed=t},initWithAction:function(t,e){return t?(this._innerAction=t,this._speed=e,!0):(cc.errorID(1021),!1)},clone:function(){var t=new cc.Speed;return t.initWithAction(this._innerAction.clone(),this._speed),t},startWithTarget:function(t){cc.Action.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},stop:function(){this._innerAction.stop(),cc.Action.prototype.stop.call(this)},step:function(t){this._innerAction.step(t*this._speed)},isDone:function(){return this._innerAction.isDone()},reverse:function(){return new cc.Speed(this._innerAction.reverse(),this._speed)},setInnerAction:function(t){this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return this._innerAction}}),cc.speed=function(t,e){return new cc.Speed(t,e)},cc.Follow=cc.Class({name:"cc.Follow",extends:cc.Action,ctor:function(t,e){this._followedNode=null,this._boundarySet=!1,this._boundaryFullyCovered=!1,this._halfScreenSize=null,this._fullScreenSize=null,this.leftBoundary=0,this.rightBoundary=0,this.topBoundary=0,this.bottomBoundary=0,this._worldRect=cc.rect(0,0,0,0),t&&(e?this.initWithTarget(t,e):this.initWithTarget(t))},clone:function(){var t=new cc.Follow,e=this._worldRect,i=new cc.Rect(e.x,e.y,e.width,e.height);return t.initWithTarget(this._followedNode,i),t},isBoundarySet:function(){return this._boundarySet},setBoundarySet:function(t){this._boundarySet=t},setBoudarySet:function(t){this.setBoundarySet(t)},initWithTarget:function(t,e){if(!t)return cc.errorID(1022),!1;e=e||cc.rect(0,0,0,0),this._followedNode=t,this._worldRect=e,this._boundarySet=!(0===e.width&&0===e.height),this._boundaryFullyCovered=!1;var i=cc.winSize;return this._fullScreenSize=cc.v2(i.width,i.height),this._halfScreenSize=this._fullScreenSize.mul(.5),this._boundarySet&&(this.leftBoundary=-(e.x+e.width-this._fullScreenSize.x),this.rightBoundary=-e.x,this.topBoundary=-e.y,this.bottomBoundary=-(e.y+e.height-this._fullScreenSize.y),this.rightBoundary<this.leftBoundary&&(this.rightBoundary=this.leftBoundary=(this.leftBoundary+this.rightBoundary)/2),this.topBoundary<this.bottomBoundary&&(this.topBoundary=this.bottomBoundary=(this.topBoundary+this.bottomBoundary)/2),this.topBoundary===this.bottomBoundary&&this.leftBoundary===this.rightBoundary&&(this._boundaryFullyCovered=!0)),!0},step:function(){var t=this.target.convertToWorldSpaceAR(cc.Vec2.ZERO),i=this._followedNode.convertToWorldSpaceAR(cc.Vec2.ZERO),n=t.sub(i),r=this.target.parent.convertToNodeSpaceAR(n.add(this._halfScreenSize));if(this._boundarySet){if(this._boundaryFullyCovered)return;this.target.setPosition(e.clampf(r.x,this.leftBoundary,this.rightBoundary),e.clampf(r.y,this.bottomBoundary,this.topBoundary))}else this.target.setPosition(r.x,r.y)},isDone:function(){return!this._followedNode.activeInHierarchy},stop:function(){this.target=null,cc.Action.prototype.stop.call(this)}}),cc.follow=function(t,e){return new cc.Follow(t,e)}}),{"../core/platform/CCClass":168,"../core/utils/misc":242}],2:[(function(){"use strict";function t(t,e){return t[Math.min(t.length-1,Math.max(e,0))]}function e(t){for(var e=[],i=t.length-1;i>=0;i--)e.push(cc.v2(t[i].x,t[i].y));return e}function i(t){for(var e=[],i=0;i<t.length;i++)e.push(cc.v2(t[i].x,t[i].y));return e}cc.CardinalSplineTo=cc.Class({name:"cc.CardinalSplineTo",extends:cc.ActionInterval,ctor:function(t,e,i){this._points=[],this._deltaT=0,this._tension=0,this._previousPosition=null,this._accumulatedDiff=null,void 0!==i&&cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:function(t,e,i){return e&&0!==e.length?!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this.setPoints(e),this._tension=i,!0):(cc.errorID(1024),!1)},clone:function(){var t=new cc.CardinalSplineTo;return t.initWithDuration(this._duration,i(this._points),this._tension),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._deltaT=1/(this._points.length-1),this._previousPosition=cc.v2(this.target.x,this.target.y),this._accumulatedDiff=cc.v2(0,0)},update:function(e){var i,n;e=this._computeEaseTime(e);var r=this._points;if(1===e)i=r.length-1,n=1;else{var a=this._deltaT;n=(e-a*(i=0|e/a))/a}var s,o,c,l,h,u,f,_,d,p,m,v,g,y,T,A,b=(s=t(r,i-1),o=t(r,i-0),c=t(r,i+1),l=t(r,i+2),d=(_=(1-this._tension)/2)*(2*(u=(h=n)*h)-(f=u*h)-h),p=_*(-f+u)+(2*f-3*u)+1,m=_*(f-2*u+h)+-2*f+3*u,v=_*(f-u),g=s.x*d+o.x*p+c.x*m+l.x*v,y=s.y*d+o.y*p+c.y*m+l.y*v,cc.v2(g,y));if(cc.macro.ENABLE_STACKABLE_ACTIONS&&(T=this.target.x-this._previousPosition.x,A=this.target.y-this._previousPosition.y,0!==T||0!==A)){var E=this._accumulatedDiff;T=E.x+T,A=E.y+A,E.x=T,E.y=A,b.x+=T,b.y+=A}this.updatePosition(b)},reverse:function(){var t=e(this._points);return cc.cardinalSplineTo(this._duration,t,this._tension)},updatePosition:function(t){this.target.setPosition(t),this._previousPosition=t},getPoints:function(){return this._points},setPoints:function(t){this._points=t}}),cc.cardinalSplineTo=function(t,e,i){return new cc.CardinalSplineTo(t,e,i)},cc.CardinalSplineBy=cc.Class({name:"cc.CardinalSplineBy",extends:cc.CardinalSplineTo,ctor:function(t,e,i){this._startPosition=cc.v2(0,0),void 0!==i&&this.initWithDuration(t,e,i)},startWithTarget:function(t){cc.CardinalSplineTo.prototype.startWithTarget.call(this,t),this._startPosition.x=t.x,this._startPosition.y=t.y},reverse:function(){for(var t,i=this._points.slice(),n=i[0],r=1;r<i.length;++r)t=i[r],i[r]=t.sub(n),n=t;var a=e(i);for(n=a[a.length-1],a.pop(),n.x=-n.x,n.y=-n.y,a.unshift(n),r=1;r<a.length;++r)(t=a[r]).x=-t.x,t.y=-t.y,t.x+=n.x,t.y+=n.y,a[r]=t,n=t;return cc.cardinalSplineBy(this._duration,a,this._tension)},updatePosition:function(t){var e=this._startPosition,i=t.x+e.x,n=t.y+e.y;this._previousPosition.x=i,this._previousPosition.y=n,this.target.setPosition(i,n)},clone:function(){var t=new cc.CardinalSplineBy;return t.initWithDuration(this._duration,i(this._points),this._tension),t}}),cc.cardinalSplineBy=function(t,e,i){return new cc.CardinalSplineBy(t,e,i)},cc.CatmullRomTo=cc.Class({name:"cc.CatmullRomTo",extends:cc.CardinalSplineTo,ctor:function(t,e){e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,.5)},clone:function(){var t=new cc.CatmullRomTo;return t.initWithDuration(this._duration,i(this._points)),t}}),cc.catmullRomTo=function(t,e){return new cc.CatmullRomTo(t,e)},cc.CatmullRomBy=cc.Class({name:"cc.CatmullRomBy",extends:cc.CardinalSplineBy,ctor:function(t,e){e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,.5)},clone:function(){var t=new cc.CatmullRomBy;return t.initWithDuration(this._duration,i(this._points)),t}}),cc.catmullRomBy=function(t,e){return new cc.CatmullRomBy(t,e)}}),{}],3:[(function(){"use strict";cc.easeIn=function(t){return{_rate:t,easing:function(t){return Math.pow(t,this._rate)},reverse:function(){return cc.easeIn(1/this._rate)}}},cc.easeOut=function(t){return{_rate:t,easing:function(t){return Math.pow(t,1/this._rate)},reverse:function(){return cc.easeOut(1/this._rate)}}},cc.easeInOut=function(t){return{_rate:t,easing:function(t){return(t*=2)<1?.5*Math.pow(t,this._rate):1-.5*Math.pow(2-t,this._rate)},reverse:function(){return cc.easeInOut(this._rate)}}};var t={easing:function(t){return 0===t?0:Math.pow(2,10*(t-1))},reverse:function(){return e}};cc.easeExponentialIn=function(){return t};var e={easing:function(t){return 1===t?1:1-Math.pow(2,-10*t)},reverse:function(){return t}};cc.easeExponentialOut=function(){return e};var i={easing:function(t){return 1!==t&&0!==t?(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1))):t},reverse:function(){return i}};cc.easeExponentialInOut=function(){return i};var n={easing:function(t){return 0===t||1===t?t:-1*Math.cos(t*Math.PI/2)+1},reverse:function(){return r}};cc.easeSineIn=function(){return n};var r={easing:function(t){return 0===t||1===t?t:Math.sin(t*Math.PI/2)},reverse:function(){return n}};cc.easeSineOut=function(){return r};var a={easing:function(t){return 0===t||1===t?t:-.5*(Math.cos(Math.PI*t)-1)},reverse:function(){return a}};cc.easeSineInOut=function(){return a};var s={easing:function(t){return 0===t||1===t?t:(t-=1,-Math.pow(2,10*t)*Math.sin((t-.075)*Math.PI*2/.3))},reverse:function(){return o}};cc.easeElasticIn=function(t){return t&&.3!==t?{_period:t,easing:function(t){return 0===t||1===t?t:(t-=1,-Math.pow(2,10*t)*Math.sin((t-this._period/4)*Math.PI*2/this._period))},reverse:function(){return cc.easeElasticOut(this._period)}}:s};var o={easing:function(t){return 0===t||1===t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*Math.PI*2/.3)+1},reverse:function(){return s}};function c(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}cc.easeElasticOut=function(t){return t&&.3!==t?{_period:t,easing:function(t){return 0===t||1===t?t:Math.pow(2,-10*t)*Math.sin((t-this._period/4)*Math.PI*2/this._period)+1},reverse:function(){return cc.easeElasticIn(this._period)}}:o},cc.easeElasticInOut=function(t){return{_period:t=t||.3,easing:function(t){var e=0,i=this._period;if(0===t||1===t)e=t;else{t*=2,i||(i=this._period=.3*1.5);var n=i/4;e=(t-=1)<0?-.5*Math.pow(2,10*t)*Math.sin((t-n)*Math.PI*2/i):Math.pow(2,-10*t)*Math.sin((t-n)*Math.PI*2/i)*.5+1}return e},reverse:function(){return cc.easeElasticInOut(this._period)}}};var l={easing:function(t){return 1-c(1-t)},reverse:function(){return h}};cc.easeBounceIn=function(){return l};var h={easing:function(t){return c(t)},reverse:function(){return l}};cc.easeBounceOut=function(){return h};var u={easing:function(t){return t<.5?.5*(1-c(1-(t*=2))):.5*c(2*t-1)+.5},reverse:function(){return u}};cc.easeBounceInOut=function(){return u};var f={easing:function(t){return 0===t||1===t?t:t*t*(2.70158*t-1.70158)},reverse:function(){return _}};cc.easeBackIn=function(){return f};var _={easing:function(t){return 0===t?0:(t-=1)*t*(2.70158*t+1.70158)+1},reverse:function(){return f}};cc.easeBackOut=function(){return _};var d={easing:function(t){return(t*=2)<1?t*t*(3.5949095*t-2.5949095)/2:(t-=2)*t*(3.5949095*t+2.5949095)/2+1},reverse:function(){return d}};cc.easeBackInOut=function(){return d},cc.easeBezierAction=function(t,e,i,n){return{easing:function(r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-r,2)*e+3*Math.pow(r,2)*(1-r)*i+Math.pow(r,3)*n},reverse:function(){return cc.easeBezierAction(n,i,e,t)}}};var p={easing:function(t){return Math.pow(t,2)},reverse:function(){return p}};cc.easeQuadraticActionIn=function(){return p};var m={easing:function(t){return-t*(t-2)},reverse:function(){return m}};cc.easeQuadraticActionOut=function(){return m};var v={easing:function(t){return(t*=2)<1?t*t*.5:-.5*(--t*(t-2)-1)},reverse:function(){return v}};cc.easeQuadraticActionInOut=function(){return v};var g={easing:function(t){return t*t*t*t},reverse:function(){return g}};cc.easeQuarticActionIn=function(){return g};var y={easing:function(t){return-((t-=1)*t*t*t-1)},reverse:function(){return y}};cc.easeQuarticActionOut=function(){return y};var T={easing:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},reverse:function(){return T}};cc.easeQuarticActionInOut=function(){return T};var A={easing:function(t){return t*t*t*t*t},reverse:function(){return A}};cc.easeQuinticActionIn=function(){return A};var b={easing:function(t){return(t-=1)*t*t*t*t+1},reverse:function(){return b}};cc.easeQuinticActionOut=function(){return b};var E={easing:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},reverse:function(){return E}};cc.easeQuinticActionInOut=function(){return E};var C={easing:function(t){return-1*(Math.sqrt(1-t*t)-1)},reverse:function(){return C}};cc.easeCircleActionIn=function(){return C};var x={easing:function(t){return t-=1,Math.sqrt(1-t*t)},reverse:function(){return x}};cc.easeCircleActionOut=function(){return x};var S={easing:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},reverse:function(){return S}};cc.easeCircleActionInOut=function(){return S};var w={easing:function(t){return t*t*t},reverse:function(){return w}};cc.easeCubicActionIn=function(){return w};var D={easing:function(t){return(t-=1)*t*t+1},reverse:function(){return D}};cc.easeCubicActionOut=function(){return D};var M={easing:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},reverse:function(){return M}};cc.easeCubicActionInOut=function(){return M}}),{}],4:[(function(){"use strict";cc.ActionInstant=cc.Class({name:"cc.ActionInstant",extends:cc.FiniteTimeAction,isDone:function(){return!0},step:function(){this.update(1)},update:function(){},reverse:function(){return this.clone()},clone:function(){return new cc.ActionInstant}}),cc.Show=cc.Class({name:"cc.Show",extends:cc.ActionInstant,update:function(){for(var t=this.target.getComponentsInChildren(cc.RenderComponent),e=0;e<t.length;++e)t[e].enabled=!0},reverse:function(){return new cc.Hide},clone:function(){return new cc.Show}}),cc.show=function(){return new cc.Show},cc.Hide=cc.Class({name:"cc.Hide",extends:cc.ActionInstant,update:function(){for(var t=this.target.getComponentsInChildren(cc.RenderComponent),e=0;e<t.length;++e)t[e].enabled=!1},reverse:function(){return new cc.Show},clone:function(){return new cc.Hide}}),cc.hide=function(){return new cc.Hide},cc.ToggleVisibility=cc.Class({name:"cc.ToggleVisibility",extends:cc.ActionInstant,update:function(){for(var t=this.target.getComponentsInChildren(cc.RenderComponent),e=0;e<t.length;++e){var i=t[e];i.enabled=!i.enabled}},reverse:function(){return new cc.ToggleVisibility},clone:function(){return new cc.ToggleVisibility}}),cc.toggleVisibility=function(){return new cc.ToggleVisibility},cc.RemoveSelf=cc.Class({name:"cc.RemoveSelf",extends:cc.ActionInstant,ctor:function(t){this._isNeedCleanUp=!0,void 0!==t&&this.init(t)},update:function(){this.target.removeFromParent(this._isNeedCleanUp)},init:function(t){return this._isNeedCleanUp=t,!0},reverse:function(){return new cc.RemoveSelf(this._isNeedCleanUp)},clone:function(){return new cc.RemoveSelf(this._isNeedCleanUp)}}),cc.removeSelf=function(t){return new cc.RemoveSelf(t)},cc.DestroySelf=cc.Class({name:"cc.DestroySelf",extends:cc.ActionInstant,update:function(){this.target.destroy()},reverse:function(){return new cc.DestroySelf},clone:function(){return new cc.DestroySelf}}),cc.destroySelf=function(){return new cc.DestroySelf},cc.FlipX=cc.Class({name:"cc.FlipX",extends:cc.ActionInstant,ctor:function(t){this._flippedX=!1,void 0!==t&&this.initWithFlipX(t)},initWithFlipX:function(t){return this._flippedX=t,!0},update:function(){this.target.scaleX=Math.abs(this.target.scaleX)*(this._flippedX?-1:1)},reverse:function(){return new cc.FlipX(!this._flippedX)},clone:function(){var t=new cc.FlipX;return t.initWithFlipX(this._flippedX),t}}),cc.flipX=function(t){return new cc.FlipX(t)},cc.FlipY=cc.Class({name:"cc.FlipY",extends:cc.ActionInstant,ctor:function(t){this._flippedY=!1,void 0!==t&&this.initWithFlipY(t)},initWithFlipY:function(t){return this._flippedY=t,!0},update:function(){this.target.scaleY=Math.abs(this.target.scaleY)*(this._flippedY?-1:1)},reverse:function(){return new cc.FlipY(!this._flippedY)},clone:function(){var t=new cc.FlipY;return t.initWithFlipY(this._flippedY),t}}),cc.flipY=function(t){return new cc.FlipY(t)},cc.Place=cc.Class({name:"cc.Place",extends:cc.ActionInstant,ctor:function(t,e){this._x=0,this._y=0,void 0!==t&&(void 0!==t.x&&(e=t.y,t=t.x),this.initWithPosition(t,e))},initWithPosition:function(t,e){return this._x=t,this._y=e,!0},update:function(){this.target.setPosition(this._x,this._y)},clone:function(){var t=new cc.Place;return t.initWithPosition(this._x,this._y),t}}),cc.place=function(t,e){return new cc.Place(t,e)},cc.CallFunc=cc.Class({name:"cc.CallFunc",extends:cc.ActionInstant,ctor:function(t,e,i){this._selectorTarget=null,this._function=null,this._data=null,this.initWithFunction(t,e,i)},initWithFunction:function(t,e,i){return t&&(this._function=t),e&&(this._selectorTarget=e),void 0!==i&&(this._data=i),!0},execute:function(){this._function&&this._function.call(this._selectorTarget,this.target,this._data)},update:function(){this.execute()},getTargetCallback:function(){return this._selectorTarget},setTargetCallback:function(t){t!==this._selectorTarget&&(this._selectorTarget&&(this._selectorTarget=null),this._selectorTarget=t)},clone:function(){var t=new cc.CallFunc;return t.initWithFunction(this._function,this._selectorTarget,this._data),t}}),cc.callFunc=function(t,e,i){return new cc.CallFunc(t,e,i)}}),{}],5:[(function(){"use strict";function t(t,e,i,n,r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-r,2)*e+3*Math.pow(r,2)*(1-r)*i+Math.pow(r,3)*n}cc.ActionInterval=cc.Class({name:"cc.ActionInterval",extends:cc.FiniteTimeAction,ctor:function(t){this.MAX_VALUE=2,this._elapsed=0,this._firstTick=!1,this._easeList=null,this._speed=1,this._timesForRepeat=1,this._repeatForever=!1,this._repeatMethod=!1,this._speedMethod=!1,void 0!==t&&cc.ActionInterval.prototype.initWithDuration.call(this,t)},getElapsed:function(){return this._elapsed},initWithDuration:function(t){return this._duration=0===t?cc.macro.FLT_EPSILON:t,this._elapsed=0,this._firstTick=!0,!0},isDone:function(){return this._elapsed>=this._duration},_cloneDecoration:function(t){t._repeatForever=this._repeatForever,t._speed=this._speed,t._timesForRepeat=this._timesForRepeat,t._easeList=this._easeList,t._speedMethod=this._speedMethod,t._repeatMethod=this._repeatMethod},_reverseEaseList:function(t){if(this._easeList){t._easeList=[];for(var e=0;e<this._easeList.length;e++)t._easeList.push(this._easeList[e].reverse())}},clone:function(){var t=new cc.ActionInterval(this._duration);return this._cloneDecoration(t),t},easing:function(){this._easeList?this._easeList.length=0:this._easeList=[];for(var t=0;t<arguments.length;t++)this._easeList.push(arguments[t]);return this},_computeEaseTime:function(t){var e=this._easeList;if(!e||0===e.length)return t;for(var i=0,n=e.length;i<n;i++)t=e[i].easing(t);return t},step:function(t){this._firstTick?(this._firstTick=!1,this._elapsed=0):this._elapsed+=t;var e=this._elapsed/(this._duration>1.192092896e-7?this._duration:1.192092896e-7);e=1>e?e:1,this.update(e>0?e:0),this._repeatMethod&&this._timesForRepeat>1&&this.isDone()&&(this._repeatForever||this._timesForRepeat--,this.startWithTarget(this.target),this.step(this._elapsed-this._duration))},startWithTarget:function(t){cc.Action.prototype.startWithTarget.call(this,t),this._elapsed=0,this._firstTick=!0},reverse:function(){return cc.logID(1010),null},setAmplitudeRate:function(){cc.logID(1011)},getAmplitudeRate:function(){return cc.logID(1012),0},speed:function(t){return t<=0?(cc.logID(1013),this):(this._speedMethod=!0,this._speed*=t,this)},getSpeed:function(){return this._speed},setSpeed:function(t){return this._speed=t,this},repeat:function(t){return t=Math.round(t),isNaN(t)||t<1?(cc.logID(1014),this):(this._repeatMethod=!0,this._timesForRepeat*=t,this)},repeatForever:function(){return this._repeatMethod=!0,this._timesForRepeat=this.MAX_VALUE,this._repeatForever=!0,this}}),cc.actionInterval=function(t){return new cc.ActionInterval(t)},cc.Sequence=cc.Class({name:"cc.Sequence",extends:cc.ActionInterval,ctor:function(t){this._actions=[],this._split=null,this._last=0,this._reversed=!1;var e=t instanceof Array?t:arguments;if(1!==e.length){var i=e.length-1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],a=1;a<i;a++)e[a]&&(n=r,r=cc.Sequence._actionOneTwo(n,e[a]));this.initWithTwoActions(r,e[i])}}else cc.errorID(1019)},initWithTwoActions:function(t,e){if(!t||!e)return cc.errorID(1025),!1;var i=t._duration,n=e._duration,r=(i*=t._repeatMethod?t._timesForRepeat:1)+(n*=e._repeatMethod?e._timesForRepeat:1);return this.initWithDuration(r),this._actions[0]=t,this._actions[1]=e,!0},clone:function(){var t=new cc.Sequence;return this._cloneDecoration(t),t.initWithTwoActions(this._actions[0].clone(),this._actions[1].clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._split=this._actions[0]._duration/this._duration,this._split*=this._actions[0]._repeatMethod?this._actions[0]._timesForRepeat:1,this._last=-1},stop:function(){-1!==this._last&&this._actions[this._last].stop(),cc.Action.prototype.stop.call(this)},update:function(t){var e,i,n=0,r=this._split,a=this._actions,s=this._last;(t=this._computeEaseTime(t))<r?(e=0!==r?t/r:1,0===n&&1===s&&this._reversed&&(a[1].update(0),a[1].stop())):(n=1,e=1===r?1:(t-r)/(1-r),-1===s&&(a[0].startWithTarget(this.target),a[0].update(1),a[0].stop()),0===s&&(a[0].update(1),a[0].stop())),i=a[n],s===n&&i.isDone()||(s!==n&&i.startWithTarget(this.target),e*=i._timesForRepeat,i.update(e>1?e%1:e),this._last=n)},reverse:function(){var t=cc.Sequence._actionOneTwo(this._actions[1].reverse(),this._actions[0].reverse());return this._cloneDecoration(t),this._reverseEaseList(t),t._reversed=!0,t}}),cc.sequence=function(t){var e=t instanceof Array?t:arguments;if(1===e.length)return cc.errorID(1019),null;var i=e.length-1;i>=0&&null==e[i]&&cc.logID(1015);var n=null;if(i>=0){n=e[0];for(var r=1;r<=i;r++)e[r]&&(n=cc.Sequence._actionOneTwo(n,e[r]))}return n},cc.Sequence._actionOneTwo=function(t,e){var i=new cc.Sequence;return i.initWithTwoActions(t,e),i},cc.Repeat=cc.Class({name:"cc.Repeat",extends:cc.ActionInterval,ctor:function(t,e){this._times=0,this._total=0,this._nextDt=0,this._actionInstant=!1,this._innerAction=null,void 0!==e&&this.initWithAction(t,e)},initWithAction:function(t,e){var i=t._duration*e;return!!this.initWithDuration(i)&&(this._times=e,this._innerAction=t,t instanceof cc.ActionInstant&&(this._actionInstant=!0,this._times-=1),this._total=0,!0)},clone:function(){var t=new cc.Repeat;return this._cloneDecoration(t),t.initWithAction(this._innerAction.clone(),this._times),t},startWithTarget:function(t){this._total=0,this._nextDt=this._innerAction._duration/this._duration,cc.ActionInterval.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},stop:function(){this._innerAction.stop(),cc.Action.prototype.stop.call(this)},update:function(t){t=this._computeEaseTime(t);var e=this._innerAction,i=this._duration,n=this._times,r=this._nextDt;if(t>=r){for(;t>r&&this._total<n;)e.update(1),this._total++,e.stop(),e.startWithTarget(this.target),r+=e._duration/i,this._nextDt=r>1?1:r;t>=1&&this._total<n&&(e.update(1),this._total++),this._actionInstant||(this._total===n?e.stop():e.update(t-(r-e._duration/i)))}else e.update(t*n%1)},isDone:function(){return this._total===this._times},reverse:function(){var t=new cc.Repeat(this._innerAction.reverse(),this._times);return this._cloneDecoration(t),this._reverseEaseList(t),t},setInnerAction:function(t){this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return this._innerAction}}),cc.repeat=function(t,e){return new cc.Repeat(t,e)},cc.repeatForever=function(t){return new cc.RepeatForever(t)},cc.RepeatForever=cc.Class({name:"cc.RepeatForever",extends:cc.ActionInterval,ctor:function(t){this._innerAction=null,t&&this.initWithAction(t)},initWithAction:function(t){return t?(this._innerAction=t,!0):(cc.errorID(1026),!1)},clone:function(){var t=new cc.RepeatForever;return this._cloneDecoration(t),t.initWithAction(this._innerAction.clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},step:function(t){var e=this._innerAction;e.step(t),e.isDone()&&(e.startWithTarget(this.target),e.step(e.getElapsed()-e._duration))},isDone:function(){return!1},reverse:function(){var t=new cc.RepeatForever(this._innerAction.reverse());return this._cloneDecoration(t),this._reverseEaseList(t),t},setInnerAction:function(t){this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return this._innerAction}}),cc.repeatForever=function(t){return new cc.RepeatForever(t)},cc.Spawn=cc.Class({name:"cc.Spawn",extends:cc.ActionInterval,ctor:function(t){this._one=null,this._two=null;var e=t instanceof Array?t:arguments;if(1!==e.length){var i=e.length-1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],a=1;a<i;a++)e[a]&&(n=r,r=cc.Spawn._actionOneTwo(n,e[a]));this.initWithTwoActions(r,e[i])}}else cc.errorID(1020)},initWithTwoActions:function(t,e){if(!t||!e)return cc.errorID(1027),!1;var i=!1,n=t._duration,r=e._duration;return this.initWithDuration(Math.max(n,r))&&(this._one=t,this._two=e,n>r?this._two=cc.Sequence._actionOneTwo(e,cc.delayTime(n-r)):n<r&&(this._one=cc.Sequence._actionOneTwo(t,cc.delayTime(r-n))),i=!0),i},clone:function(){var t=new cc.Spawn;return this._cloneDecoration(t),t.initWithTwoActions(this._one.clone(),this._two.clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._one.startWithTarget(t),this._two.startWithTarget(t)},stop:function(){this._one.stop(),this._two.stop(),cc.Action.prototype.stop.call(this)},update:function(t){t=this._computeEaseTime(t),this._one&&this._one.update(t),this._two&&this._two.update(t)},reverse:function(){var t=cc.Spawn._actionOneTwo(this._one.reverse(),this._two.reverse());return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.spawn=function(t){var e=t instanceof Array?t:arguments;if(1===e.length)return cc.errorID(1020),null;e.length>0&&null==e[e.length-1]&&cc.logID(1015);for(var i=e[0],n=1;n<e.length;n++)null!=e[n]&&(i=cc.Spawn._actionOneTwo(i,e[n]));return i},cc.Spawn._actionOneTwo=function(t,e){var i=new cc.Spawn;return i.initWithTwoActions(t,e),i},cc.RotateTo=cc.Class({name:"cc.RotateTo",extends:cc.ActionInterval,statics:{_reverse:!1},ctor:function(t,e){this._startAngle=0,this._dstAngle=0,this._angle=0,void 0!==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._dstAngle=e,!0)},clone:function(){var t=new cc.RotateTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._dstAngle),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.angle%360,i=cc.RotateTo._reverse?this._dstAngle-e:this._dstAngle+e;i>180&&(i-=360),i<-180&&(i+=360),this._startAngle=e,this._angle=cc.RotateTo._reverse?i:-i},reverse:function(){cc.logID(1016)},update:function(t){t=this._computeEaseTime(t),this.target&&(this.target.angle=this._startAngle+this._angle*t)}}),cc.rotateTo=function(t,e){return new cc.RotateTo(t,e)},cc.RotateBy=cc.Class({name:"cc.RotateBy",extends:cc.ActionInterval,statics:{_reverse:!1},ctor:function(t,e){e*=cc.RotateBy._reverse?1:-1,this._deltaAngle=0,this._startAngle=0,void 0!==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaAngle=e,!0)},clone:function(){var t=new cc.RotateBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaAngle),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startAngle=t.angle},update:function(t){t=this._computeEaseTime(t),this.target&&(this.target.angle=this._startAngle+this._deltaAngle*t)},reverse:function(){var t=new cc.RotateBy;return t.initWithDuration(this._duration,-this._deltaAngle),this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.rotateBy=function(t,e){return new cc.RotateBy(t,e)},cc.MoveBy=cc.Class({name:"cc.MoveBy",extends:cc.ActionInterval,ctor:function(t,e,i){this._positionDelta=cc.v2(0,0),this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),void 0!==e&&cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:function(t,e,i){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void 0!==e.x&&(i=e.y,e=e.x),this._positionDelta.x=e,this._positionDelta.y=i,!0)},clone:function(){var t=new cc.MoveBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._positionDelta),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPosition.x=e,this._startPosition.y=i},update:function(t){if(t=this._computeEaseTime(t),this.target){var e=this._positionDelta.x*t,i=this._positionDelta.y*t,n=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var r=this.target.x,a=this.target.y,s=this._previousPosition;n.x=n.x+r-s.x,n.y=n.y+a-s.y,e+=n.x,i+=n.y,s.x=e,s.y=i,this.target.setPosition(e,i)}else this.target.setPosition(n.x+e,n.y+i)}},reverse:function(){var t=new cc.MoveBy(this._duration,cc.v2(-this._positionDelta.x,-this._positionDelta.y));return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.moveBy=function(t,e,i){return new cc.MoveBy(t,e,i)},cc.MoveTo=cc.Class({name:"cc.MoveTo",extends:cc.MoveBy,ctor:function(t,e,i){this._endPosition=cc.v2(0,0),void 0!==e&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){return!!cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)&&(void 0!==e.x&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!0)},clone:function(){var t=new cc.MoveTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition),t},startWithTarget:function(t){cc.MoveBy.prototype.startWithTarget.call(this,t),this._positionDelta.x=this._endPosition.x-t.x,this._positionDelta.y=this._endPosition.y-t.y}}),cc.moveTo=function(t,e,i){return new cc.MoveTo(t,e,i)},cc.SkewTo=cc.Class({name:"cc.SkewTo",extends:cc.ActionInterval,ctor:function(t,e,i){this._skewX=0,this._skewY=0,this._startSkewX=0,this._startSkewY=0,this._endSkewX=0,this._endSkewY=0,this._deltaX=0,this._deltaY=0,void 0!==i&&cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:function(t,e,i){var n=!1;return cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endSkewX=e,this._endSkewY=i,n=!0),n},clone:function(){var t=new cc.SkewTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endSkewX,this._endSkewY),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startSkewX=t.skewX%180,this._deltaX=this._endSkewX-this._startSkewX,this._deltaX>180&&(this._deltaX-=360),this._deltaX<-180&&(this._deltaX+=360),this._startSkewY=t.skewY%360,this._deltaY=this._endSkewY-this._startSkewY,this._deltaY>180&&(this._deltaY-=360),this._deltaY<-180&&(this._deltaY+=360)},update:function(t){t=this._computeEaseTime(t),this.target.skewX=this._startSkewX+this._deltaX*t,this.target.skewY=this._startSkewY+this._deltaY*t}}),cc.skewTo=function(t,e,i){return new cc.SkewTo(t,e,i)},cc.SkewBy=cc.Class({name:"cc.SkewBy",extends:cc.SkewTo,ctor:function(t,e,i){void 0!==i&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){var n=!1;return cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)&&(this._skewX=e,this._skewY=i,n=!0),n},clone:function(){var t=new cc.SkewBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._skewX,this._skewY),t},startWithTarget:function(t){cc.SkewTo.prototype.startWithTarget.call(this,t),this._deltaX=this._skewX,this._deltaY=this._skewY,this._endSkewX=this._startSkewX+this._deltaX,this._endSkewY=this._startSkewY+this._deltaY},reverse:function(){var t=new cc.SkewBy(this._duration,-this._skewX,-this._skewY);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.skewBy=function(t,e,i){return new cc.SkewBy(t,e,i)},cc.JumpBy=cc.Class({name:"cc.JumpBy",extends:cc.ActionInterval,ctor:function(t,e,i,n,r){this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),this._delta=cc.v2(0,0),this._height=0,this._jumps=0,void 0!==n&&cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)},initWithDuration:function(t,e,i,n,r){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void 0===r&&(r=n,n=i,i=e.y,e=e.x),this._delta.x=e,this._delta.y=i,this._height=n,this._jumps=r,!0)},clone:function(){var t=new cc.JumpBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._delta,this._height,this._jumps),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPosition.x=e,this._startPosition.y=i},update:function(t){if(t=this._computeEaseTime(t),this.target){var e=t*this._jumps%1,i=4*this._height*e*(1-e);i+=this._delta.y*t;var n=this._delta.x*t,r=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var a=this.target.x,s=this.target.y,o=this._previousPosition;r.x=r.x+a-o.x,r.y=r.y+s-o.y,n+=r.x,i+=r.y,o.x=n,o.y=i,this.target.setPosition(n,i)}else this.target.setPosition(r.x+n,r.y+i)}},reverse:function(){var t=new cc.JumpBy(this._duration,cc.v2(-this._delta.x,-this._delta.y),this._height,this._jumps);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.jumpBy=function(t,e,i,n,r){return new cc.JumpBy(t,e,i,n,r)},cc.JumpTo=cc.Class({name:"cc.JumpTo",extends:cc.JumpBy,ctor:function(t,e,i,n,r){this._endPosition=cc.v2(0,0),void 0!==n&&this.initWithDuration(t,e,i,n,r)},initWithDuration:function(t,e,i,n,r){return!!cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)&&(void 0===r&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!0)},startWithTarget:function(t){cc.JumpBy.prototype.startWithTarget.call(this,t),this._delta.x=this._endPosition.x-this._startPosition.x,this._delta.y=this._endPosition.y-this._startPosition.y},clone:function(){var t=new cc.JumpTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition,this._height,this._jumps),t}}),cc.jumpTo=function(t,e,i,n,r){return new cc.JumpTo(t,e,i,n,r)},cc.BezierBy=cc.Class({name:"cc.BezierBy",extends:cc.ActionInterval,ctor:function(t,e){this._config=[],this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),e&&cc.BezierBy.prototype.initWithDuration.call(this,t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._config=e,!0)},clone:function(){var t=new cc.BezierBy;this._cloneDecoration(t);for(var e=[],i=0;i<this._config.length;i++){var n=this._config[i];e.push(cc.v2(n.x,n.y))}return t.initWithDuration(this._duration,e),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPosition.x=e,this._startPosition.y=i},update:function(e){if(e=this._computeEaseTime(e),this.target){var i=this._config,n=i[0].x,r=i[1].x,a=i[2].x,s=i[0].y,o=i[1].y,c=i[2].y,l=t(0,n,r,a,e),h=t(0,s,o,c,e),u=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var f=this.target.x,_=this.target.y,d=this._previousPosition;u.x=u.x+f-d.x,u.y=u.y+_-d.y,l+=u.x,h+=u.y,d.x=l,d.y=h,this.target.setPosition(l,h)}else this.target.setPosition(u.x+l,u.y+h)}},reverse:function(){var t=this._config,e=t[0].x,i=t[0].y,n=t[1].x,r=t[1].y,a=t[2].x,s=t[2].y,o=[cc.v2(n-a,r-s),cc.v2(e-a,i-s),cc.v2(-a,-s)],c=new cc.BezierBy(this._duration,o);return this._cloneDecoration(c),this._reverseEaseList(c),c}}),cc.bezierBy=function(t,e){return new cc.BezierBy(t,e)},cc.BezierTo=cc.Class({name:"cc.BezierTo",extends:cc.BezierBy,ctor:function(t,e){this._toConfig=[],e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toConfig=e,!0)},clone:function(){var t=new cc.BezierTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toConfig),t},startWithTarget:function(t){cc.BezierBy.prototype.startWithTarget.call(this,t);var e=this._startPosition,i=this._toConfig,n=this._config;n[0]=i[0].sub(e),n[1]=i[1].sub(e),n[2]=i[2].sub(e)}}),cc.bezierTo=function(t,e){return new cc.BezierTo(t,e)},cc.ScaleTo=cc.Class({name:"cc.ScaleTo",extends:cc.ActionInterval,ctor:function(t,e,i){this._scaleX=1,this._scaleY=1,this._startScaleX=1,this._startScaleY=1,this._endScaleX=0,this._endScaleY=0,this._deltaX=0,this._deltaY=0,void 0!==e&&cc.ScaleTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:function(t,e,i){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endScaleX=e,this._endScaleY=null!=i?i:e,!0)},clone:function(){var t=new cc.ScaleTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endScaleX,this._endScaleY),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startScaleX=t.scaleX,this._startScaleY=t.scaleY,this._deltaX=this._endScaleX-this._startScaleX,this._deltaY=this._endScaleY-this._startScaleY},update:function(t){t=this._computeEaseTime(t),this.target&&(this.target.scaleX=this._startScaleX+this._deltaX*t,this.target.scaleY=this._startScaleY+this._deltaY*t)}}),cc.scaleTo=function(t,e,i){return new cc.ScaleTo(t,e,i)},cc.ScaleBy=cc.Class({name:"cc.ScaleBy",extends:cc.ScaleTo,startWithTarget:function(t){cc.ScaleTo.prototype.startWithTarget.call(this,t),this._deltaX=this._startScaleX*this._endScaleX-this._startScaleX,this._deltaY=this._startScaleY*this._endScaleY-this._startScaleY},reverse:function(){var t=new cc.ScaleBy(this._duration,1/this._endScaleX,1/this._endScaleY);return this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.ScaleBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endScaleX,this._endScaleY),t}}),cc.scaleBy=function(t,e,i){return new cc.ScaleBy(t,e,i)},cc.Blink=cc.Class({name:"cc.Blink",extends:cc.ActionInterval,ctor:function(t,e){this._times=0,this._originalState=!1,void 0!==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._times=e,!0)},clone:function(){var t=new cc.Blink;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._times),t},update:function(t){if(t=this._computeEaseTime(t),this.target&&!this.isDone()){var e=1/this._times,i=t%e;this.target.opacity=i>e/2?255:0}},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._originalState=t.opacity},stop:function(){this.target.opacity=this._originalState,cc.ActionInterval.prototype.stop.call(this)},reverse:function(){var t=new cc.Blink(this._duration,this._times);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.blink=function(t,e){return new cc.Blink(t,e)},cc.FadeTo=cc.Class({name:"cc.FadeTo",extends:cc.ActionInterval,ctor:function(t,e){this._toOpacity=0,this._fromOpacity=0,void 0!==e&&cc.FadeTo.prototype.initWithDuration.call(this,t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toOpacity=e,!0)},clone:function(){var t=new cc.FadeTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},update:function(t){t=this._computeEaseTime(t);var e=void 0!==this._fromOpacity?this._fromOpacity:255;this.target.opacity=e+(this._toOpacity-e)*t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._fromOpacity=t.opacity}}),cc.fadeTo=function(t,e){return new cc.FadeTo(t,e)},cc.FadeIn=cc.Class({name:"cc.FadeIn",extends:cc.FadeTo,ctor:function(t){null==t&&(t=0),this._reverseAction=null,this.initWithDuration(t,255)},reverse:function(){var t=new cc.FadeOut;return t.initWithDuration(this._duration,0),this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.FadeIn;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},startWithTarget:function(t){this._reverseAction&&(this._toOpacity=this._reverseAction._fromOpacity),cc.FadeTo.prototype.startWithTarget.call(this,t)}}),cc.fadeIn=function(t){return new cc.FadeIn(t)},cc.FadeOut=cc.Class({name:"cc.FadeOut",extends:cc.FadeTo,ctor:function(t){null==t&&(t=0),this._reverseAction=null,this.initWithDuration(t,0)},reverse:function(){var t=new cc.FadeIn;return t._reverseAction=this,t.initWithDuration(this._duration,255),this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.FadeOut;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t}}),cc.fadeOut=function(t){return new cc.FadeOut(t)},cc.TintTo=cc.Class({name:"cc.TintTo",extends:cc.ActionInterval,ctor:function(t,e,i,n){this._to=cc.color(0,0,0),this._from=cc.color(0,0,0),e instanceof cc.Color&&(n=e.b,i=e.g,e=e.r),void 0!==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._to=cc.color(e,i,n),!0)},clone:function(){var t=new cc.TintTo;this._cloneDecoration(t);var e=this._to;return t.initWithDuration(this._duration,e.r,e.g,e.b),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._from=this.target.color},update:function(t){t=this._computeEaseTime(t);var e=this._from,i=this._to;e&&(this.target.color=cc.color(e.r+(i.r-e.r)*t,e.g+(i.g-e.g)*t,e.b+(i.b-e.b)*t))}}),cc.tintTo=function(t,e,i,n){return new cc.TintTo(t,e,i,n)},cc.TintBy=cc.Class({name:"cc.TintBy",extends:cc.ActionInterval,ctor:function(t,e,i,n){this._deltaR=0,this._deltaG=0,this._deltaB=0,this._fromR=0,this._fromG=0,this._fromB=0,void 0!==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaR=e,this._deltaG=i,this._deltaB=n,!0)},clone:function(){var t=new cc.TintBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaR,this._deltaG,this._deltaB),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.color;this._fromR=e.r,this._fromG=e.g,this._fromB=e.b},update:function(t){t=this._computeEaseTime(t),this.target.color=cc.color(this._fromR+this._deltaR*t,this._fromG+this._deltaG*t,this._fromB+this._deltaB*t)},reverse:function(){var t=new cc.TintBy(this._duration,-this._deltaR,-this._deltaG,-this._deltaB);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.tintBy=function(t,e,i,n){return new cc.TintBy(t,e,i,n)},cc.DelayTime=cc.Class({name:"cc.DelayTime",extends:cc.ActionInterval,update:function(){},reverse:function(){var t=new cc.DelayTime(this._duration);return this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.DelayTime;return this._cloneDecoration(t),t.initWithDuration(this._duration),t}}),cc.delayTime=function(t){return new cc.DelayTime(t)},cc.ReverseTime=cc.Class({name:"cc.ReverseTime",extends:cc.ActionInterval,ctor:function(t){this._other=null,t&&this.initWithAction(t)},initWithAction:function(t){return t?t===this._other?(cc.errorID(1029),!1):!!cc.ActionInterval.prototype.initWithDuration.call(this,t._duration)&&(this._other=t,!0):(cc.errorID(1028),!1)},clone:function(){var t=new cc.ReverseTime;return this._cloneDecoration(t),t.initWithAction(this._other.clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._other.startWithTarget(t)},update:function(t){t=this._computeEaseTime(t),this._other&&this._other.update(1-t)},reverse:function(){return this._other.clone()},stop:function(){this._other.stop(),cc.Action.prototype.stop.call(this)}}),cc.reverseTime=function(t){return new cc.ReverseTime(t)},cc.TargetedAction=cc.Class({name:"cc.TargetedAction",extends:cc.ActionInterval,ctor:function(t,e){this._action=null,this._forcedTarget=null,e&&this.initWithTarget(t,e)},initWithTarget:function(t,e){return!!this.initWithDuration(e._duration)&&(this._forcedTarget=t,this._action=e,!0)},clone:function(){var t=new cc.TargetedAction;return this._cloneDecoration(t),t.initWithTarget(this._forcedTarget,this._action.clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._action.startWithTarget(this._forcedTarget)},stop:function(){this._action.stop()},update:function(t){t=this._computeEaseTime(t),this._action.update(t)},getForcedTarget:function(){return this._forcedTarget},setForcedTarget:function(t){this._forcedTarget!==t&&(this._forcedTarget=t)}}),cc.targetedAction=function(t,e){return new cc.TargetedAction(t,e)}}),{}],6:[(function(t){"use strict";t("../core/platform/CCClass");var e=t("../core/platform/js"),i=function(){this.actions=[],this.target=null,this.actionIndex=0,this.currentAction=null,this.paused=!1,this.lock=!1};cc.ActionManager=function(){this._hashTargets=e.createMap(!0),this._arrayTargets=[],this._currentTarget=null,cc.director._scheduler&&cc.director._scheduler.enableForTarget(this)},cc.ActionManager.prototype={constructor:cc.ActionManager,_elementPool:[],_searchElementByTarget:function(t,e){for(var i=0;i<t.length;i++)if(e===t[i].target)return t[i];return null},_getElement:function(t,e){var n=this._elementPool.pop();return n||(n=new i),n.target=t,n.paused=!!e,n},_putElement:function(t){t.actions.length=0,t.actionIndex=0,t.currentAction=null,t.paused=!1,t.target=null,t.lock=!1,this._elementPool.push(t)},addAction:function(t,e,i){if(t&&e){var n=this._hashTargets[e._id];n?n.actions||(n.actions=[]):(n=this._getElement(e,i),this._hashTargets[e._id]=n,this._arrayTargets.push(n)),n.actions.push(t),t.startWithTarget(e)}else cc.errorID(1e3)},removeAllActions:function(){for(var t=this._arrayTargets,i=0;i<t.length;i++){var n=t[i];n&&this._putElement(n)}this._arrayTargets.length=0,this._hashTargets=e.createMap(!0)},removeAllActionsFromTarget:function(t){if(null!=t){var e=this._hashTargets[t._id];e&&(e.actions.length=0,this._deleteHashElement(e))}},removeAction:function(t){if(t){var e=t.getOriginalTarget(),i=this._hashTargets[e._id];if(i)for(var n=0;n<i.actions.length;n++)if(i.actions[n]===t){i.actions.splice(n,1),i.actionIndex>=n&&i.actionIndex--;break}}},_removeActionByTag:function(t,e,i){for(var n=0,r=e.actions.length;n<r;++n){var a=e.actions[n];if(a&&a.getTag()===t){if(i&&a.getOriginalTarget()!==i)continue;this._removeActionAtIndex(n,e);break}}},_removeAllActionsByTag:function(t,e,i){for(var n=e.actions.length-1;n>=0;--n){var r=e.actions[n];if(r&&r.getTag()===t){if(i&&r.getOriginalTarget()!==i)continue;this._removeActionAtIndex(n,e)}}},removeActionByTag:function(t,e){t===cc.Action.TAG_INVALID&&cc.logID(1002);var i=this._hashTargets;if(e){var n=i[e._id];n&&this._removeActionByTag(t,n,e)}else for(var r in i){var a=i[r];this._removeActionByTag(t,a)}},removeAllActionsByTag:function(t,e){t===cc.Action.TAG_INVALID&&cc.logID(1002);var i=this._hashTargets;if(e){var n=i[e._id];n&&this._removeAllActionsByTag(t,n,e)}else for(var r in i){var a=i[r];this._removeAllActionsByTag(t,a)}},getActionByTag:function(t,e){t===cc.Action.TAG_INVALID&&cc.logID(1004);var i=this._hashTargets[e._id];if(i){if(null!=i.actions)for(var n=0;n<i.actions.length;++n){var r=i.actions[n];if(r&&r.getTag()===t)return r}cc.logID(1005,t)}return null},getNumberOfRunningActionsInTarget:function(t){var e=this._hashTargets[t._id];return e&&e.actions?e.actions.length:0},pauseTarget:function(t){var e=this._hashTargets[t._id];e&&(e.paused=!0)},resumeTarget:function(t){var e=this._hashTargets[t._id];e&&(e.paused=!1)},pauseAllRunningActions:function(){for(var t=[],e=this._arrayTargets,i=0;i<e.length;i++){var n=e[i];n&&!n.paused&&(n.paused=!0,t.push(n.target))}return t},resumeTargets:function(t){if(t)for(var e=0;e<t.length;e++)t[e]&&this.resumeTarget(t[e])},pauseTargets:function(t){if(t)for(var e=0;e<t.length;e++)t[e]&&this.pauseTarget(t[e])},purgeSharedManager:function(){cc.director.getScheduler().unscheduleUpdate(this)},_removeActionAtIndex:function(t,e){e.actions[t],e.actions.splice(t,1),e.actionIndex>=t&&e.actionIndex--,0===e.actions.length&&this._deleteHashElement(e)},_deleteHashElement:function(t){var e=!1;if(t&&!t.lock&&this._hashTargets[t.target._id]){delete this._hashTargets[t.target._id];for(var i=this._arrayTargets,n=0,r=i.length;n<r;n++)if(i[n]===t){i.splice(n,1);break}this._putElement(t),e=!0}return e},update:function(t){for(var e,i=this._arrayTargets,n=0;n<i.length;n++){if(this._currentTarget=i[n],!(e=this._currentTarget).paused&&e.actions){for(e.lock=!0,e.actionIndex=0;e.actionIndex<e.actions.length;e.actionIndex++)if(e.currentAction=e.actions[e.actionIndex],e.currentAction){if(e.currentAction.step(t*(e.currentAction._speedMethod?e.currentAction._speed:1)),e.currentAction&&e.currentAction.isDone()){e.currentAction.stop();var r=e.currentAction;e.currentAction=null,this.removeAction(r)}e.currentAction=null}e.lock=!1}0===e.actions.length&&this._deleteHashElement(e)&&n--}}}}),{"../core/platform/CCClass":168,"../core/platform/js":189}],7:[(function(t){"use strict";t("./CCActionManager"),t("./CCAction"),t("./CCActionInterval"),t("./CCActionInstant"),t("./CCActionEase"),t("./CCActionCatmullRom"),t("./tween")}),{"./CCAction":1,"./CCActionCatmullRom":2,"./CCActionEase":3,"./CCActionInstant":4,"./CCActionInterval":5,"./CCActionManager":6,"./tween":8}],8:[(function(t){"use strict";var e=t("../animation/bezier"),i=0,n=cc.Class({name:"cc.TweenAction",extends:cc.ActionInterval,ctor:function(t,e,i){if(this._opts=i=i||Object.create(null),this._props=Object.create(null),i.progress=i.progress||this.progress,i.easing&&"string"==typeof i.easing){var n=i.easing;i.easing=cc.easing[n],!i.easing&&cc.warnID(1031,n)}var r=this._opts.relative;for(var a in e){var s=e[a],o=void 0,c=void 0;if(void 0!==s.value&&(s.easing||s.progress)&&("string"==typeof s.easing?!(o=cc.easing[s.easing])&&cc.warnID(1031,s.easing):o=s.easing,c=s.progress,s=s.value),"number"==typeof s||s.lerp&&(!r||s.add||s.mul)&&s.clone){var l=Object.create(null);l.value=s,l.easing=o,l.progress=c,this._props[a]=l}else cc.warn("Can not animate "+a+" property, because it do not have [lerp, (add|mul), clone] function.")}this._originProps=e,this.initWithDuration(t)},clone:function(){var t=new n(this._duration,this._originProps,this._opts);return this._cloneDecoration(t),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=!!this._opts.relative,i=this._props;for(var n in i){var r=t[n],a=i[n];"number"==typeof r?(a.start=r,a.current=r,a.end=e?r+a.value:a.value):(a.start=r.clone(),a.current=r.clone(),a.end=e?(r.add||r.mul).call(r,a.value):a.value)}},update:function(t){var e=this._opts,i=t;e.easing&&(i=e.easing(t));var n=this.target;if(n){var r=this._props,a=e.progress;for(var s in r){var o=r[s],c=o.easing?o.easing(t):i,l=o.current=(o.progress||a)(o.start,o.end,o.current,c);n[s]=l}var h=e.onUpdate;h&&h(n,t)}},progress:function(t,e,i,n){return"number"==typeof t?i=t+(e-t)*n:t.lerp(e,n,i),i}}),r=cc.Class({name:"cc.SetAction",extends:cc.ActionInstant,ctor:function(t){this._props={},void 0!==t&&this.init(t)},init:function(t){for(var e in t)this._props[e]=t[e];return!0},update:function(){var t=this._props,e=this.target;for(var i in t)e[i]=t[i]},clone:function(){var t=new r;return t.init(this._props),t}});function a(t){this._actions=[],this._finalAction=null,this._target=t,this._tag=cc.Action.TAG_INVALID}a.stopAll=function(){cc.director.getActionManager().removeAllActions()},a.stopAllByTag=function(t){cc.director.getActionManager().removeAllActionsByTag(t)},a.stopAllByTarget=function(t){cc.director.getActionManager().removeAllActionsFromTarget(t)},a.prototype.then=function(t){return t instanceof cc.Action?this._actions.push(t.clone()):this._actions.push(t._union()),this},a.prototype.target=function(t){return this._target=t,this},a.prototype.start=function(){var t=this._target;return t?t instanceof cc.Object&&!t.isValid?void 0:(this._finalAction&&cc.director.getActionManager().removeAction(this._finalAction),this._finalAction=this._union(),void 0===t._id&&(t._id=++i),this._finalAction.setTag(this._tag),cc.director.getActionManager().addAction(this._finalAction,t,!1),this):(cc.warn("Please set target to tween first"),this)},a.prototype.stop=function(){return this._finalAction&&(cc.director.getActionManager().removeAction(this._finalAction),this._finalAction=null),this},a.prototype.tag=function(t){return this._tag=t,this},a.prototype.clone=function(t){var e=this._union();return cc.tween(t).then(e.clone())},a.prototype.union=function(){var t=this._union();return this._actions.length=0,this._actions.push(t),this},a.prototype._union=function(){var t=this._actions;return 1===t.length?t[0]:cc.sequence(t)},Object.assign(a.prototype,{bezierTo:function(t,i,n,r,a){var s=i.x,o=i.y,c=n.x,l=n.y;return(a=a||Object.create(null)).progress=function(t,i,n,r){return n.x=(0,e.bezier)(t.x,s,c,i.x,r),n.y=(0,e.bezier)(t.y,o,l,i.y,r),n},this.to(t,{position:r},a)},bezierBy:function(t,i,n,r,a){var s=i.x,o=i.y,c=n.x,l=n.y;return(a=a||Object.create(null)).progress=function(t,i,n,r){var a=t.x,h=t.y;return n.x=(0,e.bezier)(a,s+a,c+a,i.x,r),n.y=(0,e.bezier)(h,o+h,l+h,i.y,r),n},this.by(t,{position:r},a)},flipX:function(){var t=this;return this.call((function(){t._target.scaleX*=-1}),this)},flipY:function(){var t=this;return this.call((function(){t._target.scaleY*=-1}),this)},blink:function(t,e,i){var n=1/e;return(i=i||Object.create(null)).progress=function(t,e,i,r){return r>=1?t:r%n>n/2?255:0},this.to(t,{opacity:1},i)}});var s=[];function o(t){return function(){s.length=0;for(var e=arguments.length,i=0;i<e;i++){var n=s[i]=arguments[i];n instanceof a&&(s[i]=n._union())}return t.apply(this,s)}}for(var c={to:function(t,e,i){return(i=i||Object.create(null)).relative=!1,new n(t,e,i)},by:function(t,e,i){return(i=i||Object.create(null)).relative=!0,new n(t,e,i)},set:function(t){return new r(t)},delay:cc.delayTime,call:cc.callFunc,hide:cc.hide,show:cc.show,removeSelf:cc.removeSelf,sequence:o(cc.sequence),parallel:o(cc.spawn)},l={repeat:cc.repeat,repeatForever:cc.repeatForever,reverseTime:cc.reverseTime},h=Object.keys(c),u=function(){var t=h[f];a.prototype[t]=function(){var e=c[t].apply(this,arguments);return this._actions.push(e),this}},f=0;f<h.length;f++)u();h=Object.keys(l);for(var _=function(){var t=h[d];a.prototype[t]=function(){var e=this._actions,i=arguments[arguments.length-1],n=arguments.length-1;i instanceof cc.Tween?i=i._union():i instanceof cc.Action||(i=e[e.length-1],e.length-=1,n+=1);for(var r=[i],a=0;a<n;a++)r.push(arguments[a]);return i=l[t].apply(this,r),e.push(i),this}},d=0;d<h.length;d++)_();cc.tween=function(t){return new a(t)},cc.Tween=a}),{"../animation/bezier":14}],9:[(function(t,e){"use strict";var i=cc.js,n=t("./playable"),r=t("./animation-curves"),a=r.EventAnimCurve,s=r.EventInfo,o=t("./types").WrapModeMask,c=t("../core/utils/binary-search").binarySearchEpsilon;function l(t,e){n.call(this),this.target=t,this.animation=e,this._anims=new i.array.MutableForwardIterator([])}i.extend(l,n);var h=l.prototype;function u(t,e){var i=e.clip;e.duration=i.duration,e.speed=i.speed,e.wrapMode=i.wrapMode,e.frameRate=i.sample,(e.wrapMode&o.Loop)===o.Loop?e.repeatCount=1/0:e.repeatCount=1;var n=e.curves=i.createCurves(e,t),r=i.events;if(r)for(var l,h=0,u=r.length;h<u;h++){l||((l=new a).target=t,n.push(l));var f=r[h],_=f.frame/e.duration,d=void 0,p=c(l.ratios,_);p>=0?d=l.events[p]:(d=new s,l.ratios.push(_),l.events.push(d)),d.add(f.func,f.params)}}h.playState=function(t,e){t.clip&&(t.curveLoaded||u(this.target,t),t.animator=this,t.play(),"number"==typeof e&&t.setTime(e),this.play())},h.stopStatesExcept=function(t){var e=this._anims,i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];n!==t&&this.stopState(n)}},h.addAnimation=function(t){-1===this._anims.array.indexOf(t)&&this._anims.push(t),t._setEventTarget(this.animation)},h.removeAnimation=function(t){var e=this._anims.array.indexOf(t);e>=0?(this._anims.fastRemoveAt(e),0===this._anims.array.length&&this.stop()):cc.errorID(3907),t.animator=null},h.sample=function(){var t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)e[t.i].sample()},h.stopState=function(t){t&&t.stop()},h.pauseState=function(t){t&&t.pause()},h.resumeState=function(t){t&&t.resume(),this.isPaused&&this.resume()},h.setStateTime=function(t,e){if(void 0!==e)t&&(t.setTime(e),t.sample());else{e=t;for(var i=this._anims.array,n=0;n<i.length;++n){var r=i[n];r.setTime(e),r.sample()}}},h.onStop=function(){var t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)e[t.i].stop()},h.onPause=function(){for(var t=this._anims.array,e=0;e<t.length;++e){var i=t[e];i.pause(),i.animator=null}},h.onResume=function(){for(var t=this._anims.array,e=0;e<t.length;++e){var i=t[e];i.animator=this,i.resume()}},h._reloadClip=function(t){u(this.target,t)},e.exports=l}),{"../core/utils/binary-search":236,"./animation-curves":11,"./playable":18,"./types":19}],10:[(function(t,e){"use strict";var i=t("./types").WrapMode,n=t("./animation-curves"),r=n.DynamicAnimCurve,a=n.quickFindIndex,s=t("./motion-path-helper").sampleMotionPaths,o=t("../core/utils/binary-search").binarySearchEpsilon,c=cc.Class({name:"cc.AnimationClip",extends:cc.Asset,properties:{_duration:{default:0,type:cc.Float},duration:{get:function(){return this._duration}},sample:{default:60},speed:{default:1},wrapMode:{default:i.Normal},curveData:{default:{},visible:!1},events:{default:[],visible:!1}},statics:{createWithSpriteFrames:function(t,e){if(!Array.isArray(t))return cc.errorID(3905),null;var i=new c;i.sample=e||i.sample,i._duration=t.length/i.sample;for(var n=[],r=1/i.sample,a=0,s=t.length;a<s;a++)n[a]={frame:a*r,value:t[a]};return i.curveData={comps:{"cc.Sprite":{spriteFrame:n}}},i}},onLoad:function(){this._duration=Number.parseFloat(this.duration),this.speed=Number.parseFloat(this.speed),this.wrapMode=Number.parseInt(this.wrapMode),this.frameRate=Number.parseFloat(this.sample)},createPropCurve:function(t,e,i){var n=[],c=t instanceof cc.Node&&"position"===e,l=new r;l.target=t,l.prop=e;for(var h=0,u=i.length;h<u;h++){var f=i[h],_=f.frame/this.duration;l.ratios.push(_),c&&n.push(f.motionPath);var d=f.value;l.values.push(d);var p=f.curve;if(p){if("string"==typeof p){l.types.push(p);continue}if(Array.isArray(p)){p[0]===p[1]&&p[2]===p[3]?l.types.push(r.Linear):l.types.push(r.Bezier(p));continue}}l.types.push(r.Linear)}c&&s(n,l,this.duration,this.sample,t);for(var m,v,g=l.ratios,y=!0,T=1,A=g.length;T<A;T++)if(m=g[T]-g[T-1],1===T)v=m;else if(Math.abs(m-v)>1e-6){y=!1;break}l._findFrameIndex=y?a:o;var b=l.values[0];return null==b||l._lerp||("number"==typeof b?l._lerp=r.prototype._lerpNumber:b instanceof cc.Quat?l._lerp=r.prototype._lerpQuat:b instanceof cc.Vec2?l._lerp=r.prototype._lerpVector2:b instanceof cc.Vec3?l._lerp=r.prototype._lerpVector3:b.lerp&&(l._lerp=r.prototype._lerpObject)),l},createTargetCurves:function(t,e,i){var n=e.props,r=e.comps;if(n)for(var a in n){var s=n[a],o=this.createPropCurve(t,a,s);i.push(o)}if(r)for(var c in r){var l=t.getComponent(c);if(l){var h=r[c];for(var u in h){var f=h[u],_=this.createPropCurve(l,u,f);i.push(_)}}}},createCurves:function(t,e){var i=this.curveData,n=i.paths,r=[];for(var a in this.createTargetCurves(e,i,r),n){var s=cc.find(a,e);if(s){var o=n[a];this.createTargetCurves(s,o,r)}}return r}});cc.AnimationClip=e.exports=c}),{"../core/utils/binary-search":236,"./animation-curves":11,"./motion-path-helper":17,"./types":19}],11:[(function(t,e){"use strict";var i=t("./bezier").bezierByTime,n=t("../core/utils/binary-search").binarySearchEpsilon,r=t("./types").WrapModeMask,a=t("./types").WrappedInfo;function s(t,e){if("string"==typeof e){var n=cc.easing[e];n?t=n(t):cc.errorID(3906,e)}else Array.isArray(e)&&(t=i(e,t));return t}var o=cc.Class({name:"cc.AnimCurve",sample:function(){},onTimeChangedManually:void 0});var c,l=cc.Class({name:"cc.DynamicAnimCurve",extends:o,ctor:function(){this._cachedIndex=0},properties:{target:null,prop:"",values:[],ratios:[],types:[]},_findFrameIndex:n,_lerp:void 0,_lerpNumber:function(t,e,i){return t+(e-t)*i},_lerpObject:function(t,e,i){return t.lerp(e,i)},_lerpQuat:(c=cc.quat(),function(t,e,i){return t.lerp(e,i,c)}),_lerpVector2:(function(){var t=cc.v2();return function(e,i,n){return e.lerp(i,n,t)}})(),_lerpVector3:(function(){var t=cc.v3();return function(e,i,n){return e.lerp(i,n,t)}})(),sample:function(t,e){var i=this.values,n=this.ratios,r=n.length;if(0!==r){var a,o=!0,c=this._cachedIndex;if(c<0&&(c=~c)>0&&c<n.length){var l=n[c-1],h=n[c];e>l&&e<h&&(o=!1)}o&&(this._cachedIndex=this._findFrameIndex(n,e));var u=this._cachedIndex;if(u<0)if((u=~u)<=0)a=i[0];else if(u>=r)a=i[r-1];else{var f=i[u-1];if(this._lerp){var _=n[u-1],d=n[u],p=this.types[u-1],m=(e-_)/(d-_);p&&(m=s(m,p));var v=i[u];a=this._lerp(f,v,m)}else a=f}else a=i[u];this.target[this.prop]=a}}});l.Linear=null,l.Bezier=function(t){return t};var h=function(){this.events=[]};h.prototype.add=function(t,e){this.events.push({func:t||"",params:e||[]})};var u=cc.Class({name:"cc.EventAnimCurve",extends:o,properties:{target:null,ratios:[],events:[],_wrappedInfo:{default:function(){return new a}},_lastWrappedInfo:null,_ignoreIndex:NaN},_wrapIterations:function(t){return t-(0|t)==0&&(t-=1),0|t},sample:function(t,e,i){var s=this.ratios.length,o=i.getWrappedInfo(i.time,this._wrappedInfo),c=o.direction,l=n(this.ratios,o.ratio);if(l<0&&(l=~l-1,c<0&&(l+=1)),this._ignoreIndex!==l&&(this._ignoreIndex=NaN),o.frameIndex=l,!this._lastWrappedInfo)return this._fireEvent(l),void(this._lastWrappedInfo=new a(o));var h=i.wrapMode,u=this._wrapIterations(o.iterations),f=this._lastWrappedInfo,_=this._wrapIterations(f.iterations),d=f.frameIndex,p=f.direction,m=-1!==_&&u!==_;if(d===l&&m&&1===s)this._fireEvent(0);else if(d!==l||m){c=p;do{if(d!==l){if(-1===c&&0===d&&l>0?((h&r.PingPong)===r.PingPong?c*=-1:d=s,_++):1===c&&d===s-1&&l<s-1&&((h&r.PingPong)===r.PingPong?c*=-1:d=-1,_++),d===l)break;if(_>u)break}d+=c,cc.director.getAnimationManager().pushDelayEvent(this,"_fireEvent",[d])}while(d!==l&&d>-1&&d<s)}this._lastWrappedInfo.set(o)},_fireEvent:function(t){if(!(t<0||t>=this.events.length||this._ignoreIndex===t)){var e=this.events[t].events;if(this.target.isValid)for(var i=this.target._components,n=0;n<e.length;n++)for(var r=e[n],a=r.func,s=0;s<i.length;s++){var o=i[s],c=o[a];c&&c.apply(o,r.params)}}},onTimeChangedManually:function(t,e){this._lastWrappedInfo=null,this._ignoreIndex=NaN;var i=e.getWrappedInfo(t,this._wrappedInfo),r=i.direction,a=n(this.ratios,i.ratio);a<0&&(a=~a-1,r<0&&(a+=1),this._ignoreIndex=a)}});e.exports={AnimCurve:o,DynamicAnimCurve:l,EventAnimCurve:u,EventInfo:h,computeRatioByType:s,quickFindIndex:function(t,e){var i=t.length-1;if(0===i)return 0;var n=t[0];if(e<n)return 0;var r=t[i];if(e>r)return~t.length;var a=(e=(e-n)/(r-n))/(1/i),s=0|a;return a-s<1e-6?s:s+1-a<1e-6?s+1:~(s+1)}}}),{"../core/utils/binary-search":236,"./bezier":14,"./types":19}],12:[(function(t,e){"use strict";var i=cc.js,n=cc.Class({ctor:function(){this._anims=new i.array.MutableForwardIterator([]),this._delayEvents=[],cc.director._scheduler&&cc.director._scheduler.enableForTarget(this)},update:function(t){var e=this._anims,i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];n._isPlaying&&!n._isPaused&&n.update(t)}for(var r=this._delayEvents,a=0;a<r.length;a++){var s=r[a];s.target[s.func].apply(s.target,s.args)}r.length=0},destruct:function(){},addAnimation:function(t){-1===this._anims.array.indexOf(t)&&this._anims.push(t)},removeAnimation:function(t){var e=this._anims.array.indexOf(t);e>=0?this._anims.fastRemoveAt(e):cc.errorID(3907)},pushDelayEvent:function(t,e,i){this._delayEvents.push({target:t,func:e,args:i})}});cc.AnimationManager=e.exports=n}),{}],13:[(function(t,e){"use strict";var i=cc.js,n=t("./playable"),r=t("./types"),a=r.WrappedInfo,s=r.WrapMode,o=r.WrapModeMask;function c(t,e){n.call(this),this._currentFramePlayed=!1,this._delay=0,this._delayTime=0,this._wrappedInfo=new a,this._lastWrappedInfo=null,this._process=h,this._clip=t,this._name=e||t&&t.name,this.animator=null,this.curves=[],this.delay=0,this.repeatCount=1,this.duration=1,this.speed=1,this.wrapMode=s.Normal,this.time=0,this._target=null,this._lastframeEventOn=!1,this.emit=function(){for(var t=new Array(arguments.length),e=0,i=t.length;e<i;e++)t[e]=arguments[e];cc.director.getAnimationManager().pushDelayEvent(this,"_emit",t)}}i.extend(c,n);var l=c.prototype;function h(){var t,e=this.sample();this._lastframeEventOn&&(t=this._lastWrappedInfo?this._lastWrappedInfo:this._lastWrappedInfo=new a(e),this.repeatCount>1&&(0|e.iterations)>(0|t.iterations)&&this.emit("lastframe",this),t.set(e)),e.stopped&&(this.stop(),this.emit("finished",this))}function u(){var t=this.time,e=this.duration;t>e?0==(t%=e)&&(t=e):t<0&&0!=(t%=e)&&(t+=e);for(var i=t/e,n=this.curves,r=0,a=n.length;r<a;r++)n[r].sample(t,i,this);this._lastframeEventOn&&(void 0===this._lastIterations&&(this._lastIterations=i),(this.time>0&&this._lastIterations>i||this.time<0&&this._lastIterations<i)&&this.emit("lastframe",this),this._lastIterations=i)}l._emit=function(t,e){this._target&&this._target.isValid&&this._target.emit(t,t,e)},l.on=function(t,e,i){return this._target&&this._target.isValid?("lastframe"===t&&(this._lastframeEventOn=!0),this._target.on(t,e,i)):null},l.once=function(t,e,i){if(this._target&&this._target.isValid){"lastframe"===t&&(this._lastframeEventOn=!0);var n=this;return this._target.once(t,(function(t){e.call(i,t),n._lastframeEventOn=!1}))}return null},l.off=function(t,e,i){this._target&&this._target.isValid&&("lastframe"===t&&(this._target.hasEventListener(t)||(this._lastframeEventOn=!1)),this._target.off(t,e,i))},l._setEventTarget=function(t){this._target=t},l.onPlay=function(){this.setTime(0),this._delayTime=this._delay,cc.director.getAnimationManager().addAnimation(this),this.animator&&this.animator.addAnimation(this),this.emit("play",this)},l.onStop=function(){this.isPaused||cc.director.getAnimationManager().removeAnimation(this),this.animator&&this.animator.removeAnimation(this),this.emit("stop",this)},l.onResume=function(){cc.director.getAnimationManager().addAnimation(this),this.emit("resume",this)},l.onPause=function(){cc.director.getAnimationManager().removeAnimation(this),this.emit("pause",this)},l.setTime=function(t){this._currentFramePlayed=!1,this.time=t||0;for(var e=this.curves,i=0,n=e.length;i<n;i++){var r=e[i];r.onTimeChangedManually&&r.onTimeChangedManually(t,this)}},l.update=function(t){this._delayTime>0&&(this._delayTime-=t,this._delayTime>0)||(this._currentFramePlayed?this.time+=t*this.speed:this._currentFramePlayed=!0,this._process())},l._needRevers=function(t){var e=this.wrapMode,i=!1;return(e&o.PingPong)===o.PingPong&&(t-(0|t)==0&&t>0&&(t-=1),1&t&&(i=!i)),(e&o.Reverse)===o.Reverse&&(i=!i),i},l.getWrappedInfo=function(t,e){e=e||new a;var i=!1,n=this.duration,r=this.repeatCount,s=t>0?t/n:-t/n;if(s>=r){s=r,i=!0;var c=r-(0|r);0===c&&(c=1),t=c*n*(t>0?1:-1)}if(t>n){var l=t%n;t=0===l?n:l}else t<0&&0!=(t%=n)&&(t+=n);var h=!1,u=this._wrapMode&o.ShouldWrap;u&&(h=this._needRevers(s));var f=h?-1:1;return this.speed<0&&(f*=-1),u&&h&&(t=n-t),e.ratio=t/n,e.time=t,e.direction=f,e.stopped=i,e.iterations=s,e},l.sample=function(){for(var t=this.getWrappedInfo(this.time,this._wrappedInfo),e=this.curves,i=0,n=e.length;i<n;i++)e[i].sample(t.time,t.ratio,this);return t},i.get(l,"clip",(function(){return this._clip})),i.get(l,"name",(function(){return this._name})),i.obsolete(l,"AnimationState.length","duration"),i.getset(l,"curveLoaded",(function(){return this.curves.length>0}),(function(){this.curves.length=0})),i.getset(l,"wrapMode",(function(){return this._wrapMode}),(function(t){this._wrapMode=t,this.time=0,t&o.Loop?this.repeatCount=1/0:this.repeatCount=1})),i.getset(l,"repeatCount",(function(){return this._repeatCount}),(function(t){this._repeatCount=t;var e=this._wrapMode&o.ShouldWrap,i=(this.wrapMode&o.Reverse)===o.Reverse;this._process=t!==1/0||e||i?h:u})),i.getset(l,"delay",(function(){return this._delay}),(function(t){this._delayTime=this._delay=t})),cc.AnimationState=e.exports=c}),{"./playable":18,"./types":19}],14:[(function(t,e){"use strict";var i=Math.cos,n=Math.acos,r=Math.max,a=2*Math.PI,s=Math.sqrt;function o(t){return t<0?-Math.pow(-t,1/3):Math.pow(t,1/3)}function c(t,e){var c,l,h,u,f=e-0,_=e-t[0],d=3*f,p=3*_,m=3*(e-t[2]),v=1/(-f+p-m+(e-1)),g=(d-6*_+m)*v,y=g*(1/3),T=(-d+p)*v,A=1/3*(3*T-g*g),b=A*(1/3),E=(2*g*g*g-9*g*T+f*v*27)/27,C=E/2,x=C*C+b*b*b;if(x<0){var S=1/3*-A,w=s(S*S*S),D=-E/(2*w),M=n(D<-1?-1:D>1?1:D),R=2*o(w);return l=R*i(M*(1/3))-y,h=R*i((M+a)*(1/3))-y,u=R*i((M+2*a)*(1/3))-y,0<=l&&l<=1?0<=h&&h<=1?0<=u&&u<=1?r(l,h,u):r(l,h):0<=u&&u<=1?r(l,u):l:0<=h&&h<=1?0<=u&&u<=1?r(h,u):h:u}if(0===x)return h=-(c=C<0?o(-C):-o(C))-y,0<=(l=2*c-y)&&l<=1?0<=h&&h<=1?r(l,h):l:h;var I=s(x);return(c=o(-C+I))-o(C+I)-y}e.exports={bezier:function(t,e,i,n,r){var a=1-r;return a*(a*(t+(3*e-t)*r)+3*i*r*r)+n*r*r*r},bezierByTime:function(t,e){var i=c(t,e),n=t[1];return((1-i)*(n+(t[3]-n)*i)*3+i*i)*i}}}),{}],15:[(function(t,e){"use strict";var i={constant:function(){return 0},linear:function(t){return t},quadIn:function(t){return t*t},quadOut:function(t){return t*(2-t)},quadInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quartIn:function(t){return t*t*t*t},quartOut:function(t){return 1- --t*t*t*t},quartInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quintIn:function(t){return t*t*t*t*t},quintOut:function(t){return--t*t*t*t*t+1},quintInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sineIn:function(t){return 1-Math.cos(t*Math.PI/2)},sineOut:function(t){return Math.sin(t*Math.PI/2)},sineInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},expoIn:function(t){return 0===t?0:Math.pow(1024,t-1)},expoOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},expoInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circIn:function(t){return 1-Math.sqrt(1-t*t)},circOut:function(t){return Math.sqrt(1- --t*t)},circInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin(2*(t-e)*Math.PI/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin(2*(t-e)*Math.PI/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin(2*(t-e)*Math.PI/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin(2*(t-e)*Math.PI/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-i.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*i.bounceIn(2*t):.5*i.bounceOut(2*t-1)+.5},smooth:function(t){return t<=0?0:t>=1?1:t*t*(3-2*t)},fade:function(t){return t<=0?0:t>=1?1:t*t*t*(t*(6*t-15)+10)}};function n(t,e){return function(i){return i<.5?e(2*i)/2:t(2*i-1)/2+.5}}i.quadOutIn=n(i.quadIn,i.quadOut),i.cubicOutIn=n(i.cubicIn,i.cubicOut),i.quartOutIn=n(i.quartIn,i.quartOut),i.quintOutIn=n(i.quintIn,i.quintOut),i.sineOutIn=n(i.sineIn,i.sineOut),i.expoOutIn=n(i.expoIn,i.expoOut),i.circOutIn=n(i.circIn,i.circOut),i.backOutIn=n(i.backIn,i.backOut),i.bounceIn=function(t){return 1-i.bounceOut(1-t)},i.bounceInOut=function(t){return t<.5?.5*i.bounceIn(2*t):.5*i.bounceOut(2*t-1)+.5},i.bounceOutIn=n(i.bounceIn,i.bounceOut),cc.easing=e.exports=i}),{}],16:[(function(t){"use strict";t("./bezier"),t("./easing"),t("./types"),t("./motion-path-helper"),t("./animation-curves"),t("./animation-clip"),t("./animation-manager"),t("./animation-state"),t("./animation-animator")}),{"./animation-animator":9,"./animation-clip":10,"./animation-curves":11,"./animation-manager":12,"./animation-state":13,"./bezier":14,"./easing":15,"./motion-path-helper":17,"./types":19}],17:[(function(t,e){"use strict";var i=t("./animation-curves").DynamicAnimCurve,n=t("./animation-curves").computeRatioByType,r=t("./bezier").bezier,a=t("../core/utils/binary-search").binarySearchEpsilon,s=cc.v2;function o(t){this.points=t||[],this.beziers=[],this.ratios=[],this.progresses=[],this.length=0,this.computeBeziers()}function c(){this.start=s(),this.end=s(),this.startCtrlPoint=s(),this.endCtrlPoint=s()}function l(t){if(!Array.isArray(t))return!1;for(var e=0,i=t.length;e<i;e++){var n=t[e];if(!Array.isArray(n)||6!==n.length)return!1}return!0}o.prototype.computeBeziers=function(){var t;this.beziers.length=0,this.ratios.length=0,this.progresses.length=0,this.length=0;for(var e=1;e<this.points.length;e++){var i=this.points[e-1],n=this.points[e];(t=new c).start=i.pos,t.startCtrlPoint=i.out,t.end=n.pos,t.endCtrlPoint=n.in,this.beziers.push(t),this.length+=t.getLength()}var r=0;for(e=0;e<this.beziers.length;e++)t=this.beziers[e],this.ratios[e]=t.getLength()/this.length,this.progresses[e]=r+=this.ratios[e];return this.beziers},c.prototype.getPointAt=function(t){var e=this.getUtoTmapping(t);return this.getPoint(e)},c.prototype.getPoint=function(t){var e=r(this.start.x,this.startCtrlPoint.x,this.endCtrlPoint.x,this.end.x,t),i=r(this.start.y,this.startCtrlPoint.y,this.endCtrlPoint.y,this.end.y,t);return new s(e,i)},c.prototype.getLength=function(){var t=this.getLengths();return t[t.length-1]},c.prototype.getLengths=function(t){if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1)return this.cacheArcLengths;var e,i,n=[],r=this.getPoint(0),a=s(),o=0;for(n.push(0),i=1;i<=t;i++)e=this.getPoint(i/t),a.x=r.x-e.x,a.y=r.y-e.y,o+=a.mag(),n.push(o),r=e;return this.cacheArcLengths=n,n},c.prototype.getUtoTmapping=function(t,e){var i,n=this.getLengths(),r=0,a=n.length;i=e||t*n[a-1];for(var s,o=0,c=a-1;o<=c;)if((s=n[r=Math.floor(o+(c-o)/2)]-i)<0)o=r+1;else{if(!(s>0)){c=r;break}c=r-1}if(n[r=c]===i)return r/(a-1);var l=n[r];return(r+(i-l)/(n[r+1]-l))/(a-1)},e.exports={sampleMotionPaths:function(t,e,r,c,h){function u(t){return t instanceof cc.Vec2?{in:t,pos:t,out:t}:Array.isArray(t)&&6===t.length?{in:s(t[2],t[3]),pos:s(t[0],t[1]),out:s(t[4],t[5])}:{in:cc.Vec2.ZERO,pos:cc.Vec2.ZERO,out:cc.Vec2.ZERO}}var f=e.values=e.values.map((function(t){return Array.isArray(t)&&(t=2===t.length?cc.v2(t[0],t[1]):cc.v3(t[0],t[1],t[2])),t}));if(0!==t.length&&0!==f.length){for(var _=!1,d=0;d<t.length;d++){var p=t[d];if(p&&!l(p)&&(cc.errorID(3904,h?h.name:"","position",d),p=null),p&&p.length>0){_=!0;break}}if(_&&1!==f.length){for(var m=e.types,v=e.ratios,g=e.values=[],y=e.types=[],T=e.ratios=[],A=0,b=i.Linear,E=0,C=t.length;E<C-1;E++){var x,S=t[E],w=v[E],D=v[E+1]-w,M=f[E],R=f[E+1],I=m[E],O=[],P=A/D,N=1/(D*r*c);if(S&&S.length>0){var F=[];F.push(u(M));for(var L=0,B=S.length;L<B;L++){var k=u(S[L]);F.push(k)}F.push(u(R));var V=new o(F);V.computeBeziers();for(var U=V.progresses;1-P>1e-6;){var z,G,H,W;if((x=n(x=P,I))<0)W=(0-x)*(G=V.beziers[0]).getLength(),H=G.start.sub(G.endCtrlPoint).normalize(),z=G.start.add(H.mul(W));else if(x>1)W=(x-1)*(G=V.beziers[V.beziers.length-1]).getLength(),H=G.end.sub(G.startCtrlPoint).normalize(),z=G.end.add(H.mul(W));else{var j=a(U,x);j<0&&(j=~j),x-=j>0?U[j-1]:0,x/=V.ratios[j],z=V.beziers[j].getPointAt(x)}O.push(z),P+=N}}else for(;1-P>1e-6;)x=n(x=P,I),O.push(M.lerp(R,x)),P+=N;for(b="constant"===I?I:i.Linear,L=0,B=O.length;L<B;L++){var Y=w+A+N*L*D;X(O[L],b,Y)}A=Math.abs(P-1)>1e-6?(P-1)*D:0}v[v.length-1]!==T[T.length-1]&&X(f[f.length-1],b,v[v.length-1])}}function X(t,e,i){g.push(t),y.push(e),T.push(i)}},Curve:o,Bezier:c}}),{"../core/utils/binary-search":236,"./animation-curves":11,"./bezier":14}],18:[(function(t,e){"use strict";var i=cc.js,n=t("../core/CCDebug");function r(){this._isPlaying=!1,this._isPaused=!1,this._stepOnce=!1}var a=r.prototype;i.get(a,"isPlaying",(function(){return this._isPlaying}),!0),i.get(a,"isPaused",(function(){return this._isPaused}),!0);var s=function(){};a.onPlay=s,a.onPause=s,a.onResume=s,a.onStop=s,a.onError=s,a.play=function(){this._isPlaying?this._isPaused?(this._isPaused=!1,this.onResume()):this.onError(n.getError(3912)):(this._isPlaying=!0,this.onPlay())},a.stop=function(){this._isPlaying&&(this._isPlaying=!1,this.onStop(),this._isPaused=!1)},a.pause=function(){this._isPlaying&&!this._isPaused&&(this._isPaused=!0,this.onPause())},a.resume=function(){this._isPlaying&&this._isPaused&&(this._isPaused=!1,this.onResume())},a.step=function(){this.pause(),this._stepOnce=!0,this._isPlaying||this.play()},e.exports=r}),{"../core/CCDebug":26}],19:[(function(t,e){"use strict";var i={Loop:2,ShouldWrap:4,PingPong:22,Reverse:36},n=cc.Enum({Default:0,Normal:1,Reverse:i.Reverse,Loop:i.Loop,LoopReverse:i.Loop|i.Reverse,PingPong:i.PingPong,PingPongReverse:i.PingPong|i.Reverse});function r(t){t?this.set(t):(this.ratio=0,this.time=0,this.direction=1,this.stopped=!0,this.iterations=0,this.frameIndex=void 0)}cc.WrapMode=n,r.prototype.set=function(t){this.ratio=t.ratio,this.time=t.time,this.direction=t.direction,this.stopped=t.stopped,this.iterations=t.iterations,this.frameIndex=t.frameIndex},e.exports={WrapModeMask:i,WrapMode:n,WrappedInfo:r}}),{}],20:[(function(t,e){"use strict";var i,n,r=t("../core/event/event-target"),a=t("../core/platform/CCSys"),s=t("../core/assets/CCAudioClip").LoadMode,o=!1,c=[],l=function t(e){r.call(this),this._shouldRecycleOnEnded=!1,this._src=e,this._element=null,this.id=0,this._state=t.State.INITIALZING;var i=this;this._onended=function(){i._state=t.State.STOPPED,i.emit("ended")},this._onendedSecond=function(){i._unbindEnded(i._onendedSecond),i._bindEnded()}};cc.js.extend(l,r),l.State={ERROR:-1,INITIALZING:0,PLAYING:1,PAUSED:2,STOPPED:3},(i=l.prototype)._bindEnded=function(t){if(!(t=t||this._onended)._binded){t._binded=!0;var e=this._element;this._src&&e instanceof HTMLAudioElement?e.addEventListener("ended",t):e.onended=t}},i._unbindEnded=function(t){if((t=t||this._onended)._binded){t._binded=!1;var e=this._element;e instanceof HTMLAudioElement?e.removeEventListener("ended",t):e&&(e.onended=null)}},i._onLoaded=function(){this._createElement(),this._state=l.State.INITIALZING,this.setVolume(1),this.setLoop(!1)},i._createElement=function(){var t=this._src._nativeAsset;t instanceof HTMLAudioElement?(this._element||(this._element=document.createElement("audio")),this._element.src=t.src):this._element=new h(t,this)},i.play=function(){var t=this;this._src&&this._src._ensureLoaded((function(){t._state=l.State.PLAYING,t._bindEnded();var e=t._element.play();window.Promise&&e instanceof Promise&&e.catch((function(){})),t._touchToPlay()}))},i._touchToPlay=function(){if(this._src&&this._src.loadMode===s.DOM_AUDIO&&this._element.paused&&c.push({instance:this,offset:0,audio:this._element}),!o){o=!0;var t="ontouchend"in window?"touchend":"mousedown";cc.game.canvas.addEventListener(t,(function(){for(var t;t=c.pop();)t.audio.play(t.offset)}))}},i.destroy=function(){this._element=null},i.pause=function(){if(this.getState()===l.State.PLAYING){var t=this;this._src&&this._src._ensureLoaded((function(){t._unbindEnded(),t._element.pause(),t._state=l.State.PAUSED}))}},i.resume=function(){if(this.getState()===l.State.PAUSED){var t=this;this._src&&this._src._ensureLoaded((function(){t._bindEnded(),t._element.play(),t._state=l.State.PLAYING}))}},i.stop=function(){var t=this;this._src&&this._src._ensureLoaded((function(){t._element.pause(),t._element.currentTime=0;for(var e=0;e<c.length;e++)if(c[e].instance===t){c.splice(e,1);break}t._unbindEnded(),t.emit("stop"),t._state=l.State.STOPPED}))},i.setLoop=function(t){var e=this;this._src&&this._src._ensureLoaded((function(){e._element.loop=t}))},i.getLoop=function(){return!!this._element&&this._element.loop},i.setVolume=function(t){var e=this;this._src&&this._src._ensureLoaded((function(){e._element.volume=t}))},i.getVolume=function(){return this._element?this._element.volume:1},i.setCurrentTime=function(t){var e=this;this._src&&this._src._ensureLoaded((function(){e._unbindEnded(),e._bindEnded(e._onendedSecond),e._element.currentTime=t}))},i.getCurrentTime=function(){return this._element?this._element.currentTime:0},i.getDuration=function(){return this._src?this._src.duration:0},i.getState=function(t){return void 0===t&&(t=!0),t&&this._forceUpdatingState(),this._state},i._forceUpdatingState=function(){var t=this._element;t&&(l.State.PLAYING===this._state&&t.paused?this._state=l.State.STOPPED:l.State.STOPPED!==this._state||t.paused||(this._state=l.State.PLAYING))},Object.defineProperty(i,"src",{get:function(){return this._src},set:function(t){if(this._unbindEnded(),t&&t.isValid){if(t!==this._src)if(this._src=t,t.loaded)this._onLoaded();else{var e=this;t.once("load",(function(){t===e._src&&(t.loaded=!0,e._onLoaded())}))}}else this._src=null,this._element instanceof h?this._element=null:this._element&&(this._element.src=""),this._state=l.State.INITIALZING},enumerable:!0,configurable:!0}),Object.defineProperty(i,"paused",{get:function(){return!this._element||this._element.paused},enumerable:!0,configurable:!0}),n=cc.sys.browserType===cc.sys.BROWSER_TYPE_EDGE||cc.sys.browserType===cc.sys.BROWSER_TYPE_BAIDU||cc.sys.browserType===cc.sys.BROWSER_TYPE_UC?.01:0;var h=function(t,e){this._audio=e,this._context=a.__audioSupport.context,this._buffer=t,this._gainObj=this._context.createGain(),this.volume=1,this._gainObj.connect(this._context.destination),this._loop=!1,this._startTime=-1,this._currentSource=null,this.playedLength=0,this._currentTimer=null,this._endCallback=function(){this.onended&&this.onended(this)}.bind(this)};(function(t){t.play=function(t){this._currentSource&&!this.paused&&(this._currentSource.onended=null,this._currentSource.stop(0),this.playedLength=0);var e=this._context.createBufferSource();e.buffer=this._buffer,e.connect(this._gainObj),e.loop=this._loop,this._startTime=this._context.currentTime,(t=t||this.playedLength)&&(this._startTime-=t);var i,n=this._buffer.duration,r=t;if(this._loop?e.start?e.start(0,r):e.notoGrainOn?e.noteGrainOn(0,r):e.noteOn(0,r):(i=n-t,e.start?e.start(0,r,i):e.noteGrainOn?e.noteGrainOn(0,r,i):e.noteOn(0,r,i)),this._currentSource=e,e.onended=this._endCallback,(!e.context.state||"suspended"===e.context.state)&&0===this._context.currentTime){var a=this;clearTimeout(this._currentTimer),this._currentTimer=setTimeout((function(){0===a._context.currentTime&&c.push({instance:a._audio,offset:t,audio:a})}),10)}var s=cc.sys;s.os===s.OS_IOS&&s.isBrowser&&s.isMobile&&("suspended"===e.context.state&&0!==this._context.currentTime||"interrupted"===e.context.state)&&e.context.resume()},t.pause=function(){if(clearTimeout(this._currentTimer),!this.paused){this.playedLength=this._context.currentTime-this._startTime,this.playedLength%=this._buffer.duration;var t=this._currentSource;t&&(t.onended&&(t.onended._binded=!1,t.onended=null),t.stop(0)),this._currentSource=null,this._startTime=-1}},Object.defineProperty(t,"paused",{get:function(){return(!this._currentSource||!this._currentSource.loop)&&(-1===this._startTime||this._context.currentTime-this._startTime>this._buffer.duration)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"loop",{get:function(){return this._loop},set:function(t){this._currentSource&&(this._currentSource.loop=t),this._loop=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"volume",{get:function(){return this._volume},set:function(t){if(this._volume=t,this._gainObj.gain.setTargetAtTime)try{this._gainObj.gain.setTargetAtTime(t,this._context.currentTime,n)}catch(e){this._gainObj.gain.setTargetAtTime(t,this._context.currentTime,.01)}else this._gainObj.gain.value=t;a.os===a.OS_IOS&&!this.paused&&this._currentSource&&(this._currentSource.onended=null,this.pause(),this.play())},enumerable:!0,configurable:!0}),Object.defineProperty(t,"currentTime",{get:function(){return this.paused?this.playedLength:(this.playedLength=this._context.currentTime-this._startTime,this.playedLength%=this._buffer.duration,this.playedLength)},set:function(t){this.paused?this.playedLength=t:(this.pause(),this.playedLength=t,this.play())},enumerable:!0,configurable:!0}),Object.defineProperty(t,"duration",{get:function(){return this._buffer.duration},enumerable:!0,configurable:!0})})(h.prototype),e.exports=cc._Audio=l}),{"../core/assets/CCAudioClip":63,"../core/event/event-target":141,"../core/platform/CCSys":177}],21:[(function(t,e){"use strict";var i=t("./CCAudio"),n=t("../core/assets/CCAudioClip"),r=cc.js,a=0,s=r.createMap(!0),o={},c=[],l=function(t){t._shouldRecycleOnEnded&&(t._finishCallback=null,t.off("ended"),t.off("stop"),t.src=null,cc.sys.platform===cc.sys.ALIPAY_GAME?t.destroy():c.includes(t)||(c.length<_._maxPoolSize?c.push(t):t.destroy()),t._shouldRecycleOnEnded=!1)},h=function(t){var e=++a,n=o[t];if(n||(n=o[t]=[]),_._maxAudioInstance<=n.length){var r=n.shift();u(r).stop()}var h=c.pop()||new i,f=function(){if(u(this.id)){delete s[this.id];var t=n.indexOf(this.id);cc.js.array.fastRemoveAt(n,t)}l(this)};return h.on("ended",(function(){this._finishCallback&&this._finishCallback(),this.getLoop()||f.call(this)}),h),h.on("stop",f,h),h.id=e,s[e]=h,n.push(e),h},u=function(t){return s[t]},f=function(t){return void 0===t?t=1:"string"==typeof t&&(t=Number.parseFloat(t)),t},_={AudioState:i.State,_maxAudioInstance:24,_maxPoolSize:32,_id2audio:s,play:function(t,e,i){if(!(t instanceof n))return cc.error("Wrong type of AudioClip.");var r=t.nativeUrl,a=h(r);return a.src=t,t._ensureLoaded(),a._shouldRecycleOnEnded=!0,a.setLoop(e||!1),i=f(i),a.setVolume(i),a.play(),a.id},setLoop:function(t,e){var i=u(t);i&&i.setLoop&&i.setLoop(e)},isLoop:function(t){var e=u(t);return!(!e||!e.getLoop)&&e.getLoop()},setVolume:function(t,e){var i=u(t);i&&i.setVolume(e)},getVolume:function(t){var e=u(t);return e?e.getVolume():1},setCurrentTime:function(t,e){var i=u(t);return!!i&&(i.setCurrentTime(e),!0)},getCurrentTime:function(t){var e=u(t);return e?e.getCurrentTime():0},getDuration:function(t){var e=u(t);return e?e.getDuration():0},getState:function(t){var e=u(t);return e?e.getState():this.AudioState.ERROR},isPlaying:function(t){return this.getState(t)===this.AudioState.PLAYING},setFinishCallback:function(t,e){var i=u(t);i&&(i._finishCallback=e)},pause:function(t){var e=u(t);return!!e&&(e.pause(),!0)},_pauseIDCache:[],pauseAll:function(){for(var t in s){var e=s[t];e.getState()===i.State.PLAYING&&(this._pauseIDCache.push(t),e.pause())}},resume:function(t){var e=u(t);e&&e.resume()},resumeAll:function(){for(var t=0;t<this._pauseIDCache.length;++t){var e=this._pauseIDCache[t],i=u(e);i&&i.resume()}this._pauseIDCache.length=0},stop:function(t){var e=u(t);return!!e&&(e.stop(),!0)},stopAll:function(){for(var t in s){var e=s[t];e&&e.stop()}},setMaxAudioInstance:function(){},getMaxAudioInstance:function(){return this._maxAudioInstance},uncache:function(t){var e=t;if("string"==typeof t)cc.warnID(8401,"cc.audioEngine","cc.AudioClip","AudioClip","cc.AudioClip","audio"),e=t;else{if(!t)return;e=t.nativeUrl}var i=o[e];if(i)for(;i.length>0;){var n=i.pop(),r=s[n];r&&(r.stop(),delete s[n])}},uncacheAll:function(){var t;for(var e in this.stopAll(),s)(t=s[e])&&t.destroy();for(;t=c.pop();)t.destroy();s=r.createMap(!0),o={}},_breakCache:null,_break:function(){for(var t in this._breakCache=[],s){var e=s[t];e.getState()===i.State.PLAYING&&(this._breakCache.push(t),e.pause())}},_restore:function(){if(this._breakCache){for(;this._breakCache.length>0;){var t=this._breakCache.pop(),e=u(t);e&&e.resume&&e.resume()}this._breakCache=null}},_music:{id:-1,loop:!1,volume:1},_effect:{volume:1,pauseCache:[]},playMusic:function(t,e){var i=this._music;return this.stop(i.id),i.id=this.play(t,e,i.volume),i.loop=e,i.id},stopMusic:function(){this.stop(this._music.id)},pauseMusic:function(){return this.pause(this._music.id),this._music.id},resumeMusic:function(){return this.resume(this._music.id),this._music.id},getMusicVolume:function(){return this._music.volume},setMusicVolume:function(t){t=f(t);var e=this._music;return e.volume=t,this.setVolume(e.id,e.volume),e.volume},isMusicPlaying:function(){return this.getState(this._music.id)===this.AudioState.PLAYING},playEffect:function(t,e){return this.play(t,e||!1,this._effect.volume)},setEffectsVolume:function(t){t=f(t);var e=this._music.id;for(var i in this._effect.volume=t,s){var n=s[i];n&&n.id!==e&&_.setVolume(i,t)}},getEffectsVolume:function(){return this._effect.volume},pauseEffect:function(t){return this.pause(t)},pauseAllEffects:function(){var t=this._music.id,e=this._effect;for(var i in e.pauseCache.length=0,s){var n=s[i];n&&n.id!==t&&n.getState()===this.AudioState.PLAYING&&(e.pauseCache.push(i),n.pause())}},resumeEffect:function(t){this.resume(t)},resumeAllEffects:function(){for(var t=this._effect.pauseCache,e=0;e<t.length;++e){var i=t[e],n=s[i];n&&n.resume()}},stopEffect:function(t){return this.stop(t)},stopAllEffects:function(){var t=this._music.id;for(var e in s){var i=s[e];i&&i.id!==t&&i.getState()===_.AudioState.PLAYING&&i.stop()}}};e.exports=cc.audioEngine=_}),{"../core/assets/CCAudioClip":63,"./CCAudio":20}],22:[(function(t,e){"use strict";var i={name:"Jacob__Codec"};i.Base64=t("./base64"),i.GZip=t("./gzip"),i.unzip=function(){return i.GZip.gunzip.apply(i.GZip,arguments)},i.unzipBase64=function(){var t=i.Base64.decode.apply(i.Base64,arguments);try{return i.GZip.gunzip.call(i.GZip,t)}catch(e){return t.slice(7)}},i.unzipBase64AsArray=function(t,e){e=e||1;var i,n,r,a=this.unzipBase64(t),s=[];for(i=0,r=a.length/e;i<r;i++)for(s[i]=0,n=e-1;n>=0;--n)s[i]+=a.charCodeAt(i*e+n)<<8*n;return s},i.unzipAsArray=function(t,e){e=e||1;var i,n,r,a=this.unzip(t),s=[];for(i=0,r=a.length/e;i<r;i++)for(s[i]=0,n=e-1;n>=0;--n)s[i]+=a.charCodeAt(i*e+n)<<8*n;return s},cc.codec=e.exports=i}),{"./base64":23,"./gzip":24}],23:[(function(t,e){"use strict";var i=t("../core/utils/misc").BASE64_VALUES,n={name:"Jacob__Codec__Base64",decode:function(t){var e,n,r,a,s,o,c=[],l=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<t.length;)e=i[t.charCodeAt(l++)]<<2|(a=i[t.charCodeAt(l++)])>>4,n=(15&a)<<4|(s=i[t.charCodeAt(l++)])>>2,r=(3&s)<<6|(o=i[t.charCodeAt(l++)]),c.push(String.fromCharCode(e)),64!==s&&c.push(String.fromCharCode(n)),64!==o&&c.push(String.fromCharCode(r));return c.join("")},decodeAsArray:function(t,e){var i,n,r,a=this.decode(t),s=[];for(i=0,r=a.length/e;i<r;i++)for(s[i]=0,n=e-1;n>=0;--n)s[i]+=a.charCodeAt(i*e+n)<<8*n;return s}};e.exports=n}),{"../core/utils/misc":242}],24:[(function(t,e){"use strict";var i=function(t){this.data=t,this.debug=!1,this.gpflags=void 0,this.files=0,this.unzipped=[],this.buf32k=new Array(32768),this.bIdx=0,this.modeZIP=!1,this.bytepos=0,this.bb=1,this.bits=0,this.nameBuf=[],this.fileout=void 0,this.literalTree=new Array(i.LITERALS),this.distanceTree=new Array(32),this.treepos=0,this.Places=null,this.len=0,this.fpos=new Array(17),this.fpos[0]=0,this.flens=void 0,this.fmax=void 0};i.gunzip=function(t){return t.constructor===Array||(t.constructor,String),new i(t).gunzip()[0][0]},i.HufNode=function(){this.b0=0,this.b1=0,this.jump=null,this.jumppos=-1},i.LITERALS=288,i.NAMEMAX=256,i.bitReverse=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],i.cplens=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],i.cplext=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],i.cpdist=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],i.cpdext=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],i.border=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],i.prototype.gunzip=function(){return this.outputArr=[],this.nextFile(),this.unzipped},i.prototype.readByte=function(){return this.bits+=8,this.bytepos<this.data.length?this.data.charCodeAt(this.bytepos++):-1},i.prototype.byteAlign=function(){this.bb=1},i.prototype.readBit=function(){var t;return this.bits++,t=1&this.bb,this.bb>>=1,0===this.bb&&(this.bb=this.readByte(),t=1&this.bb,this.bb=this.bb>>1|128),t},i.prototype.readBits=function(t){for(var e=0,n=t;n--;)e=e<<1|this.readBit();return t&&(e=i.bitReverse[e]>>8-t),e},i.prototype.flushBuffer=function(){this.bIdx=0},i.prototype.addBuffer=function(t){this.buf32k[this.bIdx++]=t,this.outputArr.push(String.fromCharCode(t)),32768===this.bIdx&&(this.bIdx=0)},i.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-1;if(this.flens[this.fpos[this.len]]===this.len)return this.fpos[this.len]++;this.fpos[this.len]++}},i.prototype.Rec=function(){var t,e=this.Places[this.treepos];if(17===this.len)return-1;if(this.treepos++,this.len++,(t=this.IsPat())>=0)e.b0=t;else if(e.b0=32768,this.Rec())return-1;if((t=this.IsPat())>=0)e.b1=t,e.jump=null;else if(e.b1=32768,e.jump=this.Places[this.treepos],e.jumppos=this.treepos,this.Rec())return-1;return this.len--,0},i.prototype.CreateTree=function(t,e,i){var n;for(this.Places=t,this.treepos=0,this.flens=i,this.fmax=e,n=0;n<17;n++)this.fpos[n]=0;return this.len=0,this.Rec()?-1:0},i.prototype.DecodeValue=function(t){for(var e,i,n=0,r=t[n];;)if(this.readBit()){if(!(32768&r.b1))return r.b1;for(r=r.jump,e=t.length,i=0;i<e;i++)if(t[i]===r){n=i;break}}else{if(!(32768&r.b0))return r.b0;r=t[++n]}return-1},i.prototype.DeflateLoop=function(){var t,e,n;do{var r,a;if(t=this.readBit(),0===(e=this.readBits(2)))for(this.byteAlign(),r=this.readByte(),r|=this.readByte()<<8,a=this.readByte(),65535&(r^~(a|=this.readByte()<<8))&&document.write("BlockLen checksum mismatch\n");r--;)s=this.readByte(),this.addBuffer(s);else if(1===e)for(;;)if((o=i.bitReverse[this.readBits(7)]>>1)>23?(o=o<<1|this.readBit())>199?o=(o-=128)<<1|this.readBit():(o-=48)>143&&(o+=136):o+=256,o<256)this.addBuffer(o);else{if(256===o)break;for(o-=257,p=this.readBits(i.cplext[o])+i.cplens[o],o=i.bitReverse[this.readBits(5)]>>3,i.cpdext[o]>8?(m=this.readBits(8),m|=this.readBits(i.cpdext[o]-8)<<8):m=this.readBits(i.cpdext[o]),m+=i.cpdist[o],o=0;o<p;o++){var s=this.buf32k[this.bIdx-m&32767];this.addBuffer(s)}}else if(2===e){var o,c,l,h,u,f=new Array(320);for(l=257+this.readBits(5),h=1+this.readBits(5),u=4+this.readBits(4),o=0;o<19;o++)f[o]=0;for(o=0;o<u;o++)f[i.border[o]]=this.readBits(3);for(p=this.distanceTree.length,n=0;n<p;n++)this.distanceTree[n]=new i.HufNode;if(this.CreateTree(this.distanceTree,19,f,0))return this.flushBuffer(),1;for(c=l+h,n=0;n<c;)if((o=this.DecodeValue(this.distanceTree))<16)f[n++]=o;else if(16===o){var _;if(n+(o=3+this.readBits(2))>c)return this.flushBuffer(),1;for(_=n?f[n-1]:0;o--;)f[n++]=_}else{if(n+(o=17===o?3+this.readBits(3):11+this.readBits(7))>c)return this.flushBuffer(),1;for(;o--;)f[n++]=0}for(p=this.literalTree.length,n=0;n<p;n++)this.literalTree[n]=new i.HufNode;if(this.CreateTree(this.literalTree,l,f,0))return this.flushBuffer(),1;for(p=this.literalTree.length,n=0;n<p;n++)this.distanceTree[n]=new i.HufNode;var d=new Array;for(n=l;n<f.length;n++)d[n-l]=f[n];if(this.CreateTree(this.distanceTree,h,d,0))return this.flushBuffer(),1;for(;;)if((o=this.DecodeValue(this.literalTree))>=256){var p,m;if(0==(o-=256))break;for(o--,p=this.readBits(i.cplext[o])+i.cplens[o],o=this.DecodeValue(this.distanceTree),i.cpdext[o]>8?(m=this.readBits(8),m|=this.readBits(i.cpdext[o]-8)<<8):m=this.readBits(i.cpdext[o]),m+=i.cpdist[o];p--;)s=this.buf32k[this.bIdx-m&32767],this.addBuffer(s)}else this.addBuffer(o)}}while(!t);return this.flushBuffer(),this.byteAlign(),0},i.prototype.unzipFile=function(t){var e;for(this.gunzip(),e=0;e<this.unzipped.length;e++)if(this.unzipped[e][1]===t)return this.unzipped[e][0]},i.prototype.nextFile=function(){this.outputArr=[],this.modeZIP=!1;var t=[];if(t[0]=this.readByte(),t[1]=this.readByte(),120===t[0]&&218===t[1]&&(this.DeflateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),"geonext.gxt"],this.files++),31===t[0]&&139===t[1]&&(this.skipdir(),this.unzipped[this.files]=[this.outputArr.join(""),"file"],this.files++),80===t[0]&&75===t[1]&&(this.modeZIP=!0,t[2]=this.readByte(),t[3]=this.readByte(),3===t[2]&&4===t[3])){t[0]=this.readByte(),t[1]=this.readByte(),this.gpflags=this.readByte(),this.gpflags|=this.readByte()<<8;var e=this.readByte();e|=this.readByte()<<8,this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte();var n=this.readByte();n|=this.readByte()<<8;var r=this.readByte();for(r|=this.readByte()<<8,s=0,this.nameBuf=[];n--;){var a=this.readByte();"/"===a|":"===a?s=0:s<i.NAMEMAX-1&&(this.nameBuf[s++]=String.fromCharCode(a))}this.fileout||(this.fileout=this.nameBuf);for(var s=0;s<r;)a=this.readByte(),s++;8===e&&(this.DeflateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),this.nameBuf.join("")],this.files++),this.skipdir()}},i.prototype.skipdir=function(){var t,e,n=[];if(8&this.gpflags&&(n[0]=this.readByte(),n[1]=this.readByte(),n[2]=this.readByte(),n[3]=this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte()),this.modeZIP&&this.nextFile(),n[0]=this.readByte(),8!==n[0])return 0;if(this.gpflags=this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),4&this.gpflags)for(n[0]=this.readByte(),n[2]=this.readByte(),this.len=n[0]+256*n[1],t=0;t<this.len;t++)this.readByte();if(8&this.gpflags)for(t=0,this.nameBuf=[];e=this.readByte();)"7"!==e&&":"!==e||(t=0),t<i.NAMEMAX-1&&(this.nameBuf[t++]=e);if(16&this.gpflags)for(;e=this.readByte(););2&this.gpflags&&(this.readByte(),this.readByte()),this.DeflateLoop(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.modeZIP&&this.nextFile()},e.exports=i}),{}],25:[(function(t,e){"use strict";(function(){function t(t){throw t}var e=void 0,i=!0,n=this;function r(t,i){var r,a=t.split("."),s=n;!(a[0]in s)&&s.execScript&&s.execScript("var "+a[0]);for(;a.length&&(r=a.shift());)a.length||i===e?s=s[r]?s[r]:s[r]={}:s[r]=i}var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array;function s(t){if("string"==typeof t){var e,i,n=t.split("");for(e=0,i=n.length;e<i;e++)n[e]=(255&n[e].charCodeAt(0))>>>0;t=n}for(var r,a=1,s=0,o=t.length,c=0;0<o;){o-=r=1024<o?1024:o;do{s+=a+=t[c++]}while(--r);a%=65521,s%=65521}return(s<<16|a)>>>0}function o(e,i){this.index="number"==typeof i?i:0,this.i=0,this.buffer=e instanceof(a?Uint8Array:Array)?e:new(a?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&t(Error("invalid index")),this.buffer.length<=this.index&&this.f()}o.prototype.f=function(){var t,e=this.buffer,i=e.length,n=new(a?Uint8Array:Array)(i<<1);if(a)n.set(e);else for(t=0;t<i;++t)n[t]=e[t];return this.buffer=n},o.prototype.d=function(t,e,i){var n,r=this.buffer,a=this.index,s=this.i,o=r[a];if(i&&1<e&&(t=8<e?(_[255&t]<<24|_[t>>>8&255]<<16|_[t>>>16&255]<<8|_[t>>>24&255])>>32-e:_[t]>>8-e),8>e+s)o=o<<e|t,s+=e;else for(n=0;n<e;++n)o=o<<1|t>>e-n-1&1,8==++s&&(s=0,r[a++]=_[o],o=0,a===r.length&&(r=this.f()));r[a]=o,this.buffer=r,this.i=s,this.index=a},o.prototype.finish=function(){var t,e=this.buffer,i=this.index;return 0<this.i&&(e[i]<<=8-this.i,e[i]=_[e[i]],i++),a?t=e.subarray(0,i):(e.length=i,t=e),t};var c,l=new(a?Uint8Array:Array)(256);for(c=0;256>c;++c){for(var h=f=c,u=7,f=f>>>1;f;f>>>=1)h<<=1,h|=1&f,--u;l[c]=(h<<u&255)>>>0}var _=l;function d(t){this.buffer=new(a?Uint16Array:Array)(2*t),this.length=0}function p(t){var e,i,n,r,s,o,c,l,h,u=t.length,f=0,_=Number.POSITIVE_INFINITY;for(l=0;l<u;++l)t[l]>f&&(f=t[l]),t[l]<_&&(_=t[l]);for(e=1<<f,i=new(a?Uint32Array:Array)(e),n=1,r=0,s=2;n<=f;){for(l=0;l<u;++l)if(t[l]===n){for(o=0,c=r,h=0;h<n;++h)o=o<<1|1&c,c>>=1;for(h=o;h<e;h+=s)i[h]=n<<16|l;++r}++n,r<<=1,s<<=1}return[i,f,_]}function m(t,e){this.h=g,this.w=0,this.input=t,this.b=0,e&&(e.lazy&&(this.w=e.lazy),"number"==typeof e.compressionType&&(this.h=e.compressionType),e.outputBuffer&&(this.a=a&&e.outputBuffer instanceof Array?new Uint8Array(e.outputBuffer):e.outputBuffer),"number"==typeof e.outputIndex&&(this.b=e.outputIndex)),this.a||(this.a=new(a?Uint8Array:Array)(32768))}a&&new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),d.prototype.getParent=function(t){return 2*((t-2)/4|0)},d.prototype.push=function(t,e){var i,n,r,a=this.buffer;for(i=this.length,a[this.length++]=e,a[this.length++]=t;0<i&&(n=this.getParent(i),a[i]>a[n]);)r=a[i],a[i]=a[n],a[n]=r,r=a[i+1],a[i+1]=a[n+1],a[n+1]=r,i=n;return this.length},d.prototype.pop=function(){var t,e,i,n,r,a=this.buffer;for(e=a[0],t=a[1],this.length-=2,a[0]=a[this.length],a[1]=a[this.length+1],r=0;!((n=2*r+2)>=this.length)&&(n+2<this.length&&a[n+2]>a[n]&&(n+=2),a[n]>a[r]);)i=a[r],a[r]=a[n],a[n]=i,i=a[r+1],a[r+1]=a[n+1],a[n+1]=i,r=n;return{index:t,value:e,length:this.length}};var v,g=2,y={NONE:0,r:1,j:g,N:3},T=[];for(v=0;288>v;v++)switch(i){case 143>=v:T.push([v+48,8]);break;case 255>=v:T.push([v-144+400,9]);break;case 279>=v:T.push([v-256+0,7]);break;case 287>=v:T.push([v-280+192,8]);break;default:t("invalid literal: "+v)}function A(t,e){this.length=t,this.G=e}function b(){var e=E;switch(i){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:t("invalid length: "+e)}}m.prototype.n=function(){var n,r,s,c,l=this.input;switch(this.h){case 0:for(s=0,c=l.length;s<c;){var h,u,f,_=r=a?l.subarray(s,s+65535):l.slice(s,s+65535),d=(s+=r.length)===c,p=e,m=e,v=this.a,y=this.b;if(a){for(v=new Uint8Array(this.a.buffer);v.length<=y+_.length+5;)v=new Uint8Array(v.length<<1);v.set(this.a)}if(h=d?1:0,v[y++]=0|h,f=65536+~(u=_.length)&65535,v[y++]=255&u,v[y++]=u>>>8&255,v[y++]=255&f,v[y++]=f>>>8&255,a)v.set(_,y),y+=_.length,v=v.subarray(0,y);else{for(p=0,m=_.length;p<m;++p)v[y++]=_[p];v.length=y}this.b=y,this.a=v}break;case 1:var A=new o(new Uint8Array(this.a.buffer),this.b);A.d(1,1,i),A.d(1,2,i);var b,E,C,x=w(this,l);for(b=0,E=x.length;b<E;b++)if(C=x[b],o.prototype.d.apply(A,T[C]),256<C)A.d(x[++b],x[++b],i),A.d(x[++b],5),A.d(x[++b],x[++b],i);else if(256===C)break;this.a=A.finish(),this.b=this.a.length;break;case g:var S,R,I,O,P,N,F,L,B,k,V,U,z,G,H,W=new o(new Uint8Array(this.a),this.b),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=Array(19);for(S=g,W.d(1,1,i),W.d(S,2,i),R=w(this,l),F=M(N=D(this.L,15)),B=M(L=D(this.K,7)),I=286;257<I&&0===N[I-1];I--);for(O=30;1<O&&0===L[O-1];O--);var X,q,Z,K,J,Q,$=I,tt=O,et=new(a?Uint32Array:Array)($+tt),it=new(a?Uint32Array:Array)(316),nt=new(a?Uint8Array:Array)(19);for(X=q=0;X<$;X++)et[q++]=N[X];for(X=0;X<tt;X++)et[q++]=L[X];if(!a)for(X=0,K=nt.length;X<K;++X)nt[X]=0;for(X=J=0,K=et.length;X<K;X+=q){for(q=1;X+q<K&&et[X+q]===et[X];++q);if(Z=q,0===et[X])if(3>Z)for(;0<Z--;)it[J++]=0,nt[0]++;else for(;0<Z;)(Q=138>Z?Z:138)>Z-3&&Q<Z&&(Q=Z-3),10>=Q?(it[J++]=17,it[J++]=Q-3,nt[17]++):(it[J++]=18,it[J++]=Q-11,nt[18]++),Z-=Q;else if(it[J++]=et[X],nt[et[X]]++,3>--Z)for(;0<Z--;)it[J++]=et[X],nt[et[X]]++;else for(;0<Z;)(Q=6>Z?Z:6)>Z-3&&Q<Z&&(Q=Z-3),it[J++]=16,it[J++]=Q-3,nt[16]++,Z-=Q}for(n=a?it.subarray(0,J):it.slice(0,J),k=D(nt,7),G=0;19>G;G++)Y[G]=k[j[G]];for(P=19;4<P&&0===Y[P-1];P--);for(V=M(k),W.d(I-257,5,i),W.d(O-1,5,i),W.d(P-4,4,i),G=0;G<P;G++)W.d(Y[G],3,i);for(G=0,H=n.length;G<H;G++)if(U=n[G],W.d(V[U],k[U],i),16<=U){switch(G++,U){case 16:z=2;break;case 17:z=3;break;case 18:z=7;break;default:t("invalid code: "+U)}W.d(n[G],z,i)}var rt,at,st,ot,ct,lt,ht,ut,ft=[F,N],_t=[B,L];for(ct=ft[0],lt=ft[1],ht=_t[0],ut=_t[1],rt=0,at=R.length;rt<at;++rt)if(st=R[rt],W.d(ct[st],lt[st],i),256<st)W.d(R[++rt],R[++rt],i),ot=R[++rt],W.d(ht[ot],ut[ot],i),W.d(R[++rt],R[++rt],i);else if(256===st)break;this.a=W.finish(),this.b=this.a.length;break;default:t("invalid compression type")}return this.a};var E,C,x=[];for(E=3;258>=E;E++)C=b(),x[E]=C[2]<<24|C[1]<<16|C[0];var S=a?new Uint32Array(x):x;function w(n,r){function s(e,n){var r,a,s,o,c=e.G,l=[],h=0;switch(r=S[e.length],l[h++]=65535&r,l[h++]=r>>16&255,l[h++]=r>>24,i){case 1===c:a=[0,c-1,0];break;case 2===c:a=[1,c-2,0];break;case 3===c:a=[2,c-3,0];break;case 4===c:a=[3,c-4,0];break;case 6>=c:a=[4,c-5,1];break;case 8>=c:a=[5,c-7,1];break;case 12>=c:a=[6,c-9,2];break;case 16>=c:a=[7,c-13,2];break;case 24>=c:a=[8,c-17,3];break;case 32>=c:a=[9,c-25,3];break;case 48>=c:a=[10,c-33,4];break;case 64>=c:a=[11,c-49,4];break;case 96>=c:a=[12,c-65,5];break;case 128>=c:a=[13,c-97,5];break;case 192>=c:a=[14,c-129,6];break;case 256>=c:a=[15,c-193,6];break;case 384>=c:a=[16,c-257,7];break;case 512>=c:a=[17,c-385,7];break;case 768>=c:a=[18,c-513,8];break;case 1024>=c:a=[19,c-769,8];break;case 1536>=c:a=[20,c-1025,9];break;case 2048>=c:a=[21,c-1537,9];break;case 3072>=c:a=[22,c-2049,10];break;case 4096>=c:a=[23,c-3073,10];break;case 6144>=c:a=[24,c-4097,11];break;case 8192>=c:a=[25,c-6145,11];break;case 12288>=c:a=[26,c-8193,12];break;case 16384>=c:a=[27,c-12289,12];break;case 24576>=c:a=[28,c-16385,13];break;case 32768>=c:a=[29,c-24577,13];break;default:t("invalid distance")}for(r=a,l[h++]=r[0],l[h++]=r[1],l[h++]=r[2],s=0,o=l.length;s<o;++s)v[g++]=l[s];T[l[0]]++,b[l[3]]++,y=e.length+n-1,d=null}var o,c,l,h,u,f,_,d,p,m={},v=a?new Uint16Array(2*r.length):[],g=0,y=0,T=new(a?Uint32Array:Array)(286),b=new(a?Uint32Array:Array)(30),E=n.w;if(!a){for(l=0;285>=l;)T[l++]=0;for(l=0;29>=l;)b[l++]=0}for(T[256]=1,o=0,c=r.length;o<c;++o){for(l=u=0,h=3;l<h&&o+l!==c;++l)u=u<<8|r[o+l];if(m[u]===e&&(m[u]=[]),f=m[u],!(0<y--)){for(;0<f.length&&32768<o-f[0];)f.shift();if(o+3>=c){for(d&&s(d,-1),l=0,h=c-o;l<h;++l)p=r[o+l],v[g++]=p,++T[p];break}if(0<f.length){var C=e,x=e,w=0,D=e,M=e,R=e,I=r.length,O=(M=0,f.length);t:for(;M<O;M++){if(C=f[O-M-1],D=3,3<w){for(R=w;3<R;R--)if(r[C+R-1]!==r[o+R-1])continue t;D=w}for(;258>D&&o+D<I&&r[C+D]===r[o+D];)++D;if(D>w&&(x=C,w=D),258===D)break}_=new A(w,o-x),d?d.length<_.length?(p=r[o-1],v[g++]=p,++T[p],s(_,0)):s(d,-1):_.length<E?d=_:s(_,0)}else d?s(d,-1):(p=r[o],v[g++]=p,++T[p])}f.push(o)}return v[g++]=256,T[256]++,n.L=T,n.K=b,a?v.subarray(0,g):v}function D(t,e){function i(t){var e=E[t][C[t]];e===g?(i(t+1),i(t+1)):--A[e],++C[t]}var n,r,s,o,c,l=t.length,h=new d(572),u=new(a?Uint8Array:Array)(l);if(!a)for(o=0;o<l;o++)u[o]=0;for(o=0;o<l;++o)0<t[o]&&h.push(o,t[o]);if(n=Array(h.length/2),r=new(a?Uint32Array:Array)(h.length/2),1===n.length)return u[h.pop().index]=1,u;for(o=0,c=h.length/2;o<c;++o)n[o]=h.pop(),r[o]=n[o].value;var f,_,p,m,v,g=r.length,y=new(a?Uint16Array:Array)(e),T=new(a?Uint8Array:Array)(e),A=new(a?Uint8Array:Array)(g),b=Array(e),E=Array(e),C=Array(e),x=(1<<e)-g,S=1<<e-1;for(y[e-1]=g,_=0;_<e;++_)x<S?T[_]=0:(T[_]=1,x-=S),x<<=1,y[e-2-_]=(y[e-1-_]/2|0)+g;for(y[0]=T[0],b[0]=Array(y[0]),E[0]=Array(y[0]),_=1;_<e;++_)y[_]>2*y[_-1]+T[_]&&(y[_]=2*y[_-1]+T[_]),b[_]=Array(y[_]),E[_]=Array(y[_]);for(f=0;f<g;++f)A[f]=e;for(p=0;p<y[e-1];++p)b[e-1][p]=r[p],E[e-1][p]=p;for(f=0;f<e;++f)C[f]=0;for(1===T[e-1]&&(--A[0],++C[e-1]),_=e-2;0<=_;--_){for(m=f=0,v=C[_+1],p=0;p<y[_];p++)(m=b[_+1][v]+b[_+1][v+1])>r[f]?(b[_][p]=m,E[_][p]=g,v+=2):(b[_][p]=r[f],E[_][p]=f,++f);C[_]=0,1===T[_]&&i(_)}for(s=A,o=0,c=n.length;o<c;++o)u[n[o].index]=s[o];return u}function M(e){var i,n,r,s,o=new(a?Uint16Array:Array)(e.length),c=[],l=[],h=0;for(i=0,n=e.length;i<n;i++)c[e[i]]=1+(0|c[e[i]]);for(i=1,n=16;i<=n;i++)l[i]=h,(h+=0|c[i])>1<<i&&t("overcommitted"),h<<=1;for(65536>h&&t("undercommitted"),i=0,n=e.length;i<n;i++)for(h=l[e[i]],l[e[i]]+=1,r=o[i]=0,s=e[i];r<s;r++)o[i]=o[i]<<1|1&h,h>>>=1;return o}function R(t,e){this.input=t,this.a=new(a?Uint8Array:Array)(32768),this.h=I.j;var i,n={};for(i in!e&&(e={})||"number"!=typeof e.compressionType||(this.h=e.compressionType),e)n[i]=e[i];n.outputBuffer=this.a,this.z=new m(this.input,n)}var I=y;function O(e,i){switch(this.k=[],this.l=32768,this.e=this.g=this.c=this.q=0,this.input=a?new Uint8Array(e):e,this.s=!1,this.m=N,this.B=!1,!i&&(i={})||(i.index&&(this.c=i.index),i.bufferSize&&(this.l=i.bufferSize),i.bufferType&&(this.m=i.bufferType),i.resize&&(this.B=i.resize)),this.m){case P:this.b=32768,this.a=new(a?Uint8Array:Array)(32768+this.l+258);break;case N:this.b=0,this.a=new(a?Uint8Array:Array)(this.l),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid inflate mode"))}}R.prototype.n=function(){var e,i,n,r,o,c,l,h=0;switch(l=this.a,e=ht){case ht:i=Math.LOG2E*Math.log(32768)-8;break;default:t(Error("invalid compression method"))}switch(n=i<<4|e,l[h++]=n,e){case ht:switch(this.h){case I.NONE:o=0;break;case I.r:o=1;break;case I.j:o=2;break;default:t(Error("unsupported compression type"))}break;default:t(Error("invalid compression method"))}return r=o<<6|0,l[h++]=r|31-(256*n+r)%31,c=s(this.input),this.z.b=h,h=(l=this.z.n()).length,a&&((l=new Uint8Array(l.buffer)).length<=h+4&&(this.a=new Uint8Array(l.length+4),this.a.set(l),l=this.a),l=l.subarray(0,h+4)),l[h++]=c>>24&255,l[h++]=c>>16&255,l[h++]=c>>8&255,l[h++]=255&c,l},r("Zlib.Deflate",R),r("Zlib.Deflate.compress",(function(t,e){return new R(t,e).n()})),r("Zlib.Deflate.CompressionType",I),r("Zlib.Deflate.CompressionType.NONE",I.NONE),r("Zlib.Deflate.CompressionType.FIXED",I.r),r("Zlib.Deflate.CompressionType.DYNAMIC",I.j);var P=0,N=1,F={D:P,C:N};O.prototype.p=function(){for(;!this.s;){var n=tt(this,3);switch(1&n&&(this.s=i),n>>>=1){case 0:var r=this.input,s=this.c,o=this.a,c=this.b,l=e,h=e,u=e,f=o.length,_=e;switch(this.e=this.g=0,(l=r[s++])===e&&t(Error("invalid uncompressed block header: LEN (first byte)")),h=l,(l=r[s++])===e&&t(Error("invalid uncompressed block header: LEN (second byte)")),h|=l<<8,(l=r[s++])===e&&t(Error("invalid uncompressed block header: NLEN (first byte)")),u=l,(l=r[s++])===e&&t(Error("invalid uncompressed block header: NLEN (second byte)")),h===~(u|=l<<8)&&t(Error("invalid uncompressed block header: length verify")),s+h>r.length&&t(Error("input buffer is broken")),this.m){case P:for(;c+h>o.length;){if(h-=_=f-c,a)o.set(r.subarray(s,s+_),c),c+=_,s+=_;else for(;_--;)o[c++]=r[s++];this.b=c,o=this.f(),c=this.b}break;case N:for(;c+h>o.length;)o=this.f({v:2});break;default:t(Error("invalid inflate mode"))}if(a)o.set(r.subarray(s,s+h),c),c+=h,s+=h;else for(;h--;)o[c++]=r[s++];this.c=s,this.b=c,this.a=o;break;case 1:this.o(J,$);break;case 2:it(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var L,B,k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=a?new Uint16Array(k):k,U=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],z=a?new Uint16Array(U):U,G=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],H=a?new Uint8Array(G):G,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],j=a?new Uint16Array(W):W,Y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],X=a?new Uint8Array(Y):Y,q=new(a?Uint8Array:Array)(288);for(L=0,B=q.length;L<B;++L)q[L]=143>=L?8:255>=L?9:279>=L?7:8;var Z,K,J=p(q),Q=new(a?Uint8Array:Array)(30);for(Z=0,K=Q.length;Z<K;++Z)Q[Z]=5;var $=p(Q);function tt(i,n){for(var r,a=i.g,s=i.e,o=i.input,c=i.c;s<n;)(r=o[c++])===e&&t(Error("input buffer is broken")),a|=r<<s,s+=8;return r=a&(1<<n)-1,i.g=a>>>n,i.e=s-n,i.c=c,r}function et(i,n){for(var r,a,s,o=i.g,c=i.e,l=i.input,h=i.c,u=n[0],f=n[1];c<f;)(r=l[h++])===e&&t(Error("input buffer is broken")),o|=r<<c,c+=8;return s=(a=u[o&(1<<f)-1])>>>16,i.g=o>>s,i.e=c-s,i.c=h,65535&a}function it(t){function e(t,e,i){var n,r,a,s;for(s=0;s<t;)switch(n=et(this,e),n){case 16:for(a=3+tt(this,2);a--;)i[s++]=r;break;case 17:for(a=3+tt(this,3);a--;)i[s++]=0;r=0;break;case 18:for(a=11+tt(this,7);a--;)i[s++]=0;r=0;break;default:r=i[s++]=n}return i}var i,n,r,s,o=tt(t,5)+257,c=tt(t,5)+1,l=tt(t,4)+4,h=new(a?Uint8Array:Array)(V.length);for(s=0;s<l;++s)h[V[s]]=tt(t,3);i=p(h),n=new(a?Uint8Array:Array)(o),r=new(a?Uint8Array:Array)(c),t.o(p(e.call(t,o,i,n)),p(e.call(t,c,i,r)))}function nt(e,i){var n,r;switch(this.input=e,this.c=0,!i&&(i={})||(i.index&&(this.c=i.index),i.verify&&(this.M=i.verify)),n=e[this.c++],r=e[this.c++],15&n){case ht:this.method=ht;break;default:t(Error("unsupported compression method"))}0!=((n<<8)+r)%31&&t(Error("invalid fcheck flag:"+((n<<8)+r)%31)),32&r&&t(Error("fdict flag is not supported")),this.A=new O(e,{index:this.c,bufferSize:i.bufferSize,bufferType:i.bufferType,resize:i.resize})}O.prototype.o=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,a,s,o,c=i.length-258;256!==(r=et(this,t));)if(256>r)n>=c&&(this.b=n,i=this.f(),n=this.b),i[n++]=r;else for(o=z[a=r-257],0<H[a]&&(o+=tt(this,H[a])),r=et(this,e),s=j[r],0<X[r]&&(s+=tt(this,X[r])),n>=c&&(this.b=n,i=this.f(),n=this.b);o--;)i[n]=i[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},O.prototype.I=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,a,s,o,c=i.length;256!==(r=et(this,t));)if(256>r)n>=c&&(c=(i=this.f()).length),i[n++]=r;else for(o=z[a=r-257],0<H[a]&&(o+=tt(this,H[a])),r=et(this,e),s=j[r],0<X[r]&&(s+=tt(this,X[r])),n+o>c&&(c=(i=this.f()).length);o--;)i[n]=i[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},O.prototype.f=function(){var t,e,i=new(a?Uint8Array:Array)(this.b-32768),n=this.b-32768,r=this.a;if(a)i.set(r.subarray(32768,i.length));else for(t=0,e=i.length;t<e;++t)i[t]=r[t+32768];if(this.k.push(i),this.q+=i.length,a)r.set(r.subarray(n,n+32768));else for(t=0;32768>t;++t)r[t]=r[n+t];return this.b=32768,r},O.prototype.J=function(t){var e,i,n,r=this.input.length/this.c+1|0,s=this.input,o=this.a;return t&&("number"==typeof t.v&&(r=t.v),"number"==typeof t.F&&(r+=t.F)),i=2>r?(n=(s.length-this.c)/this.u[2]/2*258|0)<o.length?o.length+n:o.length<<1:o.length*r,a?(e=new Uint8Array(i)).set(o):e=o,this.a=e},O.prototype.t=function(){var t,e,i,n,r,s=0,o=this.a,c=this.k,l=new(a?Uint8Array:Array)(this.q+(this.b-32768));if(0===c.length)return a?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(e=0,i=c.length;e<i;++e)for(n=0,r=(t=c[e]).length;n<r;++n)l[s++]=t[n];for(e=32768,i=this.b;e<i;++e)l[s++]=o[e];return this.k=[],this.buffer=l},O.prototype.H=function(){var t,e=this.b;return a?this.B?(t=new Uint8Array(e)).set(this.a.subarray(0,e)):t=this.a.subarray(0,e):(this.a.length>e&&(this.a.length=e),t=this.a),this.buffer=t},nt.prototype.p=function(){var e,i=this.input;return e=this.A.p(),this.c=this.A.c,this.M&&(i[this.c++]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==s(e)&&t(Error("invalid adler-32 checksum")),e},r("Zlib.Inflate",nt),r("Zlib.Inflate.BufferType",F),F.ADAPTIVE=F.C,F.BLOCK=F.D,r("Zlib.Inflate.prototype.decompress",nt.prototype.p),a&&new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a&&new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258]),a&&new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0]),a&&new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577]),a&&new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);var rt,at,st=new(a?Uint8Array:Array)(288);for(rt=0,at=st.length;rt<at;++rt)st[rt]=143>=rt?8:255>=rt?9:279>=rt?7:8;p(st);var ot,ct,lt=new(a?Uint8Array:Array)(30);for(ot=0,ct=lt.length;ot<ct;++ot)lt[ot]=5;p(lt);var ht=8}).call(window);var i=window.Zlib;i.Deflate=i.Deflate,i.Deflate.compress=i.Deflate.compress,i.Inflate=i.Inflate,i.Inflate.BufferType=i.Inflate.BufferType,i.Inflate.prototype.decompress=i.Inflate.prototype.decompress,e.exports=i}),{}],26:[(function(t,e){"use strict";var i,n=t("./platform/utils"),r=(t("../../DebugInfos"),"https://github.com/cocos-creator/engine/blob/master/EngineErrorMap.md");function a(t){return function(){var e=arguments[0],i=t+" "+e+", please go to "+r+"#"+e+" to see details.";if(1===arguments.length)return i;if(2===arguments.length)return i+" Arguments: "+arguments[1];var n=cc.js.shiftArguments.apply(null,arguments);return i+" Arguments: "+n.join(", ")}}cc.log=cc.warn=cc.error=cc.assert=console.log.bind?console.log.bind(console):console.log,cc._throw=function(t){n.callInNextTick((function(){throw t}))};var s=a("Log");cc.logID=function(){cc.log(s.apply(null,arguments))};var o=a("Warning");cc.warnID=function(){cc.warn(o.apply(null,arguments))};var c=a("Error");cc.errorID=function(){cc.error(c.apply(null,arguments))};var l=a("Assert");cc.assertID=function(t){t||cc.assert(!1,l.apply(null,cc.js.shiftArguments.apply(null,arguments)))};var h=cc.Enum({NONE:0,INFO:1,WARN:2,ERROR:3,INFO_FOR_WEB_PAGE:4,WARN_FOR_WEB_PAGE:5,ERROR_FOR_WEB_PAGE:6});e.exports=cc.debug={DebugMode:h,_resetDebugSetting:function(t){if(cc.log=cc.warn=cc.error=cc.assert=function(){},t!==h.NONE){if(t>h.ERROR){var e=function(t){if(cc.game.canvas){if(!i){var e=document.createElement("Div");e.setAttribute("id","logInfoDiv"),e.setAttribute("width","200"),e.setAttribute("height",cc.game.canvas.height);var n=e.style;n.zIndex="99999",n.position="absolute",n.top=n.left="0",(i=document.createElement("textarea")).setAttribute("rows","20"),i.setAttribute("cols","30"),i.setAttribute("disabled","true");var r=i.style;r.backgroundColor="transparent",r.borderBottom="1px solid #cccccc",r.borderTopWidth=r.borderLeftWidth=r.borderRightWidth="0px",r.borderTopStyle=r.borderLeftStyle=r.borderRightStyle="none",r.padding="0px",r.margin=0,e.appendChild(i),cc.game.canvas.parentNode.appendChild(e)}i.value=i.value+t+"\r\n",i.scrollTop=i.scrollHeight}};cc.error=function(){e("ERROR : "+cc.js.formatStr.apply(null,arguments))},cc.assert=function(t,i){!t&&i&&(i=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments)),e("ASSERT: "+i))},t!==h.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN : "+cc.js.formatStr.apply(null,arguments))}),t===h.INFO_FOR_WEB_PAGE&&(cc.log=function(){e(cc.js.formatStr.apply(null,arguments))})}else console&&console.log.apply&&(console.error||(console.error=console.log),console.warn||(console.warn=console.log),console.error.bind?cc.error=console.error.bind(console):cc.error=function(){return console.error.apply(console,arguments)},cc.assert=function(t,e){if(!t)throw e&&(e=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments))),new Error(e)});t!==h.ERROR&&(console.warn.bind?cc.warn=console.warn.bind(console):cc.warn=function(){return console.warn.apply(console,arguments)}),t===h.INFO&&(console.log.bind?cc.log=console.log.bind(console):cc.log=function(){return console.log.apply(console,arguments)})}},getError:a("ERROR"),isDisplayStats:function(){return!!cc.profiler&&cc.profiler.isShowingStats()},setDisplayStats:function(t){cc.profiler&&cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS&&(t?cc.profiler.showStats():cc.profiler.hideStats(),cc.game.config.showFPS=!!t)}}}),{"../../DebugInfos":void 0,"./platform/utils":192}],27:[(function(t,e){"use strict";var i=t("./event/event-target"),n=t("./component-scheduler"),r=t("./node-activator"),a=t("./platform/CCObject"),s=t("./CCGame"),o=t("./renderer"),c=t("./event-manager"),l=t("./CCScheduler");cc.Director=function(){i.call(this),this._paused=!1,this._purgeDirectorInNextLoop=!1,this._winSizeInPoints=null,this._scene=null,this._loadingScene="",this._totalFrames=0,this._lastUpdate=0,this._deltaTime=0,this._startTime=0,this._maxParticleDeltaTime=0,this._scheduler=null,this._compScheduler=null,this._nodeActivator=null,this._actionManager=null;var t=this;s.on(s.EVENT_SHOW,(function(){t._lastUpdate=performance.now()})),s.once(s.EVENT_ENGINE_INITED,this.init,this)},cc.Director.prototype={constructor:cc.Director,init:function(){return this._totalFrames=0,this._lastUpdate=performance.now(),this._startTime=this._lastUpdate,this._paused=!1,this._purgeDirectorInNextLoop=!1,this._winSizeInPoints=cc.size(0,0),this._scheduler=new l,cc.ActionManager?(this._actionManager=new cc.ActionManager,this._scheduler.scheduleUpdate(this._actionManager,l.PRIORITY_SYSTEM,!1)):this._actionManager=null,this.sharedInit(),!0},sharedInit:function(){this._compScheduler=new n,this._nodeActivator=new r,c&&c.setEnabled(!0),cc.AnimationManager?(this._animationManager=new cc.AnimationManager,this._scheduler.scheduleUpdate(this._animationManager,l.PRIORITY_SYSTEM,!1)):this._animationManager=null,cc.CollisionManager?(this._collisionManager=new cc.CollisionManager,this._scheduler.scheduleUpdate(this._collisionManager,l.PRIORITY_SYSTEM,!1)):this._collisionManager=null,cc.PhysicsManager?(this._physicsManager=new cc.PhysicsManager,this._scheduler.scheduleUpdate(this._physicsManager,l.PRIORITY_SYSTEM,!1)):this._physicsManager=null,cc.Physics3DManager?(this._physics3DManager=new cc.Physics3DManager,this._scheduler.scheduleUpdate(this._physics3DManager,l.PRIORITY_SYSTEM,!1)):this._physics3DManager=null,cc._widgetManager&&cc._widgetManager.init(this)},calculateDeltaTime:function(t){t||(t=performance.now()),this._deltaTime=t>this._lastUpdate?(t-this._lastUpdate)/1e3:0,this._lastUpdate=t},convertToGL:function(t){var e=s.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,a=n.top+window.pageYOffset-e.clientTop,o=i._devicePixelRatio*(t.x-r),c=i._devicePixelRatio*(a+n.height-t.y);return i._isRotated?cc.v2(i._viewportRect.width-c,o):cc.v2(o,c)},convertToUI:function(t){var e=s.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,a=n.top+window.pageYOffset-e.clientTop,o=cc.v2(0,0);return i._isRotated?(o.x=r+t.y/i._devicePixelRatio,o.y=a+n.height-(i._viewportRect.width-t.x)/i._devicePixelRatio):(o.x=r+t.x*i._devicePixelRatio,o.y=a+n.height-t.y*i._devicePixelRatio),o},end:function(){this._purgeDirectorInNextLoop=!0},getWinSize:function(){return cc.size(cc.winSize)},getWinSizeInPixels:function(){return cc.size(cc.winSize)},pause:function(){this._paused||(this._paused=!0)},purgeCachedData:function(){cc.assetManager.releaseAll()},purgeDirector:function(){this._scheduler.unscheduleAll(),this._compScheduler.unscheduleAll(),this._nodeActivator.reset(),c&&c.setEnabled(!1),cc.isValid(this._scene)&&this._scene.destroy(),this._scene=null,cc.renderer.clear(),cc.assetManager.builtins.clear(),cc.game.pause(),cc.assetManager.releaseAll()},reset:function(){this.purgeDirector(),c&&c.setEnabled(!0),this._actionManager&&this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._animationManager&&this._scheduler.scheduleUpdate(this._animationManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._collisionManager&&this._scheduler.scheduleUpdate(this._collisionManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._physicsManager&&this._scheduler.scheduleUpdate(this._physicsManager,cc.Scheduler.PRIORITY_SYSTEM,!1),cc.game.resume()},runSceneImmediate:function(t,e,i){cc.assertID(t instanceof cc.Scene||t instanceof cc.SceneAsset,1216),t instanceof cc.SceneAsset&&(t=t.scene),t._load();for(var n=Object.keys(s._persistRootNodes).map((function(t){return s._persistRootNodes[t]})),r=0;r<n.length;r++){var o=n[r],c=t.getChildByUuid(o.uuid);if(c){var l=c.getSiblingIndex();c._destroyImmediate(),t.insertChild(o,l)}else o.parent=t}var h=this._scene;cc.assetManager._releaseManager._autoRelease(h,t,s._persistRootNodes),cc.isValid(h)&&h.destroy(),this._scene=null,a._deferredDestroy(),e&&e(),this.emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,t),this._scene=t,t._activate(),cc.game.resume(),i&&i(null,t),this.emit(cc.Director.EVENT_AFTER_SCENE_LAUNCH,t)},runScene:function(t,e,i){cc.assertID(t,1205),cc.assertID(t instanceof cc.Scene||t instanceof cc.SceneAsset,1216),t instanceof cc.SceneAsset&&(t=t.scene),t._load(),this.once(cc.Director.EVENT_AFTER_DRAW,(function(){this.runSceneImmediate(t,e,i)}),this)},loadScene:function(t,e,i){if(this._loadingScene)return cc.warnID(1208,t,this._loadingScene),!1;var n=cc.assetManager.bundles.find((function(e){return e.getSceneInfo(t)}));if(n){this.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING,t),this._loadingScene=t;var r=this;return console.time("LoadScene "+t),n.loadScene(t,(function(n,a){console.timeEnd("LoadScene "+t),r._loadingScene="",n?(n="Failed to load scene: "+n,cc.error(n),e&&e(n)):r.runSceneImmediate(a,i,e)})),!0}return cc.errorID(1209,t),!1},preloadScene:function(t,e,i){var n=cc.assetManager.bundles.find((function(e){return e.getSceneInfo(t)}));if(!n)return cc.errorID(1209,t),null;n.preloadScene(t,null,e,i)},resume:function(){this._paused&&(this._lastUpdate=performance.now(),this._lastUpdate||cc.logID(1200),this._paused=!1,this._deltaTime=0)},setDepthTest:function(t){cc.Camera.main&&(cc.Camera.main.depth=!!t)},setClearColor:function(t){cc.Camera.main&&(cc.Camera.main.backgroundColor=t)},getRunningScene:function(){return this._scene},getScene:function(){return this._scene},getAnimationInterval:function(){return 1e3/s.getFrameRate()},setAnimationInterval:function(t){s.setFrameRate(Math.round(1e3/t))},getDeltaTime:function(){return this._deltaTime},getTotalTime:function(){return performance.now()-this._startTime},getTotalFrames:function(){return this._totalFrames},isPaused:function(){return this._paused},getScheduler:function(){return this._scheduler},setScheduler:function(t){this._scheduler!==t&&(this._scheduler=t)},getActionManager:function(){return this._actionManager},setActionManager:function(t){this._actionManager!==t&&(this._actionManager&&this._scheduler.unscheduleUpdate(this._actionManager),this._actionManager=t,this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler.PRIORITY_SYSTEM,!1))},getAnimationManager:function(){return this._animationManager},getCollisionManager:function(){return this._collisionManager},getPhysicsManager:function(){return this._physicsManager},getPhysics3DManager:function(){return this._physics3DManager},startAnimation:function(){cc.game.resume()},stopAnimation:function(){cc.game.pause()},_resetDeltaTime:function(){this._lastUpdate=performance.now(),this._deltaTime=0},mainLoop:function(t){if(this._purgeDirectorInNextLoop)this._purgeDirectorInNextLoop=!1,this.purgeDirector();else{this.calculateDeltaTime(t);var e=this._deltaTime;this._paused||(this.emit(cc.Director.EVENT_BEFORE_UPDATE,e),this._compScheduler.startPhase(),this._compScheduler.updatePhase(e),this._scheduler.update(e),this._compScheduler.lateUpdatePhase(e),this.emit(cc.Director.EVENT_AFTER_UPDATE,e),a._deferredDestroy()),this.emit(cc.Director.EVENT_BEFORE_DRAW,e),o.render(this._scene,e),this.emit(cc.Director.EVENT_AFTER_DRAW,e),c.frameUpdateListeners(),this._totalFrames++}},__fastOn:function(t,e,i){this.on(t,e,i)},__fastOff:function(t,e,i){this.off(t,e,i)}},cc.js.addon(cc.Director.prototype,i.prototype),cc.Director.EVENT_PROJECTION_CHANGED="director_projection_changed",cc.Director.EVENT_BEFORE_SCENE_LOADING="director_before_scene_loading",cc.Director.EVENT_BEFORE_SCENE_LAUNCH="director_before_scene_launch",cc.Director.EVENT_AFTER_SCENE_LAUNCH="director_after_scene_launch",cc.Director.EVENT_BEFORE_UPDATE="director_before_update",cc.Director.EVENT_AFTER_UPDATE="director_after_update",cc.Director.EVENT_BEFORE_VISIT="director_before_draw",cc.Director.EVENT_AFTER_VISIT="director_before_draw",cc.Director.EVENT_BEFORE_DRAW="director_before_draw",cc.Director.EVENT_AFTER_DRAW="director_after_draw",cc.Director.PROJECTION_2D=0,cc.Director.PROJECTION_3D=1,cc.Director.PROJECTION_CUSTOM=3,cc.Director.PROJECTION_DEFAULT=cc.Director.PROJECTION_2D,cc.Director.EVENT_BEFORE_PHYSICS="director_before_physics",cc.Director.EVENT_AFTER_PHYSICS="director_after_physics",cc.director=new cc.Director,e.exports=cc.director}),{"./CCGame":28,"./CCScheduler":32,"./component-scheduler":100,"./event-manager":139,"./event/event-target":141,"./node-activator":167,"./platform/CCObject":174,"./renderer":199}],28:[(function(t,e){"use strict";var i=t("./event/event-target");t("../audio/CCAudioEngine");var n=t("./CCDebug"),r=t("./renderer/index.js"),a=t("../core/renderer/utils/dynamic-atlas/manager"),s={EVENT_HIDE:"game_on_hide",EVENT_SHOW:"game_on_show",EVENT_RESTART:"game_on_restart",EVENT_GAME_INITED:"game_inited",EVENT_ENGINE_INITED:"engine_inited",EVENT_RENDERER_INITED:"engine_inited",RENDER_TYPE_CANVAS:0,RENDER_TYPE_WEBGL:1,RENDER_TYPE_OPENGL:2,_persistRootNodes:{},_paused:!0,_configLoaded:!1,_isCloning:!1,_prepared:!1,_rendererInitialized:!1,_renderContext:null,_intervalId:null,_lastTime:null,_frameTime:null,frame:null,container:null,canvas:null,renderType:-1,config:null,onStart:null,setFrameRate:function(t){this.config.frameRate=t,this._intervalId&&window.cancelAnimFrame(this._intervalId),this._intervalId=0,this._paused=!0,this._setAnimFrame(),this._runMainLoop()},getFrameRate:function(){return this.config.frameRate},step:function(){cc.director.mainLoop()},pause:function(){this._paused||(this._paused=!0,cc.audioEngine&&cc.audioEngine._break(),this._intervalId&&window.cancelAnimFrame(this._intervalId),this._intervalId=0)},resume:function(){this._paused&&(this._paused=!1,cc.audioEngine&&cc.audioEngine._restore(),cc.director._resetDeltaTime(),this._runMainLoop())},isPaused:function(){return this._paused},restart:function(){cc.director.once(cc.Director.EVENT_AFTER_DRAW,(function(){for(var t in s._persistRootNodes)s.removePersistRootNode(s._persistRootNodes[t]);cc.director.getScene().destroy(),cc.Object._deferredDestroy(),cc.audioEngine&&cc.audioEngine.uncacheAll(),cc.director.reset(),s.pause(),cc.assetManager.builtins.init((function(){s.onStart(),s.emit(s.EVENT_RESTART)}))}))},end:function(){close()},_initEngine:function(){this._rendererInitialized||(this._initRenderer(),this._initEvents(),this.emit(this.EVENT_ENGINE_INITED))},_loadPreviewScript:function(t){t()},_prepareFinished:function(t){var e=this;this._initEngine(),this._setAnimFrame(),cc.assetManager.builtins.init((function(){console.log("Cocos Creator v"+cc.ENGINE_VERSION),e._prepared=!0,e._runMainLoop(),e.emit(e.EVENT_GAME_INITED),t&&t()}))},eventTargetOn:i.prototype.on,eventTargetOnce:i.prototype.once,on:function(t,e,i,n){this._prepared&&t===this.EVENT_ENGINE_INITED||!this._paused&&t===this.EVENT_GAME_INITED?e.call(i):this.eventTargetOn(t,e,i,n)},once:function(t,e,i){this._prepared&&t===this.EVENT_ENGINE_INITED||!this._paused&&t===this.EVENT_GAME_INITED?e.call(i):this.eventTargetOnce(t,e,i)},prepare:function(t){var e=this;this._prepared?t&&t():this._loadPreviewScript((function(){e._prepareFinished(t)}))},run:function(t,e){this._initConfig(t),this.onStart=e,this.prepare(s.onStart&&s.onStart.bind(s))},addPersistRootNode:function(t){if(cc.Node.isNode(t)&&t.uuid){var e=t.uuid;if(!this._persistRootNodes[e]){var i=cc.director._scene;if(cc.isValid(i))if(t.parent){if(!(t.parent instanceof cc.Scene))return void cc.warnID(3801);if(t.parent!==i)return void cc.warnID(3802)}else t.parent=i;this._persistRootNodes[e]=t,t._persistNode=!0,cc.assetManager._releaseManager._addPersistNodeRef(t)}}else cc.warnID(3800)},removePersistRootNode:function(t){var e=t.uuid||"";t===this._persistRootNodes[e]&&(delete this._persistRootNodes[e],t._persistNode=!1,cc.assetManager._releaseManager._removePersistNodeRef(t))},isPersistRootNode:function(t){return t._persistNode},_setAnimFrame:function(){this._lastTime=performance.now();var t=s.config.frameRate;this._frameTime=1e3/t,cc.director._maxParticleDeltaTime=this._frameTime/1e3*2;var e=window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;60!==t&&30!==t?(window.requestAnimFrame=e?this._stTimeWithRAF:this._stTime,window.cancelAnimFrame=this._ctTime):(window.requestAnimFrame=e||this._stTime,window.cancelAnimFrame=window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||this._ctTime)},_stTimeWithRAF:function(t){var e=performance.now(),i=Math.max(0,s._frameTime-(e-s._lastTime)),n=window.setTimeout((function(){window.requestAnimationFrame(t)}),i);return s._lastTime=e+i,n},_stTime:function(t){var e=performance.now(),i=Math.max(0,s._frameTime-(e-s._lastTime)),n=window.setTimeout((function(){t()}),i);return s._lastTime=e+i,n},_ctTime:function(t){window.clearTimeout(t)},_runMainLoop:function(){if(this._prepared){var t,e=this,i=e.config,r=cc.director,a=!0,s=i.frameRate;n.setDisplayStats(i.showFPS),t=function(i){if(!e._paused){if(e._intervalId=window.requestAnimFrame(t),30===s&&(a=!a))return;r.mainLoop(i)}},e._intervalId=window.requestAnimFrame(t),e._paused=!1}},_initConfig:function(t){"number"!=typeof t.debugMode&&(t.debugMode=0),t.exposeClassName=!!t.exposeClassName,"number"!=typeof t.frameRate&&(t.frameRate=60);var e=t.renderMode;("number"!=typeof e||e>2||e<0)&&(t.renderMode=0),"boolean"!=typeof t.registerSystemEvent&&(t.registerSystemEvent=!0),t.showFPS=1!==e&&!!t.showFPS,this.collisionMatrix=t.collisionMatrix||[],this.groupList=t.groupList||[],n._resetDebugSetting(t.debugMode),this.config=t,this._configLoaded=!0},_determineRenderType:function(){var t=this.config,e=parseInt(t.renderMode)||0;this.renderType=this.RENDER_TYPE_CANVAS;var i=!1;if(0===e?cc.sys.capabilities.opengl?(this.renderType=this.RENDER_TYPE_WEBGL,i=!0):cc.sys.capabilities.canvas&&(this.renderType=this.RENDER_TYPE_CANVAS,i=!0):1===e&&cc.sys.capabilities.canvas?(this.renderType=this.RENDER_TYPE_CANVAS,i=!0):2===e&&cc.sys.capabilities.opengl&&(this.renderType=this.RENDER_TYPE_WEBGL,i=!0),!i)throw new Error(n.getError(3820,e))},_initRenderer:function(){if(!this._rendererInitialized){var t,e,i,n,s=this.config.id,o=s instanceof HTMLElement?s:document.querySelector(s)||document.querySelector("#"+s);if("CANVAS"===o.tagName?(t=o.width,e=o.height,this.canvas=i=o,this.container=n=document.createElement("DIV"),i.parentNode&&i.parentNode.insertBefore(n,i)):("DIV"!==o.tagName&&cc.warnID(3819),t=o.clientWidth,e=o.clientHeight,this.canvas=i=document.createElement("CANVAS"),this.container=n=document.createElement("DIV"),o.appendChild(n)),n.setAttribute("id","Cocos2dGameContainer"),n.appendChild(i),this.frame=n.parentNode===document.body?document.documentElement:n.parentNode,(function(t){(" "+t.className+" ").indexOf(" gameCanvas ")>-1||(t.className&&(t.className+=" "),t.className+="gameCanvas")})(i),i.setAttribute("width",t||480),i.setAttribute("height",e||320),i.setAttribute("tabindex",99),this._determineRenderType(),this.renderType===this.RENDER_TYPE_WEBGL){var c={stencil:!0,antialias:cc.macro.ENABLE_WEBGL_ANTIALIAS,alpha:cc.macro.ENABLE_TRANSPARENT_CANVAS};r.initWebGL(i,c),this._renderContext=r.device._gl,!cc.macro.CLEANUP_IMAGE_CACHE&&a&&(a.enabled=!0)}this._renderContext||(this.renderType=this.RENDER_TYPE_CANVAS,r.initCanvas(i),this._renderContext=r.device._ctx),this.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!1},this._rendererInitialized=!0}},_initEvents:function(){var t,e=window;this.config.registerSystemEvent&&cc.internal.inputManager.registerSystemEvent(this.canvas),void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden");var i=!1;function n(){i||(i=!0,s.emit(s.EVENT_HIDE))}function r(t,e,n,r,a){i&&(i=!1,s.emit(s.EVENT_SHOW,t,e,n,r,a))}if(t)for(var a=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilitychange","qbrowserVisibilityChange"],o=0;o<a.length;o++)document.addEventListener(a[o],(function(e){var i=document[t];(i=i||e.hidden)?n():r()}));else e.addEventListener("blur",n),e.addEventListener("focus",r);navigator.userAgent.indexOf("MicroMessenger")>-1&&(e.onfocus=r),"onpageshow"in window&&"onpagehide"in window&&(e.addEventListener("pagehide",n),e.addEventListener("pageshow",r),document.addEventListener("pagehide",n),document.addEventListener("pageshow",r)),this.on(s.EVENT_HIDE,(function(){s.pause()})),this.on(s.EVENT_SHOW,(function(){s.resume()}))}};i.call(s),cc.js.addon(s,i.prototype),cc.game=e.exports=s}),{"../audio/CCAudioEngine":21,"../core/renderer/utils/dynamic-atlas/manager":202,"./CCDebug":26,"./event/event-target":141,"./renderer/index.js":199}],29:[(function(t,e){"use strict";var i=t("./value-types"),n=t("./value-types/utils"),r=t("./utils/base-node"),a=t("./utils/prefab-helper"),s=t("./utils/trans-pool").NodeMemPool,o=t("./utils/affine-transform"),c=t("./event-manager"),l=t("./platform/CCMacro"),h=t("./platform/js"),u=(t("./event/event"),t("./event/event-target")),f=t("./renderer/render-flow"),_=cc.Object.Flags.Destroying,d=Math.PI/180,p=!!cc.ActionManager,m=function(){},v=new i.Vec3,g=new i.Quat,y=new i.Vec3,T=new i.Vec3,A=new i.Quat,b=new i.Quat,E=new i.Vec3,C=new i.Vec3,x=new i.Vec3,S=new i.Vec3,w=new i.Vec3,D=new i.Quat,M=new i.Quat,R=new i.Vec3,I=new i.Quat,O=new i.Vec3,P=new i.Quat,N=new i.Vec3,F=new i.Vec3,L=new i.Quat,B=new i.Quat,k=(new i.Quat,cc.mat4()),V=new i.Vec3,U=new h.Pool;U.get=function(){return this._get()||[]};var z=cc.Enum({DEBUG:31}),G=cc.Enum({POSITION:1,SCALE:2,ROTATION:4,SKEW:8,TRS:7,RS:6,TRSS:15,PHYSICS_POSITION:16,PHYSICS_SCALE:32,PHYSICS_ROTATION:64,PHYSICS_TRS:112,PHYSICS_RS:96,ALL_POSITION:17,ALL_SCALE:34,ALL_ROTATION:68,ALL_TRS:119,ALL:65535}),H=cc.Enum({TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_WHEEL:"mousewheel",POSITION_CHANGED:"position-changed",ROTATION_CHANGED:"rotation-changed",SCALE_CHANGED:"scale-changed",SIZE_CHANGED:"size-changed",ANCHOR_CHANGED:"anchor-changed",COLOR_CHANGED:"color-changed",CHILD_ADDED:"child-added",CHILD_REMOVED:"child-removed",CHILD_REORDER:"child-reorder",GROUP_CHANGED:"group-changed",SIBLING_ORDER_CHANGED:"sibling-order-changed"}),W=[H.TOUCH_START,H.TOUCH_MOVE,H.TOUCH_END,H.TOUCH_CANCEL],j=[H.MOUSE_DOWN,H.MOUSE_ENTER,H.MOUSE_MOVE,H.MOUSE_LEAVE,H.MOUSE_UP,H.MOUSE_WHEEL],Y=!0,X=function(t){if(0!==t){Y&&cc.warn("`cc.Node.skewX/Y` is deprecated since v2.2.1, please use 3D node instead.",""),Y=!1}},q=null,Z=function(t,e){var i=t.getLocation(),n=this.owner;return!!n._hitTest(i,this)&&(e.type=H.TOUCH_START,e.touch=t,e.bubbles=!0,n.dispatchEvent(e),!0)},K=function(t,e){var i=this.owner;e.type=H.TOUCH_MOVE,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},J=function(t,e){var i=t.getLocation(),n=this.owner;n._hitTest(i,this)?e.type=H.TOUCH_END:e.type=H.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,n.dispatchEvent(e)},Q=function(t,e){t.getLocation();var i=this.owner;e.type=H.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},$=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=H.MOUSE_DOWN,t.bubbles=!0,i.dispatchEvent(t))},tt=function(t){var e=t.getLocation(),i=this.owner;if(i._hitTest(e,this))this._previousIn||(q&&q._mouseListener&&(t.type=H.MOUSE_LEAVE,q.dispatchEvent(t),q._mouseListener._previousIn=!1),q=this.owner,t.type=H.MOUSE_ENTER,i.dispatchEvent(t),this._previousIn=!0),t.type=H.MOUSE_MOVE,t.bubbles=!0,i.dispatchEvent(t);else{if(!this._previousIn)return;t.type=H.MOUSE_LEAVE,i.dispatchEvent(t),this._previousIn=!1,q=null}t.stopPropagation()},et=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=H.MOUSE_UP,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())},it=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=H.MOUSE_WHEEL,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())};function nt(t,e){if(e){for(var i=0,n=null,r=t;r&&cc.Node.isNode(r);r=r._parent,++i)if(r.getComponent(e)){var a={index:i,node:r};n?n.push(a):n=[a]}return n}return null}function rt(t,e){if(!(t._objFlags&_)){if(t._bubblingListeners)for(var i=0,n=e.length;i<n;++i)if(t._bubblingListeners.hasEventListener(e[i]))return!0;if(t._capturingListeners)for(var r=0,a=e.length;r<a;++r)if(t._capturingListeners.hasEventListener(e[r]))return!0;return!1}return!0}function at(t,e,i){var n,r;for(e.target=t,i.length=0,t._getCapturingTargets(e.type,i),e.eventPhase=1,r=i.length-1;r>=0;--r)if((n=i[r])._capturingListeners&&(e.currentTarget=n,n._capturingListeners.emit(e.type,e,i),e._propagationStopped))return void(i.length=0);if(i.length=0,e.eventPhase=2,e.currentTarget=t,t._capturingListeners&&t._capturingListeners.emit(e.type,e),!e._propagationImmediateStopped&&t._bubblingListeners&&t._bubblingListeners.emit(e.type,e),!e._propagationStopped&&e.bubbles)for(t._getBubblingTargets(e.type,i),e.eventPhase=3,r=0;r<i.length;++r)if((n=i[r])._bubblingListeners&&(e.currentTarget=n,n._bubblingListeners.emit(e.type,e),e._propagationStopped))return void(i.length=0);i.length=0}function st(t){var e=t.groupIndex;return 0===e&&t.parent&&(e=st(t.parent)),e}function ot(t){var e=st(t);t._cullingMask=1<<e;for(var i=0;i<t._children.length;i++)ot(t._children[i])}function ct(){if(this._localMatDirty&G.TRSS){var t=this._matrix,e=t.m;if(i.Trs.toMat4(t,this._trs),this._skewX||this._skewY){var n=e[0],r=e[1],a=e[4],s=e[5],o=Math.tan(this._skewX*d),c=Math.tan(this._skewY*d);o===1/0&&(o=99999999),c===1/0&&(c=99999999),e[0]=n+a*c,e[1]=r+s*c,e[4]=a+n*o,e[5]=s+r*o}this._localMatDirty&=~G.TRSS,this._worldMatDirty=!0}}function lt(){var t=this._localMatDirty;if(t&G.TRSS){var e=this._matrix.m,i=this._trs;if(t&(G.RS|G.SKEW)){var n=-this._eulerAngles.z,r=this._skewX||this._skewY,a=i[7],s=i[8];if(n||r){var o=1,c=0,l=0,h=1;if(n){var u=n*d;l=Math.sin(u),o=h=Math.cos(u),c=-l}if(e[0]=o*=a,e[1]=c*=a,e[4]=l*=s,e[5]=h*=s,r){var f=e[0],_=e[1],p=e[4],m=e[5],v=Math.tan(this._skewX*d),g=Math.tan(this._skewY*d);v===1/0&&(v=99999999),g===1/0&&(g=99999999),e[0]=f+p*g,e[1]=_+m*g,e[4]=p+f*v,e[5]=m+_*v}}else e[0]=a,e[1]=0,e[4]=0,e[5]=s}e[12]=i[0],e[13]=i[1],this._localMatDirty&=~G.TRSS,this._worldMatDirty=!0}}function ht(){if(this._localMatDirty&G.TRSS&&this._updateLocalMatrix(),this._parent){var t=this._parent._worldMatrix;i.Mat4.mul(this._worldMatrix,t,this._matrix)}else i.Mat4.copy(this._worldMatrix,this._matrix);this._worldMatDirty=!1}function ut(){this._localMatDirty&G.TRSS&&this._updateLocalMatrix();var t=this._parent;t?this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):i.Mat4.copy(this._worldMatrix,this._matrix),this._worldMatDirty=!1}function ft(t,e,i){var n=e.m,r=i.m,a=t.m,s=n[0],o=n[1],c=n[4],l=n[5],h=n[12],u=n[13],f=r[0],_=r[1],d=r[4],p=r[5],m=r[12],v=r[13];0!==o||0!==c?(a[0]=f*s+_*c,a[1]=f*o+_*l,a[4]=d*s+p*c,a[5]=d*o+p*l,a[12]=s*m+c*v+h,a[13]=o*m+l*v+u):(a[0]=f*s,a[1]=_*l,a[4]=d*s,a[5]=p*l,a[12]=s*m+h,a[13]=l*v+u)}var _t=i.Mat4.mul,dt={name:"cc.Node",extends:r,properties:{_opacity:255,_color:cc.Color.WHITE,_contentSize:cc.Size,_anchorPoint:cc.v2(.5,.5),_position:void 0,_scale:void 0,_trs:null,_eulerAngles:cc.Vec3,_skewX:0,_skewY:0,_zIndex:{default:void 0,type:cc.Integer},_localZOrder:{default:0,serializable:!1},_is3DNode:!1,_groupIndex:{default:0,formerlySerializedAs:"groupIndex"},groupIndex:{get:function(){return this._groupIndex},set:function(t){this._groupIndex=t,ot(this),this.emit(H.GROUP_CHANGED,this)}},group:{get:function(){return cc.game.groupList[this.groupIndex]||""},set:function(t){this.groupIndex=cc.game.groupList.indexOf(t)}},x:{get:function(){return this._trs[0]},set:function(t){var e=this._trs;t!==e[0]&&(e[0]=t,this.setLocalDirty(G.ALL_POSITION),1&this._eventMask&&this.emit(H.POSITION_CHANGED))}},y:{get:function(){return this._trs[1]},set:function(t){var e=this._trs;t!==e[1]&&(e[1]=t,this.setLocalDirty(G.ALL_POSITION),1&this._eventMask&&this.emit(H.POSITION_CHANGED))}},z:{get:function(){return this._trs[2]},set:function(t){var e=this._trs;t!==e[2]&&(e[2]=t,this.setLocalDirty(G.ALL_POSITION),this._renderFlag|=f.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(H.POSITION_CHANGED))}},rotation:{get:function(){return-this.angle},set:function(t){this.angle=-t}},angle:{get:function(){return this._eulerAngles.z},set:function(t){i.Vec3.set(this._eulerAngles,0,0,t),i.Trs.fromAngleZ(this._trs,t),this.setLocalDirty(G.ALL_ROTATION),4&this._eventMask&&this.emit(H.ROTATION_CHANGED)}},rotationX:{get:function(){return this._eulerAngles.x},set:function(t){this._eulerAngles.x!==t&&(this._eulerAngles.x=t,this._eulerAngles.x===this._eulerAngles.y?i.Trs.fromAngleZ(this._trs,-t):i.Trs.fromEulerNumber(this._trs,t,this._eulerAngles.y,0),this.setLocalDirty(G.ALL_ROTATION),4&this._eventMask&&this.emit(H.ROTATION_CHANGED))}},rotationY:{get:function(){return this._eulerAngles.y},set:function(t){this._eulerAngles.y!==t&&(this._eulerAngles.y=t,this._eulerAngles.x===this._eulerAngles.y?i.Trs.fromAngleZ(this._trs,-t):i.Trs.fromEulerNumber(this._trs,this._eulerAngles.x,t,0),this.setLocalDirty(G.ALL_ROTATION),4&this._eventMask&&this.emit(H.ROTATION_CHANGED))}},eulerAngles:{get:function(){return i.Trs.toEuler(this._eulerAngles,this._trs)},set:function(t){i.Trs.fromEuler(this._trs,t),this.setLocalDirty(G.ALL_ROTATION),this._renderFlag|=f.FLAG_TRANSFORM,4&this._eventMask&&this.emit(H.ROTATION_CHANGED)}},quat:{get:function(){var t=this._trs;return new i.Quat(t[3],t[4],t[5],t[6])},set:function(t){this.setRotation(t)}},scale:{get:function(){return this._trs[7]},set:function(t){this.setScale(t)}},scaleX:{get:function(){return this._trs[7]},set:function(t){this._trs[7]!==t&&(this._trs[7]=t,this.setLocalDirty(G.ALL_SCALE),2&this._eventMask&&this.emit(H.SCALE_CHANGED))}},scaleY:{get:function(){return this._trs[8]},set:function(t){this._trs[8]!==t&&(this._trs[8]=t,this.setLocalDirty(G.ALL_SCALE),2&this._eventMask&&this.emit(H.SCALE_CHANGED))}},scaleZ:{get:function(){return this._trs[9]},set:function(t){this._trs[9]!==t&&(this._trs[9]=t,this.setLocalDirty(G.ALL_SCALE),this._renderFlag|=f.FLAG_TRANSFORM,2&this._eventMask&&this.emit(H.SCALE_CHANGED))}},skewX:{get:function(){return this._skewX},set:function(t){X(t),this._skewX=t,this.setLocalDirty(G.SKEW)}},skewY:{get:function(){return this._skewY},set:function(t){X(t),this._skewY=t,this.setLocalDirty(G.SKEW)}},opacity:{get:function(){return this._opacity},set:function(t){t=cc.misc.clampf(t,0,255),this._opacity!==t&&(this._opacity=t,this._renderFlag|=f.FLAG_OPACITY_COLOR)},range:[0,255]},color:{get:function(){return this._color.clone()},set:function(t){this._color.equals(t)||(this._color.set(t),this._renderFlag|=f.FLAG_COLOR,32&this._eventMask&&this.emit(H.COLOR_CHANGED,t))}},anchorX:{get:function(){return this._anchorPoint.x},set:function(t){var e=this._anchorPoint;e.x!==t&&(e.x=t,16&this._eventMask&&this.emit(H.ANCHOR_CHANGED))}},anchorY:{get:function(){return this._anchorPoint.y},set:function(t){var e=this._anchorPoint;e.y!==t&&(e.y=t,16&this._eventMask&&this.emit(H.ANCHOR_CHANGED))}},width:{get:function(){return this._contentSize.width},set:function(t){t!==this._contentSize.width&&(this._contentSize.width=t,8&this._eventMask&&this.emit(H.SIZE_CHANGED))}},height:{get:function(){return this._contentSize.height},set:function(t){t!==this._contentSize.height&&(this._contentSize.height=t,8&this._eventMask&&this.emit(H.SIZE_CHANGED))}},zIndex:{get:function(){return this._localZOrder>>16},set:function(t){t>l.MAX_ZINDEX?(cc.warnID(1636),t=l.MAX_ZINDEX):t<l.MIN_ZINDEX&&(cc.warnID(1637),t=l.MIN_ZINDEX),this.zIndex!==t&&(this._localZOrder=65535&this._localZOrder|t<<16,this.emit(H.SIBLING_ORDER_CHANGED),this._onSiblingIndexChanged())}},is3DNode:{get:function(){return this._is3DNode},set:function(t){this._is3DNode!==t&&(this._is3DNode=t,this._update3DFunction())}},up:{get:function(){return i.Vec3.transformQuat(O,i.Vec3.UP,this.getWorldRotation(P)).clone()}},right:{get:function(){return i.Vec3.transformQuat(O,i.Vec3.RIGHT,this.getWorldRotation(P)).clone()}},forward:{get:function(){return i.Vec3.transformQuat(O,i.Vec3.FORWARD,this.getWorldRotation(P)).clone()}}},ctor:function(){this._reorderChildDirty=!1,this._widget=null,this._renderComponent=null,this._capturingListeners=null,this._bubblingListeners=null,this._touchListener=null,this._mouseListener=null,this._initDataFromPool(),this._eventMask=0,this._cullingMask=1,this._childArrivalOrder=1,this._renderFlag=f.FLAG_TRANSFORM|f.FLAG_OPACITY_COLOR},statics:{EventType:H,_LocalDirtyFlag:G,isNode:function(t){return t instanceof pt&&(t.constructor===pt||!(t instanceof cc.Scene))},BuiltinGroupIndex:z},_onSiblingIndexChanged:function(){this._parent&&this._parent._delaySort()},_onPreDestroy:function(){this._onPreDestroyBase(),p&&cc.director.getActionManager().removeAllActionsFromTarget(this),q===this&&(q=null),this._bubblingListeners&&this._bubblingListeners.clear(),this._capturingListeners&&this._capturingListeners.clear(),(this._touchListener||this._mouseListener)&&(c.removeListeners(this),this._touchListener&&(this._touchListener.owner=null,this._touchListener.mask=null,this._touchListener=null),this._mouseListener&&(this._mouseListener.owner=null,this._mouseListener.mask=null,this._mouseListener=null)),this._backDataIntoPool(),this._reorderChildDirty&&cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this)},_onPostActivated:function(t){var e=p?cc.director.getActionManager():null;t?(this._renderFlag|=f.FLAG_WORLD_TRANSFORM,e&&e.resumeTarget(this),c.resumeTarget(this),this._checkListenerMask()):(e&&e.pauseTarget(this),c.pauseTarget(this))},_onHierarchyChanged:function(t){this._updateOrderOfArrival(),ot(this),this._parent&&this._parent._delaySort(),this._renderFlag|=f.FLAG_WORLD_TRANSFORM|f.FLAG_OPACITY_COLOR,this._onHierarchyChangedBase(t),cc._widgetManager&&(cc._widgetManager._nodesOrderDirty=!0),t&&this._activeInHierarchy&&this._checkListenerMask()},_update3DFunction:function(){this._is3DNode?(this._updateLocalMatrix=ct,this._calculWorldMatrix=ht,this._mulMat=_t):(this._updateLocalMatrix=lt,this._calculWorldMatrix=ut,this._mulMat=ft),this._renderComponent&&this._renderComponent._on3DNodeChanged&&this._renderComponent._on3DNodeChanged(),this._renderFlag|=f.FLAG_TRANSFORM,this._localMatDirty=G.ALL},_initDataFromPool:function(){this._spaceInfo||(this._spaceInfo=s.pop());var t=this._spaceInfo;this._matrix=cc.mat4(t.localMat),i.Mat4.identity(this._matrix),this._worldMatrix=cc.mat4(t.worldMat),i.Mat4.identity(this._worldMatrix),this._localMatDirty=G.ALL,this._worldMatDirty=!0;var e=this._trs=t.trs;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=1,e[7]=1,e[8]=1,e[9]=1},_backDataIntoPool:function(){s.push(this._spaceInfo),this._matrix=null,this._worldMatrix=null,this._trs=null,this._spaceInfo=null},_toEuler:function(){if(this.is3DNode)i.Trs.toEuler(this._eulerAngles,this._trs);else{var t=Math.asin(this._trs[5])/d*2;i.Vec3.set(this._eulerAngles,0,0,t)}},_fromEuler:function(){this.is3DNode?i.Trs.fromEuler(this._trs,this._eulerAngles):i.Trs.fromAngleZ(this._trs,this._eulerAngles.z)},_initProperties:function(){this._is3DNode&&this._update3DFunction();var t=this._trs;if(t){var e=t;t=this._trs=this._spaceInfo.trs,11===e.length?t.set(e.subarray(1)):t.set(e)}else t=this._trs=this._spaceInfo.trs;this._fromEuler()},_onBatchCreated:function(t){this._initProperties(),this._cullingMask=1<<st(this),this._activeInHierarchy||(p&&cc.director.getActionManager().pauseTarget(this),c.pauseTarget(this));for(var e=this._children,i=0,n=e.length;i<n;i++){var r=e[i];if(!t){var s=r._prefab;s&&s.sync&&s.root===r&&a.syncWithPrefab(r),r._updateOrderOfArrival()}r._onBatchCreated(t)}e.length>0&&(this._renderFlag|=f.FLAG_CHILDREN)},_checkListenerMask:function(){if(this._touchListener){var t=this._touchListener.mask=nt(this,cc.Mask);this._mouseListener&&(this._mouseListener.mask=t)}else this._mouseListener&&(this._mouseListener.mask=nt(this,cc.Mask))},_checknSetupSysEvent:function(t){var e=!1,i=!1;return-1!==W.indexOf(t)?(this._touchListener||(this._touchListener=cc.EventListener.create({event:cc.EventListener.TOUCH_ONE_BY_ONE,swallowTouches:!0,owner:this,mask:nt(this,cc.Mask),onTouchBegan:Z,onTouchMoved:K,onTouchEnded:J,onTouchCancelled:Q}),c.addListener(this._touchListener,this),e=!0),i=!0):-1!==j.indexOf(t)&&(this._mouseListener||(this._mouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,_previousIn:!1,owner:this,mask:nt(this,cc.Mask),onMouseDown:$,onMouseMove:tt,onMouseUp:et,onMouseScroll:it}),c.addListener(this._mouseListener,this),e=!0),i=!0),e&&!this._activeInHierarchy&&cc.director.getScheduler().schedule((function(){this._activeInHierarchy||c.pauseTarget(this)}),this,0,0,0,!1),i},on:function(t,e,i,n){if(this._checknSetupSysEvent(t))return this._onDispatch(t,e,i,n);switch(t){case H.POSITION_CHANGED:this._eventMask|=1;break;case H.SCALE_CHANGED:this._eventMask|=2;break;case H.ROTATION_CHANGED:this._eventMask|=4;break;case H.SIZE_CHANGED:this._eventMask|=8;break;case H.ANCHOR_CHANGED:this._eventMask|=16;break;case H.COLOR_CHANGED:this._eventMask|=32}return this._bubblingListeners||(this._bubblingListeners=new u),this._bubblingListeners.on(t,e,i)},once:function(t,e,i,n){var r=this,a=null;(a=this._checknSetupSysEvent(t)&&n?this._capturingListeners=this._capturingListeners||new u:this._bubblingListeners=this._bubblingListeners||new u).once(t,e,i),a.once(t,(function(){r.off(t,e,i)}),void 0)},_onDispatch:function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var r=null;return(r=n?this._capturingListeners=this._capturingListeners||new u:this._bubblingListeners=this._bubblingListeners||new u).hasEventListener(t,e,i)||(r.on(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this)),e}cc.errorID(6800)},off:function(t,e,i,n){var r=-1!==W.indexOf(t),a=!r&&-1!==j.indexOf(t);if(r||a)this._offDispatch(t,e,i,n),r?this._touchListener&&!rt(this,W)&&(c.removeListener(this._touchListener),this._touchListener=null):a&&this._mouseListener&&!rt(this,j)&&(c.removeListener(this._mouseListener),this._mouseListener=null);else if(this._bubblingListeners&&(this._bubblingListeners.off(t,e,i),!this._bubblingListeners.hasEventListener(t)))switch(t){case H.POSITION_CHANGED:this._eventMask&=-2;break;case H.SCALE_CHANGED:this._eventMask&=-3;break;case H.ROTATION_CHANGED:this._eventMask&=-5;break;case H.SIZE_CHANGED:this._eventMask&=-9;break;case H.ANCHOR_CHANGED:this._eventMask&=-17;break;case H.COLOR_CHANGED:this._eventMask&=-33}},_offDispatch:function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var r=n?this._capturingListeners:this._bubblingListeners;r&&(r.off(t,e,i),i&&i.__eventTargets&&h.array.fastRemove(i.__eventTargets,this))}else this._capturingListeners&&this._capturingListeners.removeAll(t),this._bubblingListeners&&this._bubblingListeners.removeAll(t)},targetOff:function(t){var e=this._bubblingListeners;e&&(e.targetOff(t),1&this._eventMask&&!e.hasEventListener(H.POSITION_CHANGED)&&(this._eventMask&=-2),2&this._eventMask&&!e.hasEventListener(H.SCALE_CHANGED)&&(this._eventMask&=-3),4&this._eventMask&&!e.hasEventListener(H.ROTATION_CHANGED)&&(this._eventMask&=-5),8&this._eventMask&&!e.hasEventListener(H.SIZE_CHANGED)&&(this._eventMask&=-9),16&this._eventMask&&!e.hasEventListener(H.ANCHOR_CHANGED)&&(this._eventMask&=-17),32&this._eventMask&&!e.hasEventListener(H.COLOR_CHANGED)&&(this._eventMask&=-33)),this._capturingListeners&&this._capturingListeners.targetOff(t),t&&t.__eventTargets&&h.array.fastRemove(t.__eventTargets,this),this._touchListener&&!rt(this,W)&&(c.removeListener(this._touchListener),this._touchListener=null),this._mouseListener&&!rt(this,j)&&(c.removeListener(this._mouseListener),this._mouseListener=null)},hasEventListener:function(t){var e=!1;return this._bubblingListeners&&(e=this._bubblingListeners.hasEventListener(t)),!e&&this._capturingListeners&&(e=this._capturingListeners.hasEventListener(t)),e},emit:function(t,e,i,n,r,a){this._bubblingListeners&&this._bubblingListeners.emit(t,e,i,n,r,a)},dispatchEvent:function(t){var e=U.get();at(this,t,e),U.put(e)},pauseSystemEvents:function(t){c.pauseTarget(this,t)},resumeSystemEvents:function(t){c.resumeTarget(this,t)},_hitTest:function(t,e){var n=this._contentSize.width,r=this._contentSize.height,a=N,s=F,o=cc.Camera.findCamera(this);if(o?o.getScreenToWorldPoint(t,a):a.set(t),this._updateWorldMatrix(),!i.Mat4.invert(k,this._worldMatrix))return!1;i.Vec2.transformMat4(s,a,k),s.x+=this._anchorPoint.x*n,s.y+=this._anchorPoint.y*r;var c=!1;if(s.x>=0&&s.y>=0&&s.x<=n&&s.y<=r&&(c=!0,e&&e.mask))for(var l=e.mask,h=this,u=l?l.length:0,f=0,_=0;h&&_<u;++f,h=h.parent){var d=l[_];if(f===d.index){if(h!==d.node){l.length=_;break}var p=h.getComponent(cc.Mask);if(p&&p._enabled&&!p._hitTest(a)){c=!1;break}_++}else if(f>d.index){l.length=_;break}}return c},_getCapturingTargets:function(t,e){for(var i=this.parent;i;)i._capturingListeners&&i._capturingListeners.hasEventListener(t)&&e.push(i),i=i.parent},_getBubblingTargets:function(t,e){for(var i=this.parent;i;)i._bubblingListeners&&i._bubblingListeners.hasEventListener(t)&&e.push(i),i=i.parent},runAction:p?function(t){if(this.active){cc.assertID(t,1618);var e=cc.director.getActionManager();return e._suppressDeprecation||(e._suppressDeprecation=!0,cc.warnID(1639)),e.addAction(t,this,!1),t}}:m,pauseAllActions:p?function(){cc.director.getActionManager().pauseTarget(this)}:m,resumeAllActions:p?function(){cc.director.getActionManager().resumeTarget(this)}:m,stopAllActions:p?function(){cc.director.getActionManager().removeAllActionsFromTarget(this)}:m,stopAction:p?function(t){cc.director.getActionManager().removeAction(t)}:m,stopActionByTag:p?function(t){t!==cc.Action.TAG_INVALID?cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:m,getActionByTag:p?function(t){return t===cc.Action.TAG_INVALID?(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:function(){return null},getNumberOfRunningActions:p?function(){return cc.director.getActionManager().getNumberOfRunningActionsInTarget(this)}:function(){return 0},getPosition:function(t){return t=t||new i.Vec3,i.Trs.toPosition(t,this._trs)},setPosition:function(t,e,i){var n;void 0===e?(n=t.x,e=t.y,i=t.z):n=t;var r=this._trs;void 0===i&&(i=r[2]),(r[0]!==n||r[1]!==e||r[2]!==i)&&(r[0]=n,r[1]=e,r[2]=i,this.setLocalDirty(G.ALL_POSITION),this._renderFlag|=f.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(H.POSITION_CHANGED))},getScale:function(t){return void 0!==t?i.Trs.toScale(t,this._trs):(cc.errorID(1400,"cc.Node.getScale","cc.Node.scale or cc.Node.getScale(cc.Vec3)"),this._trs[7])},setScale:function(t,e,i){var n;t&&"number"!=typeof t?(n=t.x,e=t.y,i=t.z):void 0!==t&&void 0===e?(n=t,e=t,i=t):n=t;var r=this._trs;void 0===i&&(i=r[9]),r[7]===n&&r[8]===e&&r[9]===i||(r[7]=n,r[8]=e,r[9]=i,this.setLocalDirty(G.ALL_SCALE),this._renderFlag|=f.FLAG_TRANSFORM,2&this._eventMask&&this.emit(H.SCALE_CHANGED))},getRotation:function(t){return t instanceof i.Quat?i.Trs.toRotation(t,this._trs):-this.angle},setRotation:function(t,e,i,n){if("number"==typeof t&&void 0===e)this.angle=-t;else{var r=t;void 0===e&&(r=t.x,e=t.y,i=t.z,n=t.w);var a=this._trs;a[3]===r&&a[4]===e&&a[5]===i&&a[6]===n||(a[3]=r,a[4]=e,a[5]=i,a[6]=n,this.setLocalDirty(G.ALL_ROTATION),4&this._eventMask&&this.emit(H.ROTATION_CHANGED))}},getContentSize:function(){return cc.size(this._contentSize.width,this._contentSize.height)},setContentSize:function(t,e){var i=this._contentSize;if(void 0===e){if((0,n.approx)(t.width,i.width)&&(0,n.approx)(t.height,i.height))return;i.width=t.width,i.height=t.height}else{if((0,n.approx)(t,i.width)&&(0,n.approx)(e,i.height))return;i.width=t,i.height=e}8&this._eventMask&&this.emit(H.SIZE_CHANGED)},getAnchorPoint:function(){return cc.v2(this._anchorPoint)},setAnchorPoint:function(t,e){var i=this._anchorPoint;if(void 0===e){if(t.x===i.x&&t.y===i.y)return;i.x=t.x,i.y=t.y}else{if(t===i.x&&e===i.y)return;i.x=t,i.y=e}this.setLocalDirty(G.ALL_POSITION),16&this._eventMask&&this.emit(H.ANCHOR_CHANGED)},_invTransformPoint:function(t,e){this._parent?this._parent._invTransformPoint(t,e):i.Vec3.copy(t,e);var n=this._trs;return i.Trs.toPosition(y,n),i.Vec3.sub(t,t,y),i.Trs.toRotation(A,n),i.Quat.conjugate(b,A),i.Vec3.transformQuat(t,t,b),i.Trs.toScale(y,n),i.Vec3.inverseSafe(T,y),i.Vec3.mul(t,t,T),t},getWorldPosition:function(t){i.Trs.toPosition(t,this._trs);for(var e,n=this._parent;n;)e=n._trs,i.Trs.toScale(v,e),i.Vec3.mul(t,t,v),i.Trs.toRotation(g,e),i.Vec3.transformQuat(t,t,g),i.Trs.toPosition(v,e),i.Vec3.add(t,t,v),n=n._parent;return t},setWorldPosition:function(t){var e=this._trs;this._parent?this._parent._invTransformPoint(E,t):i.Vec3.copy(E,t),i.Trs.fromPosition(e,E),this.setLocalDirty(G.ALL_POSITION),1&this._eventMask&&this.emit(H.POSITION_CHANGED)},getWorldRotation:function(t){i.Trs.toRotation(L,this._trs),i.Quat.copy(t,L);for(var e=this._parent;e;)i.Trs.toRotation(L,e._trs),i.Quat.mul(t,L,t),e=e._parent;return t},setWorldRotation:function(t){this._parent?(this._parent.getWorldRotation(B),i.Quat.conjugate(B,B),i.Quat.mul(B,B,t)):i.Quat.copy(B,t),i.Trs.fromRotation(this._trs,B),this.setLocalDirty(G.ALL_ROTATION)},getWorldScale:function(t){i.Trs.toScale(C,this._trs),i.Vec3.copy(t,C);for(var e=this._parent;e;)i.Trs.toScale(C,e._trs),i.Vec3.mul(t,t,C),e=e._parent;return t},setWorldScale:function(t){this._parent?(this._parent.getWorldScale(x),i.Vec3.div(x,t,x)):i.Vec3.copy(x,t),i.Trs.fromScale(this._trs,x),this.setLocalDirty(G.ALL_SCALE)},getWorldRT:function(t){var e=S,n=D,r=this._trs;i.Trs.toPosition(e,r),i.Trs.toRotation(n,r);for(var a=this._parent;a;)r=a._trs,i.Trs.toScale(w,r),i.Vec3.mul(e,e,w),i.Trs.toRotation(M,r),i.Vec3.transformQuat(e,e,M),i.Trs.toPosition(w,r),i.Vec3.add(e,e,w),i.Quat.mul(n,M,n),a=a._parent;return i.Mat4.fromRT(t,n,e),t},lookAt:function(t,e){this.getWorldPosition(R),i.Vec3.sub(R,R,t),i.Vec3.normalize(R,R),i.Quat.fromViewUp(I,R,e),this.setWorldRotation(I)},_updateLocalMatrix:lt,_calculWorldMatrix:function(){this._localMatDirty&G.TRSS&&this._updateLocalMatrix();var t=this._parent;t?this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):i.Mat4.copy(this._worldMatrix,this._matrix),this._worldMatDirty=!1},_mulMat:ft,_updateWorldMatrix:function(){if(this._parent&&this._parent._updateWorldMatrix(),this._worldMatDirty){this._calculWorldMatrix();for(var t=this._children,e=0,i=t.length;e<i;e++)t[e]._worldMatDirty=!0}},setLocalDirty:function(t){this._localMatDirty|=t,this._worldMatDirty=!0,t===G.ALL_POSITION||t===G.POSITION?this._renderFlag|=f.FLAG_WORLD_TRANSFORM:this._renderFlag|=f.FLAG_TRANSFORM},setWorldDirty:function(){this._worldMatDirty=!0},getLocalMatrix:function(t){return this._updateLocalMatrix(),i.Mat4.copy(t,this._matrix)},getWorldMatrix:function(t){return this._updateWorldMatrix(),i.Mat4.copy(t,this._worldMatrix)},convertToNodeSpaceAR:function(t,e){return this._updateWorldMatrix(),i.Mat4.invert(k,this._worldMatrix),t instanceof cc.Vec2?(e=e||new cc.Vec2,i.Vec2.transformMat4(e,t,k)):(e=e||new cc.Vec3,i.Vec3.transformMat4(e,t,k))},convertToWorldSpaceAR:function(t,e){return this._updateWorldMatrix(),t instanceof cc.Vec2?(e=e||new cc.Vec2,i.Vec2.transformMat4(e,t,this._worldMatrix)):(e=e||new cc.Vec3,i.Vec3.transformMat4(e,t,this._worldMatrix))},convertToNodeSpace:function(t){this._updateWorldMatrix(),i.Mat4.invert(k,this._worldMatrix);var e=new cc.Vec2;return i.Vec2.transformMat4(e,t,k),e.x+=this._anchorPoint.x*this._contentSize.width,e.y+=this._anchorPoint.y*this._contentSize.height,e},convertToWorldSpace:function(t){this._updateWorldMatrix();var e=new cc.Vec2(t.x-this._anchorPoint.x*this._contentSize.width,t.y-this._anchorPoint.y*this._contentSize.height);return i.Vec2.transformMat4(e,e,this._worldMatrix)},getNodeToParentTransform:function(t){t||(t=o.identity()),this._updateLocalMatrix();var e=this._contentSize;return V.x=-this._anchorPoint.x*e.width,V.y=-this._anchorPoint.y*e.height,i.Mat4.copy(k,this._matrix),i.Mat4.transform(k,k,V),o.fromMat4(t,k)},getNodeToParentTransformAR:function(t){return t||(t=o.identity()),this._updateLocalMatrix(),o.fromMat4(t,this._matrix)},getNodeToWorldTransform:function(t){t||(t=o.identity()),this._updateWorldMatrix();var e=this._contentSize;return V.x=-this._anchorPoint.x*e.width,V.y=-this._anchorPoint.y*e.height,i.Mat4.copy(k,this._worldMatrix),i.Mat4.transform(k,k,V),o.fromMat4(t,k)},getNodeToWorldTransformAR:function(t){return t||(t=o.identity()),this._updateWorldMatrix(),o.fromMat4(t,this._worldMatrix)},getParentToNodeTransform:function(t){return t||(t=o.identity()),this._updateLocalMatrix(),i.Mat4.invert(k,this._matrix),o.fromMat4(t,k)},getWorldToNodeTransform:function(t){return t||(t=o.identity()),this._updateWorldMatrix(),i.Mat4.invert(k,this._worldMatrix),o.fromMat4(t,k)},convertTouchToNodeSpace:function(t){return this.convertToNodeSpace(t.getLocation())},convertTouchToNodeSpaceAR:function(t){return this.convertToNodeSpaceAR(t.getLocation())},getBoundingBox:function(){this._updateLocalMatrix();var t=this._contentSize.width,e=this._contentSize.height,i=cc.rect(-this._anchorPoint.x*t,-this._anchorPoint.y*e,t,e);return i.transformMat4(i,this._matrix)},getBoundingBoxToWorld:function(){return this._parent?(this._parent._updateWorldMatrix(),this._getBoundingBoxTo()):this.getBoundingBox()},_getBoundingBoxTo:function(){var t=this._contentSize.width,e=this._contentSize.height,i=cc.rect(-this._anchorPoint.x*t,-this._anchorPoint.y*e,t,e);if(this._calculWorldMatrix(),i.transformMat4(i,this._worldMatrix),!this._children)return i;for(var n=this._children,r=0;r<n.length;r++){var a=n[r];if(a&&a.active){var s=a._getBoundingBoxTo();s&&i.union(i,s)}}return i},_updateOrderOfArrival:function(){var t=this._parent?++this._parent._childArrivalOrder:0;this._localZOrder=4294901760&this._localZOrder|t,this.emit(H.SIBLING_ORDER_CHANGED)},setSelfGroupIndex:function(t){this._groupIndex=t||0,this._cullingMask=1<<t},addChild:function(t,e,i){cc.assertID(t,1606),cc.assertID(null===t._parent,1605),t.parent=this,void 0!==e&&(t.zIndex=e),void 0!==i&&(t.name=i)},cleanup:function(){p&&cc.director.getActionManager().removeAllActionsFromTarget(this),c.removeListeners(this);var t,e,i=this._children.length;for(t=0;t<i;++t)(e=this._children[t])&&e.cleanup()},sortAllChildren:function(){if(this._reorderChildDirty){this._reorderChildDirty=!1;var t=this._children;this._childArrivalOrder=1;for(var e=0,i=t.length;e<i;e++)t[e]._updateOrderOfArrival();if(c._setDirtyForNode(this),t.length>1){for(var n,r,a=1,s=t.length;a<s;a++){n=t[a];for(var o=a;o>0&&(r=t[o-1])._localZOrder>n._localZOrder;o--)t[o]=r;t[o]=n}this.emit(H.CHILD_REORDER,this)}cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this)}},_delaySort:function(){this._reorderChildDirty||(this._reorderChildDirty=!0,cc.director.__fastOn(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this))},_restoreProperties:!1,onRestore:!1},pt=cc.Class(dt),mt=pt.prototype;h.getset(mt,"position",mt.getPosition,mt.setPosition,!1,!0),cc.Node=e.exports=pt}),{"./event-manager":139,"./event/event":142,"./event/event-target":141,"./platform/CCMacro":173,"./platform/js":189,"./renderer/render-flow":200,"./utils/affine-transform":234,"./utils/base-node":235,"./utils/prefab-helper":245,"./utils/trans-pool":251,"./value-types":257,"./value-types/utils":264}],30:[(function(t,e){"use strict";var i=t("./CCNode"),n=t("./renderer/render-flow"),r=(cc.Object.Flags.HideInHierarchy,i._LocalDirtyFlag),a=cc.Class({name:"cc.PrivateNode",extends:i,properties:{x:{get:function(){return this._originPos.x},set:function(t){var e=this._originPos;t!==e.x&&(e.x=t,this._posDirty(!0))},override:!0},y:{get:function(){return this._originPos.y},set:function(t){var e=this._originPos;t!==e.y&&(e.y=t,this._posDirty(!0))},override:!0},zIndex:{get:function(){return cc.macro.MIN_ZINDEX},set:function(){},override:!0},showInEditor:{default:!1,editorOnly:!0,override:!0}},ctor:function(){this._localZOrder=cc.macro.MIN_ZINDEX<<16,this._originPos=cc.v2()},_posDirty:function(t){this.setLocalDirty(r.POSITION),this._renderFlag|=n.FLAG_TRANSFORM,!0===t&&1&this._eventMask&&this.emit(i.EventType.POSITION_CHANGED)},_updateLocalMatrix:function(){if(this._localMatDirty){var t=this.parent;t&&(this._trs[0]=this._originPos.x-(t._anchorPoint.x-.5)*t._contentSize.width,this._trs[1]=this._originPos.y-(t._anchorPoint.y-.5)*t._contentSize.height),this._super()}},getPosition:function(){return new cc.Vec2(this._originPos)},setPosition:function(t,e){void 0===e&&(e=(t=t.x).y);var i=this._originPos;i.x===t&&i.y===e||(i.x=t,i.y=e,this._posDirty(!0))},setParent:function(t){var e=this._parent;this._super(t),e!==t&&(e&&e.off(i.EventType.ANCHOR_CHANGED,this._posDirty,this),t&&t.on(i.EventType.ANCHOR_CHANGED,this._posDirty,this))},_updateOrderOfArrival:function(){}}),s=a.prototype;cc.js.getset(s,"parent",s.getParent,s.setParent),cc.js.getset(s,"position",s.getPosition,s.setPosition),cc.PrivateNode=e.exports=a}),{"./CCNode":29,"./renderer/render-flow":200}],31:[(function(t,e){"use strict";cc.Scene=cc.Class({name:"cc.Scene",extends:t("./CCNode"),properties:{_is3DNode:{default:!0,override:!0},autoReleaseAssets:!1},ctor:function(){this._anchorPoint.x=0,this._anchorPoint.y=0,this._activeInHierarchy=!1,this._inited=!cc.game._isCloning,this.dependAssets=null},destroy:function(){if(cc.Object.prototype.destroy.call(this))for(var t=this._children,e=0;e<t.length;++e)t[e].active=!1;this._active=!1,this._activeInHierarchy=!1},_onHierarchyChanged:function(){},_instantiate:null,_load:function(){this._inited||(this._onBatchCreated(!1),this._inited=!0)},_activate:function(t){t=!1!==t,cc.director._nodeActivator.activateNode(this,t)}}),e.exports=cc.Scene}),{"./CCNode":29}],32:[(function(t,e){"use strict";var i=t("./platform/js"),n=new(t("./platform/id-generater"))("Scheduler"),r=function(t,e,i,n){this.target=t,this.priority=e,this.paused=i,this.markedForDeletion=n},a=[];r.get=function(t,e,i,n){var s=a.pop();return s?(s.target=t,s.priority=e,s.paused=i,s.markedForDeletion=n):s=new r(t,e,i,n),s},r.put=function(t){a.length<20&&(t.target=null,a.push(t))};var s=function(t,e,i,n){this.list=t,this.entry=e,this.target=i,this.callback=n},o=[];s.get=function(t,e,i,n){var r=o.pop();return r?(r.list=t,r.entry=e,r.target=i,r.callback=n):r=new s(t,e,i,n),r},s.put=function(t){o.length<20&&(t.list=t.entry=t.target=t.callback=null,o.push(t))};var c=function(t,e,i,n,r,a){var s=this;s.timers=t,s.target=e,s.timerIndex=i,s.currentTimer=n,s.currentTimerSalvaged=r,s.paused=a},l=[];function h(){this._lock=!1,this._scheduler=null,this._elapsed=-1,this._runForever=!1,this._useDelay=!1,this._timesExecuted=0,this._repeat=0,this._delay=0,this._interval=0,this._target=null,this._callback=null}c.get=function(t,e,i,n,r,a){var s=l.pop();return s?(s.timers=t,s.target=e,s.timerIndex=i,s.currentTimer=n,s.currentTimerSalvaged=r,s.paused=a):s=new c(t,e,i,n,r,a),s},c.put=function(t){l.length<20&&(t.timers=t.target=t.currentTimer=null,l.push(t))};var u=h.prototype;u.initWithCallback=function(t,e,i,n,r,a){return this._lock=!1,this._scheduler=t,this._target=i,this._callback=e,this._elapsed=-1,this._interval=n,this._delay=a,this._useDelay=this._delay>0,this._repeat=r,this._runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},u.getInterval=function(){return this._interval},u.setInterval=function(t){this._interval=t},u.update=function(t){-1===this._elapsed?(this._elapsed=0,this._timesExecuted=0):(this._elapsed+=t,this._runForever&&!this._useDelay?this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0):(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-=this._delay,this._timesExecuted+=1,this._useDelay=!1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecuted+=1),this._callback&&!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},u.getCallback=function(){return this._callback},u.trigger=function(){this._target&&this._callback&&(this._lock=!0,this._callback.call(this._target,this._elapsed),this._lock=!1)},u.cancel=function(){this._scheduler.unschedule(this._callback,this._target)};var f=[];h.get=function(){return f.pop()||new h},h.put=function(t){f.length<20&&!t._lock&&(t._scheduler=t._target=t._callback=null,f.push(t))},cc.Scheduler=function(){this._timeScale=1,this._updatesNegList=[],this._updates0List=[],this._updatesPosList=[],this._hashForUpdates=i.createMap(!0),this._hashForTimers=i.createMap(!0),this._currentTarget=null,this._currentTargetSalvaged=!1,this._updateHashLocked=!1,this._arrayForTimers=[]},cc.Scheduler.prototype={constructor:cc.Scheduler,_removeHashElement:function(t){delete this._hashForTimers[t.target._id];for(var e=this._arrayForTimers,i=0,n=e.length;i<n;i++)if(e[i]===t){e.splice(i,1);break}c.put(t)},_removeUpdateFromHash:function(t){var e=t.target._id,i=this._hashForUpdates[e];if(i){for(var n=i.list,a=i.entry,o=0,c=n.length;o<c;o++)if(n[o]===a){n.splice(o,1);break}delete this._hashForUpdates[e],r.put(a),s.put(i)}},_priorityIn:function(t,e,i){for(var n=0;n<t.length;n++)if(i<t[n].priority)return void t.splice(n,0,e);t.push(e)},_appendIn:function(t,e){t.push(e)},enableForTarget:function(t){t._id||(t.__instanceId?cc.warnID(1513):t._id=n.getNewId())},setTimeScale:function(t){this._timeScale=t},getTimeScale:function(){return this._timeScale},update:function(t){var e,i,n,r;for(this._updateHashLocked=!0,1!==this._timeScale&&(t*=this._timeScale),e=0,n=(i=this._updatesNegList).length;e<n;e++)(r=i[e]).paused||r.markedForDeletion||r.target.update(t);for(e=0,n=(i=this._updates0List).length;e<n;e++)(r=i[e]).paused||r.markedForDeletion||r.target.update(t);for(e=0,n=(i=this._updatesPosList).length;e<n;e++)(r=i[e]).paused||r.markedForDeletion||r.target.update(t);var a,s=this._arrayForTimers;for(e=0;e<s.length;e++){if(a=s[e],this._currentTarget=a,this._currentTargetSalvaged=!1,!a.paused)for(a.timerIndex=0;a.timerIndex<a.timers.length;++a.timerIndex)a.currentTimer=a.timers[a.timerIndex],a.currentTimerSalvaged=!1,a.currentTimer.update(t),a.currentTimer=null;this._currentTargetSalvaged&&0===this._currentTarget.timers.length&&(this._removeHashElement(this._currentTarget),--e)}for(e=0,i=this._updatesNegList;e<i.length;)(r=i[e]).markedForDeletion?this._removeUpdateFromHash(r):e++;for(e=0,i=this._updates0List;e<i.length;)(r=i[e]).markedForDeletion?this._removeUpdateFromHash(r):e++;for(e=0,i=this._updatesPosList;e<i.length;)(r=i[e]).markedForDeletion?this._removeUpdateFromHash(r):e++;this._updateHashLocked=!1,this._currentTarget=null},schedule:function(t,e,i,n,r,a){if("function"!=typeof t){var s=t;t=e,e=s}4!==arguments.length&&5!==arguments.length||(a=!!n,n=cc.macro.REPEAT_FOREVER,r=0),cc.assertID(e,1502);var o=e._id;o||(e.__instanceId?(cc.warnID(1513),o=e._id=e.__instanceId):cc.errorID(1510));var l,u,f=this._hashForTimers[o];if(f?f.paused!==a&&cc.warnID(1511):(f=c.get(null,e,0,null,null,a),this._arrayForTimers.push(f),this._hashForTimers[o]=f),null==f.timers)f.timers=[];else for(u=0;u<f.timers.length;++u)if((l=f.timers[u])&&t===l._callback)return cc.logID(1507,l.getInterval(),i),void(l._interval=i);(l=h.get()).initWithCallback(this,t,e,i,n,r),f.timers.push(l),this._currentTarget===f&&this._currentTargetSalvaged&&(this._currentTargetSalvaged=!1)},scheduleUpdate:function(t,e,i){var n=t._id;n||(t.__instanceId?(cc.warnID(1513),n=t._id=t.__instanceId):cc.errorID(1510));var a=this._hashForUpdates[n];if(a&&a.entry){if(a.entry.priority===e)return a.entry.markedForDeletion=!1,void(a.entry.paused=i);if(this._updateHashLocked)return cc.logID(1506),a.entry.markedForDeletion=!1,void(a.entry.paused=i);this.unscheduleUpdate(t)}var o,c=r.get(t,e,i,!1);0===e?(o=this._updates0List,this._appendIn(o,c)):(o=e<0?this._updatesNegList:this._updatesPosList,this._priorityIn(o,c,e)),this._hashForUpdates[n]=s.get(o,c,t,null)},unschedule:function(t,e){if(e&&t){var i=e._id;i||(e.__instanceId?(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var n=this._hashForTimers[i];if(n)for(var r=n.timers,a=0,s=r.length;a<s;a++){var o=r[a];if(t===o._callback)return o!==n.currentTimer||n.currentTimerSalvaged||(n.currentTimerSalvaged=!0),r.splice(a,1),h.put(o),n.timerIndex>=a&&n.timerIndex--,void(0===r.length&&(this._currentTarget===n?this._currentTargetSalvaged=!0:this._removeHashElement(n)))}}},unscheduleUpdate:function(t){if(t){var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForUpdates[e];i&&(this._updateHashLocked?i.entry.markedForDeletion=!0:this._removeUpdateFromHash(i.entry))}},unscheduleAllForTarget:function(t){if(t){var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForTimers[e];if(i){var n=i.timers;n.indexOf(i.currentTimer)>-1&&!i.currentTimerSalvaged&&(i.currentTimerSalvaged=!0);for(var r=0,a=n.length;r<a;r++)h.put(n[r]);n.length=0,this._currentTarget===i?this._currentTargetSalvaged=!0:this._removeHashElement(i)}this.unscheduleUpdate(t)}},unscheduleAll:function(){this.unscheduleAllWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},unscheduleAllWithMinPriority:function(t){var e,i,n,r=this._arrayForTimers;for(e=r.length-1;e>=0;e--)i=r[e],this.unscheduleAllForTarget(i.target);var a=0;if(t<0)for(e=0;e<this._updatesNegList.length;)a=this._updatesNegList.length,(n=this._updatesNegList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),a==this._updatesNegList.length&&e++;if(t<=0)for(e=0;e<this._updates0List.length;)a=this._updates0List.length,(n=this._updates0List[e])&&this.unscheduleUpdate(n.target),a==this._updates0List.length&&e++;for(e=0;e<this._updatesPosList.length;)a=this._updatesPosList.length,(n=this._updatesPosList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),a==this._updatesPosList.length&&e++},isScheduled:function(t,e){cc.assertID(t,1508),cc.assertID(e,1509);var i=e._id;i||(e.__instanceId?(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var n=this._hashForTimers[i];if(!n)return!1;if(null==n.timers)return!1;for(var r=n.timers,a=0;a<r.length;++a)if(t===r[a]._callback)return!0;return!1},pauseAllTargets:function(){return this.pauseAllTargetsWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},pauseAllTargetsWithMinPriority:function(t){var e,i,n,r,a=[],s=this._arrayForTimers;for(i=0,n=s.length;i<n;i++)(e=s[i])&&(e.paused=!0,a.push(e.target));if(t<0)for(i=0;i<this._updatesNegList.length;i++)(r=this._updatesNegList[i])&&r.priority>=t&&(r.paused=!0,a.push(r.target));if(t<=0)for(i=0;i<this._updates0List.length;i++)(r=this._updates0List[i])&&(r.paused=!0,a.push(r.target));for(i=0;i<this._updatesPosList.length;i++)(r=this._updatesPosList[i])&&r.priority>=t&&(r.paused=!0,a.push(r.target));return a},resumeTargets:function(t){if(t)for(var e=0;e<t.length;e++)this.resumeTarget(t[e])},pauseTarget:function(t){cc.assertID(t,1503);var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForTimers[e];i&&(i.paused=!0);var n=this._hashForUpdates[e];n&&(n.entry.paused=!0)},resumeTarget:function(t){cc.assertID(t,1504);var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForTimers[e];i&&(i.paused=!1);var n=this._hashForUpdates[e];n&&(n.entry.paused=!1)},isTargetPaused:function(t){cc.assertID(t,1505);var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForTimers[e];if(i)return i.paused;var n=this._hashForUpdates[e];return!!n&&n.entry.paused}},cc.Scheduler.PRIORITY_SYSTEM=1<<31,cc.Scheduler.PRIORITY_NON_SYSTEM=cc.Scheduler.PRIORITY_SYSTEM+1,e.exports=cc.Scheduler}),{"./platform/id-generater":185,"./platform/js":189}],33:[(function(t,e){"use strict";var i=t("./preprocess"),n=t("./fetch"),r=t("./cache"),a=t("./helper"),s=t("./releaseManager"),o=t("./depend-util"),c=t("./load"),l=t("./pipeline"),h=t("./task"),u=t("./request-item"),f=t("./downloader"),_=t("./parser"),d=t("./pack-manager"),p=t("./bundle"),m=t("./builtins"),v=t("./factory"),g=t("./urlTransformer"),y=g.parse,T=g.combine,A=t("./utilities"),b=A.parseParameters,E=A.asyncify,C=t("./shared"),x=C.assets,S=C.files,w=C.parsed,D=C.pipeline,M=C.transformPipeline,R=C.fetchPipeline,I=C.RequestType,O=C.bundles,P=C.BuiltinBundleName;function N(){this._preprocessPipe=i,this._fetchPipe=n,this._loadPipe=c,this.pipeline=D.append(i).append(c),this.fetchPipeline=R.append(i).append(n),this.transformPipeline=M.append(y).append(T),this.bundles=O,this.assets=x,this._files=S,this._parsed=w,this.generalImportBase="",this.generalNativeBase="",this.dependUtil=o,this._releaseManager=s,this.cacheAsset=!0,this.force=!1,this.utils=a,this.downloader=f,this.parser=_,this.builtins=m,this.packManager=d,this.factory=v,this.cacheManager=null,this.presets={default:{priority:0},preload:{maxConcurrency:2,maxRequestsPerFrame:2,priority:-1},scene:{maxConcurrency:8,maxRequestsPerFrame:8,priority:1},bundle:{maxConcurrency:8,maxRequestsPerFrame:8,priority:2},remote:{maxRetryCount:4},script:{maxConcurrency:1024,maxRequestsPerFrame:1024,priority:2}}}N.Pipeline=l,N.Task=h,N.Cache=r,N.RequestItem=u,N.Bundle=p,N.BuiltinBundleName=P,N.prototype={constructor:N,get main(){return O.get(P.MAIN)},get resources(){return O.get(P.RESOURCES)},get internal(){return O.get(P.INTERNAL)},init:function(t){t=t||Object.create(null),this._files.clear(),this._parsed.clear(),this._releaseManager.init(),this.assets.clear(),this.bundles.clear(),this.packManager.init(),this.downloader.init(t.bundleVers,t.server),this.parser.init(),this.dependUtil.init(),this.generalImportBase=t.importBase,this.generalNativeBase=t.nativeBase},getBundle:function(t){return O.get(t)},removeBundle:function(t){t._destroy(),O.remove(t.name)},loadAny:function(t,e,i,n){var r=b(e,i,n);e=r.options,i=r.onProgress,n=r.onComplete,e.preset=e.preset||"default",t=Array.isArray(t)?t.concat():t;var a=new h({input:t,onProgress:i,onComplete:E(n),options:e});D.async(a)},preloadAny:function(t,e,i,n){var r=b(e,i,n);e=r.options,i=r.onProgress,n=r.onComplete,e.preset=e.preset||"preload",t=Array.isArray(t)?t.concat():t;var a=new h({input:t,onProgress:i,onComplete:E(n),options:e});R.async(a)},postLoadNative:function(t,e,i){if(!(t instanceof cc.Asset))throw new Error("input is not asset");var n=b(e,void 0,i);if(e=n.options,i=n.onComplete,!t._native||t._nativeAsset)return E(i)(null);var r=o.getNativeDep(t._uuid);if(r){if(!O.has(r.bundle)){var a=O.find((function(e){return e.getAssetInfo(t._uuid)}));a&&(r.bundle=a.name)}this.loadAny(r,e,(function(e,n){e?cc.error(e.message,e.stack):t.isValid&&!t._nativeAsset&&(t._nativeAsset=n),i&&i(e)}))}},loadRemote:function(t,e,i){var n=b(e,void 0,i);if(e=n.options,i=n.onComplete,this.assets.has(t))return E(i)(null,this.assets.get(t));e.__isNative__=!0,e.preset=e.preset||"remote",this.loadAny({url:t},e,null,(function(n,r){n?(cc.error(n.message,n.stack),i&&i(n,null)):v.create(t,r,e.ext||cc.path.extname(t),e,(function(t,e){i&&i(t,e)}))}))},loadScript:function(t,e,i){var n=b(e,void 0,i);e=n.options,i=n.onComplete,e.__requestType__=I.URL,e.preset=e.preset||"script",this.loadAny(t,e,i)},loadBundle:function(t,e,i){var n=b(e,void 0,i),r=(e=n.options,i=n.onComplete,cc.path.basename(t));if(this.bundles.has(r))return E(i)(null,this.getBundle(r));e.preset=e.preset||"bundle",e.ext="bundle",this.loadRemote(t,e,i)},releaseAsset:function(t){s.tryRelease(t,!0)},releaseUnusedAssets:function(){x.forEach((function(t){s.tryRelease(t)}))},releaseAll:function(){x.forEach((function(t){s.tryRelease(t,!0)}))},_transform:function(t,e){var i=h.create({input:t,options:e}),n=[];try{for(var r=M.sync(i),a=0,s=r.length;a<s;a++){var o=r[a],c=o.url;o.recycle(),n.push(c)}}catch(l){for(a=0,s=i.output.length;a<s;a++)i.output[a].recycle();cc.error(l.message,l.stack)}return i.recycle(),n.length>1?n:n[0]}},cc.AssetManager=N,cc.assetManager=new N,Object.defineProperty(cc,"resources",{get:function(){return O.get(P.RESOURCES)}}),e.exports=cc.assetManager}),{"./builtins":34,"./bundle":35,"./cache":36,"./depend-util":38,"./downloader":45,"./factory":46,"./fetch":47,"./helper":49,"./load":51,"./pack-manager":52,"./parser":53,"./pipeline":54,"./preprocess":55,"./releaseManager":56,"./request-item":57,"./shared":58,"./task":59,"./urlTransformer":60,"./utilities":61}],34:[(function(t,e){"use strict";var i=t("./cache"),n=t("./releaseManager"),r=t("./shared").BuiltinBundleName,a={_assets:new i({material:new i,effect:new i}),_loadBuiltins:function(t,e){var i=t+"s",n=this._assets.get(t);return cc.assetManager.internal.loadDir(i,null,null,(function(t,i){if(t)cc.error(t.message,t.stack);else for(var r=0;r<i.length;r++){var a=i[r];n.add(a.name,a.addRef())}e()}))},init:function(t){var e=this;if(this.clear(),cc.game.renderType===cc.game.RENDER_TYPE_CANVAS||!cc.assetManager.bundles.has(r.INTERNAL))return t&&t();this._loadBuiltins("effect",(function(){e._loadBuiltins("material",t)}))},getBuiltin:function(t,e){return 0===arguments.length?this._assets:1===arguments.length?this._assets.get(t):this._assets.get(t).get(e)},clear:function(){this._assets.forEach((function(t){t.forEach((function(t){n.tryRelease(t,!0)})),t.clear()}))}};e.exports=a}),{"./cache":36,"./releaseManager":56,"./shared":58}],35:[(function(t,e){"use strict";var i=t("./config"),n=t("./releaseManager"),r=t("./utilities"),a=r.parseParameters,s=r.parseLoadResArgs,o=t("./shared"),c=o.RequestType,l=o.assets,h=o.bundles;function u(){this._config=new i}u.prototype={constructor:u,get name(){return this._config.name},get deps(){return this._config.deps},get base(){return this._config.base},getInfoWithPath:function(t,e){return this._config.getInfoWithPath(t,e)},getDirWithPath:function(t,e,i){return this._config.getDirWithPath(t,e,i)},getAssetInfo:function(t){return this._config.getAssetInfo(t)},getSceneInfo:function(t){return this._config.getSceneInfo(t)},init:function(t){this._config.init(t),h.add(t.name,this)},load:function(t,e,i,n){var r=s(e,i,n);e=r.type,i=r.onProgress,n=r.onComplete,cc.assetManager.loadAny(t,{__requestType__:c.PATH,type:e,bundle:this.name,__outputAsArray__:Array.isArray(t)},i,n)},preload:function(t,e,i,n){var r=s(e,i,n);e=r.type,i=r.onProgress,n=r.onComplete,cc.assetManager.preloadAny(t,{__requestType__:c.PATH,type:e,bundle:this.name},i,n)},loadDir:function(t,e,i,n){var r=s(e,i,n);e=r.type,i=r.onProgress,n=r.onComplete,cc.assetManager.loadAny(t,{__requestType__:c.DIR,type:e,bundle:this.name,__outputAsArray__:!0},i,n)},preloadDir:function(t,e,i,n){var r=s(e,i,n);e=r.type,i=r.onProgress,n=r.onComplete,cc.assetManager.preloadAny(t,{__requestType__:c.DIR,type:e,bundle:this.name},i,n)},loadScene:function(t,e,i,n){var r=a(e,i,n);e=r.options,i=r.onProgress,n=r.onComplete,e.preset=e.preset||"scene",e.bundle=this.name,cc.assetManager.loadAny({scene:t},e,i,(function(t,e){if(t)cc.error(t.message,t.stack),n&&n(t);else if(e instanceof cc.SceneAsset){var i=e.scene;i._id=e._uuid,i._name=e._name,n&&n(null,e)}else n&&n(new Error("The asset "+e._uuid+" is not a scene"))}))},preloadScene:function(t,e,i,n){var r=a(e,i,n);e=r.options,i=r.onProgress,n=r.onComplete,e.bundle=this.name,cc.assetManager.preloadAny({scene:t},e,i,(function(e){e&&cc.errorID(1210,t,e.message),n&&n(e)}))},get:function(t,e){var i=this.getInfoWithPath(t,e);return l.get(i&&i.uuid)},release:function(t,e){n.tryRelease(this.get(t,e),!0)},releaseUnusedAssets:function(){var t=this;l.forEach((function(e){var i=t.getAssetInfo(e._uuid);i&&!i.redirect&&n.tryRelease(e)}))},releaseAll:function(){var t=this;l.forEach((function(e){var i=t.getAssetInfo(e._uuid);i&&!i.redirect&&n.tryRelease(e,!0)}))},_destroy:function(){this._config.destroy()}},e.exports=u}),{"./config":37,"./releaseManager":56,"./shared":58,"./utilities":61}],36:[(function(t,e){"use strict";var i=t("../platform/js");function n(t){t?(this._map=t,this._count=Object.keys(t).length):(this._map=i.createMap(!0),this._count=0)}n.prototype={constructor:n,add:function(t,e){return t in this._map||this._count++,this._map[t]=e},get:function(t){return this._map[t]},has:function(t){return t in this._map},remove:function(t){var e=this._map[t];return t in this._map&&(delete this._map[t],this._count--),e},clear:function(){0!==this._count&&(this._map=i.createMap(!0),this._count=0)},forEach:function(t){for(var e in this._map)t(this._map[e],e)},find:function(t){for(var e in this._map)if(t(this._map[e],e))return this._map[e];return null},get count(){return this._count},destroy:function(){this._map=null}},e.exports=n}),{"../platform/js":189}],37:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("./cache"),r=t("./helper").normalize,a=t("./utilities").processOptions;function s(){this.name="",this.base="",this.importBase="",this.nativeBase="",this.deps=null,this.assetInfos=new n,this.scenes=new n,this.paths=new n}s.prototype={constructor:s,init:function(t){a(t),this.importBase=t.importBase||"",this.nativeBase=t.nativeBase||"",this.base=t.base||"",this.name=t.name||"",this.deps=t.deps||[],this._initUuid(t.uuids),this._initPath(t.paths),this._initScene(t.scenes),this._initPackage(t.packs),this._initVersion(t.versions),this._initRedirect(t.redirect)},_initUuid:function(t){if(t){this.assetInfos.clear();for(var e=0,i=t.length;e<i;e++){var n=t[e];this.assetInfos.add(n,{uuid:n})}}},_initPath:function(t){if(t){var e=this.paths;for(var n in e.clear(),t){var r=t[n],a=r[0],s=r[1],o=3===r.length,c=this.assetInfos.get(n);c.path=a,c.ctor=i._getClassById(s),e.has(a)?o?e.get(a).push(c):e.get(a).unshift(c):e.add(a,[c])}}},_initScene:function(t){if(t){var e=this.scenes;e.clear();var i=this.assetInfos;for(var n in t){var r=t[n],a=i.get(r);a.url=n,e.add(n,a)}}},_initPackage:function(t){if(t){var e=this.assetInfos;for(var i in t){var n=t[i],r={uuid:i,packs:n,ext:".json"};e.add(i,r);for(var a=0,s=n.length;a<s;a++){var o=n[a],c=e.get(o),l=c.packs;l?1===s?l.unshift(r):l.push(r):c.packs=[r]}}}},_initVersion:function(t){if(t){var e=this.assetInfos,i=t.import;if(i)for(var n=0,r=i.length;n<r;n+=2){var a=i[n];e.get(a).ver=i[n+1]}if(i=t.native)for(n=0,r=i.length;n<r;n+=2)a=i[n],e.get(a).nativeVer=i[n+1]}},_initRedirect:function(t){if(t)for(var e=this.assetInfos,i=0,n=t.length;i<n;i+=2){var r=t[i];e.get(r).redirect=t[i+1]}},getInfoWithPath:function(t,e){if(!t)return null;t=r(t);var n=this.paths.get(t);if(n){if(!e)return n[0];for(var a=0,s=n.length;a<s;a++){var o=n[a];if(i.isChildClassOf(o.ctor,e))return o}}return null},getDirWithPath:function(t,e,n){"/"===(t=r(t))[t.length-1]&&(t=t.slice(0,-1));var a=n||[];function s(t,e){return!(t.length>e.length)||47===t.charCodeAt(e.length)}return this.paths.forEach((function(n,r){if(r.startsWith(t)&&s(r,t)||!t)for(var o=0,c=n.length;o<c;o++){var l=n[o];e&&!i.isChildClassOf(l.ctor,e)||a.push(l)}})),a},getAssetInfo:function(t){return this.assetInfos.get(t)},getSceneInfo:function(t){return t.endsWith(".fire")||(t+=".fire"),"/"===t[0]||t.startsWith("db://")||(t="/"+t),this.scenes.find((function(e,i){return i.endsWith(t)}))},destroy:function(){this.paths.destroy(),this.scenes.destroy(),this.assetInfos.destroy()}},e.exports=s}),{"../platform/js":189,"./cache":36,"./helper":49,"./utilities":61}],38:[(function(t,e){"use strict";var i=(function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n(void 0);if(e&&e.has(t))return e.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=r?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,e&&e.set(t,i),i})(t("../platform/deserialize-compiled"));function n(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(n=function(t){return t?i:e})(t)}var r=t("./cache"),a=t("./deserialize"),s=t("./shared"),o=s.files,c=s.parsed,l={_depends:new r,init:function(){this._depends.clear()},getNativeDep:function(t){var e=this._depends.get(t);return e?e.nativeDep&&Object.assign({},e.nativeDep):null},getDeps:function(t){return this._depends.has(t)?this._depends.get(t).deps:[]},getDepsRecursively:function(t){var e=Object.create(null),i=[];return this._descend(t,e,i),i},_descend:function(t,e,i){for(var n=this.getDeps(t),r=0;r<n.length;r++){var a=n[r];e[a]||(e[a]=!0,i.push(a),this._descend(a,e,i))}},remove:function(t){this._depends.remove(t)},parse:function(t,e){var n=null;if(Array.isArray(e)||e.__type__){if(n=this._depends.get(t))return n;if(Array.isArray(e)&&!(0,i.hasNativeDep)(e))n={deps:this._parseDepsFromJson(e)};else try{var r=a(e);(n=this._parseDepsFromAsset(r)).nativeDep&&(n.nativeDep.uuid=t),c.add(t+"@import",r)}catch(s){o.remove(t+"@import"),n={deps:[]}}}else{if((n=this._depends.get(t))&&n.parsedFromExistAsset)return n;n=this._parseDepsFromAsset(e)}return this._depends.add(t,n),n},_parseDepsFromAsset:function(t){for(var e={deps:[],parsedFromExistAsset:!0,preventPreloadNativeObject:t.constructor.preventPreloadNativeObject,preventDeferredLoadDependents:t.constructor.preventDeferredLoadDependents},i=t.__depends__,n=0,r=i.length;n<r;n++){var a=i[n].uuid;e.deps.push(a)}return t.__nativeDepend__&&(e.nativeDep=t._nativeDep),e},_parseDepsFromJson:function(t){var e=(0,i.getDependUuidList)(t);return e.forEach((function(t,i){return e[i]=cc.assetManager.utils.decodeUuid(t)})),e}};e.exports=l}),{"../platform/deserialize-compiled":183,"./cache":36,"./deserialize":40,"./shared":58}],39:[(function(t){"use strict";var e=t("../platform/js");t("../CCDirector");var i=t("./utilities"),n=t("./depend-util"),r=t("./releaseManager"),a=t("./downloader"),s=t("./factory"),o=t("./helper"),c=[".png",".jpg",".bmp",".jpeg",".gif",".ico",".tiff",".webp",".image",".pvr",".pkm"],l=[".mp3",".ogg",".wav",".m4a"];function h(){return!0}var u={transformURL:function(t){var e=o.getUuidFromURL(t);if(!e)return t;var i=cc.assetManager.bundles.find((function(t){return!!t.getAssetInfo(e)}));if(!i)return t;var n,r=i.getAssetInfo(e);if(!(n=t.startsWith(i.base+i._config.nativeBase)?r.nativeVer||"":r.ver||"")||-1!==t.indexOf(n))return t;var a=!1;if(".ttf"===cc.path.extname(t)&&(a=!0),a){var s=cc.path.dirname(t),c=cc.path.basename(t);t=s+"."+n+"/"+c}else t=t.replace(/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]{8,})/,(function(t){return t+"."+n}));return t}},f={onProgress:null,_autoReleaseSetting:Object.create(null),get _cache(){return cc.assetManager.assets._map},load:function(t,e,i){void 0===i&&void 0!==e&&(i=e,e=null),t=Array.isArray(t)?t:[t];for(var n=0;n<t.length;n++){var r=t[n];"string"==typeof r?t[n]={url:r,__isNative__:!0}:(r.type&&(r.ext="."+r.type,r.type=void 0),r.url&&(r.__isNative__=!0))}var a=[],o=[];cc.assetManager.loadAny(t,null,(function(t,i,n){n.content&&(c.includes(n.ext)?a.push(n.content):l.includes(n.ext)&&o.push(n.content)),e&&e(t,i,n)}),(function(e,n){var r=null;if(!e){n=Array.isArray(n)?n:[n];for(var c=0;c<n.length;c++){var l=n[c];if(!(l instanceof cc.Asset)){var u=l,f=t[c].url;a.includes(u)?s.create(f,l,".png",null,(function(t,e){u=n[c]=e})):o.includes(u)&&s.create(f,l,".mp3",null,(function(t,e){u=n[c]=e})),cc.assetManager.assets.add(f,u)}}if(n.length>1){var _=Object.create(null);n.forEach((function(t){_[t._uuid]=t})),r={isCompleted:h,_map:_}}else r=n[0]}i&&i(e,r)}))},getXMLHttpRequest:function(){return new XMLHttpRequest},_parseLoadResArgs:i.parseLoadResArgs,getItem:function(t){return cc.assetManager.assets.has(t)?{content:cc.assetManager.assets.get(t)}:null},loadRes:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),a=(e=r.type,r.onProgress),s=r.onComplete,o=cc.path.extname(t);o&&(t=t.slice(0,-o.length)),cc.resources.load(t,e,a,s)},loadResArray:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),a=(e=r.type,r.onProgress),s=r.onComplete;t.forEach((function(e,i){var n=cc.path.extname(e);n&&(t[i]=e.slice(0,-n.length))})),cc.resources.load(t,e,a,s)},loadResDir:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),a=(e=r.type,r.onProgress),s=r.onComplete;cc.resources.loadDir(t,e,a,(function(i,n){var r=[];i||(r=cc.resources.getDirWithPath(t,e).map((function(t){return t.path}))),s&&s(i,n,r)}))},getRes:function(t,e){return cc.assetManager.assets.has(t)?cc.assetManager.assets.get(t):cc.resources.get(t,e)},getResCount:function(){return cc.assetManager.assets.count},getDependsRecursively:function(t){return t?n.getDepsRecursively("string"==typeof t?t:t._uuid).concat([t._uuid]):[]},get assetLoader(){},get md5Pipe(){return u},get downloader(){return cc.assetManager.downloader},get loader(){return cc.assetManager.parser},addDownloadHandlers:function(t){var e=Object.create(null);for(var i in t){var n=t[i];e["."+i]=function(t,e,i){n({url:t},i)}}cc.assetManager.downloader.register(e)},addLoadHandlers:function(t){var e=Object.create(null);for(var i in t){var n=t[i];e["."+i]=function(t,e,i){n({content:t},i)}}cc.assetManager.parser.register(e)},flowInDeps:function(){},release:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var i=t[e];"string"==typeof i&&(i=cc.assetManager.assets.get(i)),cc.assetManager.builtins._assets.find((function(t){return t.find((function(t){return t===i}))}))||cc.assetManager.releaseAsset(i)}else if(t){if("string"==typeof t&&(t=cc.assetManager.assets.get(t)),cc.assetManager.builtins._assets.find((function(e){return e.find((function(e){return e===t}))})))return;cc.assetManager.releaseAsset(t)}},releaseAsset:function(t){cc.assetManager.releaseAsset(t)},releaseRes:function(t,e){cc.resources.release(t,e)},releaseResDir:function(){},releaseAll:function(){cc.assetManager.releaseAll(),cc.assetManager.assets.clear()},removeItem:function(t){cc.assetManager.assets.remove(t)},setAutoRelease:function(t,e){"object"==typeof t&&(t=t._uuid),this._autoReleaseSetting[t]=!!e},setAutoReleaseRecursively:function(t,e){"object"==typeof t&&(t=t._uuid),e=!!e,this._autoReleaseSetting[t]=e;for(var i=n.getDepsRecursively(t),r=0;r<i.length;r++){var a=i[r];this._autoReleaseSetting[a]=e}},isAutoRelease:function(t){return"object"==typeof t&&(t=t._uuid),!!this._autoReleaseSetting[t]}};a.loadSubpackage=function(t,e){cc.assetManager.loadBundle(t,null,e)};var _={init:function(t){t.importBase=t.libraryPath,t.nativeBase=t.rawAssetsBase,cc.assetManager.init(t),t.rawAssets&&(new cc.AssetManager.Bundle).init({name:cc.AssetManager.BuiltinBundleName.RESOURCES,importBase:t.importBase,nativeBase:t.nativeBase,paths:t.rawAssets.assets,uuids:Object.keys(t.rawAssets.assets)})},loadAsset:function(t,e){cc.assetManager.loadAny(t,e)},getLibUrlNoExt:function(){},queryAssetInfo:function(){}};cc.url={normalize:function(t){return cc.warnID(1400,"cc.url.normalize","cc.assetManager.utils.normalize"),cc.assetManager.utils.normalize(t)},raw:function(t){return cc.warnID(1400,"cc.url.raw","cc.resources.load"),t.startsWith("resources/")?cc.assetManager._transform({path:cc.path.changeExtname(t.substr(10)),bundle:cc.AssetManager.BuiltinBundleName.RESOURCES,__isNative__:!0,ext:cc.path.extname(t)}):""}},Object.defineProperties(cc,{loader:{get:function(){return f}},AssetLibrary:{get:function(){return _}},LoadingItems:{get:function(){return cc.warnID(1400,"cc.LoadingItems","cc.AssetManager.Task"),cc.AssetManager.Task}},Pipeline:{get:function(){return cc.warnID(1400,"cc.Pipeline","cc.AssetManager.Pipeline"),cc.AssetManager.Pipeline}}}),e.obsolete(cc,"cc.RawAsset","cc.Asset"),e.obsolete(cc.Asset.prototype,"cc.Asset.url","nativeUrl"),Object.defineProperties(cc.macro,{DOWNLOAD_MAX_CONCURRENT:{get:function(){return cc.assetManager.downloader.maxConcurrency},set:function(t){cc.assetManager.downloader.maxConcurrency=t}}}),Object.assign(cc.director,{_getSceneUuid:function(t){cc.assetManager.main.getSceneInfo(t)}}),Object.defineProperties(cc.game,{_sceneInfos:{get:function(){var t=[];return cc.assetManager.main._config.scenes.forEach((function(e){t.push(e)})),t}}});var d=i.parseParameters;i.parseParameters=function(t,e,i){var n=d(t,e,i);return n.onProgress=n.onProgress||f.onProgress,n};var p=r._autoRelease;r._autoRelease=function(){p.apply(this,arguments);for(var t=f._autoReleaseSetting,e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(!0===t[n]){var a=cc.assetManager.assets.get(n);a&&r.tryRelease(a)}}}}),{"../CCDirector":27,"../platform/js":189,"./depend-util":38,"./downloader":45,"./factory":46,"./helper":49,"./releaseManager":56,"./utilities":61}],40:[(function(t,e){"use strict";var i=t("./helper");t("../platform/deserialize"),e.exports=function(t,e){var n;n=cc._MissingScript.safeFindClass;var r,a=null,s=(a=cc.deserialize.Details.pool).get();try{r=cc.deserialize(t,s,{classFinder:n,customEnv:e})}catch(_){throw a.put(s),_}for(var o=s.uuidList,c=s.uuidObjList,l=s.uuidPropList,h=[],u=0;u<o.length;u++){var f=o[u];h[u]={uuid:i.decodeUuid(f),owner:c[u],prop:l[u]}}return r.__depends__=h,r._native&&(r.__nativeDepend__=!0),a.put(s),r}}),{"../platform/deserialize":184,"../platform/deserialize-compiled":183,"../platform/deserialize-editor":void 0,"./helper":49}],41:[(function(t,e){"use strict";var i=cc.sys.__audioSupport,n=t("./utilities").parseParameters;e.exports=function(t,e,r){var a=n(e,void 0,r),s=(e=a.options,r=a.onComplete,document.createElement("audio"));s.src=t;var o=function(){clearTimeout(c),s.removeEventListener("canplaythrough",l,!1),s.removeEventListener("error",h,!1),i.USE_LOADER_EVENT&&s.removeEventListener(i.USE_LOADER_EVENT,l,!1)},c=setTimeout((function(){0===s.readyState?h():l()}),8e3),l=function(){o(),r&&r(null,s)},h=function(){o();var e="load audio failure - "+t;cc.log(e),r&&r(new Error(e))};return s.addEventListener("canplaythrough",l,!1),s.addEventListener("error",h,!1),i.USE_LOADER_EVENT&&s.addEventListener(i.USE_LOADER_EVENT,l,!1),s}}),{"./utilities":61}],42:[(function(t,e){"use strict";var i=t("./utilities").parseParameters;e.exports=function(t,e,n){var r=i(e,void 0,n),a=(e=r.options,n=r.onComplete,new Image);function s(){a.removeEventListener("load",s),a.removeEventListener("error",o),n&&n(null,a)}function o(){a.removeEventListener("load",s),a.removeEventListener("error",o),n&&n(new Error(cc.debug.getError(4930,t)))}return"file:"!==window.location.protocol&&(a.crossOrigin="anonymous"),a.addEventListener("load",s),a.addEventListener("error",o),a.src=t,a}}),{"./utilities":61}],43:[(function(t,e){"use strict";var i=t("./utilities").parseParameters;e.exports=function(t,e,n,r){var a=i(e,n,r),s=(e=a.options,n=a.onProgress,r=a.onComplete,new XMLHttpRequest),o="download failed: "+t+", status: ";if(s.open("GET",t,!0),void 0!==e.responseType&&(s.responseType=e.responseType),void 0!==e.withCredentials&&(s.withCredentials=e.withCredentials),void 0!==e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),void 0!==e.timeout&&(s.timeout=e.timeout),e.header)for(var c in e.header)s.setRequestHeader(c,e.header[c]);return s.onload=function(){200===s.status||0===s.status?r&&r(null,s.response):r&&r(new Error(o+s.status+"(no response)"))},n&&(s.onprogress=function(t){t.lengthComputable&&n(t.loaded,t.total)}),s.onerror=function(){r&&r(new Error(o+s.status+"(error)"))},s.ontimeout=function(){r&&r(new Error(o+s.status+"(time out)"))},s.onabort=function(){r&&r(new Error(o+s.status+"(abort)"))},s.send(null),s}}),{"./utilities":61}],44:[(function(t,e){"use strict";var i=t("./utilities").parseParameters,n={};e.exports=function(t,e,r){var a=i(e,void 0,r);if(e=a.options,r=a.onComplete,n[t])return r&&r(null);var s=document,o=document.createElement("script");function c(){o.parentNode.removeChild(o),o.removeEventListener("load",c,!1),o.removeEventListener("error",l,!1),n[t]=!0,r&&r(null)}function l(){o.parentNode.removeChild(o),o.removeEventListener("load",c,!1),o.removeEventListener("error",l,!1),r&&r(new Error(cc.debug.getError(4928,t)))}"file:"!==window.location.protocol&&(o.crossOrigin="anonymous"),o.async=e.async,o.src=t,o.addEventListener("load",c,!1),o.addEventListener("error",l,!1),s.body.appendChild(o)}}),{"./utilities":61}],45:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("../CCDebug"),r=t("./font-loader").loadFont,a=t("../platform/utils").callInNextTick,s=t("./download-dom-image"),o=t("./download-dom-audio"),c=t("./download-file"),l=t("./download-script.js"),h=t("./cache"),u=t("./shared").files,f=t("../platform/CCSys"),_=f.__audioSupport,d=f.capabilities,p=t("./utilities"),m=p.urlAppendTimestamp,v=p.retry,g=/^(?:\w+:\/\/|\.+\/).+/,y=function(t,e,i){e.audioLoadMode!==cc.AudioClip.LoadMode.DOM_AUDIO?E(t,e,i):o(t,e,i)},T=(y=0===(_.format||[]).length?function(t,e,i){i(new Error(n.getError(4927)))}:_.WEB_AUDIO?y:o,function(){var t=d.imageBitmap&&cc.macro.ALLOW_IMAGE_BITMAP?A:s;t.apply(this,arguments)}),A=function(t,e,i){e.responseType="blob",c(t,e,e.onFileProgress,i)},b=function(t,e,i){e.responseType="json",c(t,e,e.onFileProgress,(function(t,e){if(!t&&"string"==typeof e)try{e=JSON.parse(e)}catch(n){t=n}i&&i(t,e)}))},E=function(t,e,i){e.responseType="arraybuffer",c(t,e,e.onFileProgress,i)},C=function(t,e,i){e.responseType="text",c(t,e,e.onFileProgress,i)},x=function(t,e,i){i(null,t)},S=new h,w=[],D=!1,M=0,R=0,I=-1,O=!1,P=function(){var t=Date.now(),e=cc.director._deltaTime>F._maxInterval?F._maxInterval:cc.director._deltaTime;t-I>1e3*e&&(R=0,I=t)},N=function t(e,i){for(O=!1,P();w.length>0&&M<e&&R<i;){D&&(w.sort((function(t,e){return t.priority-e.priority})),D=!1);var n=w.pop();if(!n)break;M++,R++,n.invoke()}w.length>0&&M<e&&(a(t,e,i),O=!0)},F={_remoteServerAddress:"",_maxInterval:1/30,get remoteServerAddress(){return this._remoteServerAddress},maxConcurrency:6,maxRequestsPerFrame:6,maxRetryCount:3,appendTimeStamp:!1,limited:!0,retryInterval:2e3,bundleVers:null,downloadDomImage:s,downloadDomAudio:o,downloadFile:c,downloadScript:l,init:function(t,e){S.clear(),w.length=0,this._remoteServerAddress=e||"",this.bundleVers=t||Object.create(null)},register:function(t,e){"object"==typeof t?i.mixin(L,t):L[t]=e},download:function(t,e,i,n,r){var s,o,c=L[i]||L.default,l=this;if(s=u.get(t))r(null,s);else if(o=S.get(t)){o.push(r);for(var h=0,f=w.length;h<f;h++){var _=w[h];if(_.id===t){var d=n.priority||0;return void(_.priority<d&&(_.priority=d,D=!0))}}}else{var p=void 0!==n.maxRetryCount?n.maxRetryCount:this.maxRetryCount,g=void 0!==n.maxConcurrency?n.maxConcurrency:this.maxConcurrency,y=void 0!==n.maxRequestsPerFrame?n.maxRequestsPerFrame:this.maxRequestsPerFrame;v((function(i,s){if(0===i&&S.add(t,[r]),!l.limited)return c(m(e),n,s);function o(){c(m(e),n,(function(){M--,!O&&w.length>0&&(a(N,g,y),O=!0),s.apply(this,arguments)}))}P(),M<g&&R<y?(o(),M++,R++):(w.push({id:t,priority:n.priority||0,invoke:o}),D=!0,!O&&M<g&&(a(N,g,y),O=!0))}),p,this.retryInterval,(function(e,i){e||u.add(t,i);for(var n=S.remove(t),r=0,a=n.length;r<a;r++)n[r](e,i)}))}}},L={".png":T,".jpg":T,".bmp":T,".jpeg":T,".gif":T,".ico":T,".tiff":T,".webp":T,".image":T,".pvr":E,".pkm":E,".astc":E,".mp3":y,".ogg":y,".wav":y,".m4a":y,".txt":C,".xml":C,".vsh":C,".fsh":C,".atlas":C,".tmx":C,".tsx":C,".json":b,".ExportJson":b,".plist":C,".fnt":C,".font":r,".eot":r,".ttf":r,".woff":r,".svg":r,".ttc":r,".mp4":x,".avi":x,".mov":x,".mpg":x,".mpeg":x,".rm":x,".rmvb":x,".binary":E,".bin":E,".dbbin":E,".skel":E,".js":l,bundle:function(t,e,i){var n=cc.path.basename(t),r=t;g.test(r)||(r="assets/"+n);var a=e.version||F.bundleVers[n],s=0,o=null,c=null;b(r+"/config."+(a?a+".":"")+"json",e,(function(t,e){t&&(c=t),(o=e)&&(o.base=r+"/"),2==++s&&i(c,o)})),l(r+"/index."+(a?a+".":"")+"js",e,(function(t){t&&(c=t),2==++s&&i(c,o)}))},default:C};F._downloaders=L,e.exports=F}),{"../CCDebug":26,"../platform/CCSys":177,"../platform/js":189,"../platform/utils":192,"./cache":36,"./download-dom-audio":41,"./download-dom-image":42,"./download-file":43,"./download-script.js":44,"./font-loader":48,"./shared":58,"./utilities":61}],46:[(function(t,e){"use strict";var i=t("./bundle"),n=t("./cache"),r=t("./shared"),a=r.assets,s=r.bundles,o=new n;function c(t,e,i,n){var r=null,a=null;try{(r=new cc.Texture2D)._nativeUrl=t,r._nativeAsset=e}catch(s){a=s}n&&n(a,r)}function l(t,e,i,n){var r=new cc.AudioClip;r._nativeUrl=t,r._nativeAsset=e,r.duration=e.duration,n&&n(null,r)}function h(t,e,i,n){var r=new cc.VideoClip;r._nativeUrl=t,r._nativeAsset=e,n&&n(null,r)}function u(t,e,i,n){var r=new cc.JsonAsset;r.json=e,n&&n(null,r)}function f(t,e,i,n){var r=new cc.TextAsset;r.text=e,n&&n(null,r)}function _(t,e,i,n){var r=new cc.TTFFont;r._nativeUrl=t,r._nativeAsset=e,n&&n(null,r)}function d(t,e,i,n){var r=new cc.BufferAsset;r._nativeUrl=t,r._nativeAsset=e,n&&n(null,r)}var p={register:function(t,e){"object"==typeof t?cc.js.mixin(m,t):m[t]=e},create:function(t,e,i,n,r){var s,c,l=m[i]||m.default;(s=a.get(t))?r(null,s):(c=o.get(t))?c.push(r):(o.add(t,[r]),l(t,e,n,(function(e,i){!e&&i instanceof cc.Asset&&(i._uuid=t,a.add(t,i));for(var n=o.remove(t),r=0,s=n.length;r<s;r++)n[r](e,i)})))}},m={".png":c,".jpg":c,".bmp":c,".jpeg":c,".gif":c,".ico":c,".tiff":c,".webp":c,".image":c,".pvr":c,".pkm":c,".astc":c,".mp3":l,".ogg":l,".wav":l,".m4a":l,".mp4":h,".avi":h,".mov":h,".mpg":h,".mpeg":h,".rm":h,".rmvb":h,".txt":f,".xml":f,".vsh":f,".fsh":f,".atlas":f,".tmx":f,".tsx":f,".fnt":f,".json":u,".ExportJson":u,".font":_,".eot":_,".ttf":_,".woff":_,".svg":_,".ttc":_,".binary":d,".bin":d,".dbbin":d,".skel":d,bundle:function(t,e,n,r){var a=s.get(e.name);a||(a=new i,e.base=e.base||t+"/",a.init(e)),r&&r(null,a)},default:function(t,e,i,n){var r=new cc.Asset;r._nativeUrl=t,r._nativeAsset=e,n&&n(null,r)}};e.exports=p}),{"./bundle":35,"./cache":36,"./shared":58}],47:[(function(t,e){"use strict";var i=t("./pack-manager"),n=t("./task"),r=t("./utilities"),a=r.getDepends,s=r.clear,o=r.forEach,c=t("./shared"),l=c.assets,h=c.fetchPipeline;function u(t){for(var e=t.output,i=0,n=e.length;i<n;i++)e[i].content&&e[i].content.decRef(!1)}function f(t,e,i,n,r,s,o){var c=e.options.__exclude__,l=e.progress;t.content=i,t.file=n,e.output.push(t),r&&(c[t.uuid]=!0,a(t.uuid,n||i,c,s,!0,!1,t.config),l.total=o+s.length),l.canInvoke&&e.dispatch("progress",++l.finish,l.total,t)}e.exports=function(t,e){var r=!1;t.progress||(t.progress={finish:0,total:t.input.length,canInvoke:!0},r=!0);var a=t.options,c=[],_=t.progress,d=_.total;a.__exclude__=a.__exclude__||Object.create(null),t.output=[],o(t.input,(function(n,a){if(!n.isNative&&l.has(n.uuid)){var s=l.get(n.uuid);return s.addRef(),f(n,t,s,null,s.__asyncLoadAssets__,c,d),a()}i.load(n,t.options,(function(i,s){i?t.isFinish||(!cc.assetManager.force||r?(cc.error(i.message,i.stack),_.canInvoke=!1,e(i)):f(n,t,null,null,!1,c,d)):t.isFinish||f(n,t,null,s,!n.isNative,c,d),a()}))}),(function(){if(t.isFinish)return s(t,!0),t.dispatch("error");if(c.length>0){var i=n.create({name:t.name+" dependencies",input:c,progress:_,options:a,onProgress:t.onProgress,onError:n.prototype.recycle,onComplete:function(n){n||(t.output.push.apply(t.output,this.output),i.recycle()),r&&u(t),e(n)}});h.async(i)}else r&&u(t),e()}))}}),{"./pack-manager":52,"./shared":58,"./task":59,"./utilities":61}],48:[(function(t,e){"use strict";var i,n=t("../utils/text-utils"),r=null,a="BES bswy:->@123\u4e01\u3041\u1101",s=Object.create(null),o=-1,c=[],l=3e3,h=(i=void 0,function(){if(void 0===i)if(window.FontFace){var t=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),e=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);i=t?parseInt(t[1],10)>42:!e}else i=!1;return i});function u(){for(var t=!0,e=Date.now(),i=c.length-1;i>=0;i--){var s=c[i],h=s.fontFamilyName;if(e-s.startTime>l)cc.warnID(4933,h),s.onComplete(null,h),c.splice(i,1);else{var u=s.refWidth,f="40px "+h;r.font=f,u!==n.safeMeasureText(r,a,f)?(c.splice(i,1),s.onComplete(null,h)):t=!1}}t&&(clearInterval(o),o=-1)}var f={loadFont:function(t,e,i){var _=f._getFontFamily(t);if(s[_])return i(null,_);if(!r){var d=document.createElement("canvas");d.width=100,d.height=100,r=d.getContext("2d")}var p="40px "+_;r.font=p;var m=n.safeMeasureText(r,a,p),v=document.createElement("style");v.type="text/css";var g="";isNaN(_-0)?g+="@font-face { font-family:"+_+"; src:":g+="@font-face { font-family:'"+_+"'; src:",g+="url('"+t+"');",v.textContent=g+"}",document.body.appendChild(v);var y,T,A,b,E,C,x=document.createElement("div"),S=x.style;if(S.fontFamily=_,x.innerHTML=".",S.position="absolute",S.left="-100px",S.top="-100px",document.body.appendChild(x),h())y=Date.now(),T=_,A=i,b=new Promise(function(t,e){(function i(){Date.now()-y>=l?e():document.fonts.load("40px "+T).then((function(e){e.length>=1?t():setTimeout(i,100)}),(function(){e()}))})()}),E=null,C=new Promise(function(t,e){E=setTimeout(e,l)}),Promise.race([C,b]).then((function(){E&&(clearTimeout(E),E=null),A(null,T)}),(function(){cc.warnID(4933,T),A(null,T)}));else{var w={fontFamilyName:_,refWidth:m,onComplete:i,startTime:Date.now()};c.push(w),-1===o&&(o=setInterval(u,100))}s[_]=v},_getFontFamily:function(t){var e=t.lastIndexOf(".ttf");if(-1===e)return t;var i,n=t.lastIndexOf("/");return-1!==(i=-1===n?t.substring(0,e)+"_LABEL":t.substring(n+1,e)+"_LABEL").indexOf(" ")&&(i='"'+i+'"'),i}};e.exports=f}),{"../utils/text-utils":249}],49:[(function(t,e){"use strict";var i,n=t("./shared").bundles,r={decodeUuid:t("../utils/decode-uuid"),getUuidFromURL:(i=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]{8,})/,function(t){var e=t.match(i);return e?e[1]:""}),getUrlWithUuid:function(t,e){(e=e||Object.create(null)).__isNative__=e.isNative,e.ext=e.nativeExt;var i=n.find((function(e){return e.getAssetInfo(t)}));return i&&(e.bundle=i.name),cc.assetManager._transform(t,e)},isScene:function(t){return t&&(t.constructor===cc.SceneAsset||t instanceof cc.Scene)},normalize:function(t){return t&&(46===t.charCodeAt(0)&&47===t.charCodeAt(1)?t=t.slice(2):47===t.charCodeAt(0)&&(t=t.slice(1))),t}};e.exports=r}),{"../utils/decode-uuid":238,"./shared":58}],50:[(function(t){"use strict";t("./deprecated"),t("./CCAssetManager")}),{"./CCAssetManager":33,"./deprecated":39}],51:[(function(t,e){"use strict";var i=t("./pack-manager"),n=t("./pipeline"),r=t("./parser"),a=t("./utilities"),s=a.getDepends,o=a.cache,c=a.gatherAsset,l=a.setProperties,h=a.forEach,u=a.clear,f=a.checkCircleReference,_=t("./shared"),d=_.assets,p=_.files,m=_.parsed,v=_.pipeline,g=t("./task"),y=new n("loadOneAsset",[function(t,e){var n=t.output=t.input,r=n.options,a=n.isNative,s=n.uuid,o=n.file,c=r.reload;if(o||!c&&!a&&d.has(s))return e();i.load(n,t.options,(function(t,i){n.file=i,e(t)}))},function(t,e){var i=t.output=t.input,n=t.progress,a=t.options.__exclude__,s=i.id,o=i.file,c=i.options;if(i.isNative)r.parse(s,o,i.ext,c,(function(r,a){if(r)return e(r);i.content=a,n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),p.remove(s),m.remove(s),e()}));else{var l=i.uuid;if(l in a){var h=a[l],u=h.finish,_=h.content,v=h.err,g=h.callbacks;n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),u||f(l,l,a)?(_&&_.addRef&&_.addRef(),i.content=_,e(v)):g.push({done:e,item:i})}else if(!c.reload&&d.has(l)){var y=d.get(l);c.__asyncLoadAssets__||!y.__asyncLoadAssets__?(i.content=y.addRef(),n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),e()):T(t,y,e,!1)}else r.parse(s,o,"import",c,(function(i,n){if(i)return e(i);n._uuid=l,T(t,n,e,!0)}))}}]);function T(t,e,i,n){var r=t.input,a=t.progress,c=r.uuid,h=r.id,u=r.options,f=r.config,_=u.__asyncLoadAssets__,d=u.cacheAsset,y=[];e.addRef&&e.addRef(),s(c,e,Object.create(null),y,!1,_,f),a.canInvoke&&t.dispatch("progress",++a.finish,a.total+=y.length,r);var T=t.options.__exclude__[c]={content:e,finish:!1,callbacks:[{done:i,item:r}]},A=g.create({input:y,options:t.options,onProgress:t.onProgress,onError:g.prototype.recycle,progress:a,onComplete:function(t){if(e.decRef&&e.decRef(!1),e.__asyncLoadAssets__=_,T.finish=!0,T.err=t,!t){for(var i=Array.isArray(A.output)?A.output:[A.output],r=Object.create(null),a=0,s=i.length;a<s;a++){var u=i[a];u&&(r[u instanceof cc.Asset?u._uuid+"@import":c+"@native"]=u)}if(n){if(!l(c,e,r)&&!e.__onLoadInvoked__)try{e.onLoad&&e.onLoad(),e.__onLoadInvoked__=!0}catch(b){cc.error(b.message,b.stack)}p.remove(h),m.remove(h),o(c,e,void 0!==d?d:cc.assetManager.cacheAsset)}else if(e.__nativeDepend__&&!e._nativeAsset&&!l(c,e,r)&&!e.__onLoadInvoked__)try{e.onLoad&&e.onLoad(),e.__onLoadInvoked__=!0}catch(b){cc.error(b.message,b.stack)}A.recycle()}for(var f=T.callbacks,v=0,g=f.length;v<g;v++){var y=f[v];e.addRef&&e.addRef(),y.item.content=e,y.done(t)}f.length=0}});v.async(A)}e.exports=function(t,e){var i=!1;t.progress||(t.progress={finish:0,total:t.input.length,canInvoke:!0},i=!0);var n=t.options,r=t.progress;n.__exclude__=n.__exclude__||Object.create(null),t.output=[],h(t.input,(function(a,s){var o=g.create({input:a,onProgress:t.onProgress,options:n,progress:r,onComplete:function(n,a){n&&!t.isFinish&&(!cc.assetManager.force||i?(cc.error(n.message,n.stack),r.canInvoke=!1,e(n)):r.canInvoke&&t.dispatch("progress",++r.finish,r.total,a)),t.output.push(a),o.recycle(),s()}});y.async(o)}),(function(){if(n.__exclude__=null,t.isFinish)return u(t,!0),t.dispatch("error");c(t),u(t,!0),e()}))}}),{"./pack-manager":52,"./parser":53,"./pipeline":54,"./shared":58,"./task":59,"./utilities":61}],52:[(function(t,e){"use strict";var i=t("../platform/deserialize-compiled"),n=t("./downloader"),r=t("./cache"),a=t("../platform/js"),s=t("./shared").files,o=new r;function c(t){return o.has(t.uuid)}var l={unpackJson:function(t,e,n,r){var s=a.createMap(!0),o=null;if(Array.isArray(e)){(e=(0,i.unpackJSONs)(e)).length!==t.length&&cc.errorID(4915);for(var c=0;c<t.length;c++)s[t[c]+"@import"]=e[c]}else{var l=a._getClassId(cc.Texture2D);if(e.type===l){if(e.data){var h=e.data.split("|");h.length!==t.length&&cc.errorID(4915);for(var u=0;u<t.length;u++)s[t[u]+"@import"]=(0,i.packCustomObjData)(l,h[u],!0)}}else o=new Error("unmatched type pack!"),s=null}r&&r(o,s)},init:function(){o.clear()},register:function(t,e){"object"==typeof t?a.mixin(h,t):h[t]=e},unpack:function(t,e,i,n,r){e?(0,h[i])(t,e,n,r):r&&r(new Error("package data is wrong!"))},load:function(t,e,i){if(t.isNative||!t.info||!t.info.packs)return n.download(t.id,t.url,t.ext,t.options,i);if(s.has(t.id))return i(null,s.get(t.id));var r=t.info.packs,a=r.find(c);if(a)return o.get(a.uuid).push({onComplete:i,id:t.id});a=r[0],o.add(a.uuid,[{onComplete:i,id:t.id}]);var h=cc.assetManager._transform(a.uuid,{ext:a.ext,bundle:t.config.name});n.download(a.uuid,h,a.ext,t.options,(function(e,i){s.remove(a.uuid),e&&cc.error(e.message,e.stack),l.unpack(a.packs,i,a.ext,t.options,(function(t,e){if(t)t.message="unpack "+h+" failed! details: "+t.message;else for(var i in e)s.add(i,e[i]);for(var n=o.remove(a.uuid),r=0,c=n.length;r<c;r++){var l=n[r];if(t)l.onComplete(t);else{var u=e[l.id];u?l.onComplete(null,u):l.onComplete(new Error("can not retrieve data from package"))}}}))}))}},h={".json":l.unpackJson};e.exports=l}),{"../platform/deserialize-compiled":183,"../platform/js":189,"./cache":36,"./downloader":45,"./shared":58}],53:[(function(t,e){"use strict";var i=t("../platform/CCSAXParser").plistParser,n=t("../platform/js"),r=t("./deserialize"),a=t("./cache"),s=t("./helper").isScene,o=t("./shared"),c=o.parsed,l=o.files,h=t("../platform/CCSys"),u=h.__audioSupport,f=h.capabilities,_=new a,d={parseImage:function(t,e,i){if(f.imageBitmap&&t instanceof Blob){var n={};n.imageOrientation=e.__flipY__?"flipY":"none",n.premultiplyAlpha=e.__premultiplyAlpha__?"premultiply":"none",createImageBitmap(t,n).then((function(t){t.flipY=!!e.__flipY__,t.premultiplyAlpha=!!e.__premultiplyAlpha__,i&&i(null,t)}),(function(t){i&&i(t,null)}))}else i&&i(null,t)},parseAudio:function(t,e,i){t instanceof ArrayBuffer?u.context.decodeAudioData(t,(function(t){i&&i(null,t)}),(function(t){i&&i(t,null)})):i&&i(null,t)},parsePVRTex:function(t,e,i){var n=null,r=null;try{var a=t instanceof ArrayBuffer?t:t.buffer,s=new Int32Array(a,0,13);if(55727696!=s[0])throw new Error("Invalid magic number in PVR header");var o=s[7],c=s[6],l=s[12]+52;r={_data:new Uint8Array(a,l),_compressed:!0,width:o,height:c}}catch(h){n=h}i&&i(n,r)},parsePKMTex:(function(){function t(t,e){return t[e]<<8|t[e+1]}return function(e,i,n){var r=null,a=null;try{var s=e instanceof ArrayBuffer?e:e.buffer,o=new Uint8Array(s),c=t(o,6);if(0!==c&&1!==c&&3!==c)return new Error("Invalid magic number in ETC header");var l=t(o,12),h=t(o,14);t(o,8),t(o,10),a={_data:new Uint8Array(s,16),_compressed:!0,width:l,height:h}}catch(u){r=u}n&&n(r,a)}})(),parseASTCTex:(function(){function t(t,e){return 4===t?cc.Texture2D.PixelFormat.RGBA_ASTC_4x4:5===t?4===e?cc.Texture2D.PixelFormat.RGBA_ASTC_5x4:cc.Texture2D.PixelFormat.RGBA_ASTC_5x5:6===t?5===e?cc.Texture2D.PixelFormat.RGBA_ASTC_6x5:cc.Texture2D.PixelFormat.RGBA_ASTC_6x6:8===t?5===e?cc.Texture2D.PixelFormat.RGBA_ASTC_8x5:6===e?cc.Texture2D.PixelFormat.RGBA_ASTC_8x6:cc.Texture2D.PixelFormat.RGBA_ASTC_8x8:10===t?5===e?cc.Texture2D.PixelFormat.RGBA_ASTC_10x5:6===e?cc.Texture2D.PixelFormat.RGBA_ASTC_10x6:8===e?cc.Texture2D.PixelFormat.RGBA_ASTC_10x8:cc.Texture2D.PixelFormat.RGBA_ASTC_10x10:10===e?cc.Texture2D.PixelFormat.RGBA_ASTC_12x10:cc.Texture2D.PixelFormat.RGBA_ASTC_12x12}return function(e,i,n){var r=null,a=null;try{var s=e instanceof ArrayBuffer?e:e.buffer,o=new Uint8Array(s);if(1554098963!==o[0]+(o[1]<<8)+(o[2]<<16)+(o[3]<<24))return new Error("Invalid magic number in ASTC header");var c=o[4],l=o[5],h=o[6];if((c<3||c>6||l<3||l>6||h<3||h>6)&&(c<4||7===c||9===c||11===c||c>12||l<4||7===l||9===l||11===l||l>12||1!==h))return new Error("Invalid block number in ASTC header");var u=t(c,l),f=o[7]+(o[8]<<8)+(o[9]<<16),_=o[10]+(o[11]<<8)+(o[12]<<16);o[13],o[14],o[15],a={_data:new Uint8Array(s,16),_compressed:!0,width:f,height:_,format:u}}catch(d){r=d}n(r,a)}})(),parsePlist:function(t,e,n){var r=null,a=i.parse(t);a||(r=new Error("parse failed")),n&&n(r,a)},parseImport:function(t,e,i){if(!t)return i&&i(new Error("Json is empty"));var n,a=null;try{n=r(t,e)}catch(s){a=s}i&&i(a,n)},init:function(){_.clear()},register:function(t,e){"object"==typeof t?n.mixin(p,t):p[t]=e},parse:function(t,e,i,n,r){var a,o,h;(a=c.get(t))?r(null,a):(o=_.get(t))?o.push(r):(h=p[i])?(_.add(t,[r]),h(e,n,(function(e,i){e?l.remove(t):s(i)||c.add(t,i);for(var n=_.remove(t),r=0,a=n.length;r<a;r++)n[r](e,i)}))):r(null,e)}},p={".png":d.parseImage,".jpg":d.parseImage,".bmp":d.parseImage,".jpeg":d.parseImage,".gif":d.parseImage,".ico":d.parseImage,".tiff":d.parseImage,".webp":d.parseImage,".image":d.parseImage,".pvr":d.parsePVRTex,".pkm":d.parsePKMTex,".astc":d.parseASTCTex,".mp3":d.parseAudio,".ogg":d.parseAudio,".wav":d.parseAudio,".m4a":d.parseAudio,".plist":d.parsePlist,import:d.parseImport};e.exports=d}),{"../platform/CCSAXParser":175,"../platform/CCSys":177,"../platform/js":189,"./cache":36,"./deserialize":40,"./helper":49,"./shared":58}],54:[(function(t,e){"use strict";var i=t("./task"),n=0;function r(t,e){if(Array.isArray(e)){this.id=n++,this.name=t,this.pipes=[];for(var i=0,r=e.length;i<r;i++)"function"==typeof e[i]&&this.pipes.push(e[i])}else cc.warn("funcs must be an array")}r.prototype={constructor:r,insert:function(t,e){if(!("function"!=typeof t||e>this.pipes.length))return this.pipes.splice(e,0,t),this;cc.warnID(4921)},append:function(t){if("function"==typeof t)return this.pipes.push(t),this},remove:function(t){if("number"==typeof t)return this.pipes.splice(t,1),this},sync:function(t){var e=this.pipes;if(t instanceof i&&0!==e.length){null!=t.output&&(t.input=t.output,t.output=null),t._isFinish=!1;for(var n=0,r=e.length;n<r;){var a=(0,e[n])(t);if(a)return t._isFinish=!0,a;++n!==r&&(t.input=t.output,t.output=null)}return t._isFinish=!0,t.output}},async:function(t){var e=this.pipes;t instanceof i&&0!==e.length&&(null!=t.output&&(t.input=t.output,t.output=null),t._isFinish=!1,this._flow(0,t))},_flow:function(t,e){var i=this;(0,this.pipes[t])(e,(function(n){n?(e._isFinish=!0,e.onComplete&&e.onComplete(n)):++t<i.pipes.length?(e.input=e.output,e.output=null,i._flow(t,e)):(e._isFinish=!0,e.onComplete&&e.onComplete(n,e.output))}))}},e.exports=r}),{"./task":59}],55:[(function(t,e){"use strict";var i=t("./task"),n=t("./shared"),r=n.transformPipeline,a=n.RequestType;e.exports=function(t,e){var n=t.options,s=Object.create(null),o=Object.create(null);for(var c in n)switch(c){case a.PATH:case a.UUID:case a.DIR:case a.SCENE:case a.URL:break;case"__requestType__":case"__isNative__":case"ext":case"type":case"__nativeName__":case"audioLoadMode":case"bundle":s[c]=n[c];break;case"__exclude__":case"__outputAsArray__":o[c]=n[c];break;default:s[c]=n[c],o[c]=n[c]}t.options=o;var l=i.create({input:t.input,options:s}),h=null;try{t.output=t.source=r.sync(l)}catch(_){h=_;for(var u=0,f=l.output.length;u<f;u++)l.output[u].recycle()}l.recycle(),e(h)}}),{"./shared":58,"./task":59}],56:[(function(t,e){"use strict";var i=t("./depend-util"),n=t("./cache");t("../assets/CCAsset");var r=t("./shared").assets,a=t("../platform/utils").callInNextTick;function s(t,e){t._uuid&&e.push(t._uuid)}function o(t,e){for(var i=Object.getOwnPropertyNames(t),n=0;n<i.length;n++){var r=i[n];if("node"!==r&&"__eventTargets"!==r){var a=t[r];if("object"==typeof a&&a)if(Array.isArray(a))for(var o=0;o<a.length;o++){var c=a[o];c instanceof cc.Asset&&s(c,e)}else if(a.constructor&&a.constructor!==Object)a instanceof cc.Asset&&s(a,e);else for(var l=Object.getOwnPropertyNames(a),h=0;h<l.length;h++){var u=a[l[h]];u instanceof cc.Asset&&s(u,e)}}}}var c=[];function l(t,e){for(var i=0;i<t._components.length;i++)o(t._components[i],e);for(var n=0;n<t._children.length;n++)l(t._children[n],e)}function h(t,e,n,a){n.push(t._uuid);for(var s=i.getDeps(t._uuid),o=0,c=s.length;o<c;o++){var l=r.get(s[o]);if(l){var u=l._uuid;if(u in e?e[u]+=a:e[u]=l.refCount+a,n.includes(u))continue;h(l,e,n,a)}}}function u(t){var e=Object.create(null);if(e[t._uuid]=t.refCount,h(t,e,c,-1),c.length=0,0!==e[t._uuid])return e[t._uuid];for(var i in e)0!==e[i]&&h(r.get(i),e,c,1);return c.length=0,e[t._uuid]}var f=new n,_=new n,d=!1;function p(){d=!1,_.forEach((function(t){m._free(t)})),_.clear()}var m={init:function(){f.clear(),_.clear()},_addPersistNodeRef:function(t){var e=[];l(t,e);for(var i=0,n=e.length;i<n;i++){var a=r.get(e[i]);a&&a.addRef()}f.add(t.uuid,e)},_removePersistNodeRef:function(t){if(f.has(t.uuid)){for(var e=f.get(t.uuid),i=0,n=e.length;i<n;i++){var a=r.get(e[i]);a&&a.decRef()}f.remove(t.uuid)}},_autoRelease:function(t,e,n){if(t){for(var a=i.getDeps(t._id),s=0,o=a.length;s<o;s++){var c=r.get(a[s]);c&&c.decRef(t.autoReleaseAssets)}var l=i._depends.get(t._id);if(l&&l.persistDeps)for(var h=l.persistDeps,u=0,_=h.length;u<_;u++){var d=r.get(h[u]);d&&d.decRef(t.autoReleaseAssets)}t._id!==e._id&&i.remove(t._id)}var p=i._depends.get(e._id);for(var m in p&&(p.persistDeps=[]),n){for(var v=n[m],g=f.get(v.uuid),y=0,T=g.length;y<T;y++){var A=r.get(g[y]);A&&A.addRef()}p&&p.persistDeps.push.apply(p.persistDeps,g)}},_free:function(t,e){if(_.remove(t._uuid),cc.isValid(t,!0)&&!(!e&&t.refCount>0&&u(t)>0)){r.remove(t._uuid);for(var n=i.getDeps(t._uuid),a=0,s=n.length;a<s;a++){var o=r.get(n[a]);o&&(o.decRef(!1),m._free(o,!1))}t.destroy(),i.remove(t._uuid)}},tryRelease:function(t,e){t instanceof cc.Asset&&(e?m._free(t,e):(_.add(t._uuid,t),d||(d=!0,a(p))))}};e.exports=m}),{"../assets/CCAsset":62,"../platform/utils":192,"./cache":36,"./depend-util":38,"./shared":58}],57:[(function(t,e){"use strict";var i=[];function n(){this._id="",this.uuid="",this.url="",this.ext=".json",this.content=null,this.file=null,this.info=null,this.config=null,this.isNative=!1,this.options=Object.create(null)}n.prototype={constructor:n,get id(){return this._id||(this._id=this.uuid+"@"+(this.isNative?"native":"import")),this._id},recycle:function(){500!==i.length&&(this._id="",this.uuid="",this.url="",this.ext=".json",this.content=null,this.file=null,this.info=null,this.config=null,this.isNative=!1,this.options=Object.create(null),i.push(this))}},n.create=function(){return 0!==i.length?i.pop():new n},e.exports=n}),{}],58:[(function(t,e){"use strict";var i=t("./cache"),n=t("./pipeline"),r=new i,a=new i,s=new i,o=new i,c=new n("normal load",[]),l=new n("fetch",[]),h=new n("transform url",[]);e.exports={assets:r,files:a,parsed:s,pipeline:c,fetchPipeline:l,transformPipeline:h,RequestType:{UUID:"uuid",PATH:"path",DIR:"dir",URL:"url",SCENE:"scene"},bundles:o,BuiltinBundleName:{RESOURCES:"resources",INTERNAL:"internal",MAIN:"main",START_SCENE:"start-scene"}}}),{"./cache":36,"./pipeline":54}],59:[(function(t,e){"use strict";var i=0,n=[];function r(t){this.id=i++,this._isFinish=!0,this.onComplete=null,this.onProgress=null,this.onError=null,this.source=null,this.output=null,this.input=null,this.progress=null,this.options=null,this.set(t)}r.prototype={constructor:r,set:function(t){t=t||Object.create(null),this.onComplete=t.onComplete,this.onProgress=t.onProgress,this.onError=t.onError,this.source=this.input=t.input,this.output=null,this.progress=t.progress,this.options=t.options||Object.create(null)},dispatch:function(t,e,i,n,r){switch(t){case"complete":this.onComplete&&this.onComplete(e,i,n,r);break;case"progress":this.onProgress&&this.onProgress(e,i,n,r);break;case"error":this.onError&&this.onError(e,i,n,r);break;default:var a="on"+t[0].toUpperCase()+t.substr(1);"function"==typeof this[a]&&this[a](e,i,n,r)}},recycle:function(){500!==n.length&&(this.onComplete=null,this.onProgress=null,this.onError=null,this.source=this.output=this.input=null,this.progress=null,this.options=null,n.push(this))},get isFinish(){return this._isFinish}},r.create=function(t){var e=null;return 0!==n.length?(e=n.pop()).set(t):e=new r(t),e},e.exports=r}),{}],60:[(function(t,e){"use strict";var i=t("./helper").decodeUuid,n=t("./request-item"),r=t("./shared"),a=r.RequestType,s=r.bundles;e.exports={parse:function(t){var e=t.input,r=t.options;e=Array.isArray(e)?e:[e],t.output=[];for(var o=0;o<e.length;o++){var c=e[o],l=n.create();if("string"==typeof c&&((c=Object.create(null))[r.__requestType__||a.UUID]=e[o]),"object"==typeof c)for(var h in cc.js.addon(c,r),c.preset&&cc.js.addon(c,cc.assetManager.presets[c.preset]),c){switch(h){case a.UUID:var u=l.uuid=i(c.uuid);if(s.has(c.bundle)){if((p=(m=s.get(c.bundle)._config).getAssetInfo(u))&&p.redirect){if(!s.has(p.redirect))throw new Error("Please load bundle "+p.redirect+" first");p=(m=s.get(p.redirect)._config).getAssetInfo(u)}l.config=m,l.info=p}l.ext=c.ext||".json";break;case"__requestType__":case"ext":case"bundle":case"preset":case"type":break;case a.DIR:if(s.has(c.bundle)){var f=[];s.get(c.bundle)._config.getDirWithPath(c.dir,c.type,f);for(var _=0,d=f.length;_<d;_++){var p=f[_];e.push({uuid:p.uuid,__isNative__:!1,ext:".json",bundle:c.bundle})}}l.recycle(),l=null;break;case a.PATH:if(s.has(c.bundle)){if((p=(m=s.get(c.bundle)._config).getInfoWithPath(c.path,c.type))&&p.redirect){if(!s.has(p.redirect))throw new Error("you need to load bundle "+p.redirect+" first");p=(m=s.get(p.redirect)._config).getAssetInfo(p.uuid)}if(!p)throw l.recycle(),new Error("Bundle "+c.bundle+" doesn't contain "+c.path);l.config=m,l.uuid=p.uuid,l.info=p}l.ext=c.ext||".json";break;case a.SCENE:if(s.has(c.bundle)){var m;if((p=(m=s.get(c.bundle)._config).getSceneInfo(c.scene))&&p.redirect){if(!s.has(p.redirect))throw new Error("you need to load bundle "+p.redirect+" first");p=(m=s.get(p.redirect)._config).getAssetInfo(p.uuid)}if(!p)throw l.recycle(),new Error("Bundle "+m.name+" doesn't contain scene "+c.scene);l.config=m,l.uuid=p.uuid,l.info=p}break;case"__isNative__":l.isNative=c.__isNative__;break;case a.URL:l.url=c.url,l.uuid=c.uuid||c.url,l.ext=c.ext||cc.path.extname(c.url),l.isNative=void 0===c.__isNative__||c.__isNative__;break;default:l.options[h]=c[h]}if(!l)break}if(l&&(t.output.push(l),!l.uuid&&!l.url))throw new Error("Can not parse this input:"+JSON.stringify(c))}return null},combine:function(t){for(var e=t.output=t.input,i=0;i<e.length;i++){var n=e[i];if(!n.url){var r,a,s=n.config;a=n.isNative?s&&s.nativeBase?s.base+s.nativeBase:cc.assetManager.generalNativeBase:s&&s.importBase?s.base+s.importBase:cc.assetManager.generalImportBase;var o=n.uuid,c="";n.info&&(c=n.isNative?n.info.nativeVer?"."+n.info.nativeVer:"":n.info.ver?"."+n.info.ver:""),r=".ttf"===n.ext?a+"/"+o.slice(0,2)+"/"+o+c+"/"+n.options.__nativeName__:a+"/"+o.slice(0,2)+"/"+o+c+n.ext,n.url=r}}return null}}}),{"./helper":49,"./request-item":57,"./shared":58}],61:[(function(t,e){"use strict";var i=t("./depend-util"),n=t("./helper"),r=n.isScene,a=n.decodeUuid,s=t("./shared").assets,o=t("../platform/utils").callInNextTick;t("../assets/CCAsset");var c={processOptions:function(t){var e=t.uuids,i=t.paths,n=t.types,r=t.deps,s=t.paths=Object.create(null);if(!1===t.debug){for(var o=0,c=e.length;o<c;o++)e[o]=a(e[o]);for(var l in i){var h=i[l],u=h[1];h[1]=n[u]}}else{for(var f=Object.create(null),_=0,d=e.length;_<d;_++){var p=e[_];e[_]=f[p]=a(p)}e=f}for(var m in i){var v=i[m];s[e[m]]=v}var g=t.scenes;for(var y in g){var T=g[y];g[y]=e[T]}var A=t.packs;for(var b in A)for(var E=A[b],C=0;C<E.length;++C)E[C]=e[E[C]];var x=t.versions;if(x)for(var S in x)for(var w=x[S],D=0;D<w.length;D+=2){var M=w[D];w[D]=e[M]||M}var R=t.redirect;if(R)for(var I=0;I<R.length;I+=2)R[I]=e[R[I]],R[I+1]=r[R[I+1]]},clear:function(t,e){for(var i=0,n=t.input.length;i<n;i++){var r=t.input[i];e&&!r.isNative&&r.content&&r.content.decRef&&r.content.decRef(!1),r.recycle()}t.input=null},urlAppendTimestamp:function(t){return cc.assetManager.downloader.appendTimeStamp&&"string"==typeof t?/\?/.test(t)?t+"&_t="+(new Date-0):t+"?_t="+(new Date-0):t},retry:function(t,e,i,n,r){t(r=r||0,(function(a,s){r++,!a||r>e?n&&n(a,s):setTimeout((function(){c.retry(t,e,i,n,r)}),i)}))},getDepends:function(t,e,n,r,a,s,o){try{var c=i.parse(t,e),l=!0;if(e instanceof cc.Asset&&(!e.__nativeDepend__||e._nativeAsset)&&(l=!1),a){for(var h=0,u=c.deps.length;h<u;h++){var f=c.deps[h];f in n||(n[f]=!0,r.push({uuid:f,bundle:o&&o.name}))}l&&c.nativeDep&&(o&&(c.nativeDep.bundle=o.name),r.push(Object.assign({},c.nativeDep)))}else{s=!!e.asyncLoadAssets||s&&!c.preventDeferredLoadDependents;for(var _=0,d=c.deps.length;_<d;_++){var p=c.deps[_];p in n||(n[p]=!0,r.push({uuid:p,__asyncLoadAssets__:s,bundle:o&&o.name}))}l&&!s&&!c.preventPreloadNativeObject&&c.nativeDep&&(o&&(c.nativeDep.bundle=o.name),r.push(Object.assign({},c.nativeDep)))}}catch(m){cc.error(m.message,m.stack)}},cache:function(t,e,i){e&&(!r(e)&&i&&s.add(t,e))},setProperties:function(t,e,i){var n=!1,r=e.__depends__;if(r){for(var a=0,s=r.length;a<s;a++){var o=r[a],c=i[o.uuid+"@import"];c?o.owner[o.prop]=c.addRef():(cc.error("The asset "+o.uuid+" is missing!"),n=!0)}e.__depends__=void 0}return e.__nativeDepend__&&(e._nativeAsset||(i[t+"@native"]?e._nativeAsset=i[t+"@native"]:n=!0),e.__nativeDepend__=void 0),n},gatherAsset:function(t){var e=t.source;if(t.options.__outputAsArray__||1!==e.length)for(var i=t.output=[],n=0,r=e.length;n<r;n++)i.push(e[n].content);else t.output=e[0].content},forEach:function(t,e,i){var n=0,r=[];0===t.length&&i&&i(r);for(var a=0,s=t.length;a<s;a++)e(t[a],(function(t){t&&r.push(t),++n===s&&i&&i(r)}))},parseParameters:function(t,e,i){if(void 0===i){var n="function"==typeof t;e?(i=e,n||(e=null)):void 0===e&&n&&(i=t,t=null,e=null),void 0!==e&&n&&(e=t,t=null)}return{options:t=t||Object.create(null),onProgress:e,onComplete:i}},parseLoadResArgs:function(t,e,i){if(void 0===i){var n=cc.js.isChildClassOf(t,cc.Asset);e?(i=e,n&&(e=null)):void 0!==e||n||(i=t,e=null,t=null),void 0===e||n||(e=t,t=null)}return{type:t,onProgress:e,onComplete:i}},checkCircleReference:function(t,e,n,r){if(r||(r=Object.create(null)),!n[e]||r[e])return!1;r[e]=!0;var a=!1,s=i.getDeps(e);if(s)for(var o=0,l=s.length;o<l;o++){var h=s[o];if(h===t||c.checkCircleReference(t,h,n,r)){a=!0;break}}return a},asyncify:function(t){return function(e,i){if(t){var n=[];Array.isArray(i)?i.forEach((function(t){return t instanceof cc.Asset&&n.push(t.addRef())})):i instanceof cc.Asset&&n.push(i.addRef()),o((function(){n.forEach((function(t){return t.decRef(!1)})),t(e,i)}))}}}};e.exports=c}),{"../assets/CCAsset":62,"../platform/utils":192,"./depend-util":38,"./helper":49,"./shared":58}],62:[(function(t,e){"use strict";var i=t("../platform/CCObject");cc.Asset=cc.Class({name:"cc.Asset",extends:i,ctor:function(){Object.defineProperty(this,"_uuid",{value:"",writable:!0}),this.loaded=!0,this._nativeUrl="",this._ref=0},properties:{nativeUrl:{get:function(){if(!this._nativeUrl&&this._native){var t=this._native;if(47===t.charCodeAt(0))return t.slice(1);46===t.charCodeAt(0)?this._nativeUrl=cc.assetManager.utils.getUrlWithUuid(this._uuid,{nativeExt:t,isNative:!0}):this._nativeUrl=cc.assetManager.utils.getUrlWithUuid(this._uuid,{__nativeName__:t,nativeExt:cc.path.extname(t),isNative:!0})}return this._nativeUrl},visible:!1},refCount:{get:function(){return this._ref}},_native:"",_nativeAsset:{get:function(){return this._$nativeAsset},set:function(t){this._$nativeAsset=t}},_nativeDep:{get:function(){if(this._native)return{__isNative__:!0,uuid:this._uuid,ext:this._native}}}},statics:{deserialize:!1,preventDeferredLoadDependents:!1,preventPreloadNativeObject:!1},toString:function(){return this.nativeUrl},serialize:!1,createNode:null,_setRawAsset:function(t,e){this._native=!1!==e?t||void 0:"/"+t},addRef:function(){return this._ref++,this},decRef:function(t){return this._ref>0&&this._ref--,!1!==t&&cc.assetManager._releaseManager.tryRelease(this),this},destroy:function(){return this.loaded=!1,this._super()}}),e.exports=cc.Asset}),{"../platform/CCObject":174}],63:[(function(t,e){"use strict";var i=t("./CCAsset"),n=t("../event/event-target"),r=cc.Enum({WEB_AUDIO:0,DOM_AUDIO:1}),a=cc.Class({name:"cc.AudioClip",extends:i,mixins:[n],ctor:function(){this._loading=!1,this.loaded=!1,this._audio=null},properties:{duration:0,loadMode:{default:r.WEB_AUDIO,type:r},_nativeAsset:{get:function(){return this._audio},set:function(t){t instanceof cc.AudioClip?this._audio=t._nativeAsset:this._audio=t,this._audio&&this.emit("load")},override:!0},_nativeDep:{get:function(){return{uuid:this._uuid,audioLoadMode:this.loadMode,ext:cc.path.extname(this._native),__isNative__:!0}},override:!0}},statics:{LoadMode:r,_loadByUrl:function(t,e){var i=cc.assetManager.assets.get(t);i?e(null,i):cc.assetManager.loadRemote(t,(function(t,i){if(t)return e(t);e(null,i)}))}},_ensureLoaded:function(t){if(this.isValid){if(this.loaded)return t&&t();if(t&&this.once("load",t),!this._loading){this._loading=!0;var e=this;cc.assetManager.postLoadNative(this,(function(){e._loading=!1,e._audio&&e.emit("load")}))}}},destroy:function(){cc.audioEngine.uncache(this),this._super()}});cc.AudioClip=a,e.exports=a}),{"../event/event-target":141,"./CCAsset":62}],64:[(function(t,e){"use strict";var i=function(){this.u=0,this.v=0,this.w=0,this.h=0,this.offsetX=0,this.offsetY=0,this.textureID=0,this.valid=!1,this.xAdvance=0},n=function(t){this._letterDefinitions={},this._texture=t};n.prototype={constructor:n,addLetterDefinitions:function(t,e){this._letterDefinitions[t]=e},cloneLetterDefinition:function(){var t={};for(var e in this._letterDefinitions){var n=new i;cc.js.mixin(n,this._letterDefinitions[e]),t[e]=n}return t},getTexture:function(){return this._texture},getLetter:function(t){return this._letterDefinitions[t]},getLetterDefinitionForChar:function(t){var e=t.charCodeAt(0);return this._letterDefinitions.hasOwnProperty(e)?this._letterDefinitions[e]:null},clear:function(){this._letterDefinitions={}}};var r=cc.Class({name:"cc.BitmapFont",extends:cc.Font,properties:{fntDataStr:{default:""},spriteFrame:{default:null,type:cc.SpriteFrame},fontSize:{default:-1},_fntConfig:null,_fontDefDictionary:null},onLoad:function(){var t=this.spriteFrame;this._fontDefDictionary||(this._fontDefDictionary=new n,t&&(this._fontDefDictionary._texture=t._texture));var e=this._fntConfig;if(e){var r=e.fontDefDictionary;for(var a in r){var s=new i,o=r[a].rect;s.offsetX=r[a].xOffset,s.offsetY=r[a].yOffset,s.w=o.width,s.h=o.height,s.u=o.x,s.v=o.y,s.textureID=0,s.valid=!0,s.xAdvance=r[a].xAdvance,this._fontDefDictionary.addLetterDefinitions(a,s)}}}});cc.BitmapFont=r,cc.BitmapFont.FontLetterDefinition=i,cc.BitmapFont.FontAtlas=n,e.exports=r}),{}],65:[(function(t,e){"use strict";var i=cc.Class({name:"cc.BufferAsset",extends:cc.Asset,ctor:function(){this._buffer=null},properties:{_nativeAsset:{get:function(){return this._buffer},set:function(t){this._buffer=t.buffer||t},override:!0},buffer:function(){return this._buffer}}});cc.BufferAsset=e.exports=i}),{}],66:[(function(t,e){"use strict";var i=cc.Class({name:"cc.Font",extends:cc.Asset});cc.Font=e.exports=i}),{}],67:[(function(t,e){"use strict";var i=cc.Class({name:"cc.JsonAsset",extends:cc.Asset,properties:{json:null}});e.exports=cc.JsonAsset=i}),{}],68:[(function(t,e){"use strict";var i=cc.Class({name:"cc.LabelAtlas",extends:cc.BitmapFont,onLoad:function(){this.spriteFrame?this._fntConfig?this._super():cc.warnID(9101,this.name):cc.warnID(9100,this.name)}});cc.LabelAtlas=i,e.exports=i}),{}],69:[(function(t,e){"use strict";var i=cc.Enum({AUTO:0,SINGLE_INSTANCE:1,MULTI_INSTANCE:2}),n=cc.Class({name:"cc.Prefab",extends:cc.Asset,ctor:function(){this._createFunction=null,this._instantiatedTimes=0},properties:{data:null,optimizationPolicy:i.AUTO,asyncLoadAssets:!1,readonly:{default:!1,editorOnly:!0}},statics:{OptimizationPolicy:i,OptimizationPolicyThreshold:3},createNode:!1,compileCreateFunction:function(){var e=t("../platform/instantiate-jit");this._createFunction=e.compile(this.data)},_doInstantiate:function(t){return this.data._prefab||cc.warnID(3700),this._createFunction||this.compileCreateFunction(),this._createFunction(t)},_instantiate:function(){var t;return t=this.data._instantiate(),++this._instantiatedTimes,t},destroy:function(){this.data&&this.data.destroy(),this._super()}});cc.Prefab=e.exports=n,cc.js.obsolete(cc,"cc._Prefab","Prefab")}),{"../platform/instantiate-jit":187}],70:[(function(t,e){"use strict";var i,n=(i=t("../../renderer/gfx"))&&i.__esModule?i:{default:i},r=t("../renderer"),a=t("./CCTexture2D"),s=cc.Enum({RB_FMT_D24S8:n.default.RB_FMT_D24S8,RB_FMT_S8:n.default.RB_FMT_S8,RB_FMT_D16:n.default.RB_FMT_D16}),o=cc.Class({name:"cc.RenderTexture",extends:a,statics:{DepthStencilFormat:s},ctor:function(){this._framebuffer=null},initWithSize:function(t,e,i){this.width=Math.floor(t||cc.visibleRect.width),this.height=Math.floor(e||cc.visibleRect.height),this._resetUnderlyingMipmaps();var a,s={colors:[this._texture]};this._depthStencilBuffer&&this._depthStencilBuffer.destroy(),i&&(a=new n.default.RenderBuffer(r.device,i,t,e),i===n.default.RB_FMT_D24S8?s.depthStencil=a:i===n.default.RB_FMT_S8?s.stencil=a:i===n.default.RB_FMT_D16&&(s.depth=a)),this._depthStencilBuffer=a,this._framebuffer&&this._framebuffer.destroy(),this._framebuffer=new n.default.FrameBuffer(r.device,t,e,s),this._packable=!1,this.loaded=!0,this.emit("load")},updateSize:function(t,e){this.width=Math.floor(t||cc.visibleRect.width),this.height=Math.floor(e||cc.visibleRect.height),this._resetUnderlyingMipmaps();var i=this._depthStencilBuffer;i&&i.update(this.width,this.height),this._framebuffer._width=t,this._framebuffer._height=e},drawTextureAt:function(t,e,i){t._image&&0!==t._image.width&&this._texture.updateSubImage({x:e,y:i,image:t._image,width:t.width,height:t.height,level:0,flipY:!1,premultiplyAlpha:t._premultiplyAlpha})},readPixels:function(t,e,i,n,r){if(!this._framebuffer||!this._texture)return t;e=e||0,i=i||0;var a=n||this.width,s=r||this.height;t=t||new Uint8Array(a*s*4);var o=cc.game._renderContext,c=o.getParameter(o.FRAMEBUFFER_BINDING);return o.bindFramebuffer(o.FRAMEBUFFER,this._framebuffer.getHandle()),o.readPixels(e,i,a,s,o.RGBA,o.UNSIGNED_BYTE,t),o.bindFramebuffer(o.FRAMEBUFFER,c),t},destroy:function(){this._super(),this._framebuffer&&(this._framebuffer.destroy(),this._framebuffer=null)}});cc.RenderTexture=e.exports=o}),{"../../renderer/gfx":290,"../renderer":199,"./CCTexture2D":77}],71:[(function(t,e){"use strict";var i=cc.Class({name:"cc.SceneAsset",extends:cc.Asset,properties:{scene:null,asyncLoadAssets:void 0}});cc.SceneAsset=i,e.exports=i}),{}],72:[(function(){"use strict";var t=cc.Class({name:"cc.Script",extends:cc.Asset});cc._Script=t;var e=cc.Class({name:"cc.JavaScript",extends:t});cc._JavaScript=e;var i=cc.Class({name:"cc.TypeScript",extends:t});cc._TypeScript=i}),{}],73:[(function(t,e){"use strict";var i=cc.Class({name:"cc.SpriteAtlas",extends:cc.Asset,properties:{_spriteFrames:{default:{}}},getTexture:function(){var t=Object.keys(this._spriteFrames);if(t.length>0){var e=this._spriteFrames[t[0]];return e?e.getTexture():null}return null},getSpriteFrame:function(t){var e=this._spriteFrames[t];return e?(e.name||(e.name=t),e):null},getSpriteFrames:function(){var t=[],e=this._spriteFrames;for(var i in e)t.push(this.getSpriteFrame(i));return t}});cc.SpriteAtlas=i,e.exports=i}),{}],74:[(function(t,e){"use strict";var i=t("../event/event-target"),n=[{u:0,v:0},{u:0,v:0},{u:0,v:0},{u:0,v:0}],r=cc.Class({name:"cc.SpriteFrame",extends:t("../assets/CCAsset"),mixins:[i],properties:{_textureSetter:{set:function(t){t&&this._texture!==t&&this._refreshTexture(t)}},insetTop:{get:function(){return this._capInsets[1]},set:function(t){this._capInsets[1]=t,this._texture&&this._calculateSlicedUV()}},insetBottom:{get:function(){return this._capInsets[3]},set:function(t){this._capInsets[3]=t,this._texture&&this._calculateSlicedUV()}},insetLeft:{get:function(){return this._capInsets[0]},set:function(t){this._capInsets[0]=t,this._texture&&this._calculateSlicedUV()}},insetRight:{get:function(){return this._capInsets[2]},set:function(t){this._capInsets[2]=t,this._texture&&this._calculateSlicedUV()}}},ctor:function(){i.call(this);var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3],a=arguments[4];this._rect=null,this.uv=[],this._texture=null,this._original=null,this._offset=null,this._originalSize=null,this._rotated=!1,this._flipX=!1,this._flipY=!1,this.vertices=null,this._capInsets=[0,0,0,0],this.uvSliced=[],void 0!==t&&this.setTexture(t,e,n,r,a)},textureLoaded:function(){return this._texture&&this._texture.loaded},onTextureLoaded:function(t,e){return this.textureLoaded()?(t.call(e),!0):(this.once("load",t,e),this.ensureLoadTexture(),!1)},isRotated:function(){return this._rotated},setRotated:function(t){this._rotated=t,this._texture&&this._calculateUV()},isFlipX:function(){return this._flipX},isFlipY:function(){return this._flipY},setFlipX:function(t){this._flipX=t,this._texture&&this._calculateUV()},setFlipY:function(t){this._flipY=t,this._texture&&this._calculateUV()},getRect:function(){return cc.rect(this._rect)},setRect:function(t){this._rect=t,this._texture&&this._calculateUV()},getOriginalSize:function(){return cc.size(this._originalSize)},setOriginalSize:function(t){this._originalSize?(this._originalSize.width=t.width,this._originalSize.height=t.height):this._originalSize=cc.size(t)},getTexture:function(){return this._texture},_textureLoadedCallback:function(){var t=this._texture;if(t){var e=t.width,i=t.height;this._rect?this._checkRect(this._texture):this._rect=cc.rect(0,0,e,i),this._originalSize||(this._originalSize=cc.size(e,i)),this._offset||(this._offset=cc.v2(0,0)),this._calculateUV(),this.emit("load")}},_refreshTexture:function(t){this._texture=t,t.loaded?this._textureLoadedCallback():t.once("load",this._textureLoadedCallback,this)},getOffset:function(){return cc.v2(this._offset)},setOffset:function(t){this._offset=cc.v2(t)},clone:function(){return new r(this._texture,this.getRect(),this._rotated,this.getOffset(),this.getOriginalSize())},setTexture:function(t,e,i,n,r){if(1!==arguments.length||t!==this._texture){if(this._rect=e||null,n?this.setOffset(n):this._offset=null,r?this.setOriginalSize(r):this._originalSize=null,this._rotated=i||!1,"string"!=typeof t)return t instanceof cc.Texture2D&&this._refreshTexture(t),!0;cc.errorID(3401)}},ensureLoadTexture:function(){this._texture&&(this._texture.loaded||(this._refreshTexture(this._texture),cc.assetManager.postLoadNative(this._texture)))},_checkRect:function(t){var e=this._rect,i=e.x,n=e.y;this._rotated?(i+=e.height,n+=e.width):(i+=e.width,n+=e.height),i>t.width&&cc.errorID(3300,t.nativeUrl+"/"+this.name,i,t.width),n>t.height&&cc.errorID(3400,t.nativeUrl+"/"+this.name,n,t.height)},_flipXY:function(t){if(this._flipX){var e=t[0];t[0]=t[1],t[1]=e,e=t[2],t[2]=t[3],t[3]=e}if(this._flipY){var i=t[0];t[0]=t[2],t[2]=i,i=t[1],t[1]=t[3],t[3]=i}},_calculateSlicedUV:function(){var t=this._rect,e=this._texture.width,i=this._texture.height,r=this._capInsets[0],a=this._capInsets[2],s=t.width-r-a,o=this._capInsets[1],c=this._capInsets[3],l=t.height-o-c,h=this.uvSliced;if(h.length=0,this._rotated){n[0].u=t.x/e,n[1].u=(t.x+c)/e,n[2].u=(t.x+c+l)/e,n[3].u=(t.x+t.height)/e,n[3].v=t.y/i,n[2].v=(t.y+r)/i,n[1].v=(t.y+r+s)/i,n[0].v=(t.y+t.width)/i,this._flipXY(n);for(var u=0;u<4;++u)for(var f=n[u],_=0;_<4;++_){var d=n[3-_];h.push({u:f.u,v:d.v})}}else{n[0].u=t.x/e,n[1].u=(t.x+r)/e,n[2].u=(t.x+r+s)/e,n[3].u=(t.x+t.width)/e,n[3].v=t.y/i,n[2].v=(t.y+o)/i,n[1].v=(t.y+o+l)/i,n[0].v=(t.y+t.height)/i,this._flipXY(n);for(var p=0;p<4;++p)for(var m=n[p],v=0;v<4;++v){var g=n[v];h.push({u:g.u,v:m.v})}}},_setDynamicAtlasFrame:function(t){t&&(this._original={_texture:this._texture,_x:this._rect.x,_y:this._rect.y},this._texture=t.texture,this._rect.x=t.x,this._rect.y=t.y,this._calculateUV())},_resetDynamicAtlasFrame:function(){this._original&&(this._rect.x=this._original._x,this._rect.y=this._original._y,this._texture=this._original._texture,this._original=null,this._texture.loaded?this._calculateUV():this.ensureLoadTexture())},_calculateUV:function(){var t=this._rect,e=this._texture,i=this.uv,n=e.width,r=e.height;if(this._rotated){var a=0===n?0:t.x/n,s=0===n?0:(t.x+t.height)/n,o=0===r?0:(t.y+t.width)/r,c=0===r?0:t.y/r;i[0]=a,i[1]=c,i[2]=a,i[3]=o,i[4]=s,i[5]=c,i[6]=s,i[7]=o}else{var l=0===n?0:t.x/n,h=0===n?0:(t.x+t.width)/n,u=0===r?0:(t.y+t.height)/r,f=0===r?0:t.y/r;i[0]=l,i[1]=u,i[2]=h,i[3]=u,i[4]=l,i[5]=f,i[6]=h,i[7]=f}if(this._flipX){var _=i[0];i[0]=i[2],i[2]=_,_=i[1],i[1]=i[3],i[3]=_,_=i[4],i[4]=i[6],i[6]=_,_=i[5],i[5]=i[7],i[7]=_}if(this._flipY){var d=i[0];i[0]=i[4],i[4]=d,d=i[1],i[1]=i[5],i[5]=d,d=i[2],i[2]=i[6],i[6]=d,d=i[3],i[3]=i[7],i[7]=d}var p=this.vertices;if(p){p.nu.length=0,p.nv.length=0;for(var m=0;m<p.u.length;m++)p.nu[m]=p.u[m]/n,p.nv[m]=p.v[m]/r}this._calculateSlicedUV()},_serialize:!1,_deserialize:function(t){var e=t.rect;e&&(this._rect=new cc.Rect(e[0],e[1],e[2],e[3])),t.offset&&this.setOffset(new cc.Vec2(t.offset[0],t.offset[1])),t.originalSize&&this.setOriginalSize(new cc.Size(t.originalSize[0],t.originalSize[1])),this._rotated=1===t.rotated,this._name=t.name;var i=t.capInsets;i&&(this._capInsets[0]=i[0],this._capInsets[1]=i[1],this._capInsets[2]=i[2],this._capInsets[3]=i[3]),this.vertices=t.vertices,this.vertices&&(this.vertices.nu=[],this.vertices.nv=[])}}),a=r.prototype;a.copyWithZone=a.clone,a.copy=a.clone,a.initWithTexture=a.setTexture,cc.SpriteFrame=r,e.exports=r}),{"../assets/CCAsset":62,"../event/event-target":141}],75:[(function(t,e){"use strict";var i=t("./CCFont"),n=cc.Class({name:"cc.TTFFont",extends:i,properties:{_fontFamily:null,_nativeAsset:{type:cc.String,get:function(){return this._fontFamily},set:function(t){this._fontFamily=t||"Arial"},override:!0},_nativeDep:{get:function(){return{uuid:this._uuid,__nativeName__:this._native,ext:cc.path.extname(this._native),__isNative__:!0}},override:!0}}});cc.TTFFont=e.exports=n}),{"./CCFont":66}],76:[(function(t,e){"use strict";var i=cc.Class({name:"cc.TextAsset",extends:cc.Asset,properties:{text:""},toString:function(){return this.text}});e.exports=cc.TextAsset=i}),{}],77:[(function(t,e){"use strict";var i,n=(i=t("../../renderer/gfx"))&&i.__esModule?i:{default:i},r=t("../event/event-target"),a=t("../renderer");t("../platform/CCClass");var s=new(t("../platform/id-generater"))("Tex"),o=1024,c=cc.Enum({RGB565:n.default.TEXTURE_FMT_R5_G6_B5,RGB5A1:n.default.TEXTURE_FMT_R5_G5_B5_A1,RGBA4444:n.default.TEXTURE_FMT_R4_G4_B4_A4,RGB888:n.default.TEXTURE_FMT_RGB8,RGBA8888:n.default.TEXTURE_FMT_RGBA8,RGBA32F:n.default.TEXTURE_FMT_RGBA32F,A8:n.default.TEXTURE_FMT_A8,I8:n.default.TEXTURE_FMT_L8,AI8:n.default.TEXTURE_FMT_L8_A8,RGB_PVRTC_2BPPV1:n.default.TEXTURE_FMT_RGB_PVRTC_2BPPV1,RGBA_PVRTC_2BPPV1:n.default.TEXTURE_FMT_RGBA_PVRTC_2BPPV1,RGB_A_PVRTC_2BPPV1:o++,RGB_PVRTC_4BPPV1:n.default.TEXTURE_FMT_RGB_PVRTC_4BPPV1,RGBA_PVRTC_4BPPV1:n.default.TEXTURE_FMT_RGBA_PVRTC_4BPPV1,RGB_A_PVRTC_4BPPV1:o++,RGB_ETC1:n.default.TEXTURE_FMT_RGB_ETC1,RGBA_ETC1:o++,RGB_ETC2:n.default.TEXTURE_FMT_RGB_ETC2,RGBA_ETC2:n.default.TEXTURE_FMT_RGBA_ETC2,RGBA_ASTC_4x4:n.default.TEXTURE_FMT_RGBA_ASTC_4X4,RGBA_ASTC_5x4:n.default.TEXTURE_FMT_RGBA_ASTC_5X4,RGBA_ASTC_5x5:n.default.TEXTURE_FMT_RGBA_ASTC_5X5,RGBA_ASTC_6x5:n.default.TEXTURE_FMT_RGBA_ASTC_6X5,RGBA_ASTC_6x6:n.default.TEXTURE_FMT_RGBA_ASTC_6X6,RGBA_ASTC_8x5:n.default.TEXTURE_FMT_RGBA_ASTC_8X5,RGBA_ASTC_8x6:n.default.TEXTURE_FMT_RGBA_ASTC_8X6,RGBA_ASTC_8x8:n.default.TEXTURE_FMT_RGBA_ASTC_8X8,RGBA_ASTC_10x5:n.default.TEXTURE_FMT_RGBA_ASTC_10X5,RGBA_ASTC_10x6:n.default.TEXTURE_FMT_RGBA_ASTC_10X6,RGBA_ASTC_10x8:n.default.TEXTURE_FMT_RGBA_ASTC_10X8,RGBA_ASTC_10x10:n.default.TEXTURE_FMT_RGBA_ASTC_10X10,RGBA_ASTC_12x10:n.default.TEXTURE_FMT_RGBA_ASTC_12X10,RGBA_ASTC_12x12:n.default.TEXTURE_FMT_RGBA_ASTC_12X12}),l=cc.Enum({REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648}),h=cc.Enum({LINEAR:9729,NEAREST:9728}),u={9728:0,9729:1},f=[],_={width:void 0,height:void 0,minFilter:void 0,magFilter:void 0,wrapS:void 0,wrapT:void 0,format:void 0,genMipmaps:void 0,images:void 0,image:void 0,flipY:void 0,premultiplyAlpha:void 0};function d(){for(var t in _)_[t]=void 0;return f.length=0,_.images=f,_}var p=cc.Class({name:"cc.Texture2D",extends:t("../assets/CCAsset"),mixins:[r],properties:{_nativeAsset:{get:function(){return this._image},set:function(t){if(t._compressed&&t._data){var e=t.format;this.initWithData(t._data,e||this._format,t.width,t.height)}else this.initWithElement(t)},override:!0},_format:c.RGBA8888,_premultiplyAlpha:!1,_flipY:!1,_minFilter:h.LINEAR,_magFilter:h.LINEAR,_mipFilter:h.LINEAR,_wrapS:l.CLAMP_TO_EDGE,_wrapT:l.CLAMP_TO_EDGE,_isAlphaAtlas:!1,_genMipmaps:!1,genMipmaps:{get:function(){return this._genMipmaps},set:function(t){if(this._genMipmaps!==t){var e=d();e.genMipmaps=t,this.update(e)}}},_packable:!0,packable:{get:function(){return this._packable},set:function(t){this._packable=t}},_nativeDep:{get:function(){return{__isNative__:!0,uuid:this._uuid,ext:this._native,__flipY__:this._flipY,__premultiplyAlpha__:this._premultiplyAlpha}},override:!0}},statics:{PixelFormat:c,WrapMode:l,Filter:h,_FilterIndex:u,extnames:[".png",".jpg",".jpeg",".bmp",".webp",".pvr",".pkm",".astc"],_parseExt:function(t,e){for(var i=cc.renderer.device,n=t.split("_"),r="",a="",s=999,o=e,l=cc.macro.SUPPORT_TEXTURE_FORMATS,h=0;h<n.length;h++){var u=n[h].split("@"),f=u[0];f=p.extnames[f.charCodeAt(0)-48]||f;var _=l.indexOf(f);if(-1!==_&&_<s){var d=u[1]?parseInt(u[1]):e;if(".astc"===f&&!i.ext("WEBGL_compressed_texture_astc"))continue;if(".pvr"===f&&!i.ext("WEBGL_compressed_texture_pvrtc"))continue;if(!(d!==c.RGB_ETC1&&d!==c.RGBA_ETC1||i.ext("WEBGL_compressed_texture_etc1")))continue;if(!(d!==c.RGB_ETC2&&d!==c.RGBA_ETC2||i.ext("WEBGL_compressed_texture_etc")))continue;if(".webp"===f&&!cc.sys.capabilities.webp)continue;s=_,a=f,o=d}else r||(r=f)}return{bestExt:a,bestFormat:o,defaultExt:r}}},ctor:function(){this._id=s.getNewId(),this.loaded=!1,this.width=0,this.height=0,this._hashDirty=!0,this._hash=0,this._texture=null},getImpl:function(){return this._texture||(this._texture=new a.Texture2D(a.device,{})),this._texture},getId:function(){return this._id},toString:function(){return this.nativeUrl||""},update:function(t){if(t){var e=!1;void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.minFilter&&(this._minFilter=t.minFilter,t.minFilter=u[t.minFilter]),void 0!==t.magFilter&&(this._magFilter=t.magFilter,t.magFilter=u[t.magFilter]),void 0!==t.mipFilter&&(this._mipFilter=t.mipFilter,t.mipFilter=u[t.mipFilter]),void 0!==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!==t.format&&(this._format=t.format),void 0!==t.flipY&&(this._flipY=t.flipY,e=!0),void 0!==t.premultiplyAlpha&&(this._premultiplyAlpha=t.premultiplyAlpha,e=!0),void 0!==t.genMipmaps&&(this._genMipmaps=t.genMipmaps),cc.sys.capabilities.imageBitmap&&this._image instanceof ImageBitmap?this._checkImageBitmap(this._upload.bind(this,t,e)):this._upload(t,e)}},_upload:function(t,e){e&&this._image&&(t.image=this._image),t.images&&t.images.length>0?this._image=t.images[0]:void 0!==t.image&&(this._image=t.image,t.images||(f.length=0,t.images=f),t.images.push(t.image)),this._texture&&this._texture.update(t),this._hashDirty=!0},initWithElement:function(t){if(t)if(this._image=t,t.complete||t instanceof HTMLCanvasElement)this.handleLoadedTexture();else if(cc.sys.capabilities.imageBitmap&&t instanceof ImageBitmap)this._checkImageBitmap(this.handleLoadedTexture.bind(this));else{var e=this;t.addEventListener("load",(function(){e.handleLoadedTexture()})),t.addEventListener("error",(function(t){cc.warnID(3119,t.message)}))}},initWithData:function(t,e,i,n){var r=d();return r.image=t,r.images=[r.image],r.genMipmaps=this._genMipmaps,r.premultiplyAlpha=this._premultiplyAlpha,r.flipY=this._flipY,r.minFilter=u[this._minFilter],r.magFilter=u[this._magFilter],r.wrapS=this._wrapS,r.wrapT=this._wrapT,r.format=this._getGFXPixelFormat(e),r.width=i,r.height=n,this._texture?this._texture.update(r):this._texture=new a.Texture2D(a.device,r),this.width=i,this.height=n,this._updateFormat(),this._checkPackable(),this.loaded=!0,this.emit("load"),!0},getHtmlElementObj:function(){return this._image},destroy:function(){cc.sys.capabilities.imageBitmap&&this._image instanceof ImageBitmap&&this._image.close&&this._image.close(),this._packable&&cc.dynamicAtlasManager&&cc.dynamicAtlasManager.deleteAtlasTexture(this),this._image=null,this._texture&&this._texture.destroy(),this._super()},getPixelFormat:function(){return this._format},hasPremultipliedAlpha:function(){return this._premultiplyAlpha||!1},isAlphaAtlas:function(){return this._isAlphaAtlas},handleLoadedTexture:function(){if(this._image&&this._image.width&&this._image.height){this.width=this._image.width,this.height=this._image.height;var t=d();t.image=this._image,t.images=[t.image],t.width=this.width,t.height=this.height,t.genMipmaps=this._genMipmaps,t.format=this._getGFXPixelFormat(this._format),t.premultiplyAlpha=this._premultiplyAlpha,t.flipY=this._flipY,t.minFilter=u[this._minFilter],t.magFilter=u[this._magFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,this._texture?this._texture.update(t):this._texture=new a.Texture2D(a.device,t),this._updateFormat(),this._checkPackable(),this.loaded=!0,this.emit("load"),cc.macro.CLEANUP_IMAGE_CACHE&&this._cleanupImageCache()}},_cleanupImageCache:function(){this._image instanceof HTMLImageElement?this._clearImage():cc.sys.capabilities.imageBitmap&&this._image instanceof ImageBitmap&&this._image.close&&this._image.close()},description:function(){return"<cc.Texture2D | Name = "+this.nativeUrl+" | Dimensions = "+this.width+" x "+this.height+">"},releaseTexture:function(){this._image=null,this._texture&&this._texture.destroy()},setWrapMode:function(t,e){if(this._wrapS!==t||this._wrapT!==e){var i=d();i.wrapS=t,i.wrapT=e,this.update(i)}},setFilters:function(t,e){if(this._minFilter!==t||this._magFilter!==e){var i=d();i.minFilter=t,i.magFilter=e,this.update(i)}},setFlipY:function(t){if(this._flipY!==t){var e=d();e.flipY=t,e.premultiplyAlpha=this._premultiplyAlpha,this.update(e)}},setPremultiplyAlpha:function(t){if(this._premultiplyAlpha!==t){var e=d();e.flipY=this._flipY,e.premultiplyAlpha=t,this.update(e)}},_updateFormat:function(){this._isAlphaAtlas=this._format===c.RGBA_ETC1||this._format===c.RGB_A_PVRTC_4BPPV1||this._format===c.RGB_A_PVRTC_2BPPV1},_checkPackable:function(){var t=cc.dynamicAtlasManager;if(t)if(this._isCompressed())this._packable=!1;else{var e=this.width,i=this.height;!this._image||e>t.maxFrameSize||i>t.maxFrameSize||this._getHash()!==t.Atlas.DEFAULT_HASH?this._packable=!1:this._image&&this._image instanceof HTMLCanvasElement&&(this._packable=!0)}},_getOpts:function(){var t=d();return t.width=this.width,t.height=this.height,t.genMipmaps=this._genMipmaps,t.format=this._format,t.premultiplyAlpha=this._premultiplyAlpha,t.anisotropy=this._anisotropy,t.flipY=this._flipY,t.minFilter=u[this._minFilter],t.magFilter=u[this._magFilter],t.mipFilter=u[this._mipFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,t},_getGFXPixelFormat:function(t){return t===c.RGBA_ETC1?t=c.RGB_ETC1:t===c.RGB_A_PVRTC_4BPPV1?t=c.RGB_PVRTC_4BPPV1:t===c.RGB_A_PVRTC_2BPPV1&&(t=c.RGB_PVRTC_2BPPV1),t},_resetUnderlyingMipmaps:function(t){var e=this._getOpts();e.images=t||[null],this._texture?this._texture.update(e):this._texture=new a.Texture2D(a.device,e)},_serialize:!1,_deserialize:function(t){var e=t.split(","),i=e[0];if(i){var n=p._parseExt(i,this._format);if(n.bestExt)this._setRawAsset(n.bestExt),this._format=n.bestFormat;else{if(!n.defaultExt)throw new Error(cc.debug.getError(3121));this._setRawAsset(n.defaultExt),cc.warnID(3120,n.defaultExt,n.defaultExt)}}8===e.length&&(this._minFilter=parseInt(e[1]),this._magFilter=parseInt(e[2]),this._wrapS=parseInt(e[3]),this._wrapT=parseInt(e[4]),this._premultiplyAlpha=49===e[5].charCodeAt(0),this._genMipmaps=49===e[6].charCodeAt(0),this._packable=49===e[7].charCodeAt(0))},_getHash:function(){if(!this._hashDirty)return this._hash;var t=this._genMipmaps?1:0,e=this._premultiplyAlpha?1:0,i=this._flipY?1:0,n=this._minFilter===h.LINEAR?1:2,r=this._magFilter===h.LINEAR?1:2,a=this._wrapS===l.REPEAT?1:this._wrapS===l.CLAMP_TO_EDGE?2:3,s=this._wrapT===l.REPEAT?1:this._wrapT===l.CLAMP_TO_EDGE?2:3,o=this._format;return this._image,this._hash=Number(""+n+r+o+a+s+t+e+i),this._hashDirty=!1,this._hash},_isCompressed:function(){return this._format<c.A8||this._format>c.RGBA32F},_clearImage:function(){this._image.src=""},_checkImageBitmap:function(t){var e=this,i=this._image,n=this._flipY,r=this._premultiplyAlpha;this._flipY!==i.flipY||this._premultiplyAlpha!==i.premultiplyAlpha?createImageBitmap(i,{imageOrientation:n!==i.flipY?"flipY":"none",premultiplyAlpha:r?"premultiply":"none"}).then((function(a){i.close&&i.close(),a.flipY=n,a.premultiplyAlpha=r,e._image=a,t()}),(function(t){cc.error(t.message)})):t()}});cc.Texture2D=e.exports=p}),{"../../renderer/gfx":290,"../assets/CCAsset":62,"../event/event-target":141,"../platform/CCClass":168,"../platform/id-generater":185,"../renderer":199}],78:[(function(t,e){"use strict";var i=t("./CCAsset"),n=t("../event/event-target"),r=cc.Class({name:"cc.VideoClip",extends:i,mixins:[n]});cc.VideoClip=r,e.exports=r}),{"../event/event-target":141,"./CCAsset":62}],79:[(function(t){"use strict";t("./CCAsset"),t("./CCFont"),t("./CCPrefab"),t("./CCAudioClip"),t("./CCVideoClip"),t("./CCScripts"),t("./CCSceneAsset"),t("./CCSpriteFrame"),t("./CCTexture2D"),t("./CCRenderTexture"),t("./CCTTFFont"),t("./CCSpriteAtlas"),t("./CCBitmapFont"),t("./CCLabelAtlas"),t("./CCTextAsset"),t("./CCJsonAsset"),t("./CCBufferAsset"),t("./material")}),{"./CCAsset":62,"./CCAudioClip":63,"./CCBitmapFont":64,"./CCBufferAsset":65,"./CCFont":66,"./CCJsonAsset":67,"./CCLabelAtlas":68,"./CCPrefab":69,"./CCRenderTexture":70,"./CCSceneAsset":71,"./CCScripts":72,"./CCSpriteAtlas":73,"./CCSpriteFrame":74,"./CCTTFFont":75,"./CCTextAsset":76,"./CCTexture2D":77,"./CCVideoClip":78,"./material":86}],80:[(function(t,e){"use strict";var i,n=(i=t("../CCAsset"))&&i.__esModule?i:{default:i},r=t("./effect-parser"),a=cc.Class({name:"cc.EffectAsset",extends:n.default,ctor:function(){this._effect=null},properties:{properties:Object,techniques:[],shaders:[]},onLoad:function(){if(cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS){for(var t=cc.renderer._forward._programLib,e=0;e<this.shaders.length;e++)t.define(this.shaders[e]);this._initEffect()}},_initEffect:function(){this._effect||(this._effect=(0,r.parseEffect)(this),Object.freeze(this._effect))},getInstantiatedEffect:function(){return this._initEffect(),this._effect.clone()},getEffect:function(){return this._initEffect(),this._effect}});e.exports=cc.EffectAsset=a}),{"../CCAsset":62,"./effect-parser":83}],81:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../CCAsset"),r=t("../CCTexture2D"),a=(r.PixelFormat,t("./CCEffectAsset")),s=(t("../../utils/texture-util"),cc.gfx),o=cc.Enum({SPRITE:"2d-sprite",GRAY_SPRITE:"2d-gray-sprite",UNLIT:"unlit"}),c=cc.Class({name:"cc.Material",extends:n,ctor:function(){this.loaded=!1,this._manualHash=!1,this._dirty=!0,this._effect=null},properties:{_defines:{default:void 0,type:Object},_props:{default:void 0,type:Object},_effectAsset:{type:a,default:null},_techniqueIndex:0,_techniqueData:Object,effectName:void 0,effectAsset:{get:function(){return this._effectAsset},set:function(t){cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS&&(this._effectAsset=t,t?this._effect=this._effectAsset.getInstantiatedEffect():cc.error("Can not set an empty effect asset."))}},effect:{get:function(){return this._effect}},techniqueIndex:{get:function(){return this._techniqueIndex},set:function(t){this._techniqueIndex=t,this._effect.switchTechnique(t)}}},statics:{getBuiltinMaterial:function(t){return cc.game.renderType===cc.game.RENDER_TYPE_CANVAS?new cc.Material:cc.assetManager.builtins.getBuiltin("material","builtin-"+t)},BUILTIN_NAME:o,createWithBuiltin:function(t,e){void 0===e&&(e=0);var i=cc.assetManager.builtins.getBuiltin("effect","builtin-"+t);return c.create(i,e)},create:function(t,e){if(void 0===e&&(e=0),!t)return null;var i=new c;return i.effectAsset=t,i.techniqueIndex=e,i}},setProperty:function(t,e,i,n){if(cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS){if("string"==typeof i&&(i=parseInt(i)),e instanceof r){var a=e.isAlphaAtlas(),s="CC_USE_ALPHA_ATLAS_"+t,o=this.getDefine(s,i);(a||o)&&this.define(s,a),e.loaded||cc.assetManager.postLoadNative(e)}this._effect.setProperty(t,e,i,n)}},getProperty:function(t,e){return"string"==typeof e&&(e=parseInt(e)),this._effect.getProperty(t,e)},define:function(t,e,i,n){cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS&&("string"==typeof i&&(i=parseInt(i)),this._effect.define(t,e,i,n))},getDefine:function(t,e){return"string"==typeof e&&(e=parseInt(e)),this._effect.getDefine(t,e)},setCullMode:function(t,e){void 0===t&&(t=s.CULL_BACK),this._effect.setCullMode(t,e)},setDepth:function(t,e,i,n){void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===i&&(i=s.DS_FUNC_LESS),this._effect.setDepth(t,e,i,n)},setBlend:function(t,e,i,n,r,a,o,c,l){void 0===t&&(t=!1),void 0===e&&(e=s.BLEND_FUNC_ADD),void 0===i&&(i=s.BLEND_SRC_ALPHA),void 0===n&&(n=s.BLEND_ONE_MINUS_SRC_ALPHA),void 0===r&&(r=s.BLEND_FUNC_ADD),void 0===a&&(a=s.BLEND_SRC_ALPHA),void 0===o&&(o=s.BLEND_ONE_MINUS_SRC_ALPHA),void 0===c&&(c=4294967295),this._effect.setBlend(t,e,i,n,r,a,o,c,l)},setStencilEnabled:function(t,e){void 0===t&&(t=s.STENCIL_INHERIT),this._effect.setStencilEnabled(t,e)},setStencil:function(t,e,i,n,r,a,o,c,l){void 0===t&&(t=s.STENCIL_INHERIT),void 0===e&&(e=s.DS_FUNC_ALWAYS),void 0===i&&(i=0),void 0===n&&(n=255),void 0===r&&(r=s.STENCIL_OP_KEEP),void 0===a&&(a=s.STENCIL_OP_KEEP),void 0===o&&(o=s.STENCIL_OP_KEEP),void 0===c&&(c=255),this._effect.setStencil(t,e,i,n,r,a,o,c,l)},updateHash:function(t){this._manualHash=t,this._effect&&this._effect.updateHash(t)},getHash:function(){return this._manualHash||this._effect&&this._effect.getHash()},onLoad:function(){if(this.effectAsset=this._effectAsset,this._effect){this._techniqueIndex&&this._effect.switchTechnique(this._techniqueIndex),this._techniqueData=this._techniqueData||{};var t=this._techniqueData;for(var e in t){var i=t[e=parseInt(e)];if(i){for(var n in i.defines)this.define(n,i.defines[n],e);for(var r in i.props)this.setProperty(r,i.props[r],e)}}}}}),l=c;i.default=l,cc.Material=c,e.exports=i.default}),{"../../utils/texture-util":250,"../CCAsset":62,"../CCTexture2D":77,"./CCEffectAsset":80}],82:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../../renderer/core/pass")),r=a(t("../../../renderer/enums"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=o(n.key,"string"))?r:String(r)),n)}var r}function o(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var c=cc.gfx,l=(function(){function t(){this._dirty=!0,this._name="",this._technique=null}var e,i,a=t.prototype;return a._createPassProp=function(t,e){var i=e._properties[t];if(i){var n=Object.create(null);return n.name=t,n.type=i.type,i.value instanceof Float32Array?n.value=new Float32Array(i.value):i.value instanceof Float64Array?n.value=new Float64Array(i.value):n.value=i.value,e._properties[t]=n,n}},a._setPassProperty=function(t,e,i,a){var s=i._properties;s.hasOwnProperty(t)||this._createPassProp(t,i);var o=s[t];if(!o)return!1;var c=e;return o.type===r.default.PARAM_TEXTURE_2D&&(c=e&&e.getImpl()),o.value===c||(this._dirty=!0,n.default.prototype.setProperty.call(i,t,e,a))},a.setProperty=function(t,e,i,n){var r=!1,a=this.passes,s=0,o=a.length;void 0!==i&&(s=i,o=i+1);for(var c=s;c<o;c++)this._setPassProperty(t,e,a[c],n)&&(r=!0);r||cc.warnID(9103,this.name,t)},a.getProperty=function(t,e){var i=this.passes;if(!(e>=i.length)){var n=0,r=i.length;void 0!==e&&(n=e,r=e+1);for(var a=n;a<r;a++){var s=i[a].getProperty(t);if(void 0!==s)return s}}},a.define=function(t,e,i,n){var r=!1,a=this.passes,s=0,o=a.length;void 0!==i&&(s=i,o=i+1);for(var c=s;c<o;c++)a[c].define(t,e,n)&&(r=!0);r||cc.warnID(9104,this.name,t)},a.getDefine=function(t,e){var i=this.passes;if(!(e>=i.length)){var n=0,r=i.length;void 0!==e&&(n=e,r=e+1);for(var a=n;a<r;a++){var s=i[a].getDefine(t);if(void 0!==s)return s}}},a.setCullMode=function(t,e){void 0===t&&(t=c.CULL_BACK);var i=this.passes,n=0,r=i.length;void 0!==e&&(n=e,r=e+1);for(var a=n;a<r;a++)i[a].setCullMode(t);this._dirty=!0},a.setDepth=function(t,e,i,n){var r=this.passes,a=0,s=r.length;void 0!==n&&(a=n,s=n+1);for(var o=a;o<s;o++)r[o].setDepth(t,e,i);this._dirty=!0},a.setBlend=function(t,e,i,n,r,a,s,o,c){var l=this.passes,h=0,u=l.length;void 0!==c&&(h=c,u=c+1);for(var f=h;f<u;f++)l[f].setBlend(t,e,i,n,r,a,s,o);this._dirty=!0},a.setStencilEnabled=function(t,e){void 0===t&&(t=c.STENCIL_INHERIT);var i=this.passes,n=0,r=i.length;void 0!==e&&(n=e,r=e+1);for(var a=n;a<r;a++)i[a].setStencilEnabled(t);this._dirty=!0},a.setStencil=function(t,e,i,n,r,a,s,o,c){var l=this.passes,h=0,u=l.length;void 0!==c&&(h=c,u=c+1);for(var f=h;f<u;f++){var _=l[f];_.setStencilFront(t,e,i,n,r,a,s,o),_.setStencilBack(t,e,i,n,r,a,s,o)}this._dirty=!0},e=t,(i=[{key:"name",get:function(){return this._name}},{key:"technique",get:function(){return this._technique}},{key:"passes",get:function(){return[]}}])&&s(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=l,cc.EffectBase=l,e.exports=i.default}),{"../../../renderer/core/pass":281,"../../../renderer/enums":285}],83:[(function(t,e,i){"use strict";i.__esModule=!0,i.parseEffect=function(t){var e=f(t);return new s.default(t.name,e,0,t)};var n=c(t("../../../renderer/core/pass")),r=t("../../../renderer/types"),a=c(t("../../../renderer/enums")),s=c(t("./effect")),o=c(t("../../../renderer/core/technique"));function c(t){return t&&t.__esModule?t:{default:t}}function l(t){return cc.renderer._forward._programLib.getTemplate(t)}function h(t,e){var i=e.properties||{},n=l(e.program),s=function(e){if(!n.uniforms.find((function(t){return t.name===e})))return cc.warnID(9107,t.name,e),"continue"};for(var o in i)s(o);var c={};return n.uniforms.forEach((function(t){var e,n=t.name,s=c[n]=Object.assign({},t),o=i[n];void 0===(e=o?o.type===a.default.PARAM_TEXTURE_2D?null:o.type===a.default.PARAM_INT||o.type===a.default.PARAM_FLOAT?Array.isArray(o.value)?o.value[0]:o.value:new Float32Array(o.value):r.enums2default[t.type])&&(e=null),s.value=e})),c}function u(t){var e={};return l(t.program).defines.forEach((function(t){e[t.name]=r.enums2default[t.type]})),e}function f(t){for(var e=t.techniques.length,i=new Array(e),r=0;r<e;++r){for(var a=t.techniques[r],s=a.name||r,c=a.passes.length,l=new Array(c),f=0;f<c;++f){var _=a.passes[f],d=_.name||f,p=t.name+"-"+s+"-"+d,m=_.stage||"opaque",v=h(t,_),g=u(_),y=l[f]=new n.default(d,p,_.program,m,v,g);_.rasterizerState&&y.setCullMode(_.rasterizerState.cullMode);var T=_.blendState&&_.blendState.targets[0];T&&y.setBlend(T.blend,T.blendEq,T.blendSrc,T.blendDst,T.blendAlphaEq,T.blendSrcAlpha,T.blendDstAlpha,T.blendColor);var A=_.depthStencilState;A&&(y.setDepth(A.depthTest,A.depthWrite,A.depthFunc),y.setStencilFront(A.stencilTest,A.stencilFuncFront,A.stencilRefFront,A.stencilMaskFront,A.stencilFailOpFront,A.stencilZFailOpFront,A.stencilZPassOpFront,A.stencilWriteMaskFront),y.setStencilBack(A.stencilTest,A.stencilFuncBack,A.stencilRefBack,A.stencilMaskBack,A.stencilFailOpBack,A.stencilZFailOpBack,A.stencilZPassOpBack,A.stencilWriteMaskBack))}i[r]=new o.default(s,l)}return i}}),{"../../../renderer/core/pass":281,"../../../renderer/core/technique":283,"../../../renderer/enums":285,"../../../renderer/types":313,"./effect":85}],84:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../../../renderer/murmurhash2_gc")),r=s(t("./utils")),a=s(t("./effect-base"));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=c(n.key,"string"))?r:String(r)),n)}var r}function c(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}cc.gfx;var h=(function(t){var e,i;function a(e){var i;return(i=t.call(this)||this)._effect=void 0,i._passes=[],i._stagePasses={},i._hash=0,i.init(e),i}i=t,(e=a).prototype=Object.create(i.prototype),e.prototype.constructor=e,l(e,i);var s,c,h=a.prototype;return h._onEffectChanged=function(){},h.init=function(t){if(t instanceof a&&(t=t.effect),this._effect=t,this._dirty=!0,t){var e=t.passes,i=this._passes;i.length=0;for(var n=this._stagePasses={},r=0;r<e.length;r++){var s=i[r]=Object.setPrototypeOf({},e[r]);s._properties=Object.setPrototypeOf({},e[r]._properties),s._defines=Object.setPrototypeOf({},e[r]._defines),n[s._stage]||(n[s._stage]=[]),n[s._stage].push(s)}}},h.updateHash=function(){},h.getHash=function(){if(!this._dirty)return this._hash;this._dirty=!1;var t="";t+=r.default.serializePasses(this._passes);var e=this._effect;return e&&(t+=r.default.serializePasses(e.passes)),this._hash=(0,n.default)(t,666),this.updateHash(this._hash),this._hash},s=a,(c=[{key:"effect",get:function(){return this._effect}},{key:"name",get:function(){return this._effect&&this._effect.name+" (variant)"}},{key:"passes",get:function(){return this._passes}},{key:"stagePasses",get:function(){return this._stagePasses}}])&&o(s.prototype,c),Object.defineProperty(s,"prototype",{writable:!1}),a})(a.default);i.default=h,cc.EffectVariant=h,e.exports=i.default}),{"../../../renderer/murmurhash2_gc":308,"./effect-base":82,"./utils":89}],85:[(function(t,e,i){"use strict";var n;function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=a(n.key,"string"))?r:String(r)),n)}var r}function a(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var o=(function(t){var e,i;function n(e,i,n,r){var a;return(a=t.call(this)||this)._techniques=[],a._asset=null,a.init(e,i,n,r,!0),a}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,s(e,i);var a,o,c=n.prototype;return c.init=function(t,e,i,n){this._name=t,this._techniques=e,this._technique=e[i],this._asset=n},c.switchTechnique=function(t){t>=this._techniques.length?cc.warn("Can not switch to technique with index ["+t+"]"):this._technique=this._techniques[t]},c.clear=function(){this._techniques=[]},c.clone=function(){for(var t=[],e=0;e<this._techniques.length;e++)t.push(this._techniques[e].clone());var i=this._techniques.indexOf(this._technique);return new n(this._name,t,i,this._asset)},a=n,(o=[{key:"technique",get:function(){return this._technique}},{key:"passes",get:function(){return this._technique.passes}}])&&r(a.prototype,o),Object.defineProperty(a,"prototype",{writable:!1}),n})(((n=t("./effect-base"))&&n.__esModule?n:{default:n}).default);i.default=o,cc.Effect=o,e.exports=i.default}),{"./effect-base":82}],86:[(function(t){"use strict";t("./CCEffectAsset"),t("./CCMaterial"),t("./material-variant")}),{"./CCEffectAsset":80,"./CCMaterial":81,"./material-variant":88}],87:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("./utils")),r=a(t("../../utils/pool"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var o=new(function(t){var e,i;function r(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).enabled=!1,e._pool={},e}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,s(e,i);var a=r.prototype;return a.get=function(t,e){var i,r=this._pool;if(t instanceof cc.MaterialVariant){if(!t._owner)return t._owner=e,t;if(t._owner===e)return t;t=t.material}if(this.enabled){var a=t.effectAsset._uuid;if(r[a]){var s=n.default.serializeDefines(t._effect._defines)+n.default.serializeTechniques(t._effect._techniques);i=r[a][s]&&r[a][s].pop()}}return i?this.count--:((i=new cc.MaterialVariant(t))._name=t._name+" (Instance)",i._uuid=t._uuid),i._owner=e,i},a.put=function(t){if(this.enabled&&t._owner){var e=this._pool,i=t.effectAsset._uuid;e[i]||(e[i]={});var r=n.default.serializeDefines(t._effect._defines)+n.default.serializeTechniques(t._effect._techniques);e[i][r]||(e[i][r]=[]),this.count>this.maxSize||(this._clean(t),e[i][r].push(t),this.count++)}},a.clear=function(){this._pool={},this.count=0},a._clean=function(t){t._owner=null},r}(r.default));r.default.register("material",o);var c=o;i.default=c,e.exports=i.default}),{"../../utils/pool":244,"./utils":89}],88:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=o(t("./CCMaterial")),a=o(t("./effect-variant")),s=o(t("./material-pool"));function o(t){return t&&t.__esModule?t:{default:t}}function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=l(n.key,"string"))?r:String(r)),n)}var r}function l(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var u=(0,cc._decorator.ccclass)("cc.MaterialVariant")(n=(function(t){var e,i,n,o;function l(e){var i;return(i=t.call(this)||this)._owner=null,i._material=null,i.init(e),i}return i=t,(e=l).prototype=Object.create(i.prototype),e.prototype.constructor=e,h(e,i),l.createWithBuiltin=function(t,e){return l.create(r.default.getBuiltinMaterial(t),e)},l.create=function(t,e){return t?s.default.get(t,e):null},l.prototype.init=function(t){this._effect=new a.default(t.effect),this._effectAsset=t._effectAsset,this._material=t},n=l,(o=[{key:"uuid",get:function(){return this._material._uuid}},{key:"owner",get:function(){return this._owner}},{key:"material",get:function(){return this._material}}])&&c(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),l})(r.default))||n;i.default=u,cc.MaterialVariant=u,e.exports=i.default}),{"./CCMaterial":81,"./effect-variant":84,"./material-pool":87}],89:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../../renderer/enums"))&&n.__esModule?n:{default:n},a=[];function s(t,e){for(var i=e.length,n=0;n<i;n++){var r=e[n];a[n]=r+t[r]}return a.length=i,a.join("")}function o(t,e){for(var i=0,n=0,s=e.length;n<s;n++){var o=t[e[n]],c=o.value;c&&(o.type===r.default.PARAM_TEXTURE_2D||o.type===r.default.PARAM_TEXTURE_CUBE?a[i]=c._id:a[i]=c.toString(),i++)}return a.length=i,a.join(";")}var c={serializeDefines:s,serializePasses:function(t){for(var e,i,n="",r=0;r<t.length;r++)n+=(void 0,i=void 0,i=(e=t[r])._programName+e._cullMode,e._blend&&(i+=e._blendEq+e._blendAlphaEq+e._blendSrc+e._blendDst+e._blendSrcAlpha+e._blendDstAlpha+e._blendColor),e._depthTest&&(i+=e._depthWrite+e._depthFunc),e._stencilTest&&(i+=e._stencilFuncFront+e._stencilRefFront+e._stencilMaskFront+e._stencilFailOpFront+e._stencilZFailOpFront+e._stencilZPassOpFront+e._stencilWriteMaskFront+e._stencilFuncBack+e._stencilRefBack+e._stencilMaskBack+e._stencilFailOpBack+e._stencilZFailOpBack+e._stencilZPassOpBack+e._stencilWriteMaskBack),i+=o(e._properties,e._propertyNames),i+=s(e._defines,e._defineNames));return n},serializeUniforms:o};i.default=c,e.exports=i.default}),{"../../../renderer/enums":285}],90:[(function(t,e){"use strict";t("../CCNode").EventType;var i=56,n=7,r=cc.Enum({ONCE:0,ON_WINDOW_RESIZE:1,ALWAYS:2});function a(t,e,i,n){for(var r=t._parent.scaleX,a=t._parent.scaleY,s=0,o=0,c=t._parent;;){if(s+=c.x,o+=c.y,!(c=c._parent))return i.x=i.y=0,void(n.x=n.y=1);if(c===e)break;var l=c.scaleX,h=c.scaleY;s*=l,o*=h,r*=l,a*=h}n.x=0!==r?1/r:1,n.y=0!==a?1/a:1,i.x=-s,i.y=-o}var s=cc.Vec2.ZERO,o=cc.Vec2.ONE;function c(t,e){var r,c,l,h=e._target;h?a(t,r=h,c=s,l=o):r=t._parent;var u,f=(u=r)instanceof cc.Scene?cc.visibleRect:u._contentSize,_=r._anchorPoint,d=r instanceof cc.Scene,p=t.x,m=t.y,v=t._anchorPoint;if(e._alignFlags&i){var g,y,T=f.width;d?(g=cc.visibleRect.left.x,y=cc.visibleRect.right.x):y=(g=-_.x*T)+T,g+=e._isAbsLeft?e._left:e._left*T,y-=e._isAbsRight?e._right:e._right*T,h&&(g+=c.x,g*=l.x,y+=c.x,y*=l.x);var A,b=v.x,E=t.scaleX;if(E<0&&(b=1-b,E=-E),e.isStretchWidth)A=y-g,0!==E&&(t.width=A/E),p=g+b*A;else if(A=t.width*E,e.isAlignHorizontalCenter){var C=e._isAbsHorizontalCenter?e._horizontalCenter:e._horizontalCenter*T,x=(.5-_.x)*f.width;h&&(C*=l.x,x+=c.x,x*=l.x),p=x+(b-.5)*A+C}else p=e.isAlignLeft?g+b*A:y+(b-1)*A}if(e._alignFlags&n){var S,w,D=f.height;d?(w=cc.visibleRect.bottom.y,S=cc.visibleRect.top.y):S=(w=-_.y*D)+D,w+=e._isAbsBottom?e._bottom:e._bottom*D,S-=e._isAbsTop?e._top:e._top*D,h&&(w+=c.y,w*=l.y,S+=c.y,S*=l.y);var M,R=v.y,I=t.scaleY;if(I<0&&(R=1-R,I=-I),e.isStretchHeight)M=S-w,0!==I&&(t.height=M/I),m=w+R*M;else if(M=t.height*I,e.isAlignVerticalCenter){var O=e._isAbsVerticalCenter?e._verticalCenter:e._verticalCenter*D,P=(.5-_.y)*f.height;h&&(O*=l.y,P+=c.y,P*=l.y),m=P+(R-.5)*M+O}else m=e.isAlignBottom?w+R*M:S+(R-1)*M}t.setPosition(p,m)}function l(t){var e=t._widget;e&&(c(t,e),e.alignMode!==r.ALWAYS?f.remove(e):u.push(e));for(var i=t._children,n=0;n<i.length;n++){var a=i[n];a._active&&l(a)}}function h(){var t=cc.director.getScene();if(t){if(f.isAligning=!0,f._nodesOrderDirty)u.length=0,l(t),f._nodesOrderDirty=!1;else{var e,i=f._activeWidgetsIterator;for(i.i=0;i.i<u.length;++i.i)c((e=u[i.i]).node,e)}f.isAligning=!1}}var u=[],f=cc._widgetManager=e.exports={_AlignFlags:{TOP:1,MID:2,BOT:4,LEFT:8,CENTER:16,RIGHT:32},isAligning:!1,_nodesOrderDirty:!1,_activeWidgetsIterator:new cc.js.array.MutableForwardIterator(u),init:function(t){t.on(cc.Director.EVENT_AFTER_UPDATE,h);var e=this.onResized.bind(this);cc.view.on("canvas-resize",e),window.addEventListener("orientationchange",e)},add:function(t){t.node._widget=t,this._nodesOrderDirty=!0},remove:function(t){t.node._widget=null,this._activeWidgetsIterator.remove(t)},onResized:function(){var t=cc.director.getScene();t&&this.refreshWidgetOnResized(t)},refreshWidgetOnResized:function(t){var e=cc.Node.isNode(t)&&t.getComponent(cc.Widget);e&&e.enabled&&e.alignMode===r.ON_WINDOW_RESIZE&&this.add(e);for(var i=t._children,n=0;n<i.length;n++){var a=i[n];this.refreshWidgetOnResized(a)}},updateAlignment:function t(e){var i=e._parent;cc.Node.isNode(i)&&t(i);var n=e._widget||e.getComponent(cc.Widget);n&&i&&c(e,n)},AlignMode:r}}),{"../CCNode":29}],91:[(function(t,e){"use strict";var i=t("../value-types"),n=t("../geom-utils"),r=t("../utils/affine-transform"),a=t("../renderer/index"),s=t("../renderer/render-flow"),o=t("../CCGame"),c=null;c=t("../../renderer/scene/camera");var l=cc.mat4(),h=cc.mat4(),u=cc.v3(),f=cc.v3(),_=cc.v3(),d=[];function p(){for(var t=0,e=Number.MAX_VALUE;t<d.length;t++){var i=d[t];i._depth<e&&(T.main=i,e=i._depth)}}var m=null;function v(){if(m){var t=m.getNode(),e=cc.game.canvas;t.z=e.height/1.1566,t.x=e.width/2,t.y=e.height/2}}var g=cc.Enum({COLOR:1,DEPTH:2,STENCIL:4}),y=cc.Enum({OPAQUE:1,TRANSPARENT:2}),T=cc.Class({name:"cc.Camera",extends:cc.Component,ctor:function(){if(o.renderType!==o.RENDER_TYPE_CANVAS){var t=new c;t.setStages(["opaque"]),t.dirty=!0,this._inited=!1,this._camera=t}else this._inited=!0},editor:!1,properties:{_cullingMask:4294967295,_clearFlags:g.DEPTH|g.STENCIL,_backgroundColor:cc.color(0,0,0,255),_depth:0,_zoomRatio:1,_targetTexture:null,_fov:60,_orthoSize:10,_nearClip:1,_farClip:4096,_ortho:!0,_rect:cc.rect(0,0,1,1),_renderStages:1,_alignWithScreen:!0,zoomRatio:{get:function(){return this._zoomRatio},set:function(t){this._zoomRatio=t},tooltip:!1},fov:{get:function(){return this._fov},set:function(t){this._fov=t},tooltip:!1},orthoSize:{get:function(){return this._orthoSize},set:function(t){this._orthoSize=t},tooltip:!1},nearClip:{get:function(){return this._nearClip},set:function(t){this._nearClip=t,this._updateClippingpPlanes()},tooltip:!1},farClip:{get:function(){return this._farClip},set:function(t){this._farClip=t,this._updateClippingpPlanes()},tooltip:!1},ortho:{get:function(){return this._ortho},set:function(t){this._ortho=t,this._updateProjection()},tooltip:!1},rect:{get:function(){return this._rect},set:function(t){this._rect=t,this._updateRect()},tooltip:!1},cullingMask:{get:function(){return this._cullingMask},set:function(t){this._cullingMask=t,this._updateCameraMask()},tooltip:!1},clearFlags:{get:function(){return this._clearFlags},set:function(t){this._clearFlags=t,this._camera&&this._camera.setClearFlags(t)},tooltip:!1},backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor.equals(t)||(this._backgroundColor.set(t),this._updateBackgroundColor())},tooltip:!1},depth:{get:function(){return this._depth},set:function(t){T.main===this?this._depth<t&&p():T.main&&t<T.main._depth&&d.includes(this)&&(T.main=this),this._depth=t,this._camera&&this._camera.setPriority(t)},tooltip:!1},targetTexture:{get:function(){return this._targetTexture},set:function(t){this._targetTexture=t,this._updateTargetTexture()},tooltip:!1},renderStages:{get:function(){return this._renderStages},set:function(t){this._renderStages=t,this._updateStages()},tooltip:!1},alignWithScreen:{get:function(){return this._alignWithScreen},set:function(t){this._alignWithScreen=t}},_is3D:{get:function(){return this.node&&this.node._is3DNode}}},statics:{main:null,cameras:d,ClearFlags:g,findCamera:function(t){for(var e=0,i=d.length;e<i;e++){var n=d[e];if(n.containsNode(t))return n}return null},_findRendererCamera:function(t){for(var e=a.scene._cameras,i=0;i<e._count;i++)if(e._data[i]._cullingMask&t._cullingMask)return e._data[i];return null},_setupDebugCamera:function(){if(!m&&o.renderType!==o.RENDER_TYPE_CANVAS){var t=new c;m=t,t.setStages(["opaque"]),t.setFov(60*Math.PI/180),t.setNear(.1),t.setFar(4096),t.dirty=!0,t.cullingMask=1<<cc.Node.BuiltinGroupIndex.DEBUG,t.setPriority(cc.macro.MAX_ZINDEX),t.setClearFlags(0),t.setColor(0,0,0,0);var e=new cc.Node;t.setNode(e),v(),cc.view.on("design-resolution-changed",v),a.scene.addCamera(t)}}},_updateCameraMask:function(){if(this._camera){var t=this._cullingMask&~(1<<cc.Node.BuiltinGroupIndex.DEBUG);this._camera.cullingMask=t}},_updateBackgroundColor:function(){if(this._camera){var t=this._backgroundColor;this._camera.setColor(t.r/255,t.g/255,t.b/255,t.a/255)}},_updateTargetTexture:function(){if(this._camera){var t=this._targetTexture;this._camera.setFrameBuffer(t?t._framebuffer:null)}},_updateClippingpPlanes:function(){this._camera&&(this._camera.setNear(this._nearClip),this._camera.setFar(this._farClip))},_updateProjection:function(){if(this._camera){var t=this._ortho?1:0;this._camera.setType(t)}},_updateRect:function(){if(this._camera){var t=this._rect;this._camera.setRect(t.x,t.y,t.width,t.height)}},_updateStages:function(){var t=this._renderStages,e=[];t&y.OPAQUE&&e.push("opaque"),t&y.TRANSPARENT&&e.push("transparent"),this._camera.setStages(e)},_init:function(){if(!this._inited){this._inited=!0;var t=this._camera;t&&(t.setNode(this.node),t.setClearFlags(this._clearFlags),t.setPriority(this._depth),this._updateBackgroundColor(),this._updateCameraMask(),this._updateTargetTexture(),this._updateClippingpPlanes(),this._updateProjection(),this._updateStages(),this._updateRect(),this.beforeDraw())}},__preload:function(){this._init()},onEnable:function(){o.renderType!==o.RENDER_TYPE_CANVAS&&(cc.director.on(cc.Director.EVENT_BEFORE_DRAW,this.beforeDraw,this),a.scene.addCamera(this._camera)),d.push(this),(!T.main||this._depth<T.main._depth)&&(T.main=this)},onDisable:function(){o.renderType!==o.RENDER_TYPE_CANVAS&&(cc.director.off(cc.Director.EVENT_BEFORE_DRAW,this.beforeDraw,this),a.scene.removeCamera(this._camera)),cc.js.array.fastRemove(d,this),T.main===this&&(T.main=null,p())},getScreenToWorldMatrix2D:function(t){return this.getWorldToScreenMatrix2D(t),i.Mat4.invert(t,t),t},getWorldToScreenMatrix2D:function(t){this.node.getWorldRT(l);var e=this.zoomRatio,n=l.m;n[0]*=e,n[1]*=e,n[4]*=e,n[5]*=e;var r=n[12],a=n[13],s=cc.visibleRect.center;return n[12]=s.x-(n[0]*r+n[4]*a),n[13]=s.y-(n[1]*r+n[5]*a),t!==l&&i.Mat4.copy(t,l),t},getScreenToWorldPoint:function(t,e){return this.node.is3DNode?(e=e||new cc.Vec3,this._camera.screenToWorld(e,t,cc.visibleRect.width,cc.visibleRect.height)):(e=e||new cc.Vec2,this.getScreenToWorldMatrix2D(l),i.Vec2.transformMat4(e,t,l)),e},getWorldToScreenPoint:function(t,e){return this.node.is3DNode?(e=e||new cc.Vec3,this._camera.worldToScreen(e,t,cc.visibleRect.width,cc.visibleRect.height)):(e=e||new cc.Vec2,this.getWorldToScreenMatrix2D(l),i.Vec2.transformMat4(e,t,l)),e},getRay:function(t){return cc.geomUtils?(i.Vec3.set(_,t.x,t.y,1),this._camera.screenToWorld(f,_,cc.visibleRect.width,cc.visibleRect.height),this.ortho?(i.Vec3.set(_,t.x,t.y,-1),this._camera.screenToWorld(u,_,cc.visibleRect.width,cc.visibleRect.height)):this.node.getWorldPosition(u),n.Ray.fromPoints(new n.Ray,u,f)):t},containsNode:function(t){return(t._cullingMask&this.cullingMask)>0},render:function(t){if(!(t=t||cc.director.getScene()))return null;this.node.getWorldMatrix(l),this.beforeDraw(),s.renderCamera(this._camera,t)},_onAlignWithScreen:function(){var t=cc.game.canvas.height/cc.view._scaleY;this._targetTexture&&(t=cc.visibleRect.height);var e=this._fov*cc.macro.RAD;this.node.z=t/(2*Math.tan(e/2)),e=2*Math.atan(Math.tan(e/2)/this.zoomRatio),this._camera.setFov(e),this._camera.setOrthoHeight(t/2/this.zoomRatio),this.node.setRotation(0,0,0,1)},beforeDraw:function(){if(this._camera){if(this._alignWithScreen)this._onAlignWithScreen();else{var t=this._fov*cc.macro.RAD;t=2*Math.atan(Math.tan(t/2)/this.zoomRatio),this._camera.setFov(t),this._camera.setOrthoHeight(this._orthoSize/this.zoomRatio)}this._camera.dirty=!0}}});cc.js.mixin(T.prototype,{getNodeToCameraTransform:function(t){var e=r.identity();return t.getWorldMatrix(h),this.containsNode(t)&&(this.getWorldToCameraMatrix(l),i.Mat4.mul(h,h,l)),r.fromMat4(e,h),e},getCameraToWorldPoint:function(t,e){return this.getScreenToWorldPoint(t,e)},getWorldToCameraPoint:function(t,e){return this.getWorldToScreenPoint(t,e)},getCameraToWorldMatrix:function(t){return this.getScreenToWorldMatrix2D(t)},getWorldToCameraMatrix:function(t){return this.getWorldToScreenMatrix2D(t)}}),e.exports=cc.Camera=T}),{"../../renderer/scene/camera":310,"../CCGame":28,"../geom-utils":149,"../renderer/index":199,"../renderer/render-flow":200,"../utils/affine-transform":234,"../value-types":257}],92:[(function(t,e){"use strict";cc.Collider.Box=cc.Class({properties:{_offset:cc.v2(0,0),_size:cc.size(100,100),offset:{tooltip:!1,get:function(){return this._offset},set:function(t){this._offset=t},type:cc.Vec2},size:{tooltip:!1,get:function(){return this._size},set:function(t){this._size.width=t.width<0?0:t.width,this._size.height=t.height<0?0:t.height},type:cc.Size}},resetInEditor:!1});var i=cc.Class({name:"cc.BoxCollider",extends:cc.Collider,mixins:[cc.Collider.Box],editor:!1});cc.BoxCollider=e.exports=i}),{}],93:[(function(t,e){"use strict";cc.Collider.Circle=cc.Class({properties:{_offset:cc.v2(0,0),_radius:50,offset:{tooltip:!1,get:function(){return this._offset},set:function(t){this._offset=t},type:cc.Vec2},radius:{tooltip:!1,get:function(){return this._radius},set:function(t){this._radius=t<0?0:t}}},resetInEditor:!1});var i=cc.Class({name:"cc.CircleCollider",extends:cc.Collider,mixins:[cc.Collider.Circle],editor:!1});cc.CircleCollider=e.exports=i}),{}],94:[(function(t,e){"use strict";var i=cc.Class({name:"cc.Collider",extends:cc.Component,properties:{editing:{default:!1,serializable:!1,tooltip:!1},tag:{tooltip:!1,default:0,range:[0,1e7],type:cc.Integer}},onDisable:function(){cc.director.getCollisionManager().removeCollider(this)},onEnable:function(){cc.director.getCollisionManager().addCollider(this)}});cc.Collider=e.exports=i}),{}],95:[(function(t,e){"use strict";var i,n=(i=t("../value-types/vec2"))&&i.__esModule?i:{default:i},r=t("./CCContact"),a=r.CollisionType,s=t("../CCNode").EventType,o=new n.default;function c(t,e,i,n,r,a){var s=t.x,o=t.y,c=t.width,l=t.height,h=e.m,u=h[0],f=h[1],_=h[4],d=h[5],p=u*s+_*o+h[12],m=f*s+d*o+h[13],v=u*c,g=f*c,y=_*l,T=d*l;n.x=p,n.y=m,r.x=v+p,r.y=g+m,i.x=y+p,i.y=T+m,a.x=v+y+p,a.y=g+T+m}var l=cc.Class({mixins:[cc.EventTarget],properties:{enabled:!1,enabledDrawBoundingBox:!1},ctor:function(){this._contacts=[],this._colliders=[],this._debugDrawer=null,this._enabledDebugDraw=!1,cc.director._scheduler&&cc.director._scheduler.enableForTarget(this)},update:function(){if(this.enabled){var t,e,i=this._colliders;for(t=0,e=i.length;t<e;t++)this.updateCollider(i[t]);var n=this._contacts,r=[];for(t=0,e=n.length;t<e;t++){var s=n[t].updateState();s!==a.None&&r.push([s,n[t]])}for(t=0,e=r.length;t<e;t++){var o=r[t];this._doCollide(o[0],o[1])}this.drawColliders()}},_doCollide:function(t,e){var i;switch(t){case a.CollisionEnter:i="onCollisionEnter";break;case a.CollisionStay:i="onCollisionStay";break;case a.CollisionExit:i="onCollisionExit"}var n,r,s,o=e.collider1,c=e.collider2,l=o.node._components,h=c.node._components;for(n=0,r=l.length;n<r;n++)(s=l[n])[i]&&s[i](c,o);for(n=0,r=h.length;n<r;n++)(s=h[n])[i]&&s[i](o,c)},shouldCollide:function(t,e){var i=t.node,n=e.node,r=cc.game.collisionMatrix;return i!==n&&r[i.groupIndex][n.groupIndex]},initCollider:function(t){if(!t.world){var e=t.world={};e.aabb=cc.rect(),e.preAabb=cc.rect(),e.matrix=cc.mat4(),e.radius=0,t instanceof cc.BoxCollider?(e.position=null,e.points=[cc.v2(),cc.v2(),cc.v2(),cc.v2()]):t instanceof cc.PolygonCollider?(e.position=null,e.points=t.points.map((function(t){return cc.v2(t.x,t.y)}))):t instanceof cc.CircleCollider&&(e.position=cc.v2(),e.points=null)}},updateCollider:function(t){var e=t.offset,i=t.world,r=i.aabb,a=i.matrix;t.node.getWorldMatrix(a);var s=i.preAabb;if(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height,t instanceof cc.BoxCollider){var l=t.size;r.x=e.x-l.width/2,r.y=e.y-l.height/2,r.width=l.width,r.height=l.height;var h=i.points,u=h[0],f=h[1],_=h[2],d=h[3];c(r,a,u,f,_,d);var p=Math.min(u.x,f.x,_.x,d.x),m=Math.min(u.y,f.y,_.y,d.y),v=Math.max(u.x,f.x,_.x,d.x),g=Math.max(u.y,f.y,_.y,d.y);r.x=p,r.y=m,r.width=v-p,r.height=g-m}else if(t instanceof cc.CircleCollider){n.default.transformMat4(o,t.offset,a),i.position.x=o.x,i.position.y=o.y;var y=a.m,T=y[12],A=y[13];y[12]=y[13]=0,o.x=t.radius,o.y=0,n.default.transformMat4(o,o,a);var b=Math.sqrt(o.x*o.x+o.y*o.y);i.radius=b,r.x=i.position.x-b,r.y=i.position.y-b,r.width=2*b,r.height=2*b,y[12]=T,y[13]=A}else if(t instanceof cc.PolygonCollider){var E=t.points,C=i.points;C.length=E.length;for(var x=1e6,S=1e6,w=-1e6,D=-1e6,M=0,R=E.length;M<R;M++){C[M]||(C[M]=cc.v2()),o.x=E[M].x+e.x,o.y=E[M].y+e.y,n.default.transformMat4(o,o,a);var I=o.x,O=o.y;C[M].x=I,C[M].y=O,I>w&&(w=I),I<x&&(x=I),O>D&&(D=O),O<S&&(S=O)}r.x=x,r.y=S,r.width=w-x,r.height=D-S}},addCollider:function(t){var e=this._colliders;if(-1===e.indexOf(t)){for(var i=0,n=e.length;i<n;i++){var a=e[i];if(this.shouldCollide(t,a)){var o=new r(t,a);this._contacts.push(o)}}e.push(t),this.initCollider(t)}t.node.on(s.GROUP_CHANGED,this.onNodeGroupChanged,this)},removeCollider:function(t){var e=this._colliders,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(var n=this._contacts,r=n.length-1;r>=0;r--){var o=n[r];o.collider1!==t&&o.collider2!==t||(o.touching&&this._doCollide(a.CollisionExit,o),n.splice(r,1))}t.node.off(s.GROUP_CHANGED,this.onNodeGroupChanged,this)}else cc.errorID(6600)},onNodeGroupChanged:function(t){for(var e=t.getComponents(cc.Collider),i=0,n=e.length;i<n;i++){var r=e[i];cc.PhysicsCollider&&r instanceof cc.PhysicsCollider||(this.removeCollider(r),this.addCollider(r))}},drawColliders:function(){if(this._enabledDebugDraw){this._checkDebugDrawValid();var t=this._debugDrawer;t.clear();for(var e=this._colliders,i=0,n=e.length;i<n;i++){var r=e[i];if(t.strokeColor=cc.Color.WHITE,r instanceof cc.BoxCollider||r instanceof cc.PolygonCollider){var a=r.world.points;if(a.length>0){t.moveTo(a[0].x,a[0].y);for(var s=1;s<a.length;s++)t.lineTo(a[s].x,a[s].y);t.close(),t.stroke()}}else r instanceof cc.CircleCollider&&(t.circle(r.world.position.x,r.world.position.y,r.world.radius),t.stroke());if(this.enabledDrawBoundingBox){var o=r.world.aabb;t.strokeColor=cc.Color.BLUE,t.moveTo(o.xMin,o.yMin),t.lineTo(o.xMin,o.yMax),t.lineTo(o.xMax,o.yMax),t.lineTo(o.xMax,o.yMin),t.close(),t.stroke()}}}},_checkDebugDrawValid:function(){if(!this._debugDrawer||!this._debugDrawer.isValid){var t=new cc.Node("COLLISION_MANAGER_DEBUG_DRAW");t.zIndex=cc.macro.MAX_ZINDEX,cc.game.addPersistRootNode(t),this._debugDrawer=t.addComponent(cc.Graphics)}}});cc.js.getset(l.prototype,"enabledDebugDraw",(function(){return this._enabledDebugDraw}),(function(t){t&&!this._enabledDebugDraw?(this._checkDebugDrawValid(),this._debugDrawer.node.active=!0):!t&&this._enabledDebugDraw&&(this._debugDrawer.clear(!0),this._debugDrawer.node.active=!1),this._enabledDebugDraw=t})),cc.CollisionManager=e.exports=l}),{"../CCNode":29,"../value-types/vec2":266,"./CCContact":96}],96:[(function(t,e){"use strict";var i=t("./CCIntersection"),n=cc.Enum({None:0,CollisionEnter:1,CollisionStay:2,CollisionExit:3});function r(t,e){this.collider1=t,this.collider2=e,this.touching=!1;var n=t instanceof cc.BoxCollider||t instanceof cc.PolygonCollider,r=e instanceof cc.BoxCollider||e instanceof cc.PolygonCollider,a=t instanceof cc.CircleCollider,s=e instanceof cc.CircleCollider;n&&r?this.testFunc=i.polygonPolygon:a&&s?this.testFunc=i.circleCircle:n&&s?this.testFunc=i.polygonCircle:a&&r?(this.testFunc=i.polygonCircle,this.collider1=e,this.collider2=t):cc.errorID(6601,cc.js.getClassName(t),cc.js.getClassName(e))}r.prototype.test=function(){var t=this.collider1.world,e=this.collider2.world;return!!t.aabb.intersects(e.aabb)&&(this.testFunc===i.polygonPolygon?this.testFunc(t.points,e.points):this.testFunc===i.circleCircle?this.testFunc(t,e):this.testFunc===i.polygonCircle&&this.testFunc(t.points,e))},r.prototype.updateState=function(){var t=this.test(),e=n.None;return t&&!this.touching?(this.touching=!0,e=n.CollisionEnter):t&&this.touching?e=n.CollisionStay:!t&&this.touching&&(this.touching=!1,e=n.CollisionExit),e},r.CollisionType=n,e.exports=r}),{"./CCIntersection":97}],97:[(function(t,e){"use strict";var i={};function n(t,e,i,n){var r=(n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x),a=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),s=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);if(0!==s){var o=r/s,c=a/s;if(0<=o&&o<=1&&0<=c&&c<=1)return!0}return!1}function r(t,e,i){for(var r=i.length,a=0;a<r;++a)if(n(t,e,i[a],i[(a+1)%r]))return!0;return!1}function a(t,e){for(var i=!1,n=t.x,r=t.y,a=e.length,s=0,o=a-1;s<a;o=s++){var c=e[s].x,l=e[s].y,h=e[o].x,u=e[o].y;l>r!=u>r&&n<(h-c)*(r-l)/(u-l)+c&&(i=!i)}return i}function s(t,e,i,n){var r,a=i.x-e.x,s=i.y-e.y,o=a*a+s*s,c=((t.x-e.x)*a+(t.y-e.y)*s)/o;return r=n?o?c<0?e:c>1?i:cc.v2(e.x+c*a,e.y+c*s):e:cc.v2(e.x+c*a,e.y+c*s),a=t.x-r.x,s=t.y-r.y,Math.sqrt(a*a+s*s)}i.lineLine=n,i.lineRect=function(t,e,i){var r=new cc.Vec2(i.x,i.y),a=new cc.Vec2(i.x,i.yMax),s=new cc.Vec2(i.xMax,i.yMax),o=new cc.Vec2(i.xMax,i.y);return!!(n(t,e,r,a)||n(t,e,a,s)||n(t,e,s,o)||n(t,e,o,r))},i.linePolygon=r,i.rectRect=function(t,e){var i=t.x,n=t.y,r=t.x+t.width,a=t.y+t.height,s=e.x,o=e.y,c=e.x+e.width,l=e.y+e.height;return i<=c&&r>=s&&n<=l&&a>=o},i.rectPolygon=function(t,e){var i,n,s=new cc.Vec2(t.x,t.y),o=new cc.Vec2(t.x,t.yMax),c=new cc.Vec2(t.xMax,t.yMax),l=new cc.Vec2(t.xMax,t.y);if(r(s,o,e))return!0;if(r(o,c,e))return!0;if(r(c,l,e))return!0;if(r(l,s,e))return!0;for(i=0,n=e.length;i<n;++i)if(a(e[i],t))return!0;return!!(a(s,e)||a(o,e)||a(c,e)||a(l,e))},i.polygonPolygon=function(t,e){var i,n;for(i=0,n=t.length;i<n;++i)if(r(t[i],t[(i+1)%n],e))return!0;for(i=0,n=e.length;i<n;++i)if(a(e[i],t))return!0;for(i=0,n=t.length;i<n;++i)if(a(t[i],e))return!0;return!1},i.circleCircle=function(t,e){return t.position.sub(e.position).mag()<t.radius+e.radius},i.polygonCircle=function(t,e){var i=e.position;if(a(i,t))return!0;for(var n=0,r=t.length;n<r;n++)if(s(i,0===n?t[t.length-1]:t[n-1],t[n],!0)<e.radius)return!0;return!1},i.pointInPolygon=a,i.pointLineDistance=s,cc.Intersection=e.exports=i}),{}],98:[(function(t,e){"use strict";cc.Collider.Polygon=cc.Class({properties:{threshold:{default:1,serializable:!1,visible:!1},_offset:cc.v2(0,0),offset:{get:function(){return this._offset},set:function(t){this._offset=t},type:cc.Vec2},points:{tooltip:!1,default:function(){return[cc.v2(-50,-50),cc.v2(50,-50),cc.v2(50,50),cc.v2(-50,50)]},type:[cc.Vec2]}},resetPointsByContour:!1});var i=cc.Class({name:"cc.PolygonCollider",extends:cc.Collider,mixins:[cc.Collider.Polygon],editor:!1});cc.PolygonCollider=e.exports=i}),{}],99:[(function(t){"use strict";t("./CCCollisionManager"),t("./CCCollider"),t("./CCBoxCollider"),t("./CCCircleCollider"),t("./CCPolygonCollider")}),{"./CCBoxCollider":92,"./CCCircleCollider":93,"./CCCollider":94,"./CCCollisionManager":95,"./CCPolygonCollider":98}],100:[(function(t,e){"use strict";t("./platform/CCClass");var i=t("./platform/CCObject").Flags,n=t("./platform/js").array,r=i.IsStartCalled,a=i.IsOnEnableCalled;function s(t,e){for(var i=e.constructor._executionOrder,n=e._id,r=0,a=t.length-1,s=a>>>1;r<=a;s=r+a>>>1){var o=t[s],c=o.constructor._executionOrder;if(c>i)a=s-1;else if(c<i)r=s+1;else{var l=o._id;if(l>n)a=s-1;else{if(!(l<n))return s;r=s+1}}}return~r}function o(t,e){for(var i=t.array,n=t.i+1;n<i.length;){var r=i[n];r._enabled&&r.node&&r.node._activeInHierarchy?++n:(t.removeAt(n),e&&(r._objFlags&=~e))}}i.IsEditorOnEnableCalled;var c=cc.Class({__ctor__:function(t){var e=n.MutableForwardIterator;this._zero=new e([]),this._neg=new e([]),this._pos=new e([]),this._invoke=t},statics:{stableRemoveInactive:o},add:null,remove:null,invoke:null});function l(t,e){return t.constructor._executionOrder-e.constructor._executionOrder}var h=cc.Class({extends:c,add:function(t){var e=t.constructor._executionOrder;(0===e?this._zero:e<0?this._neg:this._pos).array.push(t)},remove:function(t){var e=t.constructor._executionOrder;(0===e?this._zero:e<0?this._neg:this._pos).fastRemove(t)},cancelInactive:function(t){o(this._zero,t),o(this._neg,t),o(this._pos,t)},invoke:function(){var t=this._neg;t.array.length>0&&(t.array.sort(l),this._invoke(t),t.array.length=0),this._invoke(this._zero),this._zero.array.length=0;var e=this._pos;e.array.length>0&&(e.array.sort(l),this._invoke(e),e.array.length=0)}}),u=cc.Class({extends:c,add:function(t){var e=t.constructor._executionOrder;if(0===e)this._zero.array.push(t);else{var i=e<0?this._neg.array:this._pos.array,n=s(i,t);n<0&&i.splice(~n,0,t)}},remove:function(t){var e=t.constructor._executionOrder;if(0===e)this._zero.fastRemove(t);else{var i=e<0?this._neg:this._pos,n=s(i.array,t);n>=0&&i.removeAt(n)}},invoke:function(t){this._neg.array.length>0&&this._invoke(this._neg,t),this._invoke(this._zero,t),this._pos.array.length>0&&this._invoke(this._pos,t)}});function f(t,e,i,n){return function(e,r){try{n(e,r)}catch(s){cc._throw(s);var a=e.array;for(i&&(a[e.i]._objFlags|=i),++e.i;e.i<a.length;++e.i)try{t(a[e.i],r)}catch(s){cc._throw(s),i&&(a[e.i]._objFlags|=i)}}}}var _=f((function(t){t.start(),t._objFlags|=r}),0,r,(function(t){var e=t.array;for(t.i=0;t.i<e.length;++t.i){var i=e[t.i];i.start(),i._objFlags|=r}})),d=f((function(t,e){t.update(e)}),0,void 0,(function(t,e){var i=t.array;for(t.i=0;t.i<i.length;++t.i)i[t.i].update(e)})),p=f((function(t,e){t.lateUpdate(e)}),0,void 0,(function(t,e){var i=t.array;for(t.i=0;t.i<i.length;++t.i)i[t.i].lateUpdate(e)}));function m(){this.startInvoker=new h(_),this.updateInvoker=new u(d),this.lateUpdateInvoker=new u(p),this._deferredComps=[],this._updating=!1}var v=cc.Class({ctor:m,unscheduleAll:m,statics:{LifeCycleInvoker:c,OneOffInvoker:h,createInvokeImpl:f,invokeOnEnable:function(t){var e=cc.director._compScheduler,i=t.array;for(t.i=0;t.i<i.length;++t.i){var n=i[t.i];n._enabled&&(n.onEnable(),!n.node._activeInHierarchy||e._onEnabled(n))}}},_onEnabled:function(t){cc.director.getScheduler().resumeTarget(t),t._objFlags|=a,this._updating?this._deferredComps.push(t):this._scheduleImmediate(t)},_onDisabled:function(t){cc.director.getScheduler().pauseTarget(t),t._objFlags&=~a;var e=this._deferredComps.indexOf(t);e>=0?n.fastRemoveAt(this._deferredComps,e):(!t.start||t._objFlags&r||this.startInvoker.remove(t),t.update&&this.updateInvoker.remove(t),t.lateUpdate&&this.lateUpdateInvoker.remove(t))},enableComp:function(t,e){if(!(t._objFlags&a)){if(t.onEnable){if(e)return void e.add(t);if(t.onEnable(),!t.node._activeInHierarchy)return}this._onEnabled(t)}},disableComp:function(t){t._objFlags&a&&(t.onDisable&&t.onDisable(),this._onDisabled(t))},_scheduleImmediate:function(t){"function"!=typeof t.start||t._objFlags&r||this.startInvoker.add(t),"function"==typeof t.update&&this.updateInvoker.add(t),"function"==typeof t.lateUpdate&&this.lateUpdateInvoker.add(t)},_deferredSchedule:function(){for(var t=this._deferredComps,e=0,i=t.length;e<i;e++)this._scheduleImmediate(t[e]);t.length=0},_startForNewComps:function(){this._deferredComps.length>0&&(this._deferredSchedule(),this.startInvoker.invoke())},startPhase:function(){this._updating=!0,this.startInvoker.invoke(),this._startForNewComps()},updatePhase:function(t){this.updateInvoker.invoke(t)},lateUpdatePhase:function(t){this.lateUpdateInvoker.invoke(t),this._updating=!1,this._startForNewComps()}});e.exports=v}),{"./platform/CCClass":168,"./platform/CCObject":174,"./platform/js":189,"./utils/misc":242}],101:[(function(t,e){"use strict";var i=t("../../animation/animation-animator"),n=t("../../animation/animation-clip"),r=t("../event/event-target"),a=t("../platform/js"),s=function(t,e){return t===e},o=cc.Enum({PLAY:"play",STOP:"stop",PAUSE:"pause",RESUME:"resume",LASTFRAME:"lastframe",FINISHED:"finished"}),c=cc.Class({name:"cc.Animation",extends:t("./CCComponent"),mixins:[r],editor:!1,statics:{EventType:o},ctor:function(){cc.EventTarget.call(this),this._animator=null,this._nameToState=a.createMap(!0),this._didInit=!1,this._currentClip=null},properties:{_defaultClip:{default:null,type:n},defaultClip:{type:n,get:function(){return this._defaultClip},set:function(){},tooltip:!1},currentClip:{get:function(){return this._currentClip},set:function(t){this._currentClip=t},type:n,visible:!1},_writableClips:{get:function(){return this._clips},set:function(t){this._didInit=!1,this._clips=t,this._init()},type:[n]},_clips:{default:[],type:[n],tooltip:!1,visible:!0},playOnLoad:{default:!1,tooltip:!1}},start:function(){if(this.playOnLoad&&this._defaultClip&&(!this._animator||!this._animator.isPlaying)){var t=this.getAnimationState(this._defaultClip.name);this._animator.playState(t)}},onEnable:function(){this._animator&&this._animator.resume()},onDisable:function(){this._animator&&this._animator.pause()},onDestroy:function(){this.stop()},getClips:function(){return this._clips},play:function(t,e){var i=this.playAdditive(t,e);return this._animator.stopStatesExcept(i),i},playAdditive:function(t,e){this._init();var i=this.getAnimationState(t||this._defaultClip&&this._defaultClip.name);if(i){this.enabled=!0;var n=this._animator;n.isPlaying&&i.isPlaying?i.isPaused?n.resumeState(i):(n.stopState(i),n.playState(i,e)):n.playState(i,e),this.enabledInHierarchy||n.pause(),this.currentClip=i.clip}return i},stop:function(t){if(this._didInit)if(t){var e=this._nameToState[t];e&&this._animator.stopState(e)}else this._animator.stop()},pause:function(t){if(this._didInit)if(t){var e=this._nameToState[t];e&&this._animator.pauseState(e)}else this.enabled=!1},resume:function(t){if(this._didInit)if(t){var e=this.getAnimationState(t);e&&this._animator.resumeState(e)}else this.enabled=!0},setCurrentTime:function(t,e){if(this._init(),e){var i=this.getAnimationState(e);i&&this._animator.setStateTime(i,t)}else this._animator.setStateTime(t)},getAnimationState:function(t){this._init();var e=this._nameToState[t];return e&&!e.curveLoaded&&this._animator._reloadClip(e),e||null},hasAnimationState:function(t){return this._init(),!!this._nameToState[t]},addClip:function(t,e){if(t){this._init(),cc.js.array.contains(this._clips,t)||this._clips.push(t),e=e||t.name;var i=this._nameToState[e];if(i){if(i.clip===t)return i;var n=this._clips.indexOf(i.clip);-1!==n&&this._clips.splice(n,1)}var r=new cc.AnimationState(t,e);return this._nameToState[e]=r,r}cc.warnID(3900)},removeClip:function(t,e){if(t){var i;for(var n in this._init(),this._nameToState)if(i=this._nameToState[n],s(i.clip,t))break;if(t===this._defaultClip){if(!e)return void cc.warnID(3902);this._defaultClip=null}if(i&&i.isPlaying){if(!e)return void cc.warnID(3903);this.stop(i.name)}this._clips=this._clips.filter((function(e){return!s(e,t)})),i&&delete this._nameToState[i.name]}else cc.warnID(3901)},sample:function(t){if(this._init(),t){var e=this.getAnimationState(t);e&&e.sample()}else this._animator.sample()},on:function(t,e,i,n){this._init();var r=this._EventTargetOn(t,e,i,n);if("lastframe"===t){var a=this._nameToState;for(var s in a)a[s]._lastframeEventOn=!0}return r},off:function(t,e,i,n){if(this._init(),"lastframe"===t){var r=this._nameToState;for(var a in r)r[a]._lastframeEventOn=!1}this._EventTargetOff(t,e,i,n)},_init:function(){this._didInit||(this._didInit=!0,this._animator=new i(this.node,this),this._createStates())},_createStates:function(){this._nameToState=a.createMap(!0);for(var t=null,e=!1,i=0;i<this._clips.length;++i){var n=this._clips[i];n&&(t=new cc.AnimationState(n),this._nameToState[t.name]=t,s(this._defaultClip,n)&&(e=t))}this._defaultClip&&!e&&(t=new cc.AnimationState(this._defaultClip),this._nameToState[t.name]=t)}});c.prototype._EventTargetOn=r.prototype.on,c.prototype._EventTargetOff=r.prototype.off,cc.Animation=e.exports=c}),{"../../animation/animation-animator":9,"../../animation/animation-clip":10,"../event/event-target":141,"../platform/js":189,"./CCComponent":106}],102:[(function(t,e){"use strict";var i=t("../utils/misc"),n=t("./CCComponent"),r=t("../assets/CCAudioClip"),a=cc.Class({name:"cc.AudioSource",extends:n,editor:!1,ctor:function(){this.audio=new cc._Audio},properties:{_clip:{default:null,type:r},_volume:1,_mute:!1,_loop:!1,_pausedFlag:{default:!1,serializable:!1},_firstlyEnabled:!0,isPlaying:{get:function(){return this.audio.getState()===cc._Audio.State.PLAYING},visible:!1},clip:{get:function(){return this._clip},set:function(t){if(t!==this._clip){if(!(t instanceof r))return cc.error("Wrong type of AudioClip.");this._clip=t,this.audio.stop(),this.audio.src=this._clip,this.preload&&this._clip._ensureLoaded()}},type:r,tooltip:!1,animatable:!1},volume:{get:function(){return this._volume},set:function(t){return t=i.clamp01(t),this._volume=t,this._mute||this.audio.setVolume(t),t},tooltip:!1},mute:{get:function(){return this._mute},set:function(t){return this._mute=t,this.audio.setVolume(t?0:this._volume),t},animatable:!1,tooltip:!1},loop:{get:function(){return this._loop},set:function(t){return this._loop=t,this.audio.setLoop(t),t},animatable:!1,tooltip:!1},playOnLoad:{default:!1,tooltip:!1,animatable:!1},preload:{default:!1,animatable:!1}},_pausedCallback:function(){this.audio.getState()===cc._Audio.State.PLAYING&&(this.audio.pause(),this._pausedFlag=!0)},_restoreCallback:function(){this._pausedFlag&&this.audio.resume(),this._pausedFlag=!1},onLoad:function(){this.audio.src||(this.audio.src=this._clip),this.preload&&this._clip._ensureLoaded()},onEnable:function(){this.playOnLoad&&this._firstlyEnabled&&(this._firstlyEnabled=!1,this.play()),cc.game.on(cc.game.EVENT_HIDE,this._pausedCallback,this),cc.game.on(cc.game.EVENT_SHOW,this._restoreCallback,this)},onDisable:function(){this.stop(),cc.game.off(cc.game.EVENT_HIDE,this._pausedCallback,this),cc.game.off(cc.game.EVENT_SHOW,this._restoreCallback,this)},onDestroy:function(){this.audio.destroy()},play:function(){if(this._clip){var t=this.audio;t.setVolume(this._mute?0:this._volume),t.setLoop(this._loop),t.setCurrentTime(0),t.play()}},stop:function(){this.audio.stop()},pause:function(){this.audio.pause()},resume:function(){this.audio.resume()},rewind:function(){this.audio.setCurrentTime(0)},getCurrentTime:function(){return this.audio.getCurrentTime()},setCurrentTime:function(t){return this.audio.setCurrentTime(t),t},getDuration:function(){return this.audio.getDuration()}});cc.AudioSource=e.exports=a}),{"../assets/CCAudioClip":63,"../utils/misc":242,"./CCComponent":106}],103:[(function(t,e){"use strict";var i=["touchstart","touchmove","touchend","mousedown","mousemove","mouseup","mouseenter","mouseleave","mousewheel"];function n(t){t.stopPropagation()}var r=cc.Class({name:"cc.BlockInputEvents",extends:t("./CCComponent"),editor:{menu:"i18n:MAIN_MENU.component.ui/Block Input Events",inspector:"packages://inspector/inspectors/comps/block-input-events.js",help:"i18n:COMPONENT.help_url.block_input_events"},onEnable:function(){for(var t=0;t<i.length;t++)this.node.on(i[t],n,this)},onDisable:function(){for(var t=0;t<i.length;t++)this.node.off(i[t],n,this)}});cc.BlockInputEvents=e.exports=r}),{"./CCComponent":106}],104:[(function(t,e){"use strict";var i=t("./CCComponent"),n=t("../utils/gray-sprite-state"),r=cc.Enum({NONE:0,COLOR:1,SPRITE:2,SCALE:3}),a=cc.Enum({NORMAL:0,HOVER:1,PRESSED:2,DISABLED:3}),s=cc.Class({name:"cc.Button",extends:i,mixins:[n],ctor:function(){this._pressed=!1,this._hovered=!1,this._fromColor=null,this._toColor=null,this._time=0,this._transitionFinished=!0,this._fromScale=cc.Vec2.ZERO,this._toScale=cc.Vec2.ZERO,this._originalScale=null,this._graySpriteMaterial=null,this._spriteMaterial=null,this._sprite=null},editor:!1,properties:{interactable:{default:!0,tooltip:!1,notify:function(){this._updateState(),this.interactable||this._resetState()},animatable:!1},_resizeToTarget:{animatable:!1,set:function(t){t&&this._resizeNodeToTargetNode()}},enableAutoGrayEffect:{default:!1,tooltip:!1,notify:function(){this._updateDisabledState(!0)}},transition:{default:r.NONE,tooltip:!1,type:r,animatable:!1,notify:function(t){this._updateTransition(t)},formerlySerializedAs:"transition"},normalColor:{default:cc.Color.WHITE,displayName:"Normal",tooltip:!1,notify:function(){this.transition===r.Color&&this._getButtonState()===a.NORMAL&&(this._getTarget().opacity=this.normalColor.a),this._updateState()}},pressedColor:{default:cc.color(211,211,211),displayName:"Pressed",tooltip:!1,notify:function(){this.transition===r.Color&&this._getButtonState()===a.PRESSED&&(this._getTarget().opacity=this.pressedColor.a),this._updateState()},formerlySerializedAs:"pressedColor"},hoverColor:{default:cc.Color.WHITE,displayName:"Hover",tooltip:!1,notify:function(){this.transition===r.Color&&this._getButtonState()===a.HOVER&&(this._getTarget().opacity=this.hoverColor.a),this._updateState()},formerlySerializedAs:"hoverColor"},disabledColor:{default:cc.color(124,124,124),displayName:"Disabled",tooltip:!1,notify:function(){this.transition===r.Color&&this._getButtonState()===a.DISABLED&&(this._getTarget().opacity=this.disabledColor.a),this._updateState()}},duration:{default:.1,range:[0,10],tooltip:!1},zoomScale:{default:1.2,tooltip:!1},normalSprite:{default:null,type:cc.SpriteFrame,displayName:"Normal",tooltip:!1,notify:function(){this._updateState()}},pressedSprite:{default:null,type:cc.SpriteFrame,displayName:"Pressed",tooltip:!1,formerlySerializedAs:"pressedSprite",notify:function(){this._updateState()}},hoverSprite:{default:null,type:cc.SpriteFrame,displayName:"Hover",tooltip:!1,formerlySerializedAs:"hoverSprite",notify:function(){this._updateState()}},disabledSprite:{default:null,type:cc.SpriteFrame,displayName:"Disabled",tooltip:!1,notify:function(){this._updateState()}},target:{default:null,type:cc.Node,tooltip:!1,notify:function(t){this._applyTarget(),t&&this.target!==t&&this._unregisterTargetEvent(t)}},clickEvents:{default:[],type:cc.Component.EventHandler,tooltip:!1}},statics:{Transition:r},__preload:function(){this._applyTarget(),this._resetState()},_resetState:function(){this._pressed=!1,this._hovered=!1;var t=this._getTarget(),e=this.transition,i=this._originalScale;e===r.COLOR&&this.interactable?this._setTargetColor(this.normalColor):e===r.SCALE&&i&&t.setScale(i.x,i.y),this._transitionFinished=!0},onEnable:function(){this.normalSprite&&this.normalSprite.ensureLoadTexture(),this.hoverSprite&&this.hoverSprite.ensureLoadTexture(),this.pressedSprite&&this.pressedSprite.ensureLoadTexture(),this.disabledSprite&&this.disabledSprite.ensureLoadTexture(),this._registerNodeEvent(),this._updateState()},onDisable:function(){this._resetState(),this._unregisterNodeEvent()},_getTarget:function(){return this.target?this.target:this.node},_onTargetSpriteFrameChanged:function(t){this.transition===r.SPRITE&&this._setCurrentStateSprite(t.spriteFrame)},_onTargetColorChanged:function(t){this.transition===r.COLOR&&this._setCurrentStateColor(t)},_onTargetScaleChanged:function(){var t=this._getTarget();this._originalScale&&(this.transition!==r.SCALE||this._transitionFinished)&&(this._originalScale.x=t.scaleX,this._originalScale.y=t.scaleY)},_setTargetColor:function(t){var e=this._getTarget(),i=t.clone();e.opacity=i.a,i.a=255,e.color=i},_getStateColor:function(t){switch(t){case a.NORMAL:return this.normalColor;case a.HOVER:return this.hoverColor;case a.PRESSED:return this.pressedColor;case a.DISABLED:return this.disabledColor}},_getStateSprite:function(t){switch(t){case a.NORMAL:return this.normalSprite;case a.HOVER:return this.hoverSprite;case a.PRESSED:return this.pressedSprite;case a.DISABLED:return this.disabledSprite}},_setCurrentStateColor:function(t){switch(this._getButtonState()){case a.NORMAL:this.normalColor=t;break;case a.HOVER:this.hoverColor=t;break;case a.PRESSED:this.pressedColor=t;break;case a.DISABLED:this.disabledColor=t}},_setCurrentStateSprite:function(t){switch(this._getButtonState()){case a.NORMAL:this.normalSprite=t;break;case a.HOVER:this.hoverSprite=t;break;case a.PRESSED:this.pressedSprite=t;break;case a.DISABLED:this.disabledSprite=t}},update:function(t){var e=this._getTarget();if(!this._transitionFinished&&(this.transition===r.COLOR||this.transition===r.SCALE)){this.time+=t;var i=1;if(this.duration>0&&(i=this.time/this.duration),i>=1&&(i=1),this.transition===r.COLOR){var n=this._fromColor.lerp(this._toColor,i);this._setTargetColor(n)}else this.transition===r.SCALE&&this._originalScale&&(e.scale=this._fromScale.lerp(this._toScale,i));1===i&&(this._transitionFinished=!0)}},_registerNodeEvent:function(){this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancel,this),this.node.on(cc.Node.EventType.MOUSE_ENTER,this._onMouseMoveIn,this),this.node.on(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)},_unregisterNodeEvent:function(){this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancel,this),this.node.off(cc.Node.EventType.MOUSE_ENTER,this._onMouseMoveIn,this),this.node.off(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)},_registerTargetEvent:function(t){t.on(cc.Node.EventType.SCALE_CHANGED,this._onTargetScaleChanged,this)},_unregisterTargetEvent:function(t){t.off(cc.Node.EventType.SCALE_CHANGED,this._onTargetScaleChanged,this)},_getTargetSprite:function(t){var e=null;return t&&(e=t.getComponent(cc.Sprite)),e},_applyTarget:function(){var t=this._getTarget();this._sprite=this._getTargetSprite(t),this._originalScale||(this._originalScale=cc.Vec2.ZERO),this._originalScale.x=t.scaleX,this._originalScale.y=t.scaleY,this._registerTargetEvent(t)},_onTouchBegan:function(t){this.interactable&&this.enabledInHierarchy&&(this._pressed=!0,this._updateState(),t.stopPropagation())},_onTouchMove:function(t){if(this.interactable&&this.enabledInHierarchy&&this._pressed){var e,i=t.touch,n=this.node._hitTest(i.getLocation()),s=this._getTarget(),o=this._originalScale;this.transition===r.SCALE&&o?n?(this._fromScale.x=o.x,this._fromScale.y=o.y,this._toScale.x=o.x*this.zoomScale,this._toScale.y=o.y*this.zoomScale,this._transitionFinished=!1):(this.time=0,this._transitionFinished=!0,s.setScale(o.x,o.y)):(e=n?a.PRESSED:a.NORMAL,this._applyTransition(e)),t.stopPropagation()}},_onTouchEnded:function(t){this.interactable&&this.enabledInHierarchy&&(this._pressed&&(cc.Component.EventHandler.emitEvents(this.clickEvents,t),this.node.emit("click",this)),this._pressed=!1,this._updateState(),t.stopPropagation())},_onTouchCancel:function(){this.interactable&&this.enabledInHierarchy&&(this._pressed=!1,this._updateState())},_onMouseMoveIn:function(){!this._pressed&&this.interactable&&this.enabledInHierarchy&&(this.transition!==r.SPRITE||this.hoverSprite)&&(this._hovered||(this._hovered=!0,this._updateState()))},_onMouseMoveOut:function(){this._hovered&&(this._hovered=!1,this._updateState())},_updateState:function(){var t=this._getButtonState();this._applyTransition(t),this._updateDisabledState()},_getButtonState:function(){return this.interactable?this._pressed?a.PRESSED:this._hovered?a.HOVER:a.NORMAL:a.DISABLED},_updateColorTransitionImmediately:function(t){var e=this._getStateColor(t);this._setTargetColor(e),this._fromColor=e.clone(),this._toColor=e},_updateColorTransition:function(t){if(t===a.DISABLED)this._updateColorTransitionImmediately(t);else{var e=this._getTarget(),i=this._getStateColor(t);this._fromColor=e.color.clone(),this._toColor=i,this.time=0,this._transitionFinished=!1}},_updateSpriteTransition:function(t){var e=this._getStateSprite(t);this._sprite&&e&&(this._sprite.spriteFrame=e)},_updateScaleTransition:function(t){t===a.PRESSED?this._zoomUp():this._zoomBack()},_zoomUp:function(){this._originalScale&&(this._fromScale.x=this._originalScale.x,this._fromScale.y=this._originalScale.y,this._toScale.x=this._originalScale.x*this.zoomScale,this._toScale.y=this._originalScale.y*this.zoomScale,this.time=0,this._transitionFinished=!1)},_zoomBack:function(){if(this._originalScale){var t=this._getTarget();this._fromScale.x=t.scaleX,this._fromScale.y=t.scaleY,this._toScale.x=this._originalScale.x,this._toScale.y=this._originalScale.y,this.time=0,this._transitionFinished=!1}},_updateTransition:function(t){t===r.COLOR?this._updateColorTransitionImmediately(a.NORMAL):t===r.SPRITE&&this._updateSpriteTransition(a.NORMAL),this._updateState()},_applyTransition:function(t){var e=this.transition;e===r.COLOR?this._updateColorTransition(t):e===r.SPRITE?this._updateSpriteTransition(t):e===r.SCALE&&this._updateScaleTransition(t)},_resizeNodeToTargetNode:!1,_updateDisabledState:function(t){if(this._sprite&&(this.enableAutoGrayEffect||t)){var e=!1;this.transition===r.SPRITE&&this.disabledSprite||(e=this.enableAutoGrayEffect&&!this.interactable),this._switchGrayMaterial(e,this._sprite)}}});cc.Button=e.exports=s}),{"../utils/gray-sprite-state":240,"./CCComponent":106}],105:[(function(t,e){"use strict";var i=t("../camera/CCCamera"),n=t("./CCComponent"),r=cc.Class({name:"cc.Canvas",extends:n,editor:!1,resetInEditor:!1,statics:{instance:null},properties:{_designResolution:cc.size(960,640),designResolution:{get:function(){return cc.size(this._designResolution)},set:function(t){this._designResolution.width=t.width,this._designResolution.height=t.height,this.applySettings()},tooltip:!1},_fitWidth:!1,_fitHeight:!0,fitHeight:{get:function(){return this._fitHeight},set:function(t){this._fitHeight!==t&&(this._fitHeight=t,this.applySettings())},tooltip:!1},fitWidth:{get:function(){return this._fitWidth},set:function(t){this._fitWidth!==t&&(this._fitWidth=t,this.applySettings())},tooltip:!1}},_fitDesignResolution:!1,__preload:function(){if(r.instance)return cc.warnID(6700,this.node.name,r.instance.node.name);r.instance=this,this.applySettings();var t=this.getComponent(cc.Widget);t&&t.updateAlignment()},start:function(){if(!i.main&&cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS){var t=new cc.Node("Main Camera");t.parent=this.node,t.setSiblingIndex(0);var e=t.addComponent(i),n=i.ClearFlags;e.clearFlags=n.COLOR|n.DEPTH|n.STENCIL,e.depth=-1}},onDestroy:function(){r.instance===this&&(r.instance=null)},applySettings:function(){var t,e=cc.ResolutionPolicy;t=this.fitHeight&&this.fitWidth?e.SHOW_ALL:this.fitHeight||this.fitWidth?this.fitWidth?e.FIXED_WIDTH:e.FIXED_HEIGHT:e.NO_BORDER;var i=this._designResolution;cc.view.setDesignResolutionSize(i.width,i.height,t)}});cc.Canvas=e.exports=r}),{"../camera/CCCamera":91,"./CCComponent":106}],106:[(function(t,e){"use strict";var i=t("../platform/CCObject"),n=t("../platform/js"),r=new(t("../platform/id-generater"))("Comp"),a=(i.Flags.IsOnEnableCalled,i.Flags.IsOnLoadCalled),s=!!cc.ActionManager,o=cc.Class({name:"cc.Component",extends:i,ctor:function(){this._id=r.getNewId(),this.__eventTargets=[]},properties:{node:{default:null,visible:!1},name:{get:function(){if(this._name)return this._name;var t=cc.js.getClassName(this),e=t.lastIndexOf(".");return e>=0&&(t=t.slice(e+1)),this.node.name+"<"+t+">"},set:function(t){this._name=t},visible:!1},uuid:{get:function(){return this._id},visible:!1},__scriptAsset:!1,_enabled:!0,enabled:{get:function(){return this._enabled},set:function(t){if(this._enabled!==t&&(this._enabled=t,this.node._activeInHierarchy)){var e=cc.director._compScheduler;t?e.enableComp(this):e.disableComp(this)}},visible:!1,animatable:!0},enabledInHierarchy:{get:function(){return this._enabled&&this.node&&this.node._activeInHierarchy},visible:!1},_isOnLoadCalled:{get:function(){return this._objFlags&a}}},update:null,lateUpdate:null,__preload:null,onLoad:null,start:null,onEnable:null,onDisable:null,onDestroy:null,onFocusInEditor:null,onLostFocusInEditor:null,resetInEditor:null,addComponent:function(t){return this.node.addComponent(t)},getComponent:function(t){return this.node.getComponent(t)},getComponents:function(t){return this.node.getComponents(t)},getComponentInChildren:function(t){return this.node.getComponentInChildren(t)},getComponentsInChildren:function(t){return this.node.getComponentsInChildren(t)},_getLocalBounds:null,onRestore:null,destroy:function(){this._super()&&this._enabled&&this.node._activeInHierarchy&&cc.director._compScheduler.disableComp(this)},_onPreDestroy:function(){s&&cc.director.getActionManager().removeAllActionsFromTarget(this),this.unscheduleAllCallbacks();for(var t=this.__eventTargets,e=t.length-1;e>=0;--e){var i=t[e];i&&i.targetOff(this)}t.length=0,cc.director._nodeActivator.destroyComp(this),this.node._removeComponent(this)},_instantiate:function(t){return t||(t=cc.instantiate._clone(this,this)),t.node=null,t},schedule:function(t,e,i,n){cc.assertID(t,1619),e=e||0,cc.assertID(e>=0,1620),i=isNaN(i)?cc.macro.REPEAT_FOREVER:i,n=n||0;var r=cc.director.getScheduler(),a=r.isTargetPaused(this);r.schedule(t,this,e,i,n,a)},scheduleOnce:function(t,e){this.schedule(t,0,0,e)},unschedule:function(t){t&&cc.director.getScheduler().unschedule(t,this)},unscheduleAllCallbacks:function(){cc.director.getScheduler().unscheduleAllForTarget(this)}});o._requireComponent=null,o._executionOrder=0,n.value(o,"_registerEditorProps",(function(t,e){var i=e.requireComponent;i&&(t._requireComponent=i);var n=e.executionOrder;n&&"number"==typeof n&&(t._executionOrder=n)})),o.prototype.__scriptUuid="",cc.Component=e.exports=o}),{"../platform/CCObject":174,"../platform/id-generater":185,"../platform/js":189}],107:[(function(){"use strict";cc.Component.EventHandler=cc.Class({name:"cc.ClickEvent",properties:{target:{default:null,type:cc.Node},component:"",_componentId:"",_componentName:{get:function(){return this._genCompIdIfNeeded(),this._compId2Name(this._componentId)},set:function(t){this._componentId=this._compName2Id(t)}},handler:{default:""},customEventData:{default:""}},statics:{emitEvents:function(t){var e;if(arguments.length>0)for(var i=0,n=(e=new Array(arguments.length-1)).length;i<n;i++)e[i]=arguments[i+1];for(var r=0,a=t.length;r<a;r++){var s=t[r];s instanceof cc.Component.EventHandler&&s.emit(e)}}},emit:function(t){var e=this.target;if(cc.isValid(e)){this._genCompIdIfNeeded();var i=cc.js._getClassById(this._componentId),n=e.getComponent(i);if(cc.isValid(n)){var r=n[this.handler];"function"==typeof r&&(null!=this.customEventData&&""!==this.customEventData&&(t=t.slice()).push(this.customEventData),r.apply(n,t))}}},_compName2Id:function(t){var e=cc.js.getClassByName(t);return cc.js._getClassId(e)},_compId2Name:function(t){var e=cc.js._getClassById(t);return cc.js.getClassName(e)},_genCompIdIfNeeded:function(){this._componentId||(this._componentName=this.component,this.component="")}})}),{}],108:[(function(t,e){"use strict";var i=t("../platform/CCMacro"),n=t("./CCRenderComponent"),r=(t("../assets/material/CCMaterial"),t("../renderer/utils/label/label-frame")),a=t("../utils/blend-func"),s=t("../renderer/utils/utils").deleteFromDynamicAtlas,o=i.TextAlignment,c=i.VerticalTextAlignment,l=cc.Enum({NONE:0,CLAMP:1,SHRINK:2,RESIZE_HEIGHT:3}),h=cc.Enum({NONE:0,BITMAP:1,CHAR:2}),u=cc.Class({name:"cc.Label",extends:n,mixins:[a],ctor:function(){this._actualFontSize=0,this._assemblerData=null,this._frame=null,this._ttfTexture=null,this._letterTexture=null,cc.game.renderType===cc.game.RENDER_TYPE_CANVAS?this._updateMaterial=this._updateMaterialCanvas:this._updateMaterial=this._updateMaterialWebgl},editor:!1,properties:{_string:{default:"",formerlySerializedAs:"_N$string"},string:{get:function(){return this._string},set:function(t){var e=this._string;this._string=""+t,this.string!==e&&this.setVertsDirty(),this._checkStringEmpty()},multiline:!0,tooltip:!1},horizontalAlign:{default:o.LEFT,type:o,tooltip:!1,notify:function(t){this.horizontalAlign!==t&&this.setVertsDirty()},animatable:!1},verticalAlign:{default:c.TOP,type:c,tooltip:!1,notify:function(t){this.verticalAlign!==t&&this.setVertsDirty()},animatable:!1},actualFontSize:{displayName:"Actual Font Size",animatable:!1,readonly:!0,get:function(){return this._actualFontSize},tooltip:!1},_fontSize:40,fontSize:{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.setVertsDirty())},range:[0,512],tooltip:!1},fontFamily:{default:"Arial",tooltip:!1,notify:function(t){this.fontFamily!==t&&this.setVertsDirty()},animatable:!1},_lineHeight:40,lineHeight:{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.setVertsDirty())},tooltip:!1},overflow:{default:l.NONE,type:l,tooltip:!1,notify:function(t){this.overflow!==t&&this.setVertsDirty()},animatable:!1},_enableWrapText:!0,enableWrapText:{get:function(){return this._enableWrapText},set:function(t){this._enableWrapText!==t&&(this._enableWrapText=t,this.setVertsDirty())},animatable:!1,tooltip:!1},_N$file:null,font:{get:function(){return this._N$file},set:function(t){this.font!==t&&(t||(this._isSystemFontUsed=!0),this._N$file=t,t&&this._isSystemFontUsed&&(this._isSystemFontUsed=!1),this.enabledInHierarchy&&this._forceUpdateRenderData())},type:cc.Font,tooltip:!1,animatable:!1},_isSystemFontUsed:!0,useSystemFont:{get:function(){return this._isSystemFontUsed},set:function(t){if(this._isSystemFontUsed!==t){if(this._isSystemFontUsed=!!t,t){if(this.font=null,!this.enabledInHierarchy)return;this._forceUpdateRenderData()}this.markForValidate()}},animatable:!1,tooltip:!1},_bmFontOriginalSize:{displayName:"BMFont Original Size",get:function(){return this._N$file instanceof cc.BitmapFont?this._N$file.fontSize:-1},visible:!0,animatable:!1},_spacingX:0,spacingX:{get:function(){return this._spacingX},set:function(t){this._spacingX=t,this.setVertsDirty()},tooltip:!1},_batchAsBitmap:!1,cacheMode:{default:h.NONE,type:h,tooltip:!1,notify:function(t){this.cacheMode!==t&&(t!==h.BITMAP||this.font instanceof cc.BitmapFont||this._frame&&this._frame._resetDynamicAtlasFrame(),t===h.CHAR&&(this._ttfTexture=null),this.enabledInHierarchy&&this._forceUpdateRenderData())},animatable:!1},_styleFlags:0,enableBold:{get:function(){return!!(1&this._styleFlags)},set:function(t){t?this._styleFlags|=1:this._styleFlags&=-2,this.setVertsDirty()},animatable:!1,tooltip:!1},enableItalic:{get:function(){return!!(2&this._styleFlags)},set:function(t){t?this._styleFlags|=2:this._styleFlags&=-3,this.setVertsDirty()},animatable:!1,tooltip:!1},enableUnderline:{get:function(){return!!(4&this._styleFlags)},set:function(t){t?this._styleFlags|=4:this._styleFlags&=-5,this.setVertsDirty()},animatable:!1,tooltip:!1},_underlineHeight:0,underlineHeight:{get:function(){return this._underlineHeight},set:function(t){this._underlineHeight!==t&&(this._underlineHeight=t,this.setVertsDirty())},tooltip:!1}},statics:{HorizontalAlign:o,VerticalAlign:c,Overflow:l,CacheMode:h,_shareAtlas:null,clearCharCache:function(){u._shareAtlas&&u._shareAtlas.clearAllCache()}},onLoad:function(){this._batchAsBitmap&&this.cacheMode===h.NONE&&(this.cacheMode=h.BITMAP,this._batchAsBitmap=!1),cc.game.renderType===cc.game.RENDER_TYPE_CANVAS&&(this.cacheMode=h.NONE)},onEnable:function(){this._super(),this.node.on(cc.Node.EventType.SIZE_CHANGED,this._nodeSizeChanged,this),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this.setVertsDirty,this),this.node.on(cc.Node.EventType.COLOR_CHANGED,this._nodeColorChanged,this),this._forceUpdateRenderData()},onDisable:function(){this._super(),this.node.off(cc.Node.EventType.SIZE_CHANGED,this._nodeSizeChanged,this),this.node.off(cc.Node.EventType.ANCHOR_CHANGED,this.setVertsDirty,this),this.node.off(cc.Node.EventType.COLOR_CHANGED,this._nodeColorChanged,this)},onDestroy:function(){this._assembler&&this._assembler._resetAssemblerData&&this._assembler._resetAssemblerData(this._assemblerData),this._assemblerData=null,this._letterTexture=null,this._ttfTexture&&(this._ttfTexture.destroy(),this._ttfTexture=null),this._super()},onRestore:!1,_nodeSizeChanged:function(){this.overflow!==l.NONE&&this.setVertsDirty()},_nodeColorChanged:function(){this.font instanceof cc.BitmapFont||this.setVertsDirty()},setVertsDirty:function(){this._super()},_updateColor:function(){this.font instanceof cc.BitmapFont||this._srcBlendFactor===cc.macro.BlendFactor.SRC_ALPHA&&this.node._renderFlag&cc.RenderFlow.FLAG_OPACITY||this.setVertsDirty(),n.prototype._updateColor.call(this)},_validateRender:function(){if(this.string){if(this._materials[0]){var t=this.font;if(!(t instanceof cc.BitmapFont))return;var e=t.spriteFrame;if(e&&e.textureLoaded()&&t._fntConfig)return}this.disableRender()}else this.disableRender()},_resetAssembler:function(){this._resetFrame(),n.prototype._resetAssembler.call(this)},_resetFrame:function(){!this._frame||this.font instanceof cc.BitmapFont||(s(this,this._frame),this._frame=null)},_checkStringEmpty:function(){this.markForRender(!!this.string)},_on3DNodeChanged:function(){this._resetAssembler(),this._applyFontTexture()},_onBMFontTextureLoaded:function(){this._frame._texture=this.font.spriteFrame._texture,this.markForRender(!0),this._updateMaterial(),this._assembler&&this._assembler.updateRenderData(this)},_onBlendChanged:function(){this.useSystemFont&&this.enabledInHierarchy&&this._forceUpdateRenderData()},_applyFontTexture:function(){var t=this.font;if(t instanceof cc.BitmapFont){var e=t.spriteFrame;this._frame=e,e&&e.onTextureLoaded(this._onBMFontTextureLoaded,this)}else this._nativeTTF()||(this._frame||(this._frame=new r),this.cacheMode===h.CHAR?(this._letterTexture=this._assembler._getAssemblerData(),this._frame._refreshTexture(this._letterTexture)):this._ttfTexture||(this._ttfTexture=new cc.Texture2D,this._assemblerData=this._assembler._getAssemblerData(),this._ttfTexture.initWithElement(this._assemblerData.canvas)),this.cacheMode!==h.CHAR&&(this._frame._resetDynamicAtlasFrame(),this._frame._refreshTexture(this._ttfTexture),this._srcBlendFactor===cc.macro.BlendFactor.ONE&&this._ttfTexture.setPremultiplyAlpha(!0)),this._updateMaterial()),this._assembler&&this._assembler.updateRenderData(this);this.markForValidate()},_updateMaterialCanvas:function(){this._frame&&(this._frame._texture._nativeUrl=this.uuid+"_texture")},_updateMaterialWebgl:function(){var t=this.getMaterial(0);this._nativeTTF()?t&&this._assembler._updateTTFMaterial(this):this._frame&&(t&&t.setProperty("texture",this._frame._texture),a.prototype._updateMaterial.call(this))},_forceUseCanvas:!1,_useNativeTTF:function(){return cc.macro.ENABLE_NATIVE_TTF_RENDERER&&!this._forceUseCanvas},_nativeTTF:function(){return this._useNativeTTF()&&!!this._assembler&&!!this._assembler._updateTTFMaterial},_forceUpdateRenderData:function(){this.setVertsDirty(),this._resetAssembler(),this._applyFontTexture()},_enableBold:function(t){this.enableBold=!!t},_enableItalics:function(t){this.enableItalic=!!t},_enableUnderline:function(t){this.enableUnderline=!!t}});cc.Label=e.exports=u}),{"../assets/material/CCMaterial":81,"../platform/CCMacro":173,"../renderer/utils/label/label-frame":204,"../renderer/utils/utils":207,"../utils/blend-func":237,"./CCRenderComponent":115}],109:[(function(t,e){"use strict";var i=cc.Class({name:"cc.LabelOutline",extends:t("./CCComponent"),editor:!1,properties:{_color:cc.Color.WHITE,_width:1,color:{tooltip:!1,get:function(){return this._color.clone()},set:function(t){this._color.equals(t)||this._color.set(t),this._updateRenderData()}},width:{tooltip:!1,get:function(){return this._width},set:function(t){this._width!==t&&(this._width=t,this._updateRenderData())},range:[0,512]}},onEnable:function(){this._updateRenderData()},onDisable:function(){this._updateRenderData()},_updateRenderData:function(){var t=this.node.getComponent(cc.Label);t&&t.setVertsDirty()}});cc.LabelOutline=e.exports=i}),{"./CCComponent":106}],110:[(function(t,e){"use strict";var i=cc.Class({name:"cc.LabelShadow",extends:t("./CCComponent"),editor:!1,properties:{_color:cc.Color.WHITE,_offset:cc.v2(2,2),_blur:2,color:{tooltip:!1,get:function(){return this._color.clone()},set:function(t){this._color.equals(t)||this._color.set(t),this._updateRenderData()}},offset:{tooltip:!1,get:function(){return this._offset},set:function(t){this._offset=t,this._updateRenderData()}},blur:{tooltip:!1,get:function(){return this._blur},set:function(t){this._blur=t,this._updateRenderData()},range:[0,1024]}},onEnable:function(){this._updateRenderData()},onDisable:function(){this._updateRenderData()},_updateRenderData:function(){var t=this.node.getComponent(cc.Label);t&&t.setVertsDirty()}});cc.LabelShadow=e.exports=i}),{"./CCComponent":106}],111:[(function(t,e){"use strict";var i=t("../CCNode").EventType,n=cc.Enum({NONE:0,HORIZONTAL:1,VERTICAL:2,GRID:3}),r=cc.Enum({NONE:0,CONTAINER:1,CHILDREN:2}),a=cc.Enum({HORIZONTAL:0,VERTICAL:1}),s=cc.Enum({BOTTOM_TO_TOP:0,TOP_TO_BOTTOM:1}),o=cc.Enum({LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1}),c=cc.Class({name:"cc.Layout",extends:t("./CCComponent"),editor:!1,properties:{_layoutSize:cc.size(300,200),_layoutDirty:{default:!0,serializable:!1},_resize:r.NONE,_N$layoutType:n.NONE,type:{type:n,get:function(){return this._N$layoutType},set:function(t){this._N$layoutType=t,this._doLayoutDirty()},tooltip:!1,animatable:!1},resizeMode:{type:r,tooltip:!1,animatable:!1,get:function(){return this._resize},set:function(t){this.type===n.NONE&&t===r.CHILDREN||(this._resize=t,this._doLayoutDirty())}},cellSize:{default:cc.size(40,40),tooltip:!1,type:cc.Size,notify:function(){this._doLayoutDirty()}},startAxis:{default:a.HORIZONTAL,tooltip:!1,type:a,notify:function(){this._doLayoutDirty()},animatable:!1},paddingLeft:{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingRight:{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingTop:{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingBottom:{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},spacingX:{default:0,notify:function(){this._doLayoutDirty()},tooltip:!1},spacingY:{default:0,notify:function(){this._doLayoutDirty()},tooltip:!1},verticalDirection:{default:s.TOP_TO_BOTTOM,type:s,notify:function(){this._doLayoutDirty()},tooltip:!1,animatable:!1},horizontalDirection:{default:o.LEFT_TO_RIGHT,type:o,notify:function(){this._doLayoutDirty()},tooltip:!1,animatable:!1},affectedByScale:{default:!1,notify:function(){this._doLayoutDirty()},animatable:!1,tooltip:!1}},statics:{Type:n,VerticalDirection:s,HorizontalDirection:o,ResizeMode:r,AxisDirection:a},onEnable:function(){this._addEventListeners(),this.node.getContentSize().equals(cc.size(0,0))&&this.node.setContentSize(this._layoutSize),this._doLayoutDirty()},onDisable:function(){this._removeEventListeners()},_doLayoutDirty:function(){this._layoutDirty=!0},_doScaleDirty:function(){this._layoutDirty=this._layoutDirty||this.affectedByScale},_addEventListeners:function(){cc.director.on(cc.Director.EVENT_AFTER_UPDATE,this.updateLayout,this),this.node.on(i.SIZE_CHANGED,this._resized,this),this.node.on(i.ANCHOR_CHANGED,this._doLayoutDirty,this),this.node.on(i.CHILD_ADDED,this._childAdded,this),this.node.on(i.CHILD_REMOVED,this._childRemoved,this),this.node.on(i.CHILD_REORDER,this._doLayoutDirty,this),this._addChildrenEventListeners()},_removeEventListeners:function(){cc.director.off(cc.Director.EVENT_AFTER_UPDATE,this.updateLayout,this),this.node.off(i.SIZE_CHANGED,this._resized,this),this.node.off(i.ANCHOR_CHANGED,this._doLayoutDirty,this),this.node.off(i.CHILD_ADDED,this._childAdded,this),this.node.off(i.CHILD_REMOVED,this._childRemoved,this),this.node.off(i.CHILD_REORDER,this._doLayoutDirty,this),this._removeChildrenEventListeners()},_addChildrenEventListeners:function(){for(var t=this.node.children,e=0;e<t.length;++e){var n=t[e];n.on(i.SCALE_CHANGED,this._doScaleDirty,this),n.on(i.SIZE_CHANGED,this._doLayoutDirty,this),n.on(i.POSITION_CHANGED,this._doLayoutDirty,this),n.on(i.ANCHOR_CHANGED,this._doLayoutDirty,this),n.on("active-in-hierarchy-changed",this._doLayoutDirty,this)}},_removeChildrenEventListeners:function(){for(var t=this.node.children,e=0;e<t.length;++e){var n=t[e];n.off(i.SCALE_CHANGED,this._doScaleDirty,this),n.off(i.SIZE_CHANGED,this._doLayoutDirty,this),n.off(i.POSITION_CHANGED,this._doLayoutDirty,this),n.off(i.ANCHOR_CHANGED,this._doLayoutDirty,this),n.off("active-in-hierarchy-changed",this._doLayoutDirty,this)}},_childAdded:function(t){t.on(i.SCALE_CHANGED,this._doScaleDirty,this),t.on(i.SIZE_CHANGED,this._doLayoutDirty,this),t.on(i.POSITION_CHANGED,this._doLayoutDirty,this),t.on(i.ANCHOR_CHANGED,this._doLayoutDirty,this),t.on("active-in-hierarchy-changed",this._doLayoutDirty,this),this._doLayoutDirty()},_childRemoved:function(t){t.off(i.SCALE_CHANGED,this._doScaleDirty,this),t.off(i.SIZE_CHANGED,this._doLayoutDirty,this),t.off(i.POSITION_CHANGED,this._doLayoutDirty,this),t.off(i.ANCHOR_CHANGED,this._doLayoutDirty,this),t.off("active-in-hierarchy-changed",this._doLayoutDirty,this),this._doLayoutDirty()},_resized:function(){this._layoutSize=this.node.getContentSize(),this._doLayoutDirty()},_doLayoutHorizontally:function(t,e,i,a){var c=this.node.getAnchorPoint(),l=this.node.children,h=1,u=this.paddingLeft,f=-c.x*t;this.horizontalDirection===o.RIGHT_TO_LEFT&&(h=-1,f=(1-c.x)*t,u=this.paddingRight);for(var _=f+h*u-h*this.spacingX,d=0,p=0,m=0,v=0,g=0,y=0,T=0,A=0;A<l.length;++A)(E=l[A]).activeInHierarchy&&T++;var b=this.cellSize.width;for(this.type!==n.GRID&&this.resizeMode===r.CHILDREN&&(b=(t-(this.paddingLeft+this.paddingRight)-(T-1)*this.spacingX)/T),A=0;A<l.length;++A){var E=l[A],C=this._getUsedScaleValue(E.scaleX),x=this._getUsedScaleValue(E.scaleY);if(E.activeInHierarchy){this._resize===r.CHILDREN&&(E.width=b/C,this.type===n.GRID&&(E.height=this.cellSize.height/x));var S=E.anchorX,w=E.width*C,D=E.height*x;m>p&&(p=m),D>=p&&(m=p,p=D,y=E.getAnchorPoint().y),this.horizontalDirection===o.RIGHT_TO_LEFT&&(S=1-E.anchorX),_=_+h*S*w+h*this.spacingX;var M=h*(1-S)*w;if(e){var R=_+M+h*(h>0?this.paddingRight:this.paddingLeft),I=this.horizontalDirection===o.LEFT_TO_RIGHT&&R>(1-c.x)*t,O=this.horizontalDirection===o.RIGHT_TO_LEFT&&R<-c.x*t;(I||O)&&(D>=p?(0===m&&(m=p),d+=m,m=p):(d+=p,m=D,p=0),_=f+h*(u+S*w),v++)}var P=i(E,d,v);t>=w+this.paddingLeft+this.paddingRight&&a&&E.setPosition(cc.v2(_,P));var N,F=1,L=0===p?D:p;this.verticalDirection===s.TOP_TO_BOTTOM?(g=g||this.node._contentSize.height,(N=P+(F=-1)*(L*y+this.paddingBottom))<g&&(g=N)):(g=g||-this.node._contentSize.height,(N=P+F*(L*y+this.paddingTop))>g&&(g=N)),_+=M}}return g},_getVerticalBaseHeight:function(t){var e=0,i=0;if(this.resizeMode===r.CONTAINER){for(var n=0;n<t.length;++n){var a=t[n];a.activeInHierarchy&&(i++,e+=a.height*this._getUsedScaleValue(a.scaleY))}e+=(i-1)*this.spacingY+this.paddingBottom+this.paddingTop}else e=this.node.getContentSize().height;return e},_doLayoutVertically:function(t,e,i,a){var c=this.node.getAnchorPoint(),l=this.node.children,h=1,u=this.paddingBottom,f=-c.y*t;this.verticalDirection===s.TOP_TO_BOTTOM&&(h=-1,f=(1-c.y)*t,u=this.paddingTop);for(var _=f+h*u-h*this.spacingY,d=0,p=0,m=0,v=0,g=0,y=0,T=0,A=0;A<l.length;++A)(E=l[A]).activeInHierarchy&&T++;var b=this.cellSize.height;for(this.type!==n.GRID&&this.resizeMode===r.CHILDREN&&(b=(t-(this.paddingTop+this.paddingBottom)-(T-1)*this.spacingY)/T),A=0;A<l.length;++A){var E=l[A],C=this._getUsedScaleValue(E.scaleX),x=this._getUsedScaleValue(E.scaleY);if(E.activeInHierarchy){this.resizeMode===r.CHILDREN&&(E.height=b/x,this.type===n.GRID&&(E.width=this.cellSize.width/C));var S=E.anchorY,w=E.width*C,D=E.height*x;m>p&&(p=m),w>=p&&(m=p,p=w,y=E.getAnchorPoint().x),this.verticalDirection===s.TOP_TO_BOTTOM&&(S=1-E.anchorY),_=_+h*S*D+h*this.spacingY;var M=h*(1-S)*D;if(e){var R=_+M+h*(h>0?this.paddingTop:this.paddingBottom),I=this.verticalDirection===s.BOTTOM_TO_TOP&&R>(1-c.y)*t,O=this.verticalDirection===s.TOP_TO_BOTTOM&&R<-c.y*t;(I||O)&&(w>=p?(0===m&&(m=p),d+=m,m=p):(d+=p,m=w,p=0),_=f+h*(u+S*D),v++)}var P=i(E,d,v);t>=D+(this.paddingTop+this.paddingBottom)&&a&&E.setPosition(cc.v2(P,_));var N,F=1,L=0===p?w:p;this.horizontalDirection===o.RIGHT_TO_LEFT?(F=-1,g=g||this.node._contentSize.width,(N=P+F*(L*y+this.paddingLeft))<g&&(g=N)):(g=g||-this.node._contentSize.width,(N=P+F*(L*y+this.paddingRight))>g&&(g=N)),_+=M}}return g},_doLayoutBasic:function(){for(var t=this.node.children,e=null,i=0;i<t.length;++i){var n=t[i];n.activeInHierarchy&&(e?e.union(e,n.getBoundingBoxToWorld()):e=n.getBoundingBoxToWorld())}if(e){var r=this.node.convertToNodeSpaceAR(cc.v2(e.x,e.y));r=cc.v2(r.x-this.paddingLeft,r.y-this.paddingBottom);var a=this.node.convertToNodeSpaceAR(cc.v2(e.xMax,e.yMax)),s=(a=cc.v2(a.x+this.paddingRight,a.y+this.paddingTop)).sub(r);if(0!==(s=cc.size(parseFloat(s.x.toFixed(2)),parseFloat(s.y.toFixed(2)))).width){var o=-r.x/s.width;this.node.anchorX=parseFloat(o.toFixed(2))}if(0!==s.height){var c=-r.y/s.height;this.node.anchorY=parseFloat(c.toFixed(2))}this.node.setContentSize(s)}},_doLayoutGridAxisHorizontal:function(t,e){var i=e.width,n=1,a=-t.y*e.height,o=this.paddingBottom;this.verticalDirection===s.TOP_TO_BOTTOM&&(n=-1,a=(1-t.y)*e.height,o=this.paddingTop);var c=function(t,e,i){return a+n*(e+t.anchorY*t.height*this._getUsedScaleValue(t.scaleY)+o+i*this.spacingY)}.bind(this),l=0;if(this.resizeMode===r.CONTAINER){var h=this._doLayoutHorizontally(i,!0,c,!1);(l=a-h)<0&&(l*=-1),a=-t.y*l,this.verticalDirection===s.TOP_TO_BOTTOM&&(n=-1,a=(1-t.y)*l)}this._doLayoutHorizontally(i,!0,c,!0),this.resizeMode===r.CONTAINER&&this.node.setContentSize(i,l)},_doLayoutGridAxisVertical:function(t,e){var i=e.height,n=1,a=-t.x*e.width,s=this.paddingLeft;this.horizontalDirection===o.RIGHT_TO_LEFT&&(n=-1,a=(1-t.x)*e.width,s=this.paddingRight);var c=function(t,e,i){return a+n*(e+t.anchorX*t.width*this._getUsedScaleValue(t.scaleX)+s+i*this.spacingX)}.bind(this),l=0;if(this.resizeMode===r.CONTAINER){var h=this._doLayoutVertically(i,!0,c,!1);(l=a-h)<0&&(l*=-1),a=-t.x*l,this.horizontalDirection===o.RIGHT_TO_LEFT&&(n=-1,a=(1-t.x)*l)}this._doLayoutVertically(i,!0,c,!0),this.resizeMode===r.CONTAINER&&this.node.setContentSize(l,i)},_doLayoutGrid:function(){var t=this.node.getAnchorPoint(),e=this.node.getContentSize();this.startAxis===a.HORIZONTAL?this._doLayoutGridAxisHorizontal(t,e):this.startAxis===a.VERTICAL&&this._doLayoutGridAxisVertical(t,e)},_getHorizontalBaseWidth:function(t){var e=0,i=0;if(this.resizeMode===r.CONTAINER){for(var n=0;n<t.length;++n){var a=t[n];a.activeInHierarchy&&(i++,e+=a.width*this._getUsedScaleValue(a.scaleX))}e+=(i-1)*this.spacingX+this.paddingLeft+this.paddingRight}else e=this.node.getContentSize().width;return e},_doLayout:function(){if(this.type===n.HORIZONTAL){var t=this._getHorizontalBaseWidth(this.node.children);this._doLayoutHorizontally(t,!1,(function(t){return t.y}),!0),this.node.width=t}else if(this.type===n.VERTICAL){var e=this._getVerticalBaseHeight(this.node.children);this._doLayoutVertically(e,!1,(function(t){return t.x}),!0),this.node.height=e}else this.type===n.NONE?this.resizeMode===r.CONTAINER&&this._doLayoutBasic():this.type===n.GRID&&this._doLayoutGrid()},_getUsedScaleValue:function(t){return this.affectedByScale?Math.abs(t):1},updateLayout:function(){this._layoutDirty&&this.node.children.length>0&&this.node.children.find((function(t){return t.activeInHierarchy}))&&(this._doLayout(),this._layoutDirty=!1)}});cc.Layout=e.exports=c}),{"../CCNode":29,"./CCComponent":106}],112:[(function(t,e){"use strict";var i=s(t("../../renderer/gfx")),n=s(t("../value-types/mat4")),r=s(t("../value-types/vec2")),a=s(t("../assets/material/material-variant"));function s(t){return t&&t.__esModule?t:{default:t}}var o=t("../utils/misc"),c=t("./CCRenderComponent"),l=t("../renderer/render-flow"),h=t("../graphics/graphics"),u=new r.default,f=new n.default,_=[];function d(t,e,i){_.length=0;for(var n=2*Math.PI/i,r=0;r<i;++r)_.push(cc.v2(e.x*Math.cos(n*r)+t.x,e.y*Math.sin(n*r)+t.y));return _}var p=cc.Enum({RECT:0,ELLIPSE:1,IMAGE_STENCIL:2}),m=cc.Class({name:"cc.Mask",extends:c,editor:!1,ctor:function(){this._graphics=null,this._enableMaterial=null,this._exitMaterial=null,this._clearMaterial=null},properties:{_spriteFrame:{default:null,type:cc.SpriteFrame},_type:p.RECT,type:{get:function(){return this._type},set:function(t){this._type!==t&&this._resetAssembler(),this._type=t,this._type!==p.IMAGE_STENCIL&&(this.spriteFrame=null,this.alphaThreshold=0,this._updateGraphics()),this._activateMaterial()},type:p,tooltip:!1},spriteFrame:{type:cc.SpriteFrame,tooltip:!1,get:function(){return this._spriteFrame},set:function(t){var e=this._spriteFrame;e!==t&&(e&&e.off("load",this.setVertsDirty,this),this._spriteFrame=t,this.setVertsDirty(),this._updateMaterial())}},alphaThreshold:{default:.1,type:cc.Float,range:[0,1,.1],slide:!0,tooltip:!1,notify:function(){cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS?this._updateMaterial():cc.warnID(4201)}},inverted:{default:!1,type:cc.Boolean,tooltip:!1,notify:function(){cc.game.renderType===cc.game.RENDER_TYPE_CANVAS&&cc.warnID(4202)}},_segments:64,segements:{get:function(){return this._segments},set:function(t){this._segments=o.clampf(t,3,1e4),this._updateGraphics()},type:cc.Integer,tooltip:!1},_resizeToTarget:{animatable:!1,set:function(t){t&&this._resizeNodeToTargetNode()}}},statics:{Type:p},onRestore:function(){this._activateMaterial()},onEnable:function(){this._super(),this._type!==p.IMAGE_STENCIL?this._updateGraphics():this._spriteFrame&&this._spriteFrame.once("load",this.setVertsDirty,this),this.node.on(cc.Node.EventType.POSITION_CHANGED,this._updateGraphics,this),this.node.on(cc.Node.EventType.ROTATION_CHANGED,this._updateGraphics,this),this.node.on(cc.Node.EventType.SCALE_CHANGED,this._updateGraphics,this),this.node.on(cc.Node.EventType.SIZE_CHANGED,this._updateGraphics,this),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this._updateGraphics,this)},onDisable:function(){this._super(),this.node.off(cc.Node.EventType.POSITION_CHANGED,this._updateGraphics,this),this.node.off(cc.Node.EventType.ROTATION_CHANGED,this._updateGraphics,this),this.node.off(cc.Node.EventType.SCALE_CHANGED,this._updateGraphics,this),this.node.off(cc.Node.EventType.SIZE_CHANGED,this._updateGraphics,this),this.node.off(cc.Node.EventType.ANCHOR_CHANGED,this._updateGraphics,this),this.node._renderFlag&=~l.FLAG_POST_RENDER},onDestroy:function(){this._super(),this._removeGraphics(),this._spriteFrame&&this._spriteFrame.off("load",this.setVertsDirty,this)},_resizeNodeToTargetNode:!1,_validateRender:function(){if(this._type===p.IMAGE_STENCIL){var t=this._spriteFrame;t&&t.textureLoaded()||this.disableRender()}},_activateMaterial:function(){this._createGraphics();var t=this._materials[0];(t=t?a.default.create(t,this):a.default.createWithBuiltin("2d-sprite",this)).define("USE_ALPHA_TEST",!0),this._type===p.IMAGE_STENCIL?(t.define("CC_USE_MODEL",!1),t.define("USE_TEXTURE",!0)):(t.define("CC_USE_MODEL",!0),t.define("USE_TEXTURE",!1)),this._enableMaterial||(this._enableMaterial=a.default.createWithBuiltin("2d-sprite",this)),this._exitMaterial||(this._exitMaterial=a.default.createWithBuiltin("2d-sprite",this),this._exitMaterial.setStencilEnabled(i.default.STENCIL_DISABLE)),this._clearMaterial||(this._clearMaterial=a.default.createWithBuiltin("clear-stencil",this)),this.setMaterial(0,t),this._graphics._materials[0]=t,this._updateMaterial()},_updateMaterial:function(){var t=this._materials[0];if(t){if(this._type===p.IMAGE_STENCIL&&this.spriteFrame){var e=this.spriteFrame.getTexture();t.setProperty("texture",e)}t.setProperty("alphaThreshold",this.alphaThreshold)}},_createGraphics:function(){this._graphics||(this._graphics=new h,cc.Assembler.init(this._graphics),this._graphics.node=this.node,this._graphics.lineWidth=0,this._graphics.strokeColor=cc.color(0,0,0,0))},_updateGraphics:function(){if(this.enabledInHierarchy){var t=this.node,e=this._graphics;e.clear(!1);var i=t._contentSize.width,n=t._contentSize.height,r=-i*t._anchorPoint.x,a=-n*t._anchorPoint.y;if(this._type===p.RECT)e.rect(r,a,i,n);else if(this._type===p.ELLIPSE){for(var s=d(cc.v2(r+i/2,a+n/2),{x:i/2,y:n/2},this._segments),o=0;o<s.length;++o){var c=s[o];0===o?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y)}e.close()}cc.game.renderType===cc.game.RENDER_TYPE_CANVAS?e.stroke():e.fill(),this.setVertsDirty()}},_removeGraphics:function(){this._graphics&&(this._graphics.destroy(),this._graphics._destroyImmediate(),this._graphics=null)},_hitTest:function(t){var e=this.node,i=e.getContentSize(),a=i.width,s=i.height,o=u;if(e._updateWorldMatrix(),!n.default.invert(f,e._worldMatrix))return!1;r.default.transformMat4(o,t,f),o.x+=e._anchorPoint.x*a,o.y+=e._anchorPoint.y*s;var c=!1;if(this.type===p.RECT||this.type===p.IMAGE_STENCIL)c=o.x>=0&&o.y>=0&&o.x<=a&&o.y<=s;else if(this.type===p.ELLIPSE){var l=a/2,h=s/2,_=o.x-.5*a,d=o.y-.5*s;c=_*_/(l*l)+d*d/(h*h)<1}return this.inverted&&(c=!c),c},markForRender:function(t){var e=l.FLAG_RENDER|l.FLAG_UPDATE_RENDER_DATA|l.FLAG_POST_RENDER;t?(this.node._renderFlag|=e,this.markForValidate()):t||(this.node._renderFlag&=~e)},disableRender:function(){this.node._renderFlag&=~(l.FLAG_RENDER|l.FLAG_UPDATE_RENDER_DATA|l.FLAG_POST_RENDER)}});cc.Mask=e.exports=m}),{"../../renderer/gfx":290,"../assets/material/material-variant":88,"../graphics/graphics":157,"../renderer/render-flow":200,"../utils/misc":242,"../value-types/mat4":259,"../value-types/vec2":266,"./CCRenderComponent":115}],113:[(function(t,e){"use strict";var i=t("../components/CCRenderComponent"),n=t("../../core/utils/blend-func"),r=cc.Class({name:"cc.MotionStreak",extends:i,mixins:[n],editor:!1,ctor:function(){this._points=[],this._lastWPos=new cc.Vec2,this._lastWPosUpdated=!1},properties:{preview:{default:!1,editorOnly:!0,notify:!1,animatable:!1},_fadeTime:1,fadeTime:{get:function(){return this._fadeTime},set:function(t){this._fadeTime=t,this.reset()},animatable:!1,tooltip:!1},_minSeg:1,minSeg:{get:function(){return this._minSeg},set:function(t){this._minSeg=t},animatable:!1,tooltip:!1},_stroke:64,stroke:{get:function(){return this._stroke},set:function(t){this._stroke=t},animatable:!1,tooltip:!1},_texture:{default:null,type:cc.Texture2D},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this._updateMaterial())},type:cc.Texture2D,animatable:!1,tooltip:!1},_color:cc.Color.WHITE,color:{get:function(){return this._color.clone()},set:function(t){this._color.equals(t)||this._color.set(t)},type:cc.Color,tooltip:!1},_fastMode:!1,fastMode:{get:function(){return this._fastMode},set:function(t){this._fastMode=t},animatable:!1,tooltip:!1}},onEnable:function(){this._super(),this.reset()},_updateMaterial:function(){var t=this.getMaterial(0);t&&t.setProperty("texture",this._texture),n.prototype._updateMaterial.call(this)},onFocusInEditor:!1,onLostFocusInEditor:!1,reset:function(){this._points.length=0,this._assembler&&this._assembler._renderData.clear(),this._lastWPosUpdated=!1},lateUpdate:function(t){this._assembler&&this._assembler.update(this,t)}});cc.MotionStreak=e.exports=r}),{"../../core/utils/blend-func":237,"../components/CCRenderComponent":115}],114:[(function(t,e){"use strict";var i=t("../utils/misc"),n=t("./CCComponent"),r=cc.Enum({HORIZONTAL:0,VERTICAL:1,FILLED:2}),a=cc.Class({name:"cc.ProgressBar",extends:n,editor:!1,_initBarSprite:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e=this.node.getContentSize(),i=this.node.getAnchorPoint(),n=t.getContentSize();t.parent===this.node&&this.node.setContentSize(n),this.barSprite.fillType===cc.Sprite.FillType.RADIAL&&(this.mode=r.FILLED);var a=t.getContentSize();if(this.mode===r.HORIZONTAL?this.totalLength=a.width:this.mode===r.VERTICAL?this.totalLength=a.height:this.totalLength=this.barSprite.fillRange,t.parent===this.node){var s=-e.width*i.x;t.setPosition(cc.v2(s,0))}}},_updateBarStatus:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e,n,a,s=t.getAnchorPoint(),o=t.getContentSize(),c=t.getPosition(),l=cc.v2(0,.5),h=i.clamp01(this.progress),u=this.totalLength*h;switch(this.mode){case r.HORIZONTAL:this.reverse&&(l=cc.v2(1,.5)),e=cc.size(u,o.height),n=this.totalLength,a=o.height;break;case r.VERTICAL:l=this.reverse?cc.v2(.5,1):cc.v2(.5,0),e=cc.size(o.width,u),n=o.width,a=this.totalLength}if(this.mode===r.FILLED)this.barSprite.type!==cc.Sprite.Type.FILLED?cc.warn("ProgressBar FILLED mode only works when barSprite's Type is FILLED!"):(this.reverse&&(u*=-1),this.barSprite.fillRange=u);else if(this.barSprite.type!==cc.Sprite.Type.FILLED){var f=l.x-s.x,_=l.y-s.y,d=cc.v2(n*f,a*_);t.setPosition(c.x+d.x,c.y+d.y),t.setAnchorPoint(l),t.setContentSize(e)}else cc.warn("ProgressBar non-FILLED mode only works when barSprite's Type is non-FILLED!")}},properties:{barSprite:{default:null,type:cc.Sprite,tooltip:!1,notify:function(){this._initBarSprite()},animatable:!1},mode:{default:r.HORIZONTAL,type:r,tooltip:!1,notify:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e=t.getContentSize();this.mode===r.HORIZONTAL?this.totalLength=e.width:this.mode===r.VERTICAL?this.totalLength=e.height:this.mode===r.FILLED&&(this.totalLength=this.barSprite.fillRange)}},animatable:!1},_N$totalLength:1,totalLength:{range:[0,Number.MAX_VALUE],tooltip:!1,get:function(){return this._N$totalLength},set:function(t){this.mode===r.FILLED&&(t=i.clamp01(t)),this._N$totalLength=t,this._updateBarStatus()}},progress:{default:1,type:cc.Float,range:[0,1,.1],slide:!0,tooltip:!1,notify:function(){this._updateBarStatus()}},reverse:{default:!1,tooltip:!1,notify:function(){this.barSprite&&(this.barSprite.fillStart=1-this.barSprite.fillStart),this._updateBarStatus()},animatable:!1}},statics:{Mode:r}});cc.ProgressBar=e.exports=a}),{"../utils/misc":242,"./CCComponent":106}],115:[(function(t,e){"use strict";var i=a(t("../renderer/assembler")),n=a(t("../assets/material/material-variant")),r=t("../value-types");function a(t){return t&&t.__esModule?t:{default:t}}var s=t("./CCComponent"),o=t("../renderer/render-flow"),c=t("../assets/material/CCMaterial"),l=new r.Color,h=cc.Class({name:"RenderComponent",extends:s,editor:!1,properties:{_materials:{default:[],type:c},materials:{get:function(){return this._materials},set:function(t){this._materials=t,this._activateMaterial()},type:[c],displayName:"Materials",animatable:!1}},ctor:function(){this._vertsDirty=!0,this._assembler=null},_resetAssembler:function(){i.default.init(this),this._updateColor(),this.setVertsDirty()},__preload:function(){this._resetAssembler(),this._activateMaterial()},onEnable:function(){this.node._renderComponent&&(this.node._renderComponent.enabled=!1),this.node._renderComponent=this,this.node._renderFlag|=o.FLAG_OPACITY_COLOR,this.setVertsDirty()},onDisable:function(){this.node._renderComponent=null,this.disableRender()},onDestroy:function(){for(var t=this._materials,e=0;e<t.length;e++)cc.pool.material.put(t[e]);t.length=0,cc.pool.assembler.put(this._assembler),this.disableRender()},setVertsDirty:function(){this._vertsDirty=!0,this.markForRender(!0)},_on3DNodeChanged:function(){this._resetAssembler()},_validateRender:function(){},markForValidate:function(){cc.RenderFlow.registerValidate(this)},markForRender:function(t){var e=o.FLAG_RENDER|o.FLAG_UPDATE_RENDER_DATA;t?(this.node._renderFlag|=e,this.markForValidate()):this.node._renderFlag&=~e},disableRender:function(){this.node._renderFlag&=~(o.FLAG_RENDER|o.FLAG_UPDATE_RENDER_DATA)},getMaterial:function(t){if(t<0||t>=this._materials.length)return null;var e=this._materials[t];if(!e)return null;var i=n.default.create(e,this);return i!==e&&this.setMaterial(t,i),i},getMaterials:function(){for(var t=this._materials,e=0;e<t.length;e++)t[e]=n.default.create(t[e],this);return t},setMaterial:function(t,e){return e!==this._materials[t]&&(e=n.default.create(e,this),this._materials[t]=e),this._updateMaterial(),this.markForRender(!0),e},_getDefaultMaterial:function(){return c.getBuiltinMaterial("2d-sprite")},_activateMaterial:function(){var t=this._materials;if(!t[0]){var e=this._getDefaultMaterial();t[0]=e}for(var i=0;i<t.length;i++)t[i]=n.default.create(t[i],this);this._updateMaterial()},_updateMaterial:function(){},_updateColor:function(){if(this._assembler.updateColor){var t=this.srcBlendFactor===cc.macro.BlendFactor.ONE;t&&r.Color.premultiplyAlpha(l,this.node._color);var e=t?l._val:null;this._assembler.updateColor(this,e)}},_checkBacth:function(t,e){var i=this._materials[0];(i&&i.getHash()!==t.material.getHash()||t.cullingMask!==e)&&(t._flush(),t.node=i.getDefine("CC_USE_MODEL")?this.node:t._dummyNode,t.material=i,t.cullingMask=e)}});cc.RenderComponent=e.exports=h}),{"../assets/material/CCMaterial":81,"../assets/material/material-variant":88,"../renderer/assembler":196,"../renderer/render-flow":200,"../value-types":257,"./CCComponent":106}],116:[(function(t,e){"use strict";var i=t("./CCWidget"),n=t("../base-ui/CCWidgetManager"),r=cc.Class({name:"cc.SafeArea",extends:t("./CCComponent"),editor:!1,onEnable:function(){this.updateArea(),cc.view.on("canvas-resize",this.updateArea,this)},onDisable:function(){cc.view.off("canvas-resize",this.updateArea,this)},updateArea:function(){var t,e=null==(t=this.node)?void 0:t.getComponent(i);if(e){e.updateAlignment();var r=this.node.position,a=this.node.getAnchorPoint();e.isAlignTop=e.isAlignBottom=e.isAlignLeft=e.isAlignRight=!0;var s=cc.winSize.width,o=cc.winSize.height,c=cc.sys.getSafeAreaRect();e.top=o-c.y-c.height,e.bottom=c.y,e.left=c.x,e.right=s-c.x-c.width,e.updateAlignment();var l=this.node.position,h=a.x-(l.x-r.x)/this.node.width,u=a.y-(l.y-r.y)/this.node.height;this.node.setAnchorPoint(h,u),n.add(e)}}});cc.SafeArea=e.exports=r}),{"../base-ui/CCWidgetManager":90,"./CCComponent":106,"./CCWidget":126}],117:[(function(t,e){"use strict";var i=t("../utils/misc"),n=(t("./CCComponent"),cc.Enum({HORIZONTAL:0,VERTICAL:1})),r=cc.Class({name:"cc.Scrollbar",extends:t("./CCComponent"),editor:!1,properties:{_scrollView:null,_touching:!1,_autoHideRemainingTime:{default:0,serializable:!1},_opacity:255,handle:{default:null,type:cc.Sprite,tooltip:!1,notify:function(){this._onScroll(cc.v2(0,0))},animatable:!1},direction:{default:n.HORIZONTAL,type:n,tooltip:!1,notify:function(){this._onScroll(cc.v2(0,0))},animatable:!1},enableAutoHide:{default:!0,animatable:!1,tooltip:!1},autoHideTime:{default:1,animatable:!1,tooltip:!1}},statics:{Direction:n},setTargetScrollView:function(t){this._scrollView=t},_convertToScrollViewSpace:function(t){var e=this._scrollView.node,i=t.convertToWorldSpaceAR(cc.v2(-t.anchorX*t.width,-t.anchorY*t.height)),n=e.convertToNodeSpaceAR(i);return n.x+=e.anchorX*e.width,n.y+=e.anchorY*e.height,n},_setOpacity:function(t){this.handle&&(this.node.opacity=t,this.handle.node.opacity=t)},_onScroll:function(t){if(this._scrollView){var e=this._scrollView.content;if(e){var i=e.getContentSize(),r=this._scrollView.node.getContentSize(),a=this.node.getContentSize();if(this._conditionalDisableScrollBar(i,r))return;this.enableAutoHide&&(this._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity));var s=0,o=0,c=0,l=0,h=0;this.direction===n.HORIZONTAL?(s=i.width,o=r.width,h=a.width,c=t.x,l=-this._convertToScrollViewSpace(e).x):this.direction===n.VERTICAL&&(s=i.height,o=r.height,h=a.height,c=t.y,l=-this._convertToScrollViewSpace(e).y);var u=this._calculateLength(s,o,h,c),f=this._calculatePosition(s,o,h,l,c,u);this._updateLength(u),this._updateHanlderPosition(f)}}},_updateHanlderPosition:function(t){if(this.handle){var e=this._fixupHandlerPosition();this.handle.node.setPosition(t.x+e.x,t.y+e.y)}},_fixupHandlerPosition:function(){var t=this.node.getContentSize(),e=this.node.getAnchorPoint(),i=this.handle.node.getContentSize(),r=this.handle.node.parent,a=this.node.convertToWorldSpaceAR(cc.v2(-t.width*e.x,-t.height*e.y)),s=r.convertToNodeSpaceAR(a);return this.direction===n.HORIZONTAL?s=cc.v2(s.x,s.y+(t.height-i.height)/2):this.direction===n.VERTICAL&&(s=cc.v2(s.x+(t.width-i.width)/2,s.y)),this.handle.node.setPosition(s),s},_onTouchBegan:function(){this.enableAutoHide&&(this._touching=!0)},_conditionalDisableScrollBar:function(t,e){return t.width<=e.width&&this.direction===n.HORIZONTAL||t.height<=e.height&&this.direction===n.VERTICAL},_onTouchEnded:function(){if(this.enableAutoHide&&(this._touching=!1,!(this.autoHideTime<=0))){if(this._scrollView){var t=this._scrollView.content;if(t){var e=t.getContentSize(),i=this._scrollView.node.getContentSize();if(this._conditionalDisableScrollBar(e,i))return}}this._autoHideRemainingTime=this.autoHideTime}},_calculateLength:function(t,e,i,n){var r=t;return n&&(r+=20*(n>0?n:-n)),i*(e/r)},_calculatePosition:function(t,e,r,a,s,o){var c=t-e;s&&(c+=Math.abs(s));var l=0;c&&(l=a/c,l=i.clamp01(l));var h=(r-o)*l;return this.direction===n.VERTICAL?cc.v2(0,h):cc.v2(h,0)},_updateLength:function(t){if(this.handle){var e=this.handle.node,i=e.getContentSize();e.setAnchorPoint(cc.v2(0,0)),this.direction===n.HORIZONTAL?e.setContentSize(t,i.height):e.setContentSize(i.width,t)}},_processAutoHide:function(t){if(this.enableAutoHide&&!(this._autoHideRemainingTime<=0)&&!this._touching&&(this._autoHideRemainingTime-=t,this._autoHideRemainingTime<=this.autoHideTime)){this._autoHideRemainingTime=Math.max(0,this._autoHideRemainingTime);var e=this._opacity*(this._autoHideRemainingTime/this.autoHideTime);this._setOpacity(e)}},start:function(){this.enableAutoHide&&this._setOpacity(0)},hide:function(){this._autoHideRemainingTime=0,this._setOpacity(0)},show:function(){this._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity)},update:function(t){this._processAutoHide(t)}});cc.Scrollbar=e.exports=r}),{"../utils/misc":242,"./CCComponent":106}],118:[(function(t,e){"use strict";var i=t("../CCNode").EventType,n=cc.v2(),r=cc.v2(),a=function(){return(new Date).getMilliseconds()},s=cc.Enum({SCROLL_TO_TOP:0,SCROLL_TO_BOTTOM:1,SCROLL_TO_LEFT:2,SCROLL_TO_RIGHT:3,SCROLLING:4,BOUNCE_TOP:5,BOUNCE_BOTTOM:6,BOUNCE_LEFT:7,BOUNCE_RIGHT:8,SCROLL_ENDED:9,TOUCH_UP:10,AUTOSCROLL_ENDED_WITH_THRESHOLD:11,SCROLL_BEGAN:12}),o={"scroll-to-top":s.SCROLL_TO_TOP,"scroll-to-bottom":s.SCROLL_TO_BOTTOM,"scroll-to-left":s.SCROLL_TO_LEFT,"scroll-to-right":s.SCROLL_TO_RIGHT,scrolling:s.SCROLLING,"bounce-bottom":s.BOUNCE_BOTTOM,"bounce-left":s.BOUNCE_LEFT,"bounce-right":s.BOUNCE_RIGHT,"bounce-top":s.BOUNCE_TOP,"scroll-ended":s.SCROLL_ENDED,"touch-up":s.TOUCH_UP,"scroll-ended-with-threshold":s.AUTOSCROLL_ENDED_WITH_THRESHOLD,"scroll-began":s.SCROLL_BEGAN},c=cc.Class({name:"cc.ScrollView",extends:t("./CCViewGroup"),editor:!1,ctor:function(){this._topBoundary=0,this._bottomBoundary=0,this._leftBoundary=0,this._rightBoundary=0,this._touchMoveDisplacements=[],this._touchMoveTimeDeltas=[],this._touchMovePreviousTimestamp=0,this._touchMoved=!1,this._autoScrolling=!1,this._autoScrollAttenuate=!1,this._autoScrollStartPosition=cc.v2(0,0),this._autoScrollTargetDelta=cc.v2(0,0),this._autoScrollTotalTime=0,this._autoScrollAccumulatedTime=0,this._autoScrollCurrentlyOutOfBoundary=!1,this._autoScrollBraking=!1,this._autoScrollBrakingStartPosition=cc.v2(0,0),this._outOfBoundaryAmount=cc.v2(0,0),this._outOfBoundaryAmountDirty=!0,this._stopMouseWheel=!1,this._mouseWheelEventElapsedTime=0,this._isScrollEndedWithThresholdEventFired=!1,this._scrollEventEmitMask=0,this._isBouncing=!1,this._scrolling=!1},properties:{content:{default:void 0,type:cc.Node,tooltip:!1,formerlySerializedAs:"content",notify:function(){this._calculateBoundary()}},horizontal:{default:!0,animatable:!1,tooltip:!1},vertical:{default:!0,animatable:!1,tooltip:!1},inertia:{default:!0,tooltip:!1},brake:{default:.5,type:cc.Float,range:[0,1,.1],tooltip:!1},elastic:{default:!0,animatable:!1,tooltip:!1},bounceDuration:{default:1,range:[0,10],tooltip:!1},horizontalScrollBar:{default:void 0,type:cc.Scrollbar,tooltip:!1,notify:function(){this.horizontalScrollBar&&(this.horizontalScrollBar.setTargetScrollView(this),this._updateScrollBar(0))},animatable:!1},verticalScrollBar:{default:void 0,type:cc.Scrollbar,tooltip:!1,notify:function(){this.verticalScrollBar&&(this.verticalScrollBar.setTargetScrollView(this),this._updateScrollBar(0))},animatable:!1},scrollEvents:{default:[],type:cc.Component.EventHandler,tooltip:!1},cancelInnerEvents:{default:!0,animatable:!1,tooltip:!1},_view:{get:function(){if(this.content)return this.content.parent}}},statics:{EventType:s},scrollToBottom:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i,!0)},scrollToTop:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(0,1),applyToHorizontal:!1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToLeft:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToRight:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(1,0),applyToHorizontal:!0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToTopLeft:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(0,1),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToTopRight:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(1,1),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToBottomLeft:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToBottomRight:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.v2(1,0),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToOffset:function(t,e,i){var n=this.getMaxScrollOffset(),r=cc.v2(0,0);0===n.x?r.x=0:r.x=t.x/n.x,0===n.y?r.y=1:r.y=(n.y-t.y)/n.y,this.scrollTo(r,e,i)},getScrollOffset:function(){var t=this._getContentTopBoundary()-this._topBoundary,e=this._getContentLeftBoundary()-this._leftBoundary;return cc.v2(e,t)},getMaxScrollOffset:function(){var t=this._view.getContentSize(),e=this.content.getContentSize(),i=e.width-t.width,n=e.height-t.height;return i=i>=0?i:0,n=n>=0?n:0,cc.v2(i,n)},scrollToPercentHorizontal:function(t,e,i){var n=this._calculateMovePercentDelta({anchor:cc.v2(t,0),applyToHorizontal:!0,applyToVertical:!1});e?this._startAutoScroll(n,e,!1!==i):this._moveContent(n)},scrollTo:function(t,e,i){var n=this._calculateMovePercentDelta({anchor:cc.v2(t),applyToHorizontal:!0,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!==i):this._moveContent(n)},scrollToPercentVertical:function(t,e,i){var n=this._calculateMovePercentDelta({anchor:cc.v2(0,t),applyToHorizontal:!1,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!==i):this._moveContent(n)},stopAutoScroll:function(){this._autoScrolling=!1,this._autoScrollAccumulatedTime=this._autoScrollTotalTime},setContentPosition:function(t){t.fuzzyEquals(this.getContentPosition(),1e-4)||(this.content.setPosition(t),this._outOfBoundaryAmountDirty=!0)},getContentPosition:function(){return this.content.getPosition()},isScrolling:function(){return this._scrolling},isAutoScrolling:function(){return this._autoScrolling},_registerEvent:function(){this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!0),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!0),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!0),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!0),this.node.on(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!0)},_unregisterEvent:function(){this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!0),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!0),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!0),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!0),this.node.off(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!0)},_onMouseWheel:function(t,e){if(this.enabledInHierarchy&&!this.hasNestedViewGroup(t,e)){var i=cc.v2(0,0),n=-.1;cc.sys.os===cc.sys.OS_WINDOWS&&cc.sys.browserType===cc.sys.BROWSER_TYPE_FIREFOX&&(n=-.1/3),this.vertical?i=cc.v2(0,t.getScrollY()*n):this.horizontal&&(i=cc.v2(t.getScrollY()*n,0)),this._mouseWheelEventElapsedTime=0,this._processDeltaMove(i),this._stopMouseWheel||(this._handlePressLogic(),this.schedule(this._checkMouseWheel,1/60),this._stopMouseWheel=!0),this._stopPropagationIfTargetIsMe(t)}},_checkMouseWheel:function(t){if(!this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-4))return this._processInertiaScroll(),this.unschedule(this._checkMouseWheel),this._dispatchEvent("scroll-ended"),void(this._stopMouseWheel=!1);this._mouseWheelEventElapsedTime+=t,this._mouseWheelEventElapsedTime>.1&&(this._onScrollBarTouchEnded(),this.unschedule(this._checkMouseWheel),this._dispatchEvent("scroll-ended"),this._stopMouseWheel=!1)},_calculateMovePercentDelta:function(t){var e=t.anchor,i=t.applyToHorizontal,n=t.applyToVertical;this._calculateBoundary(),e=e.clampf(cc.v2(0,0),cc.v2(1,1));var r=this._view.getContentSize(),a=this.content.getContentSize(),s=this._getContentBottomBoundary()-this._bottomBoundary;s=-s;var o=this._getContentLeftBoundary()-this._leftBoundary;o=-o;var c=cc.v2(0,0),l=0;return i&&(l=a.width-r.width,c.x=o-l*e.x),n&&(l=a.height-r.height,c.y=s-l*e.y),c},_moveContentToTopLeft:function(t){var e=this.content.getContentSize(),i=this._getContentBottomBoundary()-this._bottomBoundary;i=-i;var n=cc.v2(0,0),r=0,a=this._getContentLeftBoundary()-this._leftBoundary;a=-a,e.height<t.height&&(r=e.height-t.height,n.y=i-r),e.width<t.width&&(r=e.width-t.width,n.x=a),this._updateScrollBarState(),this._moveContent(n),this._adjustContentOutOfBoundary()},_calculateBoundary:function(){if(this.content){var t=this.content.getComponent(cc.Layout);t&&t.enabledInHierarchy&&t.updateLayout();var e=this._view.getContentSize(),i=e.width*this._view.anchorX,n=e.height*this._view.anchorY;this._leftBoundary=-i,this._bottomBoundary=-n,this._rightBoundary=this._leftBoundary+e.width,this._topBoundary=this._bottomBoundary+e.height,this._moveContentToTopLeft(e)}},hasNestedViewGroup:function(t,e){if(t.eventPhase===cc.Event.CAPTURING_PHASE){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(this.node===n)return!!t.target.getComponent(cc.ViewGroup);if(n.getComponent(cc.ViewGroup))return!0}return!1}},_stopPropagationIfTargetIsMe:function(t){t.eventPhase===cc.Event.AT_TARGET&&t.target===this.node&&t.stopPropagation()},_onTouchBegan:function(t,e){if(this.enabledInHierarchy&&!this.hasNestedViewGroup(t,e)){var i=t.touch;this.content&&this._handlePressLogic(i),this._touchMoved=!1,this._stopPropagationIfTargetIsMe(t)}},_onTouchMoved:function(t,e){if(this.enabledInHierarchy&&!this.hasNestedViewGroup(t,e)){var i=t.touch;if(this.content&&this._handleMoveLogic(i),this.cancelInnerEvents){if(i.getLocation().sub(i.getStartLocation()).mag()>7&&!this._touchMoved&&t.target!==this.node){var n=new cc.Event.EventTouch(t.getTouches(),t.bubbles);n.type=cc.Node.EventType.TOUCH_CANCEL,n.touch=t.touch,n.simulate=!0,t.target.dispatchEvent(n),this._touchMoved=!0}this._stopPropagationIfTargetIsMe(t)}}},_onTouchEnded:function(t,e){if(this.enabledInHierarchy&&!this.hasNestedViewGroup(t,e)){this._dispatchEvent("touch-up");var i=t.touch;this.content&&this._handleReleaseLogic(i),this._touchMoved?t.stopPropagation():this._stopPropagationIfTargetIsMe(t)}},_onTouchCancelled:function(t,e){if(this.enabledInHierarchy&&!this.hasNestedViewGroup(t,e)){if(!t.simulate){var i=t.touch;this.content&&this._handleReleaseLogic(i)}this._stopPropagationIfTargetIsMe(t)}},_processDeltaMove:function(t){this._scrollChildren(t),this._gatherTouchMove(t)},_getLocalAxisAlignDelta:function(t){return this.node.convertToNodeSpaceAR(t.getLocation(),n),this.node.convertToNodeSpaceAR(t.getPreviousLocation(),r),n.sub(r)},_handleMoveLogic:function(t){var e=this._getLocalAxisAlignDelta(t);this._processDeltaMove(e)},_scrollChildren:function(t){var e,i=t=this._clampDelta(t);this.elastic&&(e=this._getHowMuchOutOfBoundary(),i.x*=0===e.x?1:.5,i.y*=0===e.y?1:.5),this.elastic||(e=this._getHowMuchOutOfBoundary(i),i=i.add(e));var n="",r="";this.vertical&&(i.y>0?this.content.y-this.content.anchorY*this.content.height+i.y>=this._bottomBoundary&&(n="scroll-to-bottom"):i.y<0&&this.content.y-this.content.anchorY*this.content.height+this.content.height+i.y<=this._topBoundary&&(n="scroll-to-top")),this.horizontal&&(i.x<0?this.content.x-this.content.anchorX*this.content.width+this.content.width+i.x<=this._rightBoundary&&(r="scroll-to-right"):i.x>0&&this.content.x-this.content.anchorX*this.content.width+i.x>=this._leftBoundary&&(r="scroll-to-left")),this._moveContent(i,!1),(this.horizontal&&0!==i.x||this.vertical&&0!==i.y)&&(this._scrolling||(this._scrolling=!0,this._dispatchEvent("scroll-began")),this._dispatchEvent("scrolling")),""!==n&&this._dispatchEvent(n),""!==r&&this._dispatchEvent(r)},_handlePressLogic:function(){this._autoScrolling&&this._dispatchEvent("scroll-ended"),this._autoScrolling=!1,this._isBouncing=!1,this._touchMovePreviousTimestamp=a(),this._touchMoveDisplacements.length=0,this._touchMoveTimeDeltas.length=0,this._onScrollBarTouchBegan()},_clampDelta:function(t){var e=this.content.getContentSize(),i=this._view.getContentSize();return e.width<i.width&&(t.x=0),e.height<i.height&&(t.y=0),t},_gatherTouchMove:function(t){for(t=this._clampDelta(t);this._touchMoveDisplacements.length>=5;)this._touchMoveDisplacements.shift(),this._touchMoveTimeDeltas.shift();this._touchMoveDisplacements.push(t);var e=a();this._touchMoveTimeDeltas.push((e-this._touchMovePreviousTimestamp)/1e3),this._touchMovePreviousTimestamp=e},_startBounceBackIfNeeded:function(){if(!this.elastic)return!1;var t=this._getHowMuchOutOfBoundary();if((t=this._clampDelta(t)).fuzzyEquals(cc.v2(0,0),1e-4))return!1;var e=Math.max(this.bounceDuration,0);return this._startAutoScroll(t,e,!0),this._isBouncing||(t.y>0&&this._dispatchEvent("bounce-top"),t.y<0&&this._dispatchEvent("bounce-bottom"),t.x>0&&this._dispatchEvent("bounce-right"),t.x<0&&this._dispatchEvent("bounce-left"),this._isBouncing=!0),!0},_processInertiaScroll:function(){if(!this._startBounceBackIfNeeded()&&this.inertia){var t=this._calculateTouchMoveVelocity();!t.fuzzyEquals(cc.v2(0,0),1e-4)&&this.brake<1&&this._startInertiaScroll(t)}this._onScrollBarTouchEnded()},_handleReleaseLogic:function(t){var e=this._getLocalAxisAlignDelta(t);this._gatherTouchMove(e),this._processInertiaScroll(),this._scrolling&&(this._scrolling=!1,this._autoScrolling||this._dispatchEvent("scroll-ended"))},_isOutOfBoundary:function(){return!this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-4)},_isNecessaryAutoScrollBrake:function(){if(this._autoScrollBraking)return!0;if(this._isOutOfBoundary()){if(!this._autoScrollCurrentlyOutOfBoundary)return this._autoScrollCurrentlyOutOfBoundary=!0,this._autoScrollBraking=!0,this._autoScrollBrakingStartPosition=this.getContentPosition(),!0}else this._autoScrollCurrentlyOutOfBoundary=!1;return!1},getScrollEndedEventTiming:function(){return 1e-4},_processAutoScrolling:function(t){var e=this._isNecessaryAutoScrollBrake(),i=e?.05:1;this._autoScrollAccumulatedTime+=t*(1/i);var n,r=Math.min(1,this._autoScrollAccumulatedTime/this._autoScrollTotalTime);this._autoScrollAttenuate&&(n=r,r=(n-=1)*n*n*n*n+1);var a=this._autoScrollStartPosition.add(this._autoScrollTargetDelta.mul(r)),s=Math.abs(r-1)<=1e-4;if(Math.abs(r-1)<=this.getScrollEndedEventTiming()&&!this._isScrollEndedWithThresholdEventFired&&(this._dispatchEvent("scroll-ended-with-threshold"),this._isScrollEndedWithThresholdEventFired=!0),this.elastic){var o=a.sub(this._autoScrollBrakingStartPosition);e&&(o=o.mul(i)),a=this._autoScrollBrakingStartPosition.add(o)}else{var c=a.sub(this.getContentPosition()),l=this._getHowMuchOutOfBoundary(c);l.fuzzyEquals(cc.v2(0,0),1e-4)||(a=a.add(l),s=!0)}s&&(this._autoScrolling=!1);var h=a.sub(this.getContentPosition());this._moveContent(this._clampDelta(h),s),this._dispatchEvent("scrolling"),this._autoScrolling||(this._isBouncing=!1,this._scrolling=!1,this._dispatchEvent("scroll-ended"))},_startInertiaScroll:function(t){var e=t.mul(.7);this._startAttenuatingAutoScroll(e,t)},_calculateAttenuatedFactor:function(t){return this.brake<=0?1-this.brake:(1-this.brake)*(1/(1+14e-6*t+t*t*8e-9))},_startAttenuatingAutoScroll:function(t,e){var i=this._calculateAutoScrollTimeByInitalSpeed(e.mag()),n=t.normalize(),r=this.content.getContentSize(),a=this._view.getContentSize(),s=r.width-a.width,o=r.height-a.height,c=this._calculateAttenuatedFactor(s),l=this._calculateAttenuatedFactor(o);n=cc.v2(n.x*s*(1-this.brake)*c,n.y*o*l*(1-this.brake));var h=t.mag(),u=n.mag()/h;n=n.add(t),this.brake>0&&u>7&&(u=Math.sqrt(u),n=t.mul(u).add(t)),this.brake>0&&u>3&&(i*=u=3),0===this.brake&&u>1&&(i*=u),this._startAutoScroll(n,i,!0)},_calculateAutoScrollTimeByInitalSpeed:function(t){return Math.sqrt(Math.sqrt(t/5))},_startAutoScroll:function(t,e,i){var n=this._flattenVectorByDirection(t);this._autoScrolling=!0,this._autoScrollTargetDelta=n,this._autoScrollAttenuate=i,this._autoScrollStartPosition=this.getContentPosition(),this._autoScrollTotalTime=e,this._autoScrollAccumulatedTime=0,this._autoScrollBraking=!1,this._isScrollEndedWithThresholdEventFired=!1,this._autoScrollBrakingStartPosition=cc.v2(0,0),this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-4)||(this._autoScrollCurrentlyOutOfBoundary=!0)},_calculateTouchMoveVelocity:function(){var t=0;if((t=this._touchMoveTimeDeltas.reduce((function(t,e){return t+e}),t))<=0||t>=.5)return cc.v2(0,0);var e=cc.v2(0,0);return e=this._touchMoveDisplacements.reduce((function(t,e){return t.add(e)}),e),cc.v2(e.x*(1-this.brake)/t,e.y*(1-this.brake)/t)},_flattenVectorByDirection:function(t){var e=t;return e.x=this.horizontal?e.x:0,e.y=this.vertical?e.y:0,e},_moveContent:function(t,e){var i=this._flattenVectorByDirection(t),n=this.getContentPosition().add(i);this.setContentPosition(n);var r=this._getHowMuchOutOfBoundary();this._updateScrollBar(r),this.elastic&&e&&this._startBounceBackIfNeeded()},_getContentLeftBoundary:function(){return this.getContentPosition().x-this.content.getAnchorPoint().x*this.content.getContentSize().width},_getContentRightBoundary:function(){var t=this.content.getContentSize();return this._getContentLeftBoundary()+t.width},_getContentTopBoundary:function(){var t=this.content.getContentSize();return this._getContentBottomBoundary()+t.height},_getContentBottomBoundary:function(){return this.getContentPosition().y-this.content.getAnchorPoint().y*this.content.getContentSize().height},_getHowMuchOutOfBoundary:function(t){if((t=t||cc.v2(0,0)).fuzzyEquals(cc.v2(0,0),1e-4)&&!this._outOfBoundaryAmountDirty)return this._outOfBoundaryAmount;var e=cc.v2(0,0);return this._getContentLeftBoundary()+t.x>this._leftBoundary?e.x=this._leftBoundary-(this._getContentLeftBoundary()+t.x):this._getContentRightBoundary()+t.x<this._rightBoundary&&(e.x=this._rightBoundary-(this._getContentRightBoundary()+t.x)),this._getContentTopBoundary()+t.y<this._topBoundary?e.y=this._topBoundary-(this._getContentTopBoundary()+t.y):this._getContentBottomBoundary()+t.y>this._bottomBoundary&&(e.y=this._bottomBoundary-(this._getContentBottomBoundary()+t.y)),t.fuzzyEquals(cc.v2(0,0),1e-4)&&(this._outOfBoundaryAmount=e,this._outOfBoundaryAmountDirty=!1),this._clampDelta(e)},_updateScrollBarState:function(){if(this.content){var t=this.content.getContentSize(),e=this._view.getContentSize();this.verticalScrollBar&&(t.height<e.height?this.verticalScrollBar.hide():this.verticalScrollBar.show()),this.horizontalScrollBar&&(t.width<e.width?this.horizontalScrollBar.hide():this.horizontalScrollBar.show())}},_updateScrollBar:function(t){this.horizontalScrollBar&&this.horizontalScrollBar._onScroll(t),this.verticalScrollBar&&this.verticalScrollBar._onScroll(t)},_onScrollBarTouchBegan:function(){this.horizontalScrollBar&&this.horizontalScrollBar._onTouchBegan(),this.verticalScrollBar&&this.verticalScrollBar._onTouchBegan()},_onScrollBarTouchEnded:function(){this.horizontalScrollBar&&this.horizontalScrollBar._onTouchEnded(),this.verticalScrollBar&&this.verticalScrollBar._onTouchEnded()},_dispatchEvent:function(t){if("scroll-ended"===t)this._scrollEventEmitMask=0;else if("scroll-to-top"===t||"scroll-to-bottom"===t||"scroll-to-left"===t||"scroll-to-right"===t){var e=1<<o[t];if(this._scrollEventEmitMask&e)return;this._scrollEventEmitMask|=e}cc.Component.EventHandler.emitEvents(this.scrollEvents,this,o[t]),this.node.emit(t,this)},_adjustContentOutOfBoundary:function(){if(this._outOfBoundaryAmountDirty=!0,this._isOutOfBoundary()){var t=this._getHowMuchOutOfBoundary(cc.v2(0,0)),e=this.getContentPosition().add(t);this.content&&(this.content.setPosition(e),this._updateScrollBar(0))}},start:function(){this._calculateBoundary(),this.content&&cc.director.once(cc.Director.EVENT_BEFORE_DRAW,this._adjustContentOutOfBoundary,this)},_hideScrollbar:function(){this.horizontalScrollBar&&this.horizontalScrollBar.hide(),this.verticalScrollBar&&this.verticalScrollBar.hide()},onDisable:function(){this._unregisterEvent(),this.content&&(this.content.off(i.SIZE_CHANGED,this._calculateBoundary,this),this.content.off(i.SCALE_CHANGED,this._calculateBoundary,this),this._view&&(this._view.off(i.POSITION_CHANGED,this._calculateBoundary,this),this._view.off(i.SCALE_CHANGED,this._calculateBoundary,this),this._view.off(i.SIZE_CHANGED,this._calculateBoundary,this))),this._hideScrollbar(),this.stopAutoScroll()},onEnable:function(){this._registerEvent(),this.content&&(this.content.on(i.SIZE_CHANGED,this._calculateBoundary,this),this.content.on(i.SCALE_CHANGED,this._calculateBoundary,this),this._view&&(this._view.on(i.POSITION_CHANGED,this._calculateBoundary,this),this._view.on(i.SCALE_CHANGED,this._calculateBoundary,this),this._view.on(i.SIZE_CHANGED,this._calculateBoundary,this))),this._updateScrollBarState()},update:function(t){this._autoScrolling&&this._processAutoScrolling(t)}});cc.ScrollView=e.exports=c}),{"../CCNode":29,"./CCViewGroup":125}],119:[(function(t,e){"use strict";var i=t("../utils/misc"),n=t("./CCComponent"),r=cc.Enum({Horizontal:0,Vertical:1}),a=cc.Class({name:"cc.Slider",extends:n,editor:!1,ctor:function(){this._offset=cc.v2(),this._touchHandle=!1,this._dragging=!1},properties:{handle:{default:null,type:cc.Button,tooltip:!1,notify:function(){}},direction:{default:r.Horizontal,type:r,tooltip:!1},progress:{default:.5,type:cc.Float,range:[0,1,.1],slide:!0,tooltip:!1,notify:function(){this._updateHandlePosition()}},slideEvents:{default:[],type:cc.Component.EventHandler,tooltip:!1}},statics:{Direction:r},__preload:function(){this._updateHandlePosition()},onEnable:function(){this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this),this.handle&&this.handle.isValid&&(this.handle.node.on(cc.Node.EventType.TOUCH_START,this._onHandleDragStart,this),this.handle.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.handle.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this))},onDisable:function(){this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this),this.handle&&this.handle.isValid&&(this.handle.node.off(cc.Node.EventType.TOUCH_START,this._onHandleDragStart,this),this.handle.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.handle.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this))},_onHandleDragStart:function(t){this._dragging=!0,this._touchHandle=!0,this._offset=this.handle.node.convertToNodeSpaceAR(t.touch.getLocation()),t.stopPropagation()},_onTouchBegan:function(t){this.handle&&(this._dragging=!0,this._touchHandle||this._handleSliderLogic(t.touch),t.stopPropagation())},_onTouchMoved:function(t){this._dragging&&(this._handleSliderLogic(t.touch),t.stopPropagation())},_onTouchEnded:function(t){this._dragging=!1,this._touchHandle=!1,this._offset=cc.v2(),t.stopPropagation()},_onTouchCancelled:function(t){this._dragging=!1,t.stopPropagation()},_handleSliderLogic:function(t){this._updateProgress(t),this._emitSlideEvent()},_emitSlideEvent:function(){cc.Component.EventHandler.emitEvents(this.slideEvents,this),this.node.emit("slide",this)},_updateProgress:function(t){if(this.handle){var e=this.node,n=e.convertToNodeSpaceAR(t.getLocation());this.direction===r.Horizontal?this.progress=i.clamp01((n.x-this._offset.x+e.anchorX*e.width)/e.width):this.progress=i.clamp01((n.y-this._offset.y+e.anchorY*e.height)/e.height)}},_updateHandlePosition:function(){if(this.handle){var t;t=this.direction===r.Horizontal?cc.v2(-this.node.width*this.node.anchorX+this.progress*this.node.width,0):cc.v2(0,-this.node.height*this.node.anchorY+this.progress*this.node.height);var e=this.node.convertToWorldSpaceAR(t);this.handle.node.position=this.handle.node.parent.convertToNodeSpaceAR(e)}}});cc.Slider=e.exports=a}),{"../utils/misc":242,"./CCComponent":106}],120:[(function(t,e){"use strict";var i=t("../utils/misc"),n=(t("../CCNode").EventType,t("./CCRenderComponent")),r=t("../utils/blend-func"),a=cc.Enum({SIMPLE:0,SLICED:1,TILED:2,FILLED:3,MESH:4}),s=cc.Enum({HORIZONTAL:0,VERTICAL:1,RADIAL:2}),o=cc.Enum({CUSTOM:0,TRIMMED:1,RAW:2}),c=cc.Enum({NORMAL:0,GRAY:1}),l=cc.Class({name:"cc.Sprite",extends:n,mixins:[r],editor:!1,properties:{_spriteFrame:{default:null,type:cc.SpriteFrame},_type:a.SIMPLE,_sizeMode:o.TRIMMED,_fillType:0,_fillCenter:cc.v2(0,0),_fillStart:0,_fillRange:0,_isTrimmedMode:!0,_atlas:{default:null,type:cc.SpriteAtlas,tooltip:!1,editorOnly:!0,visible:!0,animatable:!1},spriteFrame:{get:function(){return this._spriteFrame},set:function(t){var e=this._spriteFrame;e!==t&&(this._spriteFrame=t,this._applySpriteFrame(e))},type:cc.SpriteFrame},type:{get:function(){return this._type},set:function(t){this._type!==t&&(this._type=t,this.setVertsDirty(),this._resetAssembler())},type:a,animatable:!1,tooltip:!1},fillType:{get:function(){return this._fillType},set:function(t){t!==this._fillType&&(this._fillType=t,this.setVertsDirty(),this._resetAssembler())},type:s,tooltip:!1},fillCenter:{get:function(){return this._fillCenter},set:function(t){this._fillCenter.x=t.x,this._fillCenter.y=t.y,this._type===a.FILLED&&this.setVertsDirty()},tooltip:!1},fillStart:{get:function(){return this._fillStart},set:function(t){this._fillStart=i.clampf(t,-1,1),this._type===a.FILLED&&this.setVertsDirty()},tooltip:!1},fillRange:{get:function(){return this._fillRange},set:function(t){this._fillRange=i.clampf(t,-1,1),this._type===a.FILLED&&this.setVertsDirty()},tooltip:!1},trim:{get:function(){return this._isTrimmedMode},set:function(t){this._isTrimmedMode!==t&&(this._isTrimmedMode=t,this._type!==a.SIMPLE&&this._type!==a.MESH||this.setVertsDirty())},animatable:!1,tooltip:!1},sizeMode:{get:function(){return this._sizeMode},set:function(t){this._sizeMode=t,t!==o.CUSTOM&&this._applySpriteSize()},animatable:!1,type:o,tooltip:!1}},statics:{FillType:s,Type:a,SizeMode:o,State:c},setVisible:function(t){this.enabled=t},setState:function(){},getState:function(){},__preload:function(){this._super(),this._applySpriteFrame()},onEnable:function(){this._super(),this._validateRender(),this._spriteFrame&&this._spriteFrame.isValid&&this._spriteFrame.ensureLoadTexture(),this.node.on(cc.Node.EventType.SIZE_CHANGED,this.setVertsDirty,this),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this.setVertsDirty,this)},onDisable:function(){this._super(),this.node.off(cc.Node.EventType.SIZE_CHANGED,this.setVertsDirty,this),this.node.off(cc.Node.EventType.ANCHOR_CHANGED,this.setVertsDirty,this)},onRestore:!1,_updateMaterial:function(){var t=null;this._spriteFrame&&(t=this._spriteFrame.getTexture());var e=this.getMaterial(0);if(e){var i=e.getDefine("USE_TEXTURE");void 0===i||i||e.define("USE_TEXTURE",!0);var n=t&&t.getImpl();e.getProperty("texture")!==n&&(e.setProperty("texture",t),this.setVertsDirty())}r.prototype._updateMaterial.call(this)},_applyAtlas:!1,_validateRender:function(){var t=this._spriteFrame;this._materials[0]&&t&&t.textureLoaded()||this.disableRender()},_applySpriteSize:function(){if(this.isValid&&this._spriteFrame&&this._spriteFrame.isValid){if(o.RAW===this._sizeMode){var t=this._spriteFrame._originalSize;this.node.setContentSize(t)}else if(o.TRIMMED===this._sizeMode){var e=this._spriteFrame._rect;this.node.setContentSize(e.width,e.height)}this.setVertsDirty()}},_applySpriteFrame:function(t){if(this.isValid){var e=t&&t.isValid&&t.getTexture();e&&!e.loaded&&t.off("load",this._applySpriteSize,this);var i=this._spriteFrame,n=i&&i.isValid,r=n&&i.getTexture();e!==r&&this._updateMaterial(),r&&r.loaded?this._applySpriteSize():(this.disableRender(),n&&i.once("load",this._applySpriteSize,this))}}});cc.Sprite=e.exports=l}),{"../CCNode":29,"../utils/blend-func":237,"../utils/misc":242,"./CCRenderComponent":115}],121:[(function(t,e){"use strict";var i=cc.Enum({NONE:0,CHECKBOX:1,TEXT_ATLAS:2,SLIDER_BAR:3,LIST_VIEW:4,PAGE_VIEW:5}),n=cc.Enum({VERTICAL:0,HORIZONTAL:1}),r=cc.Enum({TOP:0,CENTER:1,BOTTOM:2}),a=cc.Enum({LEFT:0,CENTER:1,RIGHT:2}),s=cc.Class({name:"cc.StudioComponent",extends:cc.Component,editor:!1,properties:!1,statics:{ComponentType:i,ListDirection:n,VerticalAlign:r,HorizontalAlign:a}});cc.StudioComponent=e.exports=s;var o=cc.Class({name:"cc.StudioWidget",extends:cc.Widget,editor:!1,_validateTargetInDEV:function(){}});cc.StudioWidget=e.exports=o}),{}],122:[(function(t,e){"use strict";var i=t("../utils/gray-sprite-state"),n=cc.Class({name:"cc.Toggle",extends:t("./CCButton"),mixins:[i],editor:!1,properties:{_N$isChecked:!0,isChecked:{get:function(){return this._N$isChecked},set:function(t){if(t!==this._N$isChecked){var e=this.toggleGroup||this._toggleContainer;e&&e.enabled&&this._N$isChecked&&!e.allowSwitchOff||(this._N$isChecked=t,this._updateCheckMark(),e&&e.enabled&&e.updateToggles(this),cc.Toggle._triggerEventInScript_isChecked&&this._emitToggleEvents())}},tooltip:!1},toggleGroup:{default:null,tooltip:!1,type:t("./CCToggleGroup")},checkMark:{default:null,type:cc.Sprite,tooltip:!1},checkEvents:{default:[],type:cc.Component.EventHandler},_resizeToTarget:{animatable:!1,set:function(t){t&&this._resizeNodeToTargetNode()}}},statics:{_triggerEventInScript_check:!1,_triggerEventInScript_isChecked:!1},onEnable:function(){this._super(),this._registerToggleEvent(),this.toggleGroup&&this.toggleGroup.enabledInHierarchy&&this.toggleGroup.addToggle(this)},onDisable:function(){this._super(),this._unregisterToggleEvent(),this.toggleGroup&&this.toggleGroup.enabledInHierarchy&&this.toggleGroup.removeToggle(this)},_hideCheckMark:function(){this._N$isChecked=!1,this._updateCheckMark()},toggle:function(t){this.isChecked=!this.isChecked,cc.Toggle._triggerEventInScript_isChecked||!cc.Toggle._triggerEventInScript_check&&!t||this._emitToggleEvents()},check:function(){this.isChecked=!0,!cc.Toggle._triggerEventInScript_isChecked&&cc.Toggle._triggerEventInScript_check&&this._emitToggleEvents()},uncheck:function(){this.isChecked=!1,!cc.Toggle._triggerEventInScript_isChecked&&cc.Toggle._triggerEventInScript_check&&this._emitToggleEvents()},_updateCheckMark:function(){this.checkMark&&(this.checkMark.node.active=!!this.isChecked)},_updateDisabledState:function(){if(this._super(),this.enableAutoGrayEffect&&this.checkMark){var t=!this.interactable;this._switchGrayMaterial(t,this.checkMark)}},_registerToggleEvent:function(){this.node.on("click",this.toggle,this)},_unregisterToggleEvent:function(){this.node.off("click",this.toggle,this)},_emitToggleEvents:function(){this.node.emit("toggle",this),this.checkEvents&&cc.Component.EventHandler.emitEvents(this.checkEvents,this)}});cc.Toggle=e.exports=n,t("../platform/js").get(n.prototype,"_toggleContainer",(function(){var t=this.node.parent;return cc.Node.isNode(t)?t.getComponent(cc.ToggleContainer):null}))}),{"../platform/js":189,"../utils/gray-sprite-state":240,"./CCButton":104,"./CCToggleGroup":124}],123:[(function(t,e){"use strict";var i=cc.Class({name:"cc.ToggleContainer",extends:cc.Component,editor:!1,properties:{allowSwitchOff:{tooltip:!1,default:!1},checkEvents:{default:[],type:cc.Component.EventHandler}},updateToggles:function(t){this.enabledInHierarchy&&t.isChecked&&(this.toggleItems.forEach((function(e){e!==t&&e.isChecked&&e.enabled&&e._hideCheckMark()})),this.checkEvents&&cc.Component.EventHandler.emitEvents(this.checkEvents,t))},_allowOnlyOneToggleChecked:function(){var t=!1;return this.toggleItems.forEach((function(e){t?e._hideCheckMark():e.isChecked&&(t=!0)})),t},_makeAtLeastOneToggleChecked:function(){if(!this._allowOnlyOneToggleChecked()&&!this.allowSwitchOff){var t=this.toggleItems;t.length>0&&t[0].check()}},onEnable:function(){this._makeAtLeastOneToggleChecked(),this.node.on("child-added",this._allowOnlyOneToggleChecked,this),this.node.on("child-removed",this._makeAtLeastOneToggleChecked,this)},onDisable:function(){this.node.off("child-added",this._allowOnlyOneToggleChecked,this),this.node.off("child-removed",this._makeAtLeastOneToggleChecked,this)}});t("../platform/js").get(i.prototype,"toggleItems",(function(){return this.node._children.map((function(t){return t.getComponent(cc.Toggle)})).filter(Boolean)})),cc.ToggleContainer=e.exports=i}),{"../platform/js":189}],124:[(function(t,e){"use strict";var i=cc.Class({name:"cc.ToggleGroup",extends:cc.Component,ctor:function(){this._toggleItems=[]},editor:!1,properties:{allowSwitchOff:{tooltip:!1,default:!1},toggleItems:{get:function(){return this._toggleItems}}},updateToggles:function(t){this.enabledInHierarchy&&this._toggleItems.forEach((function(e){t.isChecked&&e!==t&&e.isChecked&&e.enabled&&e._hideCheckMark()}))},addToggle:function(t){-1===this._toggleItems.indexOf(t)&&this._toggleItems.push(t),this._allowOnlyOneToggleChecked()},removeToggle:function(t){var e=this._toggleItems.indexOf(t);e>-1&&this._toggleItems.splice(e,1),this._makeAtLeastOneToggleChecked()},_allowOnlyOneToggleChecked:function(){var t=!1;return this._toggleItems.forEach((function(e){t&&e.enabled&&e._hideCheckMark(),e.isChecked&&e.enabled&&(t=!0)})),t},_makeAtLeastOneToggleChecked:function(){this._allowOnlyOneToggleChecked()||this.allowSwitchOff||this._toggleItems.length>0&&(this._toggleItems[0].isChecked=!0)},start:function(){this._makeAtLeastOneToggleChecked()}}),n=t("../platform/js"),r=!1;n.get(cc,"ToggleGroup",(function(){return r||(cc.errorID(1405,"cc.ToggleGroup","cc.ToggleContainer"),r=!0),i})),e.exports=i}),{"../platform/js":189}],125:[(function(t,e){"use strict";var i=cc.Class({name:"cc.ViewGroup",extends:t("./CCComponent")});cc.ViewGroup=e.exports=i}),{"./CCComponent":106}],126:[(function(t,e){"use strict";var i=t("../base-ui/CCWidgetManager"),n=i.AlignMode,r=i._AlignFlags,a=r.TOP,s=r.MID,o=r.BOT,c=r.LEFT,l=r.CENTER,h=r.RIGHT,u=a|o,f=c|h,_=cc.Class({name:"cc.Widget",extends:t("./CCComponent"),editor:!1,properties:{target:{get:function(){return this._target},set:function(t){this._target=t},type:cc.Node,tooltip:!1},isAlignTop:{get:function(){return(this._alignFlags&a)>0},set:function(t){this._setAlign(a,t)},animatable:!1,tooltip:!1},isAlignVerticalCenter:{get:function(){return(this._alignFlags&s)>0},set:function(t){t?(this.isAlignTop=!1,this.isAlignBottom=!1,this._alignFlags|=s):this._alignFlags&=~s},animatable:!1,tooltip:!1},isAlignBottom:{get:function(){return(this._alignFlags&o)>0},set:function(t){this._setAlign(o,t)},animatable:!1,tooltip:!1},isAlignLeft:{get:function(){return(this._alignFlags&c)>0},set:function(t){this._setAlign(c,t)},animatable:!1,tooltip:!1},isAlignHorizontalCenter:{get:function(){return(this._alignFlags&l)>0},set:function(t){t?(this.isAlignLeft=!1,this.isAlignRight=!1,this._alignFlags|=l):this._alignFlags&=~l},animatable:!1,tooltip:!1},isAlignRight:{get:function(){return(this._alignFlags&h)>0},set:function(t){this._setAlign(h,t)},animatable:!1,tooltip:!1},isStretchWidth:{get:function(){return(this._alignFlags&f)===f},visible:!1},isStretchHeight:{get:function(){return(this._alignFlags&u)===u},visible:!1},top:{get:function(){return this._top},set:function(t){this._top=t},tooltip:!1},bottom:{get:function(){return this._bottom},set:function(t){this._bottom=t},tooltip:!1},left:{get:function(){return this._left},set:function(t){this._left=t},tooltip:!1},right:{get:function(){return this._right},set:function(t){this._right=t},tooltip:!1},horizontalCenter:{get:function(){return this._horizontalCenter},set:function(t){this._horizontalCenter=t},tooltip:!1},verticalCenter:{get:function(){return this._verticalCenter},set:function(t){this._verticalCenter=t},tooltip:!1},isAbsoluteHorizontalCenter:{get:function(){return this._isAbsHorizontalCenter},set:function(t){this._isAbsHorizontalCenter=t},animatable:!1},isAbsoluteVerticalCenter:{get:function(){return this._isAbsVerticalCenter},set:function(t){this._isAbsVerticalCenter=t},animatable:!1},isAbsoluteTop:{get:function(){return this._isAbsTop},set:function(t){this._isAbsTop=t},animatable:!1},isAbsoluteBottom:{get:function(){return this._isAbsBottom},set:function(t){this._isAbsBottom=t},animatable:!1},isAbsoluteLeft:{get:function(){return this._isAbsLeft},set:function(t){this._isAbsLeft=t},animatable:!1},isAbsoluteRight:{get:function(){return this._isAbsRight},set:function(t){this._isAbsRight=t},animatable:!1},alignMode:{default:n.ON_WINDOW_RESIZE,type:n,tooltip:!1},_wasAlignOnce:{default:void 0,formerlySerializedAs:"isAlignOnce"},_target:null,_alignFlags:0,_left:0,_right:0,_top:0,_bottom:0,_verticalCenter:0,_horizontalCenter:0,_isAbsLeft:!0,_isAbsRight:!0,_isAbsTop:!0,_isAbsBottom:!0,_isAbsHorizontalCenter:!0,_isAbsVerticalCenter:!0,_originalWidth:0,_originalHeight:0},statics:{AlignMode:n},onLoad:function(){void 0!==this._wasAlignOnce&&(this.alignMode=this._wasAlignOnce?n.ONCE:n.ALWAYS,this._wasAlignOnce=void 0)},onEnable:function(){i.add(this)},onDisable:function(){i.remove(this)},_validateTargetInDEV:!1,_setAlign:function(t,e){if(e!==(this._alignFlags&t)>0){var i=(t&f)>0;e?(this._alignFlags|=t,i?(this.isAlignHorizontalCenter=!1,this.isStretchWidth&&(this._originalWidth=this.node.width)):(this.isAlignVerticalCenter=!1,this.isStretchHeight&&(this._originalHeight=this.node.height))):(i?this.isStretchWidth&&(this.node.width=this._originalWidth):this.isStretchHeight&&(this.node.height=this._originalHeight),this._alignFlags&=~t)}},updateAlignment:function(){i.updateAlignment(this.node)}});Object.defineProperty(_.prototype,"isAlignOnce",{get:function(){return this.alignMode===n.ONCE},set:function(t){this.alignMode=t?n.ONCE:n.ALWAYS}}),cc.Widget=e.exports=_}),{"../base-ui/CCWidgetManager":90,"./CCComponent":106}],127:[(function(t,e){"use strict";var i=t("./CCComponent"),n=cc.Class({name:"cc.SubContextView",extends:i,editor:!1,properties:{_firstlyEnabled:!0,_fps:60,fps:{get:function(){return this._fps},set:function(t){this._fps!==t&&(this._fps=t,this._updateInterval=1/t,this._updateSubContextFrameRate())},tooltip:!1}},ctor:function(){this._sprite=null,this._tex=new cc.Texture2D,this._tex._packable=!1,this._context=null,this._updatedTime=performance.now(),this._updateInterval=0},onLoad:function(){if(window.__globalAdapter&&__globalAdapter.getOpenDataContext){this._updateInterval=1e3/this._fps,this._context=__globalAdapter.getOpenDataContext(),this.reset();var t=this._context.canvas;this._tex.setPremultiplyAlpha(!0),this._tex.initWithElement(t),this._tex._packable=!1,this._sprite=this.node.getComponent(cc.Sprite),this._sprite||(this._sprite=this.node.addComponent(cc.Sprite),this._sprite.srcBlendFactor=cc.macro.BlendFactor.ONE),this._sprite.spriteFrame=new cc.SpriteFrame(this._tex)}else this.enabled=!1},reset:function(){if(this._context){this.updateSubContextViewport();var t=this._context.canvas;t&&(t.width=this.node.width,t.height=this.node.height)}},onEnable:function(){this._firstlyEnabled&&this._context?(this._context.postMessage({fromEngine:!0,event:"boot"}),this._firstlyEnabled=!1):this._runSubContextMainLoop(),this._registerNodeEvent(),this._updateSubContextFrameRate(),this.updateSubContextViewport()},onDisable:function(){this._unregisterNodeEvent(),this._stopSubContextMainLoop()},update:function(t){if(void 0===t)return this._context&&this._context.postMessage({fromEngine:!0,event:"step"}),void this._updateSubContextTexture();performance.now()-this._updatedTime>=this._updateInterval&&(this._updatedTime+=this._updateInterval,this._updateSubContextTexture())},_updateSubContextTexture:function(){this._tex&&this._context&&(this._tex.initWithElement(this._context.canvas),this._tex._packable=!1,this._sprite._activateMaterial())},updateSubContextViewport:function(){if(this._context){var t=this.node.getBoundingBoxToWorld(),e=cc.view._scaleX,i=cc.view._scaleY;this._context.postMessage({fromEngine:!0,event:"viewport",x:t.x*e+cc.view._viewportRect.x,y:t.y*i+cc.view._viewportRect.y,width:t.width*e,height:t.height*i})}},_registerNodeEvent:function(){this.node.on("position-changed",this.updateSubContextViewport,this),this.node.on("scale-changed",this.updateSubContextViewport,this),this.node.on("size-changed",this.updateSubContextViewport,this)},_unregisterNodeEvent:function(){this.node.off("position-changed",this.updateSubContextViewport,this),this.node.off("scale-changed",this.updateSubContextViewport,this),this.node.off("size-changed",this.updateSubContextViewport,this)},_runSubContextMainLoop:function(){this._context&&this._context.postMessage({fromEngine:!0,event:"mainLoop",value:!0})},_stopSubContextMainLoop:function(){this._context&&this._context.postMessage({fromEngine:!0,event:"mainLoop",value:!1})},_updateSubContextFrameRate:function(){this._context&&this._context.postMessage({fromEngine:!0,event:"frameRate",value:this._fps})}});cc.SubContextView=e.exports=n,cc.WXSubContextView=n,cc.SwanSubContextView=n}),{"./CCComponent":106}],128:[(function(t,e){"use strict";var i=t("../../platform/CCMacro"),n=t("../editbox/EditBoxImplBase"),r=t("../CCLabel"),a=t("./types"),s=a.InputMode,o=a.InputFlag,c=a.KeyboardReturnType;function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}var h=cc.Class({name:"cc.EditBox",extends:cc.Component,editor:!1,properties:{_string:"",string:{tooltip:!1,get:function(){return this._string},set:function(t){t=""+t,this.maxLength>=0&&t.length>=this.maxLength&&(t=t.slice(0,this.maxLength)),this._string=t,this._updateString(t)}},textLabel:{tooltip:!1,default:null,type:r,notify:function(t){this.textLabel&&this.textLabel!==t&&(this._updateTextLabel(),this._updateLabels())}},placeholderLabel:{tooltip:!1,default:null,type:r,notify:function(t){this.placeholderLabel&&this.placeholderLabel!==t&&(this._updatePlaceholderLabel(),this._updateLabels())}},background:{tooltip:!1,default:null,type:cc.Sprite,notify:function(t){this.background&&this.background!==t&&this._updateBackgroundSprite()}},_N$backgroundImage:{default:void 0,type:cc.SpriteFrame},backgroundImage:{get:function(){return this.background?this.background.spriteFrame:null},set:function(t){this.background&&(this.background.spriteFrame=t)}},returnType:{default:c.DEFAULT,tooltip:!1,displayName:"KeyboardReturnType",type:c},_N$returnType:{default:void 0,type:cc.Float},inputFlag:{tooltip:!1,default:o.DEFAULT,type:o,notify:function(){this._updateString(this._string)}},inputMode:{tooltip:!1,default:s.ANY,type:s,notify:function(t){this.inputMode!==t&&(this._updateTextLabel(),this._updatePlaceholderLabel())}},fontSize:{get:function(){return this.textLabel?this.textLabel.fontSize:0},set:function(t){this.textLabel&&(this.textLabel.fontSize=t)}},_N$fontSize:{default:void 0,type:cc.Float},lineHeight:{get:function(){return this.textLabel?this.textLabel.lineHeight:0},set:function(t){this.textLabel&&(this.textLabel.lineHeight=t)}},_N$lineHeight:{default:void 0,type:cc.Float},fontColor:{get:function(){return this.textLabel?this.textLabel.node.color:cc.Color.BLACK},set:function(t){this.textLabel&&(this.textLabel.node.color=t,this.textLabel.node.opacity=t.a)}},_N$fontColor:void 0,placeholder:{tooltip:!1,get:function(){return this.placeholderLabel?this.placeholderLabel.string:""},set:function(t){this.placeholderLabel&&(this.placeholderLabel.string=t)}},_N$placeholder:{default:void 0,type:cc.String},placeholderFontSize:{get:function(){return this.placeholderLabel?this.placeholderLabel.fontSize:0},set:function(t){this.placeholderLabel&&(this.placeholderLabel.fontSize=t)}},_N$placeholderFontSize:{default:void 0,type:cc.Float},placeholderFontColor:{get:function(){return this.placeholderLabel?this.placeholderLabel.node.color:cc.Color.BLACK},set:function(t){this.placeholderLabel&&(this.placeholderLabel.node.color=t,this.placeholderLabel.node.opacity=t.a)}},_N$placeholderFontColor:void 0,maxLength:{tooltip:!1,default:20},_N$maxLength:{default:void 0,type:cc.Float},stayOnTop:{default:!1,notify:function(){cc.warn("editBox.stayOnTop is removed since v2.1.")}},_tabIndex:0,tabIndex:{tooltip:!1,get:function(){return this._tabIndex},set:function(t){this._tabIndex!==t&&(this._tabIndex=t,this._impl&&this._impl.setTabIndex(t))}},editingDidBegan:{default:[],type:cc.Component.EventHandler},textChanged:{default:[],type:cc.Component.EventHandler},editingDidEnded:{default:[],type:cc.Component.EventHandler},editingReturn:{default:[],type:cc.Component.EventHandler}},statics:{_ImplClass:n,KeyboardReturnType:c,InputFlag:o,InputMode:s},_init:function(){this._upgradeComp(),this._isLabelVisible=!0,this.node.on(cc.Node.EventType.SIZE_CHANGED,this._syncSize,this),(this._impl=new h._ImplClass).init(this),this._updateString(this._string),this._syncSize()},_updateBackgroundSprite:function(){var t=this.background;if(!t){var e=this.node.getChildByName("BACKGROUND_SPRITE");e||(e=new cc.Node("BACKGROUND_SPRITE")),(t=e.getComponent(cc.Sprite))||(t=e.addComponent(cc.Sprite)),e.parent=this.node,this.background=t}t.type=cc.Sprite.Type.SLICED,void 0!==this._N$backgroundImage&&(t.spriteFrame=this._N$backgroundImage,this._N$backgroundImage=void 0)},_updateTextLabel:function(){var t=this.textLabel;if(!t){var e=this.node.getChildByName("TEXT_LABEL");e||(e=new cc.Node("TEXT_LABEL")),(t=e.getComponent(r))||(t=e.addComponent(r)),e.parent=this.node,this.textLabel=t}t.node.setAnchorPoint(0,1),t.overflow=r.Overflow.CLAMP,this.inputMode===s.ANY?(t.verticalAlign=i.VerticalTextAlignment.TOP,t.enableWrapText=!0):(t.verticalAlign=i.VerticalTextAlignment.CENTER,t.enableWrapText=!1),t.string=this._updateLabelStringStyle(this._string),void 0!==this._N$fontColor&&(t.node.color=this._N$fontColor,t.node.opacity=this._N$fontColor.a,this._N$fontColor=void 0),void 0!==this._N$fontSize&&(t.fontSize=this._N$fontSize,this._N$fontSize=void 0),void 0!==this._N$lineHeight&&(t.lineHeight=this._N$lineHeight,this._N$lineHeight=void 0)},_updatePlaceholderLabel:function(){var t=this.placeholderLabel;if(!t){var e=this.node.getChildByName("PLACEHOLDER_LABEL");e||(e=new cc.Node("PLACEHOLDER_LABEL")),(t=e.getComponent(r))||(t=e.addComponent(r)),e.parent=this.node,this.placeholderLabel=t}t.node.setAnchorPoint(0,1),t.overflow=r.Overflow.CLAMP,this.inputMode===s.ANY?(t.verticalAlign=i.VerticalTextAlignment.TOP,t.enableWrapText=!0):(t.verticalAlign=i.VerticalTextAlignment.CENTER,t.enableWrapText=!1),t.string=this.placeholder,void 0!==this._N$placeholderFontColor&&(t.node.color=this._N$placeholderFontColor,t.node.opacity=this._N$placeholderFontColor.a,this._N$placeholderFontColor=void 0),void 0!==this._N$placeholderFontSize&&(t.fontSize=this._N$placeholderFontSize,this._N$placeholderFontSize=void 0)},_upgradeComp:function(){void 0!==this._N$returnType&&(this.returnType=this._N$returnType,this._N$returnType=void 0),void 0!==this._N$maxLength&&(this.maxLength=this._N$maxLength,this._N$maxLength=void 0),void 0!==this._N$backgroundImage&&this._updateBackgroundSprite(),void 0===this._N$fontColor&&void 0===this._N$fontSize&&void 0===this._N$lineHeight||this._updateTextLabel(),void 0===this._N$placeholderFontColor&&void 0===this._N$placeholderFontSize||this._updatePlaceholderLabel(),void 0!==this._N$placeholder&&(this.placeholder=this._N$placeholder,this._N$placeholder=void 0)},_syncSize:function(){if(this._impl){var t=this.node.getContentSize();this._impl.setSize(t.width,t.height)}},_showLabels:function(){this._isLabelVisible=!0,this._updateLabels()},_hideLabels:function(){this._isLabelVisible=!1,this.textLabel&&(this.textLabel.node.active=!1),this.placeholderLabel&&(this.placeholderLabel.node.active=!1)},_updateLabels:function(){if(this._isLabelVisible){var t=this._string;this.textLabel&&(this.textLabel.node.active=""!==t),this.placeholderLabel&&(this.placeholderLabel.node.active=""===t)}},_updateString:function(t){var e=this.textLabel;if(e){var i=t;i&&(i=this._updateLabelStringStyle(i)),e.string=i,this._updateLabels()}},_updateLabelStringStyle:function(t,e){var i=this.inputFlag;if(e||i!==o.PASSWORD)i===o.INITIAL_CAPS_ALL_CHARACTERS?t=t.toUpperCase():i===o.INITIAL_CAPS_WORD?t=t.replace(/(?:^|\s)\S/g,(function(t){return t.toUpperCase()})):i===o.INITIAL_CAPS_SENTENCE&&(t=l(t));else{for(var n="",r=t.length,a=0;a<r;++a)n+="\u25cf";t=n}return t},editBoxEditingDidBegan:function(){cc.Component.EventHandler.emitEvents(this.editingDidBegan,this),this.node.emit("editing-did-began",this)},editBoxEditingDidEnded:function(){cc.Component.EventHandler.emitEvents(this.editingDidEnded,this),this.node.emit("editing-did-ended",this)},editBoxTextChanged:function(t){t=this._updateLabelStringStyle(t,!0),this.string=t,cc.Component.EventHandler.emitEvents(this.textChanged,t,this),this.node.emit("text-changed",this)},editBoxEditingReturn:function(){cc.Component.EventHandler.emitEvents(this.editingReturn,this),this.node.emit("editing-return",this)},onEnable:function(){this._registerEvent(),this._impl&&this._impl.enable()},onDisable:function(){this._unregisterEvent(),this._impl&&this._impl.disable()},onDestroy:function(){this._impl&&this._impl.clear()},__preload:function(){this._init()},_registerEvent:function(){this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_unregisterEvent:function(){this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_onTouchBegan:function(t){t.stopPropagation()},_onTouchCancel:function(t){t.stopPropagation()},_onTouchEnded:function(t){this._impl&&this._impl.beginEditing(),t.stopPropagation()},setFocus:function(){cc.errorID(1400,"setFocus()","focus()"),this._impl&&this._impl.setFocus(!0)},focus:function(){this._impl&&this._impl.setFocus(!0)},blur:function(){this._impl&&this._impl.setFocus(!1)},isFocused:function(){return!!this._impl&&this._impl.isFocused()},update:function(){this._impl&&this._impl.update()}});cc.EditBox=e.exports=h,cc.sys.isBrowser&&t("./WebEditBoxImpl")}),{"../../platform/CCMacro":173,"../CCLabel":108,"../editbox/EditBoxImplBase":129,"./WebEditBoxImpl":130,"./types":132}],129:[(function(t,e){"use strict";var i=cc.Class({ctor:function(){this._delegate=null,this._editing=!1},init:function(){},enable:function(){},disable:function(){this._editing&&this.endEditing()},clear:function(){},update:function(){},setTabIndex:function(){},setSize:function(){},setFocus:function(t){t?this.beginEditing():this.endEditing()},isFocused:function(){return this._editing},beginEditing:function(){},endEditing:function(){}});e.exports=i}),{}],130:[(function(t){"use strict";var e,i=(e=t("../../value-types/mat4"))&&e.__esModule?e:{default:e},n=t("../../platform/utils"),r=t("../../platform/CCMacro"),a=t("./types"),s=t("../CCLabel"),o=t("./tabIndexUtil"),c=cc.EditBox,l=cc.js,h=a.InputMode,u=a.InputFlag,f=a.KeyboardReturnType,_={zoomInvalid:!1};cc.sys.OS_ANDROID!==cc.sys.os||cc.sys.browserType!==cc.sys.BROWSER_TYPE_SOUGOU&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_360||(_.zoomInvalid=!0);var d=0,p=cc.v3(),m=null,v=!1,g=!1,y=c._ImplClass;function T(){y.call(this),this._domId="EditBoxId_"+ ++d,this._placeholderStyleSheet=null,this._elem=null,this._isTextArea=!1,this._worldMat=new i.default,this._cameraMat=new i.default,this._m00=0,this._m01=0,this._m04=0,this._m05=0,this._m12=0,this._m13=0,this._w=0,this._h=0,this._cacheViewportRect=cc.rect(0,0,0,0),this._inputMode=null,this._inputFlag=null,this._returnType=null,this._eventListeners={},this._textLabelFont=null,this._textLabelFontSize=null,this._textLabelFontColor=null,this._textLabelAlign=null,this._placeholderLabelFont=null,this._placeholderLabelFontSize=null,this._placeholderLabelFontColor=null,this._placeholderLabelAlign=null,this._placeholderLineHeight=null}l.extend(T,y),c._ImplClass=T,Object.assign(T.prototype,{init:function(t){t&&(this._delegate=t,t.inputMode===h.ANY?this._createTextArea():this._createInput(),o.add(this),this.setTabIndex(t.tabIndex),this._initStyleSheet(),this._registerEventListeners(),this._addDomToGameContainer(),v=cc.view.isAutoFullScreenEnabled(),g=cc.view._resizeWithBrowserSize)},clear:function(){this._removeEventListeners(),this._removeDomFromGameContainer(),o.remove(this),m===this&&(m=null)},update:function(){this._updateMatrix()},setTabIndex:function(t){this._elem.tabIndex=t,o.resort()},setSize:function(t,e){var i=this._elem;i.style.width=t+"px",i.style.height=e+"px"},beginEditing:function(){m&&m!==this&&m.setFocus(!1),this._editing=!0,m=this,this._delegate.editBoxEditingDidBegan(),this._showDom(),this._elem.focus()},endEditing:function(){this._elem&&this._elem.blur()},_createInput:function(){this._isTextArea=!1,this._elem=document.createElement("input")},_createTextArea:function(){this._isTextArea=!0,this._elem=document.createElement("textarea")},_addDomToGameContainer:function(){cc.game.container.appendChild(this._elem),document.head.appendChild(this._placeholderStyleSheet)},_removeDomFromGameContainer:function(){n.contains(cc.game.container,this._elem)&&cc.game.container.removeChild(this._elem),n.contains(document.head,this._placeholderStyleSheet)&&document.head.removeChild(this._placeholderStyleSheet),delete this._elem,delete this._placeholderStyleSheet},_showDom:function(){this._updateMaxLength(),this._updateInputType(),this._updateStyleSheet(),this._elem.style.display="",this._delegate._hideLabels(),cc.sys.isMobile&&this._showDomOnMobile()},_hideDom:function(){this._elem.style.display="none",this._delegate._showLabels(),cc.sys.isMobile&&this._hideDomOnMobile()},_showDomOnMobile:function(){cc.sys.os===cc.sys.OS_ANDROID&&(v&&(cc.view.enableAutoFullScreen(!1),cc.screen.exitFullScreen()),g&&cc.view.resizeWithBrowserSize(!1),this._adjustWindowScroll())},_hideDomOnMobile:function(){cc.sys.os===cc.sys.OS_ANDROID&&(g&&cc.view.resizeWithBrowserSize(!0),setTimeout((function(){m||v&&cc.view.enableAutoFullScreen(!0)}),800))},_adjustWindowScroll:function(){var t=this;setTimeout((function(){window.scrollY<100&&t._elem.scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})}),800)},_scrollBackWindow:function(){setTimeout((function(){var t=cc.sys;t.browserType!==t.BROWSER_TYPE_WECHAT||t.os!==t.OS_IOS?window.scrollTo(0,0):window.top&&window.top.scrollTo(0,0)}),800)},_updateCameraMatrix:function(){var t=this._delegate.node;t.getWorldMatrix(this._worldMat);var e=this._worldMat,n=t._contentSize,r=t._anchorPoint;p.x=-r.x*n.width,p.y=-r.y*n.height,i.default.transform(e,e,p);var a=cc.Camera.findCamera(t);return!!a&&(a.getWorldToScreenMatrix2D(this._cameraMat),i.default.mul(this._cameraMat,this._cameraMat,e),!0)},_updateMatrix:function(){if(this._updateCameraMatrix()){var t=this._cameraMat.m,e=this._delegate.node,i=cc.view;if(this._m00!==t[0]||this._m01!==t[1]||this._m04!==t[4]||this._m05!==t[5]||this._m12!==t[12]||this._m13!==t[13]||this._w!==e._contentSize.width||this._h!==e._contentSize.height||!this._cacheViewportRect.equals(i._viewportRect)){this._m00=t[0],this._m01=t[1],this._m04=t[4],this._m05=t[5],this._m12=t[12],this._m13=t[13],this._w=e._contentSize.width,this._h=e._contentSize.height,this._cacheViewportRect.set(i._viewportRect);var n=i._scaleX,r=i._scaleY,a=i._viewportRect,s=i._devicePixelRatio;n/=s,r/=s;var o=cc.game.container,c=t[0]*n,l=t[1],h=t[4],u=t[5]*r,f=o&&o.style.paddingLeft&&parseInt(o.style.paddingLeft);f+=a.x/s;var d=o&&o.style.paddingBottom&&parseInt(o.style.paddingBottom);d+=a.y/s;var p=t[12]*n+f,m=t[13]*r+d;_.zoomInvalid&&(this.setSize(e.width*c,e.height*u),c=1,u=1);var v=this._elem,g="matrix("+c+","+-l+","+-h+","+u+","+p+","+-m+")";v.style.transform=g,v.style["-webkit-transform"]=g,v.style["transform-origin"]="0px 100% 0px",v.style["-webkit-transform-origin"]="0px 100% 0px"}}},_updateInputType:function(){var t=this._delegate,e=t.inputMode,i=t.inputFlag,n=t.returnType,r=this._elem;if(this._inputMode!==e||this._inputFlag!==i||this._returnType!==n){if(this._inputMode=e,this._inputFlag=i,this._returnType=n,this._isTextArea){var a="none";return i===u.INITIAL_CAPS_ALL_CHARACTERS?a="uppercase":i===u.INITIAL_CAPS_WORD&&(a="capitalize"),void(r.style.textTransform=a)}if(i===u.PASSWORD)return r.type="password",void(r.style.textTransform="none");var s=r.type;e===h.EMAIL_ADDR?s="email":e===h.NUMERIC?s="number":e===h.DECIMAL?s="digit":e===h.PHONE_NUMBER?(s="tel",r.onmousewheel=function(){return!1}):e===h.URL?s="url":(s="text",n===f.SEARCH&&(s="search")),r.type=s;var o="none";i===u.INITIAL_CAPS_ALL_CHARACTERS?o="uppercase":i===u.INITIAL_CAPS_WORD&&(o="capitalize"),r.style.textTransform=o}},_updateMaxLength:function(){var t=this._delegate.maxLength;t<0&&(t=65535),this._elem.maxLength=t},_initStyleSheet:function(){var t=this._elem;t.style.display="none",t.style.border=0,t.style.background="transparent",t.style.width="100%",t.style.height="100%",t.style.active=0,t.style.outline="medium",t.style.padding="0",t.style.textTransform="none",t.style.position="absolute",t.style.bottom="0px",t.style.left="2px",t.className="cocosEditBox",t.id=this._domId,this._isTextArea?(t.style.resize="none",t.style.overflow_y="scroll"):(t.type="text",t.style["-moz-appearance"]="textfield"),this._placeholderStyleSheet=document.createElement("style")},_updateStyleSheet:function(){var t=this._delegate,e=this._elem;e.value=t.string,e.placeholder=t.placeholder,this._updateTextLabel(t.textLabel),this._updatePlaceholderLabel(t.placeholderLabel)},_updateTextLabel:function(t){if(t){var e=t.font;e=!e||e instanceof cc.BitmapFont?t.fontFamily:e._fontFamily;var i=t.fontSize*t.node.scaleY;if(this._textLabelFont!==e||this._textLabelFontSize!==i||this._textLabelFontColor!==t.fontColor||this._textLabelAlign!==t.horizontalAlign){this._textLabelFont=e,this._textLabelFontSize=i,this._textLabelFontColor=t.fontColor,this._textLabelAlign=t.horizontalAlign;var n=this._elem;switch(n.style.fontSize=i+"px",n.style.color=t.node.color.toCSS(),n.style.fontFamily=e,t.horizontalAlign){case s.HorizontalAlign.LEFT:n.style.textAlign="left";break;case s.HorizontalAlign.CENTER:n.style.textAlign="center";break;case s.HorizontalAlign.RIGHT:n.style.textAlign="right"}}}},_updatePlaceholderLabel:function(t){if(t){var e=t.font;e=!e||e instanceof cc.BitmapFont?t.fontFamily:t.font._fontFamily;var i=t.fontSize*t.node.scaleY;if(this._placeholderLabelFont!==e||this._placeholderLabelFontSize!==i||this._placeholderLabelFontColor!==t.fontColor||this._placeholderLabelAlign!==t.horizontalAlign||this._placeholderLineHeight!==t.fontSize){this._placeholderLabelFont=e,this._placeholderLabelFontSize=i,this._placeholderLabelFontColor=t.fontColor,this._placeholderLabelAlign=t.horizontalAlign,this._placeholderLineHeight=t.fontSize;var n,r=this._placeholderStyleSheet,a=t.node.color.toCSS(),o=t.fontSize;switch(t.horizontalAlign){case s.HorizontalAlign.LEFT:n="left";break;case s.HorizontalAlign.CENTER:n="center";break;case s.HorizontalAlign.RIGHT:n="right"}r.innerHTML="#"+this._domId+"::-webkit-input-placeholder,#"+this._domId+"::-moz-placeholder,#"+this._domId+":-ms-input-placeholder{text-transform: initial; font-family: "+e+"; font-size: "+i+"px; color: "+a+"; line-height: "+o+"px; text-align: "+n+";}",cc.sys.browserType===cc.sys.BROWSER_TYPE_EDGE&&(r.innerHTML+="#"+this._domId+"::-ms-clear{display: none;}")}}},_registerEventListeners:function(){var t=this,e=this._elem,i=!1,n=this._eventListeners;n.compositionStart=function(){i=!0},n.compositionEnd=function(){i=!1,t._delegate.editBoxTextChanged(e.value)},n.onInput=function(){if(!i){var n=t._delegate.maxLength;n>=0&&(e.value=e.value.slice(0,n)),t._delegate.editBoxTextChanged(e.value)}},n.onClick=function(){t._editing&&cc.sys.isMobile&&t._adjustWindowScroll()},n.onKeydown=function(i){i.keyCode===r.KEY.enter?(i.stopPropagation(),t._delegate.editBoxEditingReturn(),t._isTextArea||e.blur()):i.keyCode===r.KEY.tab&&(i.stopPropagation(),i.preventDefault(),o.next(t))},n.onBlur=function(){cc.sys.isMobile&&i&&n.compositionEnd(),t._editing=!1,m=null,t._hideDom(),t._delegate.editBoxEditingDidEnded()},e.addEventListener("compositionstart",n.compositionStart),e.addEventListener("compositionend",n.compositionEnd),e.addEventListener("input",n.onInput),e.addEventListener("keydown",n.onKeydown),e.addEventListener("blur",n.onBlur),e.addEventListener("touchstart",n.onClick)},_removeEventListeners:function(){var t=this._elem,e=this._eventListeners;t.removeEventListener("compositionstart",e.compositionStart),t.removeEventListener("compositionend",e.compositionEnd),t.removeEventListener("input",e.onInput),t.removeEventListener("keydown",e.onKeydown),t.removeEventListener("blur",e.onBlur),t.removeEventListener("touchstart",e.onClick),e.compositionStart=null,e.compositionEnd=null,e.onInput=null,e.onKeydown=null,e.onBlur=null,e.onClick=null}})}),{"../../platform/CCMacro":173,"../../platform/utils":192,"../../value-types/mat4":259,"../CCLabel":108,"./tabIndexUtil":131,"./types":132}],131:[(function(t,e){"use strict";e.exports={_tabIndexList:[],add:function(t){var e=this._tabIndexList;-1===e.indexOf(t)&&e.push(t)},remove:function(t){var e=this._tabIndexList,i=e.indexOf(t);-1!==i&&e.splice(i,1)},resort:function(){this._tabIndexList.sort((function(t,e){return t._delegate._tabIndex-e._delegate._tabIndex}))},next:function(t){var e=this._tabIndexList,i=e.indexOf(t);if(t.setFocus(!1),-1!==i){var n=e[i+1];n&&n._delegate._tabIndex>=0&&n.setFocus(!0)}}}}),{}],132:[(function(t,e){"use strict";var i=cc.Enum({DEFAULT:0,DONE:1,SEND:2,SEARCH:3,GO:4,NEXT:5}),n=cc.Enum({ANY:0,EMAIL_ADDR:1,NUMERIC:2,PHONE_NUMBER:3,URL:4,DECIMAL:5,SINGLE_LINE:6}),r=cc.Enum({PASSWORD:0,SENSITIVE:1,INITIAL_CAPS_WORD:2,INITIAL_CAPS_SENTENCE:3,INITIAL_CAPS_ALL_CHARACTERS:4,DEFAULT:5});e.exports={KeyboardReturnType:i,InputMode:n,InputFlag:r}}),{}],133:[(function(t,e){"use strict";t("./CCComponent"),t("./CCComponentEventHandler"),t("./missing-script");var i=t("./SubContextView");i||(i=cc.Class({name:"cc.SubContextView",extends:cc.Component}),cc.SubContextView=cc.WXSubContextView=cc.SwanSubContextView=i);var n=[t("./CCSprite"),t("./CCWidget"),t("./CCCanvas"),t("./CCAudioSource"),t("./CCAnimation"),t("./CCButton"),t("./CCLabel"),t("./CCProgressBar"),t("./CCMask"),t("./CCScrollBar"),t("./CCScrollView"),t("./CCPageViewIndicator"),t("./CCPageView"),t("./CCSlider"),t("./CCLayout"),t("./editbox/CCEditBox"),t("./CCLabelOutline"),t("./CCLabelShadow"),t("./CCRichText"),t("./CCToggleContainer"),t("./CCToggleGroup"),t("./CCToggle"),t("./CCBlockInputEvents"),t("./CCMotionStreak"),t("./CCSafeArea"),i];e.exports=n}),{"./CCAnimation":101,"./CCAudioSource":102,"./CCBlockInputEvents":103,"./CCButton":104,"./CCCanvas":105,"./CCComponent":106,"./CCComponentEventHandler":107,"./CCLabel":108,"./CCLabelOutline":109,"./CCLabelShadow":110,"./CCLayout":111,"./CCMask":112,"./CCMotionStreak":113,"./CCPageView":void 0,"./CCPageViewIndicator":void 0,"./CCProgressBar":114,"./CCRichText":void 0,"./CCSafeArea":116,"./CCScrollBar":117,"./CCScrollView":118,"./CCSlider":119,"./CCSprite":120,"./CCToggle":122,"./CCToggleContainer":123,"./CCToggleGroup":124,"./CCWidget":126,"./SubContextView":127,"./editbox/CCEditBox":128,"./missing-script":134}],134:[(function(t,e){"use strict";var i=cc.js,n=cc.Class({name:"cc.MissingScript",extends:cc.Component,editor:{inspector:"packages://inspector/inspectors/comps/missing-script.js"},properties:{compiled:{default:!1,serializable:!1},_$erialized:{default:null,visible:!1,editorOnly:!0}},ctor:!1,statics:{safeFindClass:function(t){return i._getClassById(t)||(cc.deserialize.reportMissingClass(t),n)}},onLoad:function(){cc.warnID(4600,this.node.name)}});cc._MissingScript=e.exports=n}),{}],135:[(function(t,e){"use strict";var i=cc.js;t("../event/event");var n=function(t,e){cc.Event.call(this,cc.Event.MOUSE,e),this._eventType=t,this._button=0,this._x=0,this._y=0,this._prevX=0,this._prevY=0,this._scrollX=0,this._scrollY=0};i.extend(n,cc.Event);var r=n.prototype;r.setScrollData=function(t,e){this._scrollX=t,this._scrollY=e},r.getScrollX=function(){return this._scrollX},r.getScrollY=function(){return this._scrollY},r.setLocation=function(t,e){this._x=t,this._y=e},r.getLocation=function(){return cc.v2(this._x,this._y)},r.getLocationInView=function(){return cc.v2(this._x,cc.view._designResolutionSize.height-this._y)},r._setPrevCursor=function(t,e){this._prevX=t,this._prevY=e},r.getPreviousLocation=function(){return cc.v2(this._prevX,this._prevY)},r.getDelta=function(){return cc.v2(this._x-this._prevX,this._y-this._prevY)},r.getDeltaX=function(){return this._x-this._prevX},r.getDeltaY=function(){return this._y-this._prevY},r.setButton=function(t){this._button=t},r.getButton=function(){return this._button},r.getLocationX=function(){return this._x},r.getLocationY=function(){return this._y},n.NONE=0,n.DOWN=1,n.UP=2,n.MOVE=3,n.SCROLL=4,n.BUTTON_LEFT=0,n.BUTTON_RIGHT=2,n.BUTTON_MIDDLE=1,n.BUTTON_4=3,n.BUTTON_5=4,n.BUTTON_6=5,n.BUTTON_7=6,n.BUTTON_8=7;var a=function(t,e){cc.Event.call(this,cc.Event.TOUCH,e),this._eventCode=0,this._touches=t||[],this.touch=null,this.currentTouch=null};i.extend(a,cc.Event),(r=a.prototype).getEventCode=function(){return this._eventCode},r.getTouches=function(){return this._touches},r._setEventCode=function(t){this._eventCode=t},r._setTouches=function(t){this._touches=t},r.setLocation=function(t,e){this.touch&&this.touch.setTouchInfo(this.touch.getID(),t,e)},r.getLocation=function(){return this.touch?this.touch.getLocation():cc.v2()},r.getLocationInView=function(){return this.touch?this.touch.getLocationInView():cc.v2()},r.getPreviousLocation=function(){return this.touch?this.touch.getPreviousLocation():cc.v2()},r.getStartLocation=function(){return this.touch?this.touch.getStartLocation():cc.v2()},r.getID=function(){return this.touch?this.touch.getID():null},r.getDelta=function(){return this.touch?this.touch.getDelta():cc.v2()},r.getDeltaX=function(){return this.touch?this.touch.getDelta().x:0},r.getDeltaY=function(){return this.touch?this.touch.getDelta().y:0},r.getLocationX=function(){return this.touch?this.touch.getLocationX():0},r.getLocationY=function(){return this.touch?this.touch.getLocationY():0},a.MAX_TOUCHES=5,a.BEGAN=0,a.MOVED=1,a.ENDED=2,a.CANCELED=3;var s=function(t,e){cc.Event.call(this,cc.Event.ACCELERATION,e),this.acc=t};i.extend(s,cc.Event);var o=function(t,e,i){cc.Event.call(this,cc.Event.KEYBOARD,i),this.keyCode=t,this.isPressed=e};i.extend(o,cc.Event),cc.Event.EventMouse=n,cc.Event.EventTouch=a,cc.Event.EventAcceleration=s,cc.Event.EventKeyboard=o,e.exports=cc.Event}),{"../event/event":142}],136:[(function(t,e){"use strict";var i=t("../platform/js");cc.EventListener=function(t,e,i){this._onEvent=i,this._type=t||0,this._listenerID=e||"",this._registered=!1,this._fixedPriority=0,this._node=null,this._target=null,this._paused=!0,this._isEnabled=!0},cc.EventListener.prototype={constructor:cc.EventListener,_setPaused:function(t){this._paused=t},_isPaused:function(){return this._paused},_setRegistered:function(t){this._registered=t},_isRegistered:function(){return this._registered},_getType:function(){return this._type},_getListenerID:function(){return this._listenerID},_setFixedPriority:function(t){this._fixedPriority=t},_getFixedPriority:function(){return this._fixedPriority},_setSceneGraphPriority:function(t){this._target=t,this._node=t},_getSceneGraphPriority:function(){return this._node},checkAvailable:function(){return null!==this._onEvent},clone:function(){return null},setEnabled:function(t){this._isEnabled=t},isEnabled:function(){return this._isEnabled},retain:function(){},release:function(){}},cc.EventListener.UNKNOWN=0,cc.EventListener.TOUCH_ONE_BY_ONE=1,cc.EventListener.TOUCH_ALL_AT_ONCE=2,cc.EventListener.KEYBOARD=3,cc.EventListener.MOUSE=4,cc.EventListener.ACCELERATION=6,cc.EventListener.CUSTOM=8;var n=cc.EventListener.ListenerID={MOUSE:"__cc_mouse",TOUCH_ONE_BY_ONE:"__cc_touch_one_by_one",TOUCH_ALL_AT_ONCE:"__cc_touch_all_at_once",KEYBOARD:"__cc_keyboard",ACCELERATION:"__cc_acceleration"},r=function(t,e){this._onCustomEvent=e,cc.EventListener.call(this,cc.EventListener.CUSTOM,t,this._callback)};i.extend(r,cc.EventListener),i.mixin(r.prototype,{_onCustomEvent:null,_callback:function(t){null!==this._onCustomEvent&&this._onCustomEvent(t)},checkAvailable:function(){return cc.EventListener.prototype.checkAvailable.call(this)&&null!==this._onCustomEvent},clone:function(){return new r(this._listenerID,this._onCustomEvent)}});var a=function(){cc.EventListener.call(this,cc.EventListener.MOUSE,n.MOUSE,this._callback)};i.extend(a,cc.EventListener),i.mixin(a.prototype,{onMouseDown:null,onMouseUp:null,onMouseMove:null,onMouseScroll:null,_callback:function(t){var e=cc.Event.EventMouse;switch(t._eventType){case e.DOWN:this.onMouseDown&&this.onMouseDown(t);break;case e.UP:this.onMouseUp&&this.onMouseUp(t);break;case e.MOVE:this.onMouseMove&&this.onMouseMove(t);break;case e.SCROLL:this.onMouseScroll&&this.onMouseScroll(t)}},clone:function(){var t=new a;return t.onMouseDown=this.onMouseDown,t.onMouseUp=this.onMouseUp,t.onMouseMove=this.onMouseMove,t.onMouseScroll=this.onMouseScroll,t},checkAvailable:function(){return!0}});var s=function(){cc.EventListener.call(this,cc.EventListener.TOUCH_ONE_BY_ONE,n.TOUCH_ONE_BY_ONE,null),this._claimedTouches=[]};i.extend(s,cc.EventListener),i.mixin(s.prototype,{constructor:s,_claimedTouches:null,swallowTouches:!1,onTouchBegan:null,onTouchMoved:null,onTouchEnded:null,onTouchCancelled:null,setSwallowTouches:function(t){this.swallowTouches=t},isSwallowTouches:function(){return this.swallowTouches},clone:function(){var t=new s;return t.onTouchBegan=this.onTouchBegan,t.onTouchMoved=this.onTouchMoved,t.onTouchEnded=this.onTouchEnded,t.onTouchCancelled=this.onTouchCancelled,t.swallowTouches=this.swallowTouches,t},checkAvailable:function(){return!!this.onTouchBegan||(cc.logID(1801),!1)}});var o=function(){cc.EventListener.call(this,cc.EventListener.TOUCH_ALL_AT_ONCE,n.TOUCH_ALL_AT_ONCE,null)};i.extend(o,cc.EventListener),i.mixin(o.prototype,{constructor:o,onTouchesBegan:null,onTouchesMoved:null,onTouchesEnded:null,onTouchesCancelled:null,clone:function(){var t=new o;return t.onTouchesBegan=this.onTouchesBegan,t.onTouchesMoved=this.onTouchesMoved,t.onTouchesEnded=this.onTouchesEnded,t.onTouchesCancelled=this.onTouchesCancelled,t},checkAvailable:function(){return null!==this.onTouchesBegan||null!==this.onTouchesMoved||null!==this.onTouchesEnded||null!==this.onTouchesCancelled||(cc.logID(1802),!1)}});var c=function(t){this._onAccelerationEvent=t,cc.EventListener.call(this,cc.EventListener.ACCELERATION,n.ACCELERATION,this._callback)};i.extend(c,cc.EventListener),i.mixin(c.prototype,{constructor:c,_onAccelerationEvent:null,_callback:function(t){this._onAccelerationEvent(t.acc,t)},checkAvailable:function(){return cc.assertID(this._onAccelerationEvent,1803),!0},clone:function(){return new c(this._onAccelerationEvent)}});var l=function(){cc.EventListener.call(this,cc.EventListener.KEYBOARD,n.KEYBOARD,this._callback)};i.extend(l,cc.EventListener),i.mixin(l.prototype,{constructor:l,onKeyPressed:null,onKeyReleased:null,_callback:function(t){t.isPressed?this.onKeyPressed&&this.onKeyPressed(t.keyCode,t):this.onKeyReleased&&this.onKeyReleased(t.keyCode,t)},clone:function(){var t=new l;return t.onKeyPressed=this.onKeyPressed,t.onKeyReleased=this.onKeyReleased,t},checkAvailable:function(){return null!==this.onKeyPressed||null!==this.onKeyReleased||(cc.logID(1800),!1)}}),cc.EventListener.create=function(t){cc.assertID(t&&t.event,1900);var e=t.event;delete t.event;var i=null;for(var n in e===cc.EventListener.TOUCH_ONE_BY_ONE?i=new s:e===cc.EventListener.TOUCH_ALL_AT_ONCE?i=new o:e===cc.EventListener.MOUSE?i=new a:e===cc.EventListener.CUSTOM?(i=new r(t.eventName,t.callback),delete t.eventName,delete t.callback):e===cc.EventListener.KEYBOARD?i=new l:e===cc.EventListener.ACCELERATION&&(i=new c(t.callback),delete t.callback),t)i[n]=t[n];return i},e.exports=cc.EventListener}),{"../platform/js":189}],137:[(function(t,e){"use strict";var i=t("../platform/js");t("./CCEventListener");var n=cc.EventListener.ListenerID,r=function(){this._fixedListeners=[],this._sceneGraphListeners=[],this.gt0Index=0};r.prototype={constructor:r,size:function(){return this._fixedListeners.length+this._sceneGraphListeners.length},empty:function(){return 0===this._fixedListeners.length&&0===this._sceneGraphListeners.length},push:function(t){0===t._getFixedPriority()?this._sceneGraphListeners.push(t):this._fixedListeners.push(t)},clearSceneGraphListeners:function(){this._sceneGraphListeners.length=0},clearFixedListeners:function(){this._fixedListeners.length=0},clear:function(){this._sceneGraphListeners.length=0,this._fixedListeners.length=0},getFixedPriorityListeners:function(){return this._fixedListeners},getSceneGraphPriorityListeners:function(){return this._sceneGraphListeners}};var a=function(t){var e=cc.Event,i=t.type;return i===e.ACCELERATION?n.ACCELERATION:i===e.KEYBOARD?n.KEYBOARD:i.startsWith(e.MOUSE)?n.MOUSE:(i.startsWith(e.TOUCH)&&cc.logID(2e3),"")},s={DIRTY_NONE:0,DIRTY_FIXED_PRIORITY:1,DIRTY_SCENE_GRAPH_PRIORITY:2,DIRTY_ALL:3,_listenersMap:{},_priorityDirtyFlagMap:{},_nodeListenersMap:{},_toAddedListeners:[],_toRemovedListeners:[],_dirtyListeners:{},_inDispatch:0,_isEnabled:!1,_currentTouch:null,_currentTouchListener:null,_internalCustomListenerIDs:[],_setDirtyForNode:function(t){var e=this._nodeListenersMap[t._id];if(e)for(var i=0,n=e.length;i<n;i++){var r=e[i]._getListenerID();null==this._dirtyListeners[r]&&(this._dirtyListeners[r]=!0)}if(t.childrenCount>0)for(var a=t._children,s=0,o=a.length;s<o;s++)this._setDirtyForNode(a[s])},pauseTarget:function(t,e){if(t instanceof cc._BaseNode){var i,n,r=this._nodeListenersMap[t._id];if(r)for(i=0,n=r.length;i<n;i++){var a=r[i];a._setPaused(!0),a._claimedTouches&&a._claimedTouches.includes(this._currentTouch)&&this._clearCurTouch()}if(!0===e){var s=t._children;for(i=0,n=s?s.length:0;i<n;i++)this.pauseTarget(s[i],!0)}}else cc.warnID(3506)},resumeTarget:function(t,e){if(t instanceof cc._BaseNode){var i,n,r=this._nodeListenersMap[t._id];if(r)for(i=0,n=r.length;i<n;i++)r[i]._setPaused(!1);if(this._setDirtyForNode(t),!0===e){var a=t._children;for(i=0,n=a?a.length:0;i<n;i++)this.resumeTarget(a[i],!0)}}else cc.warnID(3506)},_addListener:function(t){0===this._inDispatch?this._forceAddEventListener(t):this._toAddedListeners.push(t)},_forceAddEventListener:function(t){var e=t._getListenerID(),i=this._listenersMap[e];if(i||(i=new r,this._listenersMap[e]=i),i.push(t),0===t._getFixedPriority()){this._setDirty(e,this.DIRTY_SCENE_GRAPH_PRIORITY);var n=t._getSceneGraphPriority();null===n&&cc.logID(3507),this._associateNodeAndEventListener(n,t),n.activeInHierarchy&&this.resumeTarget(n)}else this._setDirty(e,this.DIRTY_FIXED_PRIORITY)},_getListeners:function(t){return this._listenersMap[t]},_updateDirtyFlagForSceneGraph:function(){var t=this._dirtyListeners;for(var e in t)this._setDirty(e,this.DIRTY_SCENE_GRAPH_PRIORITY);this._dirtyListeners={}},_removeAllListenersInVector:function(t){if(t)for(var e,i=t.length-1;i>=0;i--)(e=t[i])._setRegistered(!1),null!=e._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(e._getSceneGraphPriority(),e),e._setSceneGraphPriority(null)),0===this._inDispatch&&cc.js.array.removeAt(t,i)},_removeListenersForListenerID:function(t){var e,i=this._listenersMap[t];if(i){var n=i.getFixedPriorityListeners(),r=i.getSceneGraphPriorityListeners();this._removeAllListenersInVector(r),this._removeAllListenersInVector(n),delete this._priorityDirtyFlagMap[t],this._inDispatch||(i.clear(),delete this._listenersMap[t])}var a,s=this._toAddedListeners;for(e=s.length-1;e>=0;e--)(a=s[e])&&a._getListenerID()===t&&cc.js.array.removeAt(s,e)},_sortEventListeners:function(t){var e=this.DIRTY_NONE,i=this._priorityDirtyFlagMap;i[t]&&(e=i[t]),e!==this.DIRTY_NONE&&(i[t]=this.DIRTY_NONE,e&this.DIRTY_FIXED_PRIORITY&&this._sortListenersOfFixedPriority(t),e&this.DIRTY_SCENE_GRAPH_PRIORITY&&cc.director.getScene()&&this._sortListenersOfSceneGraphPriority(t))},_sortListenersOfSceneGraphPriority:function(t){var e=this._getListeners(t);if(e){var i=e.getSceneGraphPriorityListeners();i&&0!==i.length&&e.getSceneGraphPriorityListeners().sort(this._sortEventListenersOfSceneGraphPriorityDes)}},_sortEventListenersOfSceneGraphPriorityDes:function(t,e){var i=t._getSceneGraphPriority(),n=e._getSceneGraphPriority();if(!(e&&n&&n._activeInHierarchy&&null!==n._parent))return-1;if(!t||!i||!i._activeInHierarchy||null===i._parent)return 1;for(var r=i,a=n,s=!1;r._parent._id!==a._parent._id;)r=null===r._parent._parent?(s=!0)&&n:r._parent,a=null===a._parent._parent?(s=!0)&&i:a._parent;if(r._id===a._id){if(r._id===n._id)return-1;if(r._id===i._id)return 1}return s?r._localZOrder-a._localZOrder:a._localZOrder-r._localZOrder},_sortListenersOfFixedPriority:function(t){var e=this._listenersMap[t];if(e){var i=e.getFixedPriorityListeners();if(i&&0!==i.length){i.sort(this._sortListenersOfFixedPriorityAsc);for(var n=0,r=i.length;n<r&&!(i[n]._getFixedPriority()>=0);)++n;e.gt0Index=n}}},_sortListenersOfFixedPriorityAsc:function(t,e){return t._getFixedPriority()-e._getFixedPriority()},_onUpdateListeners:function(t){var e,i,n,r=t.getFixedPriorityListeners(),a=t.getSceneGraphPriorityListeners(),s=this._toRemovedListeners;if(a)for(e=a.length-1;e>=0;e--)(i=a[e])._isRegistered()||(cc.js.array.removeAt(a,e),-1!==(n=s.indexOf(i))&&s.splice(n,1));if(r)for(e=r.length-1;e>=0;e--)(i=r[e])._isRegistered()||(cc.js.array.removeAt(r,e),-1!==(n=s.indexOf(i))&&s.splice(n,1));a&&0===a.length&&t.clearSceneGraphListeners(),r&&0===r.length&&t.clearFixedListeners()},frameUpdateListeners:function(){var t=this._listenersMap,e=this._priorityDirtyFlagMap;for(var i in t)t[i].empty()&&(delete e[i],delete t[i]);var n=this._toAddedListeners;if(0!==n.length){for(var r=0,a=n.length;r<a;r++)this._forceAddEventListener(n[r]);n.length=0}0!==this._toRemovedListeners.length&&this._cleanToRemovedListeners()},_updateTouchListeners:function(){var t=this._inDispatch;if(cc.assertID(t>0,3508),!(t>1)){var e;(e=this._listenersMap[n.TOUCH_ONE_BY_ONE])&&this._onUpdateListeners(e),(e=this._listenersMap[n.TOUCH_ALL_AT_ONCE])&&this._onUpdateListeners(e),cc.assertID(1===t,3509);var i=this._toAddedListeners;if(0!==i.length){for(var r=0,a=i.length;r<a;r++)this._forceAddEventListener(i[r]);this._toAddedListeners.length=0}0!==this._toRemovedListeners.length&&this._cleanToRemovedListeners()}},_cleanToRemovedListeners:function(){for(var t=this._toRemovedListeners,e=0;e<t.length;e++){var i=t[e],n=this._listenersMap[i._getListenerID()];if(n){var r,a=n.getFixedPriorityListeners(),s=n.getSceneGraphPriorityListeners();s&&-1!==(r=s.indexOf(i))&&s.splice(r,1),a&&-1!==(r=a.indexOf(i))&&a.splice(r,1)}}t.length=0},_onTouchEventCallback:function(t,e){if(!t._isRegistered())return!1;var i=e.event,n=i.currentTouch;i.currentTarget=t._node;var r,a=!1,o=i.getEventCode(),c=cc.Event.EventTouch;if(o===c.BEGAN){if(!cc.macro.ENABLE_MULTI_TOUCH&&s._currentTouch){var l=s._currentTouchListener._node;if(l&&l.activeInHierarchy)return!1}t.onTouchBegan&&(a=t.onTouchBegan(n,i))&&t._registered&&(t._claimedTouches.push(n),s._currentTouchListener=t,s._currentTouch=n)}else if(t._claimedTouches.length>0&&-1!==(r=t._claimedTouches.indexOf(n))){if(a=!0,!cc.macro.ENABLE_MULTI_TOUCH&&s._currentTouch&&s._currentTouch!==n)return!1;o===c.MOVED&&t.onTouchMoved?t.onTouchMoved(n,i):o===c.ENDED?(t.onTouchEnded&&t.onTouchEnded(n,i),t._registered&&t._claimedTouches.splice(r,1),s._clearCurTouch()):o===c.CANCELED&&(t.onTouchCancelled&&t.onTouchCancelled(n,i),t._registered&&t._claimedTouches.splice(r,1),s._clearCurTouch())}return i.isStopped()?(s._updateTouchListeners(i),!0):!(!a||!t.swallowTouches||(e.needsMutableSet&&e.touches.splice(n,1),0))},_dispatchTouchEvent:function(t){this._sortEventListeners(n.TOUCH_ONE_BY_ONE),this._sortEventListeners(n.TOUCH_ALL_AT_ONCE);var e=this._getListeners(n.TOUCH_ONE_BY_ONE),i=this._getListeners(n.TOUCH_ALL_AT_ONCE);if(null!==e||null!==i){var r=t.getTouches(),a=cc.js.array.copy(r),s={event:t,needsMutableSet:e&&i,touches:a,selTouch:null};if(e)for(var o=0;o<r.length;o++)t.currentTouch=r[o],t._propagationStopped=t._propagationImmediateStopped=!1,this._dispatchEventToListeners(e,this._onTouchEventCallback,s);i&&a.length>0&&(this._dispatchEventToListeners(i,this._onTouchesEventCallback,{event:t,touches:a}),t.isStopped())||this._updateTouchListeners(t)}},_onTouchesEventCallback:function(t,e){if(!t._registered)return!1;var i=cc.Event.EventTouch,n=e.event,r=e.touches,a=n.getEventCode();return n.currentTarget=t._node,a===i.BEGAN&&t.onTouchesBegan?t.onTouchesBegan(r,n):a===i.MOVED&&t.onTouchesMoved?t.onTouchesMoved(r,n):a===i.ENDED&&t.onTouchesEnded?t.onTouchesEnded(r,n):a===i.CANCELED&&t.onTouchesCancelled&&t.onTouchesCancelled(r,n),!!n.isStopped()&&(s._updateTouchListeners(n),!0)},_associateNodeAndEventListener:function(t,e){var i=this._nodeListenersMap[t._id];i||(i=[],this._nodeListenersMap[t._id]=i),i.push(e)},_dissociateNodeAndEventListener:function(t,e){var i=this._nodeListenersMap[t._id];i&&(cc.js.array.remove(i,e),0===i.length&&delete this._nodeListenersMap[t._id])},_dispatchEventToListeners:function(t,e,i){var n,r,a=!1,s=t.getFixedPriorityListeners(),o=t.getSceneGraphPriorityListeners(),c=0;if(s&&0!==s.length)for(;c<t.gt0Index;++c)if((r=s[c]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){a=!0;break}if(o&&!a)for(n=0;n<o.length;n++)if((r=o[n]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){a=!0;break}if(s&&!a)for(;c<s.length;++c)if((r=s[c]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){a=!0;break}},_setDirty:function(t,e){var i=this._priorityDirtyFlagMap;null==i[t]?i[t]=e:i[t]=e|i[t]},_sortNumberAsc:function(t,e){return t-e},hasEventListener:function(t){return!!this._getListeners(t)},addListener:function(t,e){if(cc.assertID(t&&e,3503),cc.js.isNumber(e)||e instanceof cc._BaseNode){if(t instanceof cc.EventListener){if(t._isRegistered())return void cc.logID(3505)}else cc.assertID(!cc.js.isNumber(e),3504),t=cc.EventListener.create(t);if(t.checkAvailable()){if(cc.js.isNumber(e)){if(0===e)return void cc.logID(3500);t._setSceneGraphPriority(null),t._setFixedPriority(e),t._setRegistered(!0),t._setPaused(!1),this._addListener(t)}else t._setSceneGraphPriority(e),t._setFixedPriority(0),t._setRegistered(!0),this._addListener(t);return t}}else cc.warnID(3506)},addCustomListener:function(t,e){var i=new cc.EventListener.create({event:cc.EventListener.CUSTOM,eventName:t,callback:e});return this.addListener(i,1),i},removeListener:function(t){if(null!=t){var e,i=this._listenersMap;for(var n in i){var r=i[n],a=r.getFixedPriorityListeners(),s=r.getSceneGraphPriorityListeners();if((e=this._removeListenerInVector(s,t))?this._setDirty(t._getListenerID(),this.DIRTY_SCENE_GRAPH_PRIORITY):(e=this._removeListenerInVector(a,t))&&this._setDirty(t._getListenerID(),this.DIRTY_FIXED_PRIORITY),r.empty()&&(delete this._priorityDirtyFlagMap[t._getListenerID()],delete i[n]),e)break}if(!e)for(var o=this._toAddedListeners,c=o.length-1;c>=0;c--){var l=o[c];if(l===t){cc.js.array.removeAt(o,c),l._setRegistered(!1);break}}this._currentTouchListener===t&&this._clearCurTouch()}},_clearCurTouch:function(){this._currentTouchListener=null,this._currentTouch=null},_removeListenerInCallback:function(t,e){if(null==t)return!1;for(var i=t.length-1;i>=0;i--){var n=t[i];if(n._onCustomEvent===e||n._onEvent===e)return n._setRegistered(!1),null!=n._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(n._getSceneGraphPriority(),n),n._setSceneGraphPriority(null)),0===this._inDispatch?cc.js.array.removeAt(t,i):this._toRemovedListeners.push(n),!0}return!1},_removeListenerInVector:function(t,e){if(null==t)return!1;for(var i=t.length-1;i>=0;i--){var n=t[i];if(n===e)return n._setRegistered(!1),null!=n._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(n._getSceneGraphPriority(),n),n._setSceneGraphPriority(null)),0===this._inDispatch?cc.js.array.removeAt(t,i):this._toRemovedListeners.push(n),!0}return!1},removeListeners:function(t,e){var i=this;if(cc.js.isNumber(t)||t instanceof cc._BaseNode)if(void 0!==t._id){var r,a=i._nodeListenersMap[t._id];if(a){var s=cc.js.array.copy(a);for(r=0;r<s.length;r++)i.removeListener(s[r]);delete i._nodeListenersMap[t._id]}var o=i._toAddedListeners;for(r=0;r<o.length;){var c=o[r];c._getSceneGraphPriority()===t?(c._setSceneGraphPriority(null),c._setRegistered(!1),o.splice(r,1)):++r}if(!0===e){var l,h=t.children;for(r=0,l=h.length;r<l;r++)i.removeListeners(h[r],!0)}}else t===cc.EventListener.TOUCH_ONE_BY_ONE?i._removeListenersForListenerID(n.TOUCH_ONE_BY_ONE):t===cc.EventListener.TOUCH_ALL_AT_ONCE?i._removeListenersForListenerID(n.TOUCH_ALL_AT_ONCE):t===cc.EventListener.MOUSE?i._removeListenersForListenerID(n.MOUSE):t===cc.EventListener.ACCELERATION?i._removeListenersForListenerID(n.ACCELERATION):t===cc.EventListener.KEYBOARD?i._removeListenersForListenerID(n.KEYBOARD):cc.logID(3501);else cc.warnID(3506)},removeCustomListeners:function(t){this._removeListenersForListenerID(t)},removeAllListeners:function(){var t=this._listenersMap,e=this._internalCustomListenerIDs;for(var i in t)-1===e.indexOf(i)&&this._removeListenersForListenerID(i)},setPriority:function(t,e){if(null!=t){var i=this._listenersMap;for(var n in i){var r=i[n].getFixedPriorityListeners();if(r&&-1!==r.indexOf(t))return null!=t._getSceneGraphPriority()&&cc.logID(3502),void(t._getFixedPriority()!==e&&(t._setFixedPriority(e),this._setDirty(t._getListenerID(),this.DIRTY_FIXED_PRIORITY)))}}},setEnabled:function(t){this._isEnabled=t},isEnabled:function(){return this._isEnabled},dispatchEvent:function(t){if(this._isEnabled)if(this._updateDirtyFlagForSceneGraph(),this._inDispatch++,t&&t.getType){if(t.getType().startsWith(cc.Event.TOUCH))return this._dispatchTouchEvent(t),void this._inDispatch--;var e=a(t);this._sortEventListeners(e);var i=this._listenersMap[e];null!=i&&(this._dispatchEventToListeners(i,this._onListenerCallback,t),this._onUpdateListeners(i)),this._inDispatch--}else cc.errorID(3511)},_onListenerCallback:function(t,e){return e.currentTarget=t._target,t._onEvent(e),e.isStopped()},dispatchCustomEvent:function(t,e){var i=new cc.Event.EventCustom(t);i.setUserData(e),this.dispatchEvent(i)}};i.get(cc,"eventManager",(function(){return cc.errorID(1405,"cc.eventManager","cc.EventTarget or cc.systemEvent"),s})),e.exports=cc.internal.eventManager=s}),{"../platform/js":189,"./CCEventListener":136}],138:[(function(){"use strict";cc.Touch=function(t,e,i){this._lastModified=0,this.setTouchInfo(i,t,e)},cc.Touch.prototype={constructor:cc.Touch,getLocation:function(){return cc.v2(this._point.x,this._point.y)},getLocationX:function(){return this._point.x},getLocationY:function(){return this._point.y},getPreviousLocation:function(){return cc.v2(this._prevPoint.x,this._prevPoint.y)},getStartLocation:function(){return cc.v2(this._startPoint.x,this._startPoint.y)},getDelta:function(){return this._point.sub(this._prevPoint)},getLocationInView:function(){return cc.v2(this._point.x,cc.view._designResolutionSize.height-this._point.y)},getPreviousLocationInView:function(){return cc.v2(this._prevPoint.x,cc.view._designResolutionSize.height-this._prevPoint.y)},getStartLocationInView:function(){return cc.v2(this._startPoint.x,cc.view._designResolutionSize.height-this._startPoint.y)},getID:function(){return this._id},setTouchInfo:function(t,e,i){this._prevPoint=this._point,this._point=cc.v2(e||0,i||0),this._id=t,this._startPointCaptured||(this._startPoint=cc.v2(this._point),cc.view._convertPointWithScale(this._startPoint),this._startPointCaptured=!0)},_setPoint:function(t,e){void 0===e?(this._point.x=t.x,this._point.y=t.y):(this._point.x=t,this._point.y=e)},_setPrevPoint:function(t,e){this._prevPoint=void 0===e?cc.v2(t.x,t.y):cc.v2(t||0,e||0)}}}),{}],139:[(function(t,e){"use strict";t("./CCEvent"),t("./CCTouch"),t("./CCEventListener");var i=t("./CCEventManager");e.exports=i}),{"./CCEvent":135,"./CCEventListener":136,"./CCEventManager":137,"./CCTouch":138}],140:[(function(t,e){"use strict";var i=cc.js,n=t("../platform/callbacks-invoker");function r(){n.call(this)}i.extend(r,n),r.prototype.emit=function(t,e){var i=t.type,n=this._callbackTable[i];if(n){var r=!n.isInvoking;n.isInvoking=!0;for(var a=n.callbackInfos,s=0,o=a.length;s<o;++s){var c=a[s];if(c&&c.callback&&(c.callback.call(c.target,t,e),t._propagationImmediateStopped))break}r&&(n.isInvoking=!1,n.containCanceled&&n.purgeCanceled())}},e.exports=r}),{"../platform/callbacks-invoker":181}],141:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("../platform/callbacks-invoker"),r=i.array.fastRemove;function a(){n.call(this)}i.extend(a,n);var s=a.prototype;s.__on=s.on,s.on=function(t,e,i,n){if(e)return this.hasEventListener(t,e,i)||(this.__on(t,e,i,n),i&&i.__eventTargets&&i.__eventTargets.push(this)),e;cc.errorID(6800)},s.__off=s.off,s.off=function(t,e,i){if(e)this.__off(t,e,i),i&&i.__eventTargets&&r(i.__eventTargets,this);else{var n=this._callbackTable[t];if(!n)return;for(var a=n.callbackInfos,s=0;s<a.length;++s){var o=a[s]&&a[s].target;o&&o.__eventTargets&&r(o.__eventTargets,this)}this.removeAll(t)}},s.targetOff=function(t){this.removeAll(t),t&&t.__eventTargets&&r(t.__eventTargets,this)},s.once=function(t,e,i){this.on(t,e,i,!0)},s.dispatchEvent=function(t){this.emit(t.type,t)},s.clear=function(){for(var t in this._callbackTable)for(var e=this._callbackTable[t].callbackInfos,i=e.length-1;i>=0;i--){var n=e[i];n&&this.off(t,n.callback,n.target)}},cc.EventTarget=e.exports=a}),{"../platform/callbacks-invoker":181,"../platform/js":189}],142:[(function(t,e){"use strict";var i=t("../platform/js");cc.Event=function(t,e){this.type=t,this.bubbles=!!e,this.target=null,this.currentTarget=null,this.eventPhase=0,this._propagationStopped=!1,this._propagationImmediateStopped=!1},cc.Event.prototype={constructor:cc.Event,unuse:function(){this.type=cc.Event.NO_TYPE,this.target=null,this.currentTarget=null,this.eventPhase=cc.Event.NONE,this._propagationStopped=!1,this._propagationImmediateStopped=!1},reuse:function(t,e){this.type=t,this.bubbles=e||!1},stopPropagation:function(){this._propagationStopped=!0},stopPropagationImmediate:function(){this._propagationImmediateStopped=!0},isStopped:function(){return this._propagationStopped||this._propagationImmediateStopped},getCurrentTarget:function(){return this.currentTarget},getType:function(){return this.type}},cc.Event.NO_TYPE="no_type",cc.Event.TOUCH="touch",cc.Event.MOUSE="mouse",cc.Event.KEYBOARD="keyboard",cc.Event.ACCELERATION="acceleration",cc.Event.NONE=0,cc.Event.CAPTURING_PHASE=1,cc.Event.AT_TARGET=2,cc.Event.BUBBLING_PHASE=3;var n=function(t,e){cc.Event.call(this,t,e),this.detail=null};i.extend(n,cc.Event),n.prototype.reset=n,n.prototype.setUserData=function(t){this.detail=t},n.prototype.getUserData=function(){return this.detail},n.prototype.getEventName=cc.Event.prototype.getType;var r=new i.Pool(10);n.put=function(t){r.put(t)},n.get=function(t,e){var i=r._get();return i?i.reset(t,e):i=new n(t,e),i},cc.Event.EventCustom=n,e.exports=cc.Event}),{"../platform/js":189}],143:[(function(t){"use strict";t("./event"),t("./event-listeners"),t("./event-target"),t("./system-event")}),{"./event":142,"./event-listeners":140,"./event-target":141,"./system-event":144}],144:[(function(t,e){"use strict";var i=t("../event/event-target"),n=t("../event-manager"),r=t("../platform/CCInputManager"),a=cc.Enum({KEY_DOWN:"keydown",KEY_UP:"keyup",DEVICEMOTION:"devicemotion"}),s=null,o=null,c=cc.Class({name:"SystemEvent",extends:i,statics:{EventType:a},setAccelerometerEnabled:function(t){t&&window.DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceMotionEvent.requestPermission().then((function(t){console.log("Device Motion Event request permission: "+t),r.setAccelerometerEnabled("granted"===t)})):r.setAccelerometerEnabled(t)},setAccelerometerInterval:function(t){r.setAccelerometerInterval(t)},on:function(t,e,i,r){this._super(t,e,i,r),t!==a.KEY_DOWN&&t!==a.KEY_UP||(s||(s=cc.EventListener.create({event:cc.EventListener.KEYBOARD,onKeyPressed:function(t,e){e.type=a.KEY_DOWN,cc.systemEvent.dispatchEvent(e)},onKeyReleased:function(t,e){e.type=a.KEY_UP,cc.systemEvent.dispatchEvent(e)}})),n.hasEventListener(cc.EventListener.ListenerID.KEYBOARD)||n.addListener(s,1)),t===a.DEVICEMOTION&&(o||(o=cc.EventListener.create({event:cc.EventListener.ACCELERATION,callback:function(t,e){e.type=a.DEVICEMOTION,cc.systemEvent.dispatchEvent(e)}})),n.hasEventListener(cc.EventListener.ListenerID.ACCELERATION)||n.addListener(o,1))},off:function(t,e,i){if(this._super(t,e,i),s&&(t===a.KEY_DOWN||t===a.KEY_UP)){var r=this.hasEventListener(a.KEY_DOWN),c=this.hasEventListener(a.KEY_UP);r||c||n.removeListener(s)}o&&t===a.DEVICEMOTION&&n.removeListener(o)}});cc.SystemEvent=e.exports=c,cc.systemEvent=new cc.SystemEvent}),{"../event-manager":139,"../event/event-target":141,"../platform/CCInputManager":172}],145:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../value-types/vec3")),r=s(t("../value-types/mat3")),a=s(t("./enums"));function s(t){return t&&t.__esModule?t:{default:t}}var o=new n.default,c=new n.default,l=new r.default,h=function(t,e,i){var r=l.m,a=i.m;r[0]=Math.abs(a[0]),r[1]=Math.abs(a[1]),r[2]=Math.abs(a[2]),r[3]=Math.abs(a[4]),r[4]=Math.abs(a[5]),r[5]=Math.abs(a[6]),r[6]=Math.abs(a[8]),r[7]=Math.abs(a[9]),r[8]=Math.abs(a[10]),n.default.transformMat3(t,e,l)},u=(function(){function t(t,e,i,r,s,o){this.center=void 0,this.halfExtents=void 0,this._type=void 0,this._type=a.default.SHAPE_AABB,this.center=new n.default(t,e,i),this.halfExtents=new n.default(r,s,o)}t.create=function(e,i,n,r,a,s){return new t(e,i,n,r,a,s)},t.clone=function(e){return new t(e.center.x,e.center.y,e.center.z,e.halfExtents.x,e.halfExtents.y,e.halfExtents.z)},t.copy=function(t,e){return n.default.copy(t.center,e.center),n.default.copy(t.halfExtents,e.halfExtents),t},t.fromPoints=function(t,e,i){return n.default.scale(t.center,n.default.add(o,e,i),.5),n.default.scale(t.halfExtents,n.default.sub(c,i,e),.5),t},t.set=function(t,e,i,r,a,s,o){return n.default.set(t.center,e,i,r),n.default.set(t.halfExtents,a,s,o),t};var e=t.prototype;return e.getBoundary=function(t,e){n.default.sub(t,this.center,this.halfExtents),n.default.add(e,this.center,this.halfExtents)},e.transform=function(t,e,i,r,a){a||(a=this),n.default.transformMat4(a.center,this.center,t),h(a.halfExtents,this.halfExtents,t)},t})();i.default=u,e.exports=i.default}),{"../value-types/mat3":258,"../value-types/vec3":267,"./enums":147}],146:[(function(t,e,i){"use strict";i.__esModule=!0,i.point_plane=f,i.pt_point_aabb=function(t,e,i){return n.Vec3.copy(t,e),n.Vec3.subtract(c,i.center,i.halfExtents),n.Vec3.add(l,i.center,i.halfExtents),t.x=t.x<c.x?c.x:t.x,t.y=t.y<c.x?c.y:t.y,t.z=t.z<c.x?c.z:t.z,t.x=t.x>l.x?l.x:t.x,t.y=t.y>l.x?l.y:t.y,t.z=t.z>l.x?l.z:t.z,t},i.pt_point_obb=function(t,e,i){var c=i.orientation.m;n.Vec3.set(r,c[0],c[1],c[2]),n.Vec3.set(a,c[3],c[4],c[5]),n.Vec3.set(s,c[6],c[7],c[8]),h[0]=r,h[1]=a,h[2]=s,u[0]=i.halfExtents.x,u[1]=i.halfExtents.y,u[2]=i.halfExtents.z,n.Vec3.subtract(o,e,i.center),n.Vec3.set(t,i.center.x,i.center.y,i.center.z);for(var l=0;l<3;l++){var f=n.Vec3.dot(o,h[l]);f>u[l]&&(f=u[l]),f<-u[l]&&(f=-u[l]),t.x+=f*h[l].x,t.y+=f*h[l].y,t.z+=f*h[l].z}return t},i.pt_point_plane=function(t,e,i){var r=f(e,i);return n.Vec3.subtract(t,e,n.Vec3.multiplyScalar(t,i.n,r))};var n=t("../value-types"),r=new n.Vec3,a=new n.Vec3,s=new n.Vec3,o=new n.Vec3,c=new n.Vec3,l=new n.Vec3,h=new Array(3),u=new Array(3);function f(t,e){return n.Vec3.dot(e.n,t)-e.d}}),{"../value-types":257}],147:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0,i.default={SHAPE_RAY:1,SHAPE_LINE:2,SHAPE_SPHERE:4,SHAPE_AABB:8,SHAPE_OBB:16,SHAPE_PLANE:32,SHAPE_TRIANGLE:64,SHAPE_FRUSTUM:128,SHAPE_FRUSTUM_ACCURATE:256},e.exports=i.default}),{}],148:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../value-types"),r=s(t("./enums")),a=s(t("./plane"));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=c(n.key,"string"))?r:String(r)),n)}var r}function c(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var l=new Array(8);l[0]=new n.Vec3(1,1,1),l[1]=new n.Vec3(-1,1,1),l[2]=new n.Vec3(-1,-1,1),l[3]=new n.Vec3(1,-1,1),l[4]=new n.Vec3(1,1,-1),l[5]=new n.Vec3(-1,1,-1),l[6]=new n.Vec3(-1,-1,-1),l[7]=new n.Vec3(1,-1,-1);var h,u=(function(){function t(){this.planes=void 0,this.vertices=void 0,this._type=void 0,this._type=r.default.SHAPE_FRUSTUM,this.planes=new Array(6);for(var t=0;t<6;++t)this.planes[t]=a.default.create(0,0,0,0);this.vertices=new Array(8);for(var e=0;e<8;++e)this.vertices[e]=new n.Vec3}t.create=function(){return new t},t.clone=function(e){return t.copy(new t,e)},t.copy=function(t,e){t._type=e._type;for(var i=0;i<6;++i)a.default.copy(t.planes[i],e.planes[i]);for(var r=0;r<8;++r)n.Vec3.copy(t.vertices[r],e.vertices[r]);return t};var e,i,s=t.prototype;return s.update=function(t,e){var i=t.m;if(n.Vec3.set(this.planes[0].n,i[3]+i[0],i[7]+i[4],i[11]+i[8]),this.planes[0].d=-(i[15]+i[12]),n.Vec3.set(this.planes[1].n,i[3]-i[0],i[7]-i[4],i[11]-i[8]),this.planes[1].d=-(i[15]-i[12]),n.Vec3.set(this.planes[2].n,i[3]+i[1],i[7]+i[5],i[11]+i[9]),this.planes[2].d=-(i[15]+i[13]),n.Vec3.set(this.planes[3].n,i[3]-i[1],i[7]-i[5],i[11]-i[9]),this.planes[3].d=-(i[15]-i[13]),n.Vec3.set(this.planes[4].n,i[3]+i[2],i[7]+i[6],i[11]+i[10]),this.planes[4].d=-(i[15]+i[14]),n.Vec3.set(this.planes[5].n,i[3]-i[2],i[7]-i[6],i[11]-i[10]),this.planes[5].d=-(i[15]-i[14]),this._type===r.default.SHAPE_FRUSTUM_ACCURATE){for(var a=0;a<6;a++){var s=this.planes[a],o=1/s.n.length();n.Vec3.multiplyScalar(s.n,s.n,o),s.d*=o}for(var c=0;c<8;c++)n.Vec3.transformMat4(this.vertices[c],l[c],e)}},s.transform=function(t){if(this._type===r.default.SHAPE_FRUSTUM_ACCURATE){for(var e=0;e<8;e++)n.Vec3.transformMat4(this.vertices[e],this.vertices[e],t);a.default.fromPoints(this.planes[0],this.vertices[1],this.vertices[5],this.vertices[6]),a.default.fromPoints(this.planes[1],this.vertices[3],this.vertices[7],this.vertices[4]),a.default.fromPoints(this.planes[2],this.vertices[6],this.vertices[7],this.vertices[3]),a.default.fromPoints(this.planes[3],this.vertices[0],this.vertices[4],this.vertices[5]),a.default.fromPoints(this.planes[4],this.vertices[2],this.vertices[3],this.vertices[0]),a.default.fromPoints(this.planes[0],this.vertices[7],this.vertices[6],this.vertices[5])}},e=t,(i=[{key:"accurate",set:function(t){this._type=t?r.default.SHAPE_FRUSTUM_ACCURATE:r.default.SHAPE_FRUSTUM}}])&&o(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=u,u.createOrtho=(h=new n.Vec3,function(t,e,i,r,s,o){var c=e/2,l=i/2;n.Vec3.set(h,c,l,r),n.Vec3.transformMat4(t.vertices[0],h,o),n.Vec3.set(h,-c,l,r),n.Vec3.transformMat4(t.vertices[1],h,o),n.Vec3.set(h,-c,-l,r),n.Vec3.transformMat4(t.vertices[2],h,o),n.Vec3.set(h,c,-l,r),n.Vec3.transformMat4(t.vertices[3],h,o),n.Vec3.set(h,c,l,s),n.Vec3.transformMat4(t.vertices[4],h,o),n.Vec3.set(h,-c,l,s),n.Vec3.transformMat4(t.vertices[5],h,o),n.Vec3.set(h,-c,-l,s),n.Vec3.transformMat4(t.vertices[6],h,o),n.Vec3.set(h,c,-l,s),n.Vec3.transformMat4(t.vertices[7],h,o),a.default.fromPoints(t.planes[0],t.vertices[1],t.vertices[6],t.vertices[5]),a.default.fromPoints(t.planes[1],t.vertices[3],t.vertices[4],t.vertices[7]),a.default.fromPoints(t.planes[2],t.vertices[6],t.vertices[3],t.vertices[7]),a.default.fromPoints(t.planes[3],t.vertices[0],t.vertices[5],t.vertices[4]),a.default.fromPoints(t.planes[4],t.vertices[2],t.vertices[0],t.vertices[3]),a.default.fromPoints(t.planes[0],t.vertices[7],t.vertices[5],t.vertices[6])}),e.exports=i.default}),{"../value-types":257,"./enums":147,"./plane":153}],149:[(function(t,e,i){"use strict";i.__esModule=!0;var n={enums:!0,Triangle:!0,Aabb:!0,Ray:!0,intersect:!0,Sphere:!0,Obb:!0,Frustum:!0,Line:!0,Plane:!0};i.intersect=i.enums=i.Triangle=i.Sphere=i.Ray=i.Plane=i.Obb=i.Line=i.Frustum=i.Aabb=void 0;var r=p(t("./enums"));i.enums=r.default;var a=p(t("./triangle"));i.Triangle=a.default;var s=p(t("./aabb"));i.Aabb=s.default;var o=p(t("./ray"));i.Ray=o.default;var c=p(t("./intersect"));i.intersect=c.default;var l=p(t("./sphere"));i.Sphere=l.default;var h=p(t("./obb"));i.Obb=h.default;var u=p(t("./frustum"));i.Frustum=u.default;var f=p(t("./line"));i.Line=f.default;var _=p(t("./plane"));i.Plane=_.default;var d=t("./distance");function p(t){return t&&t.__esModule?t:{default:t}}Object.keys(d).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in i&&i[t]===d[t]||(i[t]=d[t]))})),cc.geomUtils=e.exports}),{"./aabb":145,"./distance":146,"./enums":147,"./frustum":148,"./intersect":150,"./line":151,"./obb":152,"./plane":153,"./ray":154,"./sphere":155,"./triangle":156}],150:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=f(t("../../renderer/gfx")),r=f(t("../../renderer/memop/recycle-pool")),a=t("../value-types"),s=f(t("./aabb")),o=(function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=u(void 0);if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if("default"!==r&&Object.prototype.hasOwnProperty.call(t,r)){var a=n?Object.getOwnPropertyDescriptor(t,r):null;a&&(a.get||a.set)?Object.defineProperty(i,r,a):i[r]=t[r]}return i.default=t,e&&e.set(t,i),i})(t("./distance")),c=f(t("./enums")),l=f(t("./ray")),h=f(t("./triangle"));function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(u=function(t){return t?i:e})(t)}function f(t){return t&&t.__esModule?t:{default:t}}var _,d,p,m,v,g,y,T,A,b,E,C,x,S,w,D=(function(){var t=h.default.create(),e=1/0;function i(t,e,i,n){a.Vec3.set(t,e[i*n],e[i*n+1],e[i*n+2])}return function(r,a){e=1/0;for(var s=a._subMeshes,o=0;o<s.length;o++)if(s[o]._primitiveType===n.default.PT_TRIANGLES)for(var c=a._subDatas[o]||a._subDatas[0],l=a._getAttrMeshData(o,n.default.ATTR_POSITION),h=c.getIData(Uint16Array),u=c.vfm.element(n.default.ATTR_POSITION).num,f=0;f<h.length;f+=3){i(t.a,l,h[f],u),i(t.b,l,h[f+1],u),i(t.c,l,h[f+2],u);var _=O(r,t);_>0&&_<e&&(e=_)}return e}})(),M=(function(){function t(e,i){for(var n=e.children,r=n.length-1;r>=0;r--)t(n[r],i);i(e)}function e(t,e){return t.distance-e.distance}function i(t,e,i){var n=i.m,r=e.x,a=e.y,s=e.z,o=n[3]*r+n[7]*a+n[11]*s;return o=o?1/o:1,t.x=(n[0]*r+n[4]*a+n[8]*s)*o,t.y=(n[1]*r+n[5]*a+n[9]*s)*o,t.z=(n[2]*r+n[6]*a+n[10]*s)*o,t}var n=new r.default(function(){return{distance:0,node:null}},1),o=[],c=s.default.create(),h=new a.Vec3,u=new a.Vec3,f=new l.default,_=cc.mat4(),d=cc.mat4(),p=new a.Vec3;function m(t){return t>0&&t<1/0}return function(r,l,v,g){return n.reset(),o.length=0,t(r=r||cc.director.getScene(),(function(t){if(!g||g(t)){a.Mat4.invert(d,t.getWorldMatrix(_)),a.Vec3.transformMat4(f.o,l.o,d),a.Vec3.normalize(f.d,i(f.d,l.d,d));var e=1/0,r=t._renderComponent;if(r instanceof cc.MeshRenderer?e=B(f,r._boundingBox):t.width&&t.height&&(a.Vec3.set(h,-t.width*t.anchorX,-t.height*t.anchorY,t.z),a.Vec3.set(u,t.width*(1-t.anchorX),t.height*(1-t.anchorY),t.z),s.default.fromPoints(c,h,u),e=B(f,c)),m(e)&&(v&&(e=v(f,t,e)),m(e))){a.Vec3.scale(p,f.d,e),i(p,p,_);var y=n.add();y.node=t,y.distance=a.Vec3.mag(p),o.push(y)}}})),o.sort(e),o}})(),R=(_=new a.Vec3(0,0,0),function(t,e){var i=a.Vec3.dot(t.d,e.n);if(Math.abs(i)<Number.EPSILON)return 0;a.Vec3.multiplyScalar(_,e.n,e.d);var n=a.Vec3.dot(a.Vec3.subtract(_,_,t.o),e.n)/i;return n<0?0:n}),I=(d=new a.Vec3(0,0,0),function(t,e){a.Vec3.subtract(d,t.e,t.s);var i=(e.d-a.Vec3.dot(t.s,e.n))/a.Vec3.dot(d,e.n);return i<0||i>1?0:i}),O=(function(){var t=new a.Vec3(0,0,0),e=new a.Vec3(0,0,0),i=new a.Vec3(0,0,0),n=new a.Vec3(0,0,0),r=new a.Vec3(0,0,0);return function(s,o,c){a.Vec3.subtract(t,o.b,o.a),a.Vec3.subtract(e,o.c,o.a),a.Vec3.cross(i,s.d,e);var l=a.Vec3.dot(t,i);if(l<Number.EPSILON&&(!c||l>-Number.EPSILON))return 0;var h=1/l;a.Vec3.subtract(n,s.o,o.a);var u=a.Vec3.dot(n,i)*h;if(u<0||u>1)return 0;a.Vec3.cross(r,n,t);var f=a.Vec3.dot(s.d,r)*h;if(f<0||u+f>1)return 0;var _=a.Vec3.dot(e,r)*h;return _<0?0:_}})(),P=O,N=(function(){var t=new a.Vec3(0,0,0),e=new a.Vec3(0,0,0),i=new a.Vec3(0,0,0),n=new a.Vec3(0,0,0),r=new a.Vec3(0,0,0),s=new a.Vec3(0,0,0);return function(o,c,l){a.Vec3.subtract(t,c.b,c.a),a.Vec3.subtract(e,c.c,c.a),a.Vec3.subtract(i,o.s,o.e),a.Vec3.cross(r,t,e);var h=a.Vec3.dot(i,r);if(h<=0)return 0;a.Vec3.subtract(n,o.s,c.a);var u=a.Vec3.dot(n,r);if(u<0||u>h)return 0;a.Vec3.cross(s,i,n);var f=a.Vec3.dot(e,s);if(f<0||f>h)return 0;var _=-a.Vec3.dot(t,s);if(_<0||f+_>h)return 0;if(l){var d=1/h,p=1-(f*=d)-(_*=d);a.Vec3.set(l,c.a.x*p+c.b.x*f+c.c.x*_,c.a.y*p+c.b.y*f+c.c.y*_,c.a.z*p+c.b.z*f+c.c.z*_)}return 1}})(),F=(p=new a.Vec3(0,0,0),m=new a.Vec3(0,0,0),v=new a.Vec3(0,0,0),g=new a.Vec3(0,0,0),y=new a.Vec3(0,0,0),T=new a.Vec3(0,0,0),A=new a.Vec3(0,0,0),function(t,e,i,n,r,s,o){a.Vec3.subtract(p,e,t),a.Vec3.subtract(m,i,t),a.Vec3.subtract(v,n,t),a.Vec3.subtract(g,r,t),a.Vec3.cross(T,g,p);var c=a.Vec3.dot(m,T);if(c>=0){var l=-a.Vec3.dot(v,T);if(l<0)return 0;var h=a.Vec3.dot(a.Vec3.cross(A,p,v),m);if(h<0)return 0;if(o){var u=1/(l+c+h);l*=u,c*=u,h*=u,a.Vec3.set(o,i.x*l+n.x*c+r.x*h,i.y*l+n.y*c+r.y*h,i.z*l+n.z*c+r.z*h)}}else{a.Vec3.subtract(y,s,t);var f=a.Vec3.dot(y,T);if(f<0)return 0;var _=a.Vec3.dot(a.Vec3.cross(A,p,m),y);if(_<0)return 0;if(o){var d=1/(f+(c=-c)+_);f*=d,c*=d,_*=d,a.Vec3.set(o,i.x*f+s.x*c+r.x*_,i.y*f+s.y*c+r.y*_,i.z*f+s.z*c+r.z*_)}}return 1}),L=(function(){var t=new a.Vec3(0,0,0);return function(e,i){var n=i.radius,r=i.center,s=e.o,o=e.d,c=n*n;a.Vec3.subtract(t,r,s);var l=t.lengthSqr(),h=a.Vec3.dot(t,o),u=c-(l-h*h);if(u<0)return 0;var f=Math.sqrt(u),_=l<c?h+f:h-f;return _<0?0:_}})(),B=(b=new a.Vec3,E=new a.Vec3,function(t,e){var i=t.o,n=t.d,r=1/n.x,s=1/n.y,o=1/n.z;a.Vec3.subtract(b,e.center,e.halfExtents),a.Vec3.add(E,e.center,e.halfExtents);var c=(b.x-i.x)*r,l=(E.x-i.x)*r,h=(b.y-i.y)*s,u=(E.y-i.y)*s,f=(b.z-i.z)*o,_=(E.z-i.z)*o,d=Math.max(Math.max(Math.min(c,l),Math.min(h,u)),Math.min(f,_)),p=Math.min(Math.min(Math.max(c,l),Math.max(h,u)),Math.max(f,_));return p<0||d>p?0:d}),k=B,V=(function(){var t=new a.Vec3,e=new a.Vec3,i=new a.Vec3,n=new a.Vec3,r=new a.Vec3,s=new a.Vec3,o=new a.Vec3,c=new Array(3),l=new Array(3),h=new Array(3),u=new Array(6);return function(f,_){c[0]=_.halfExtents.x,c[1]=_.halfExtents.y,c[2]=_.halfExtents.z,t=_.center,e=f.o,i=f.d;var d=_.orientation.m;a.Vec3.set(n,d[0],d[1],d[2]),a.Vec3.set(r,d[3],d[4],d[5]),a.Vec3.set(s,d[6],d[7],d[8]),a.Vec3.subtract(o,t,e),l[0]=a.Vec3.dot(n,i),l[1]=a.Vec3.dot(r,i),l[2]=a.Vec3.dot(s,i),h[0]=a.Vec3.dot(n,o),h[1]=a.Vec3.dot(r,o),h[2]=a.Vec3.dot(s,o);for(var p=0;p<3;++p){if(0===l[p]){if(-h[p]-c[p]>0||-h[p]+c[p]<0)return 0;l[p]=1e-7}u[2*p+0]=(h[p]+c[p])/l[p],u[2*p+1]=(h[p]-c[p])/l[p]}var m=Math.max(Math.max(Math.min(u[0],u[1]),Math.min(u[2],u[3])),Math.min(u[4],u[5])),v=Math.min(Math.min(Math.max(u[0],u[1]),Math.max(u[2],u[3])),Math.max(u[4],u[5]));return v<0||m>v||m<0?0:m}})(),U=(C=new a.Vec3,x=new a.Vec3,S=new a.Vec3,w=new a.Vec3,function(t,e){return a.Vec3.subtract(C,t.center,t.halfExtents),a.Vec3.add(x,t.center,t.halfExtents),a.Vec3.subtract(S,e.center,e.halfExtents),a.Vec3.add(w,e.center,e.halfExtents),C.x<=w.x&&x.x>=S.x&&C.y<=w.y&&x.y>=S.y&&C.z<=w.z&&x.z>=S.z});function z(t,e,i){a.Vec3.set(i[0],t.x,e.y,e.z),a.Vec3.set(i[1],t.x,e.y,t.z),a.Vec3.set(i[2],t.x,t.y,e.z),a.Vec3.set(i[3],t.x,t.y,t.z),a.Vec3.set(i[4],e.x,e.y,e.z),a.Vec3.set(i[5],e.x,e.y,t.z),a.Vec3.set(i[6],e.x,t.y,e.z),a.Vec3.set(i[7],e.x,t.y,t.z)}function G(t,e,i,n,r,s){a.Vec3.set(s[0],t.x+i.x*e.x+n.x*e.y+r.x*e.z,t.y+i.y*e.x+n.y*e.y+r.y*e.z,t.z+i.z*e.x+n.z*e.y+r.z*e.z),a.Vec3.set(s[1],t.x-i.x*e.x+n.x*e.y+r.x*e.z,t.y-i.y*e.x+n.y*e.y+r.y*e.z,t.z-i.z*e.x+n.z*e.y+r.z*e.z),a.Vec3.set(s[2],t.x+i.x*e.x-n.x*e.y+r.x*e.z,t.y+i.y*e.x-n.y*e.y+r.y*e.z,t.z+i.z*e.x-n.z*e.y+r.z*e.z),a.Vec3.set(s[3],t.x+i.x*e.x+n.x*e.y-r.x*e.z,t.y+i.y*e.x+n.y*e.y-r.y*e.z,t.z+i.z*e.x+n.z*e.y-r.z*e.z),a.Vec3.set(s[4],t.x-i.x*e.x-n.x*e.y-r.x*e.z,t.y-i.y*e.x-n.y*e.y-r.y*e.z,t.z-i.z*e.x-n.z*e.y-r.z*e.z),a.Vec3.set(s[5],t.x+i.x*e.x-n.x*e.y-r.x*e.z,t.y+i.y*e.x-n.y*e.y-r.y*e.z,t.z+i.z*e.x-n.z*e.y-r.z*e.z),a.Vec3.set(s[6],t.x-i.x*e.x+n.x*e.y-r.x*e.z,t.y-i.y*e.x+n.y*e.y-r.y*e.z,t.z-i.z*e.x+n.z*e.y-r.z*e.z),a.Vec3.set(s[7],t.x-i.x*e.x-n.x*e.y+r.x*e.z,t.y-i.y*e.x-n.y*e.y+r.y*e.z,t.z-i.z*e.x-n.z*e.y+r.z*e.z)}function H(t,e){for(var i=a.Vec3.dot(e,t[0]),n=i,r=1;r<8;++r){var s=a.Vec3.dot(e,t[r]);i=s<i?s:i,n=s>n?s:n}return[i,n]}var W,j=(function(){for(var t=new Array(15),e=0;e<15;e++)t[e]=new a.Vec3(0,0,0);for(var i=new Array(8),n=new Array(8),r=0;r<8;r++)i[r]=new a.Vec3(0,0,0),n[r]=new a.Vec3(0,0,0);var s=new a.Vec3,o=new a.Vec3;return function(e,r){var c=r.orientation.m;a.Vec3.set(t[0],1,0,0),a.Vec3.set(t[1],0,1,0),a.Vec3.set(t[2],0,0,1),a.Vec3.set(t[3],c[0],c[1],c[2]),a.Vec3.set(t[4],c[3],c[4],c[5]),a.Vec3.set(t[5],c[6],c[7],c[8]);for(var l=0;l<3;++l)a.Vec3.cross(t[6+3*l],t[l],t[0]),a.Vec3.cross(t[7+3*l],t[l],t[1]),a.Vec3.cross(t[7+3*l],t[l],t[2]);a.Vec3.subtract(s,e.center,e.halfExtents),a.Vec3.add(o,e.center,e.halfExtents),z(s,o,i),G(r.center,r.halfExtents,t[3],t[4],t[5],n);for(var h=0;h<15;++h){var u=H(i,t[h]),f=H(n,t[h]);if(f[0]>u[1]||u[0]>f[1])return 0}return 1}})(),Y=function(t,e){var i=t.halfExtents.x*Math.abs(e.n.x)+t.halfExtents.y*Math.abs(e.n.y)+t.halfExtents.z*Math.abs(e.n.z),n=a.Vec3.dot(e.n,t.center);return n+i<e.d?-1:n-i>e.d?0:1},X=function(t,e){for(var i=0;i<e.planes.length;i++)if(-1===Y(t,e.planes[i]))return 0;return 1},q=(function(){for(var t=new Array(8),e=0,i=0,n=0;n<t.length;n++)t[n]=new a.Vec3(0,0,0);return function(n,r){for(var s=0,o=!1,c=0;c<r.planes.length;c++){if(-1===(s=Y(n,r.planes[c])))return 0;1===s&&(o=!0)}if(!o)return 1;for(var l=0;l<r.vertices.length;l++)a.Vec3.subtract(t[l],r.vertices[l],n.center);e=0,i=0;for(var h=0;h<r.vertices.length;h++)t[h].x>n.halfExtents.x?e++:t[h].x<-n.halfExtents.x&&i++;if(e===r.vertices.length||i===r.vertices.length)return 0;e=0,i=0;for(var u=0;u<r.vertices.length;u++)t[u].y>n.halfExtents.y?e++:t[u].y<-n.halfExtents.y&&i++;if(e===r.vertices.length||i===r.vertices.length)return 0;e=0,i=0;for(var f=0;f<r.vertices.length;f++)t[f].z>n.halfExtents.z?e++:t[f].z<-n.halfExtents.z&&i++;return e===r.vertices.length||i===r.vertices.length?0:1}})(),Z=(function(){var t=new a.Vec3(0,0,0),e=new a.Mat3;return function(i,n){return a.Vec3.subtract(t,n,i.center),a.Vec3.transformMat3(t,t,a.Mat3.transpose(e,i.orientation)),r=t,s=i.halfExtents,Math.abs(r.x)<s.x&&Math.abs(r.y)<s.y&&Math.abs(r.z)<s.z;var r,s}})(),K=(W=function(t,e,i,n){return Math.abs(t.x*e+t.y*i+t.z*n)},function(t,e){var i=t.orientation.m,n=t.halfExtents.x*W(e.n,i[0],i[1],i[2])+t.halfExtents.y*W(e.n,i[3],i[4],i[5])+t.halfExtents.z*W(e.n,i[6],i[7],i[8]),r=a.Vec3.dot(e.n,t.center);return r+n<e.d?-1:r-n>e.d?0:1}),J=function(t,e){for(var i=0;i<e.planes.length;i++)if(-1===K(t,e.planes[i]))return 0;return 1},Q=(function(){for(var t=new Array(8),e=0,i=0,n=0,r=0;r<t.length;r++)t[r]=new a.Vec3(0,0,0);var s=function(t,e,i,n){return t.x*e+t.y*i+t.z*n};return function(r,o){for(var c=0,l=!1,h=0;h<o.planes.length;h++){if(-1===(c=K(r,o.planes[h])))return 0;1===c&&(l=!0)}if(!l)return 1;for(var u=0;u<o.vertices.length;u++)a.Vec3.subtract(t[u],o.vertices[u],r.center);i=0,n=0;for(var f=r.orientation.m,_=0;_<o.vertices.length;_++)(e=s(t[_],f[0],f[1],f[2]))>r.halfExtents.x?i++:e<-r.halfExtents.x&&n++;if(i===o.vertices.length||n===o.vertices.length)return 0;i=0,n=0;for(var d=0;d<o.vertices.length;d++)(e=s(t[d],f[3],f[4],f[5]))>r.halfExtents.y?i++:e<-r.halfExtents.y&&n++;if(i===o.vertices.length||n===o.vertices.length)return 0;i=0,n=0;for(var p=0;p<o.vertices.length;p++)(e=s(t[p],f[6],f[7],f[8]))>r.halfExtents.z?i++:e<-r.halfExtents.z&&n++;return i===o.vertices.length||n===o.vertices.length?0:1}})(),$=(function(){for(var t=new Array(15),e=0;e<15;e++)t[e]=new a.Vec3(0,0,0);for(var i=new Array(8),n=new Array(8),r=0;r<8;r++)i[r]=new a.Vec3(0,0,0),n[r]=new a.Vec3(0,0,0);return function(e,r){var s=e.orientation.m,o=r.orientation.m;a.Vec3.set(t[0],s[0],s[1],s[2]),a.Vec3.set(t[1],s[3],s[4],s[5]),a.Vec3.set(t[2],s[6],s[7],s[8]),a.Vec3.set(t[3],o[0],o[1],o[2]),a.Vec3.set(t[4],o[3],o[4],o[5]),a.Vec3.set(t[5],o[6],o[7],o[8]);for(var c=0;c<3;++c)a.Vec3.cross(t[6+3*c],t[c],t[0]),a.Vec3.cross(t[7+3*c],t[c],t[1]),a.Vec3.cross(t[7+3*c],t[c],t[2]);G(e.center,e.halfExtents,t[0],t[1],t[2],i),G(r.center,r.halfExtents,t[3],t[4],t[5],n);for(var l=0;l<15;++l){var h=H(i,t[l]),u=H(n,t[l]);if(u[0]>h[1]||h[0]>u[1])return 0}return 1}})(),tt=function(t,e){var i=a.Vec3.dot(e.n,t.center),n=t.radius*e.n.length();return i+n<e.d?-1:i-n>e.d?0:1},et=function(t,e){for(var i=0;i<e.planes.length;i++)if(-1===tt(t,e.planes[i]))return 0;return 1},it=(function(){var t=new a.Vec3(0,0,0),e=[1,-1,1,-1,1,-1];return function(i,n){for(var r=0;r<6;r++){var s=n.planes[r],o=i.radius,c=i.center,l=s.n,h=s.d,u=a.Vec3.dot(l,c);if(u+o<h)return 0;if(!(u-o>h)){a.Vec3.add(t,c,a.Vec3.multiplyScalar(t,l,o));for(var f=0;f<6;f++)if(f!==r&&f!==r+e[r]){var _=n.planes[f];if(a.Vec3.dot(_.n,t)<_.d)return 0}}}return 1}})(),nt=function(t,e){var i=t.radius+e.radius;return a.Vec3.squaredDistance(t.center,e.center)<i*i},rt=(function(){var t=new a.Vec3;return function(e,i){return o.pt_point_aabb(t,e.center,i),a.Vec3.squaredDistance(e.center,t)<e.radius*e.radius}})(),at=(function(){var t=new a.Vec3;return function(e,i){return o.pt_point_obb(t,e.center,i),a.Vec3.squaredDistance(e.center,t)<e.radius*e.radius}})(),st={rayAabb:k,rayMesh:D,raycast:M,rayTriangle:P,ray_sphere:L,ray_aabb:B,ray_obb:V,ray_plane:R,ray_triangle:O,line_plane:I,line_triangle:N,line_quad:F,sphere_sphere:nt,sphere_aabb:rt,sphere_obb:at,sphere_plane:tt,sphere_frustum:et,sphere_frustum_accurate:it,aabb_aabb:U,aabb_obb:j,aabb_plane:Y,aabb_frustum:X,aabb_frustum_accurate:q,obb_obb:$,obb_plane:K,obb_frustum:J,obb_frustum_accurate:Q,obb_point:Z,resolve:function(t,e,i){void 0===i&&(i=null);var n=t._type,r=e._type,a=this[n|r];return n<r?a(t,e,i):a(e,t,i)}};st[c.default.SHAPE_RAY|c.default.SHAPE_SPHERE]=L,st[c.default.SHAPE_RAY|c.default.SHAPE_AABB]=B,st[c.default.SHAPE_RAY|c.default.SHAPE_OBB]=V,st[c.default.SHAPE_RAY|c.default.SHAPE_PLANE]=R,st[c.default.SHAPE_RAY|c.default.SHAPE_TRIANGLE]=O,st[c.default.SHAPE_LINE|c.default.SHAPE_PLANE]=I,st[c.default.SHAPE_LINE|c.default.SHAPE_TRIANGLE]=N,st[c.default.SHAPE_SPHERE]=nt,st[c.default.SHAPE_SPHERE|c.default.SHAPE_AABB]=rt,st[c.default.SHAPE_SPHERE|c.default.SHAPE_OBB]=at,st[c.default.SHAPE_SPHERE|c.default.SHAPE_PLANE]=tt,st[c.default.SHAPE_SPHERE|c.default.SHAPE_FRUSTUM]=et,st[c.default.SHAPE_SPHERE|c.default.SHAPE_FRUSTUM_ACCURATE]=it,st[c.default.SHAPE_AABB]=U,st[c.default.SHAPE_AABB|c.default.SHAPE_OBB]=j,st[c.default.SHAPE_AABB|c.default.SHAPE_PLANE]=Y,st[c.default.SHAPE_AABB|c.default.SHAPE_FRUSTUM]=X,st[c.default.SHAPE_AABB|c.default.SHAPE_FRUSTUM_ACCURATE]=q,st[c.default.SHAPE_OBB]=$,st[c.default.SHAPE_OBB|c.default.SHAPE_PLANE]=K,st[c.default.SHAPE_OBB|c.default.SHAPE_FRUSTUM]=J,st[c.default.SHAPE_OBB|c.default.SHAPE_FRUSTUM_ACCURATE]=Q;var ot=st;i.default=ot,e.exports=i.default}),{"../../renderer/gfx":290,"../../renderer/memop/recycle-pool":305,"../value-types":257,"./aabb":145,"./distance":146,"./enums":147,"./ray":154,"./triangle":156}],151:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),a=(n=t("./enums"))&&n.__esModule?n:{default:n},s=(function(){function t(t,e,i,n,s,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=-1),this.s=void 0,this.e=void 0,this._type=void 0,this._type=a.default.SHAPE_LINE,this.s=new r.Vec3(t,e,i),this.e=new r.Vec3(n,s,o)}return t.create=function(e,i,n,r,a,s){return new t(e,i,n,r,a,s)},t.clone=function(e){return new t(e.s.x,e.s.y,e.s.z,e.e.x,e.e.y,e.e.z)},t.copy=function(t,e){return r.Vec3.copy(t.s,e.s),r.Vec3.copy(t.e,e.e),t},t.fromPoints=function(t,e,i){return r.Vec3.copy(t.s,e),r.Vec3.copy(t.e,i),t},t.set=function(t,e,i,n,r,a,s){return t.s.x=e,t.s.y=i,t.s.z=n,t.e.x=r,t.e.y=a,t.e.z=s,t},t.len=function(t){return r.Vec3.distance(t.s,t.e)},t.prototype.length=function(){return r.Vec3.distance(this.s,this.e)},t})();i.default=s,e.exports=i.default}),{"../value-types":257,"./enums":147}],152:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),a=(n=t("./enums"))&&n.__esModule?n:{default:n};function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=o(n.key,"string"))?r:String(r)),n)}var r}function o(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var c=new r.Vec3,l=new r.Vec3,h=new r.Mat3,u=(function(){function t(t,e,i,n,s,o,c,l,h,u,f,_,d,p,m){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=1),void 0===o&&(o=1),void 0===c&&(c=1),void 0===l&&(l=0),void 0===h&&(h=0),void 0===u&&(u=0),void 0===f&&(f=1),void 0===_&&(_=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=1),this.center=void 0,this.halfExtents=void 0,this.orientation=void 0,this._type=void 0,this._type=a.default.SHAPE_OBB,this.center=new r.Vec3(t,e,i),this.halfExtents=new r.Vec3(n,s,o),this.orientation=new r.Mat3(c,l,h,u,f,_,d,p,m)}t.create=function(e,i,n,r,a,s,o,c,l,h,u,f,_,d,p){return new t(e,i,n,r,a,s,o,c,l,h,u,f,_,d,p)},t.clone=function(e){var i=e.orientation.m;return new t(e.center.x,e.center.y,e.center.z,e.halfExtents.x,e.halfExtents.y,e.halfExtents.z,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},t.copy=function(t,e){return r.Vec3.copy(t.center,e.center),r.Vec3.copy(t.halfExtents,e.halfExtents),r.Mat3.copy(t.orientation,e.orientation),t},t.fromPoints=function(t,e,i){return r.Vec3.multiplyScalar(t.center,r.Vec3.add(c,e,i),.5),r.Vec3.multiplyScalar(t.halfExtents,r.Vec3.subtract(l,i,e),.5),r.Mat3.identity(t.orientation),t},t.set=function(t,e,i,n,a,s,o,c,l,h,u,f,_,d,p,m){return r.Vec3.set(t.center,e,i,n),r.Vec3.set(t.halfExtents,a,s,o),r.Mat3.set(t.orientation,c,l,h,u,f,_,d,p,m),t};var e,i,n=t.prototype;return n.getBoundary=function(t,e){var i,n,a,s,o;i=c,n=this.halfExtents,a=this.orientation,s=h.m,o=a.m,s[0]=Math.abs(o[0]),s[1]=Math.abs(o[1]),s[2]=Math.abs(o[2]),s[3]=Math.abs(o[3]),s[4]=Math.abs(o[4]),s[5]=Math.abs(o[5]),s[6]=Math.abs(o[6]),s[7]=Math.abs(o[7]),s[8]=Math.abs(o[8]),r.Vec3.transformMat3(i,n,h),r.Vec3.subtract(t,this.center,c),r.Vec3.add(e,this.center,c)},n.transform=function(t,e,i,n,a){r.Vec3.transformMat4(a.center,this.center,t),r.Mat3.fromQuat(a.orientation,i),r.Vec3.multiply(a.halfExtents,this.halfExtents,n)},n.translateAndRotate=function(t,e,i){r.Vec3.transformMat4(i.center,this.center,t),r.Mat3.fromQuat(i.orientation,e)},n.setScale=function(t,e){r.Vec3.multiply(e.halfExtents,this.halfExtents,t)},e=t,(i=[{key:"type",get:function(){return this._type}}])&&s(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=u,e.exports=i.default}),{"../value-types":257,"./enums":147}],153:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),a=(n=t("./enums"))&&n.__esModule?n:{default:n},s=new r.Vec3(0,0,0),o=new r.Vec3(0,0,0),c=cc.mat4(),l=cc.v4(),h=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),this.n=void 0,this.d=void 0,this._type=void 0,this._type=a.default.SHAPE_PLANE,this.n=new r.Vec3(t,e,i),this.d=n}return t.create=function(e,i,n,r){return new t(e,i,n,r)},t.clone=function(e){return new t(e.n.x,e.n.y,e.n.z,e.d)},t.copy=function(t,e){return r.Vec3.copy(t.n,e.n),t.d=e.d,t},t.fromPoints=function(t,e,i,n){return r.Vec3.subtract(s,i,e),r.Vec3.subtract(o,n,e),r.Vec3.normalize(t.n,r.Vec3.cross(t.n,s,o)),t.d=r.Vec3.dot(t.n,e),t},t.set=function(t,e,i,n,r){return t.n.x=e,t.n.y=i,t.n.z=n,t.d=r,t},t.fromNormalAndPoint=function(t,e,i){return r.Vec3.copy(t.n,e),t.d=r.Vec3.dot(e,i),t},t.normalize=function(t,e){var i=e.n.len();return r.Vec3.normalize(t.n,e.n),i>0&&(t.d=e.d/i),t},t.prototype.transform=function(t){r.Mat4.invert(c,t),r.Mat4.transpose(c,c),r.Vec4.set(l,this.n.x,this.n.y,this.n.z,this.d),r.Vec4.transformMat4(l,l,c),r.Vec3.set(this.n,l.x,l.y,l.z),this.d=l.w},t})();i.default=h,e.exports=i.default}),{"../value-types":257,"./enums":147}],154:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),a=(n=t("./enums"))&&n.__esModule?n:{default:n},s=(function(){function t(t,e,i,n,s,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=-1),this.o=void 0,this.d=void 0,this._type=void 0,this._type=a.default.SHAPE_RAY,this.o=new r.Vec3(t,e,i),this.d=new r.Vec3(n,s,o)}return t.create=function(e,i,n,r,a,s){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===a&&(a=0),void 0===s&&(s=1),new t(e,i,n,r,a,s)},t.clone=function(e){return new t(e.o.x,e.o.y,e.o.z,e.d.x,e.d.y,e.d.z)},t.copy=function(t,e){return r.Vec3.copy(t.o,e.o),r.Vec3.copy(t.d,e.d),t},t.fromPoints=function(t,e,i){return r.Vec3.copy(t.o,e),r.Vec3.normalize(t.d,r.Vec3.subtract(t.d,i,e)),t},t.set=function(t,e,i,n,r,a,s){return t.o.x=e,t.o.y=i,t.o.z=n,t.d.x=r,t.d.y=a,t.d.z=s,t},t.prototype.computeHit=function(t,e){r.Vec3.normalize(t,this.d),r.Vec3.scaleAndAdd(t,this.o,t,e)},t})();i.default=s,e.exports=i.default}),{"../value-types":257,"./enums":147}],155:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),a=(n=t("./enums"))&&n.__esModule?n:{default:n},s=new r.Vec3,o=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),this.center=void 0,this.radius=void 0,this._type=void 0,this._type=a.default.SHAPE_SPHERE,this.center=new r.Vec3(t,e,i),this.radius=n}t.create=function(e,i,n,r){return new t(e,i,n,r)},t.clone=function(e){return new t(e.center.x,e.center.y,e.center.z,e.radius)},t.copy=function(t,e){return r.Vec3.copy(t.center,e.center),t.radius=e.radius,t},t.fromPoints=function(t,e,i){return r.Vec3.multiplyScalar(t.center,r.Vec3.add(s,e,i),.5),t.radius=.5*r.Vec3.subtract(s,i,e).len(),t},t.set=function(t,e,i,n,r){return t.center.x=e,t.center.y=i,t.center.z=n,t.radius=r,t};var e=t.prototype;return e.clone=function(){return t.clone(this)},e.copy=function(e){return t.copy(this,e)},e.getBoundary=function(t,e){r.Vec3.set(t,this.center.x-this.radius,this.center.y-this.radius,this.center.z-this.radius),r.Vec3.set(e,this.center.x+this.radius,this.center.y+this.radius,this.center.z+this.radius)},e.transform=function(t,e,i,n,a){r.Vec3.transformMat4(a.center,this.center,t),a.radius=this.radius*n.maxAxis()},e.translateAndRotate=function(t,e,i){r.Vec3.transformMat4(i.center,this.center,t)},e.setScale=function(t,e){e.radius=this.radius*t.maxAxis()},t})();i.default=o,e.exports=i.default}),{"../value-types":257,"./enums":147}],156:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../value-types/vec3")),r=a(t("./enums"));function a(t){return t&&t.__esModule?t:{default:t}}var s=(function(){function t(t,e,i,a,s,o,c,l,h){this.a=void 0,this.b=void 0,this.c=void 0,this._type=void 0,this.a=new n.default(t,e,i),this.b=new n.default(a,s,o),this.c=new n.default(c,l,h),this._type=r.default.SHAPE_TRIANGLE}return t.create=function(e,i,n,r,a,s,o,c,l){return new t(e,i,n,r,a,s,o,c,l)},t.clone=function(e){return new t(e.a.x,e.a.y,e.a.z,e.b.x,e.b.y,e.b.z,e.c.x,e.c.y,e.c.z)},t.copy=function(t,e){return n.default.copy(t.a,e.a),n.default.copy(t.b,e.b),n.default.copy(t.c,e.c),t},t.fromPoints=function(t,e,i,r){return n.default.copy(t.a,e),n.default.copy(t.b,i),n.default.copy(t.c,r),t},t.set=function(t,e,i,n,r,a,s,o,c,l){return t.a.x=e,t.a.y=i,t.a.z=n,t.b.x=r,t.b.y=a,t.b.z=s,t.c.x=o,t.c.y=c,t.c.z=l,t},t})();i.default=s,e.exports=i.default}),{"../value-types/vec3":267,"./enums":147}],157:[(function(t,e){"use strict";var i=t("../components/CCRenderComponent"),n=t("../assets/material/CCMaterial"),r=t("./types"),a=r.LineCap,s=r.LineJoin,o=cc.Class({name:"cc.Graphics",extends:i,editor:!1,ctor:function(){this._impl=new o._Impl(this)},properties:{_lineWidth:2,_strokeColor:cc.Color.BLACK,_lineJoin:s.MITER,_lineCap:a.BUTT,_fillColor:cc.Color.WHITE,_miterLimit:10,lineWidth:{get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this._impl.lineWidth=t}},lineJoin:{get:function(){return this._lineJoin},set:function(t){this._lineJoin=t,this._impl.lineJoin=t},type:s},lineCap:{get:function(){return this._lineCap},set:function(t){this._lineCap=t,this._impl.lineCap=t},type:a},strokeColor:{get:function(){return this._strokeColor},set:function(t){this._impl.strokeColor=this._strokeColor=cc.color(t)}},fillColor:{get:function(){return this._fillColor},set:function(t){this._impl.fillColor=this._fillColor=cc.color(t)}},miterLimit:{get:function(){return this._miterLimit},set:function(t){this._miterLimit=t,this._impl.miterLimit=t}}},statics:{LineJoin:s,LineCap:a},onRestore:function(){this._impl||(this._impl=new o._Impl(this))},onDestroy:function(){this.clear(!0),this._super(),this._impl=null},_getDefaultMaterial:function(){return n.getBuiltinMaterial("2d-graphics")},_updateMaterial:function(){var t=this._materials[0];t&&(void 0!==t.getDefine("CC_USE_MODEL")&&t.define("CC_USE_MODEL",!0),void 0!==t.getDefine("CC_SUPPORT_standard_derivatives")&&cc.sys.glExtension("OES_standard_derivatives")&&t.define("CC_SUPPORT_standard_derivatives",!0))},moveTo:function(t,e){this._impl.moveTo(t,e)},lineTo:function(t,e){this._impl.lineTo(t,e)},bezierCurveTo:function(t,e,i,n,r,a){this._impl.bezierCurveTo(t,e,i,n,r,a)},quadraticCurveTo:function(t,e,i,n){this._impl.quadraticCurveTo(t,e,i,n)},arc:function(t,e,i,n,r,a){this._impl.arc(t,e,i,n,r,a)},ellipse:function(t,e,i,n){this._impl.ellipse(t,e,i,n)},circle:function(t,e,i){this._impl.circle(t,e,i)},rect:function(t,e,i,n){this._impl.rect(t,e,i,n)},roundRect:function(t,e,i,n,r){this._impl.roundRect(t,e,i,n,r)},fillRect:function(t,e,i,n){this.rect(t,e,i,n),this.fill()},clear:function(t){this._impl.clear(t),this._assembler&&this._assembler.clear(t)},close:function(){this._impl.close()},stroke:function(){this._assembler||this._resetAssembler(),this._assembler.stroke(this)},fill:function(){this._assembler||this._resetAssembler(),this._assembler.fill(this)}});cc.Graphics=e.exports=o,cc.Graphics.Types=r,cc.Graphics.Helper=t("./helper")}),{"../assets/material/CCMaterial":81,"../components/CCRenderComponent":115,"./helper":158,"./types":160}],158:[(function(t,e){"use strict";var i=t("./types").PointFlags,n=Math.PI,r=Math.min,a=Math.max,s=Math.cos,o=Math.sin,c=Math.abs,l=Math.sign,h=.5522847493;e.exports={arc:function(t,e,i,l,h,u,f){var _,d,p,m=0,v=0,g=0,y=0,T=0,A=0,b=0,E=0,C=0,x=0,S=0,w=0,D=0;if(v=u-h,f=f||!1)if(c(v)>=2*n)v=2*n;else for(;v<0;)v+=2*n;else if(c(v)>=2*n)v=2*-n;else for(;v>0;)v-=2*n;for(p=0|a(1,r(c(v)/(.5*n)+.5,5)),g=c(4/3*(1-s(_=v/p/2))/o(_)),f||(g=-g),d=0;d<=p;d++)A=e+(y=s(m=h+v*(d/p)))*l,b=i+(T=o(m))*l,E=-T*l*g,C=y*l*g,0===d?t.moveTo(A,b):t.bezierCurveTo(x+w,S+D,A-E,b-C,A,b),x=A,S=b,w=E,D=C},ellipse:function(t,e,i,n,r){t.moveTo(e-n,i),t.bezierCurveTo(e-n,i+r*h,e-n*h,i+r,e,i+r),t.bezierCurveTo(e+n*h,i+r,e+n,i+r*h,e+n,i),t.bezierCurveTo(e+n,i-r*h,e+n*h,i-r,e,i-r),t.bezierCurveTo(e-n*h,i-r,e-n,i-r*h,e-n,i),t.close()},roundRect:function(t,e,i,n,a,s){if(s<.1)t.rect(e,i,n,a);else{var o=r(s,.5*c(n))*l(n),u=r(s,.5*c(a))*l(a);t.moveTo(e,i+u),t.lineTo(e,i+a-u),t.bezierCurveTo(e,i+a-u*(1-h),e+o*(1-h),i+a,e+o,i+a),t.lineTo(e+n-o,i+a),t.bezierCurveTo(e+n-o*(1-h),i+a,e+n,i+a-u*(1-h),e+n,i+a-u),t.lineTo(e+n,i+u),t.bezierCurveTo(e+n,i+u*(1-h),e+n-o*(1-h),i,e+n-o,i),t.lineTo(e+o,i),t.bezierCurveTo(e+o*(1-h),i,e,i+u*(1-h),e,i+u),t.close()}},tesselateBezier:function t(e,n,r,a,s,o,l,h,u,f,_){var d,p,m,v,g,y,T,A,b,E,C,x,S,w,D,M;f>10||(g=.5*(o+h),y=.5*(l+u),T=.5*((d=.5*(n+a))+(m=.5*(a+o))),A=.5*((p=.5*(r+s))+(v=.5*(s+l))),((D=c((a-h)*(w=u-r)-(s-u)*(S=h-n)))+(M=c((o-h)*w-(l-u)*S)))*(D+M)<e._tessTol*(S*S+w*w)?e._addPoint(h,u,0===_?_|i.PT_BEVEL:_):(t(e,n,r,d,p,T,A,C=.5*(T+(b=.5*(m+g))),x=.5*(A+(E=.5*(v+y))),f+1,0),t(e,C,x,b,E,g,y,h,u,f+1,_)))}}}),{"./types":160}],159:[(function(t){"use strict";t("./graphics")}),{"./graphics":157}],160:[(function(t,e){"use strict";var i=cc.Enum({BUTT:0,ROUND:1,SQUARE:2}),n=cc.Enum({BEVEL:0,ROUND:1,MITER:2}),r=cc.Enum({PT_CORNER:1,PT_LEFT:2,PT_BEVEL:4,PT_INNERBEVEL:8});e.exports={LineCap:i,LineJoin:n,PointFlags:r}}),{}],161:[(function(t){"use strict";t("./platform"),t("./assets"),t("./CCNode"),t("./CCPrivateNode"),t("./CCScene"),t("./components"),t("./graphics"),t("./collider"),t("./collider/CCIntersection"),t("./physics"),t("./camera/CCCamera"),t("./geom-utils"),t("./mesh"),t("./3d"),t("./base-ui/CCWidgetManager")}),{"./3d":void 0,"./CCNode":29,"./CCPrivateNode":30,"./CCScene":31,"./assets":79,"./base-ui/CCWidgetManager":90,"./camera/CCCamera":91,"./collider":99,"./collider/CCIntersection":97,"./components":133,"./geom-utils":149,"./graphics":159,"./mesh":164,"./physics":void 0,"./platform":186}],162:[(function(t,e){"use strict";var i=a(t("../../renderer/core/input-assembler")),n=a(t("../../renderer/gfx")),r=t("./mesh-data");function a(t){return t&&t.__esModule?t:{default:t}}var s=t("../renderer"),o=t("../event/event-target");function c(t,e,i){t[e]=i._val}function l(t,e,i){t[e]=i.x,t[e+1]=i.y}function h(t,e,i){t[e]=i.x,t[e+1]=i.y,t[e+2]=i.z}var u,f={5120:"getInt8",5121:"getUint8",5122:"getInt16",5123:"getUint16",5124:"getInt32",5125:"getUint32",5126:"getFloat32"},_={5120:"setInt8",5121:"setUint8",5122:"setInt16",5123:"setUint16",5124:"setInt32",5125:"setUint32",5126:"setFloat32"},d=(u=new ArrayBuffer(2),new DataView(u).setInt16(0,256,!0),256===new Int16Array(u)[0]),p=cc.Class({name:"cc.Mesh",extends:cc.Asset,mixins:[o],properties:{_nativeAsset:{override:!0,get:function(){return this._buffer},set:function(t){this._buffer=ArrayBuffer.isView(t)?t.buffer:t,this.initWithBuffer()}},_vertexBundles:{default:null,type:r.VertexBundle},_primitives:{default:null,Primitive:r.Primitive},_minPos:cc.v3(),_maxPos:cc.v3(),subMeshes:{get:function(){return this._subMeshes},set:function(t){this._subMeshes=t}},subDatas:{get:function(){return this._subDatas}}},ctor:function(){this._subMeshes=[],this._subDatas=[],this.loaded=!1},initWithBuffer:function(){this._subMeshes.length=0;for(var t=this._primitives,e=0;e<t.length;e++){var a=t[e],o=a.data,c=new Uint8Array(this._buffer,o.offset,o.length),l=this._vertexBundles[a.vertexBundleIndices[0]],h=l.data,u=new n.default.VertexFormat(l.formats),f=new Uint8Array(this._buffer,h.offset,h.length),_=this._canVertexFormatBatch(u),d=new r.MeshData;d.vData=f,d.iData=c,d.vfm=u,d.offset=h.offset,d.canBatch=_,this._subDatas.push(d);var p=new n.default.VertexBuffer(s.device,u,n.default.USAGE_STATIC,f),m=new n.default.IndexBuffer(s.device,a.indexUnit,n.default.USAGE_STATIC,c);this._subMeshes.push(new i.default(p,m))}this.loaded=!0,this.emit("load")},_canVertexFormatBatch:function(t){var e=t._attr2el[n.default.ATTR_POSITION];return!e||e.type===n.default.ATTR_TYPE_FLOAT32&&t._bytes%4==0},init:function(t,e,a,o){void 0===a&&(a=!1),void 0===o&&(o=0);var c=new Uint8Array(t._bytes*e),l=new r.MeshData;l.vData=c,l.vfm=t,l.vDirty=!0,l.canBatch=this._canVertexFormatBatch(t);var h=new n.default.VertexBuffer(s.device,t,a?n.default.USAGE_DYNAMIC:n.default.USAGE_STATIC,c);l.vb=h,this._subMeshes[o]=new i.default(l.vb);var u=this._subDatas[o];u&&(u.vb&&u.vb.destroy(),u.ib&&u.ib.destroy()),this._subDatas[o]=l,this.loaded=!0,this.emit("load"),this.emit("init-format")},setVertices:function(t,e,i){i=i||0;var r=this._subDatas[i],a=r.vfm.element(t);if(!a)return cc.warn("Cannot find "+t+" attribute in vertex defines.");var s,o="number"==typeof e[0],u=a.num,f=o?e.length/u|0:e.length;r.vData.byteLength<f*a.stride&&r.setVData(new Uint8Array(f*r.vfm._bytes));var _=4;t===n.default.ATTR_COLOR?o?(s=r.getVData(),_=1):s=r.getVData(Uint32Array):s=r.getVData(Float32Array);var d=a.stride/_,p=a.offset/_;if(o)for(var m=0,v=e.length/u;m<v;m++)for(var g=m*u,y=m*d+p,T=0;T<u;T++)s[y+T]=e[g+T];else{var A;A=t===n.default.ATTR_COLOR?c:2===u?l:h;for(var b=0,E=e.length;b<E;b++)A(s,b*d+p,e[b])}r.vDirty=!0},setIndices:function(t,e,i){e=e||0;var r=t;t instanceof Uint16Array?r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(r=new Uint16Array(t),r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));var a=i?n.default.USAGE_DYNAMIC:n.default.USAGE_STATIC,o=this._subDatas[e];if(o.ib)o.iData=r,o.iDirty=!0;else{o.iData=r;var c=new n.default.IndexBuffer(s.device,n.default.INDEX_FMT_UINT16,a,r,r.byteLength/n.default.IndexBuffer.BYTES_PER_INDEX[n.default.INDEX_FMT_UINT16]);o.ib=c,this._subMeshes[e]._indexBuffer=o.ib}},setPrimitiveType:function(t,e){e=e||0,this._subMeshes[e]?this._subMeshes[e]._primitiveType=t:cc.warn("Do not have sub mesh at index "+e)},clear:function(){this._subMeshes.length=0;for(var t=this._subDatas,e=0,i=t.length;e<i;e++){var n=t[e].vb;n&&n.destroy();var r=t[e].ib;r&&r.destroy()}t.length=0},setBoundingBox:function(t,e){this._minPos=t,this._maxPos=e},destroy:function(){this.clear()},_uploadData:function(){for(var t=this._subDatas,e=0,i=t.length;e<i;e++){var n=t[e];if(n.vDirty){var r=n.vb,a=n.vData;r.update(0,a),n.vDirty=!1}if(n.iDirty){var s=n.ib,o=n.iData;s.update(0,o),n.iDirty=!1}}},_getAttrMeshData:function(t,e){var i=this._subDatas[t];if(!i)return[];var n=i.vfm,r=n.element(e);if(!r)return[];i.attrDatas||(i.attrDatas={});var a=i.attrDatas,s=a[e];if(s)return s;s=a[e]=[];for(var o=i.vData,c=new DataView(o.buffer,o.byteOffset,o.byteLength),l=r.stride,h=r.offset,u=r.num,_=r.bytes/u,p=f[r.type],m=o.byteLength/n._bytes,v=0;v<m;v++)for(var g=v*l+h,y=0;y<u;y++){var T=c[p](g+y*_,d);s.push(T)}return s},copyAttribute:function(t,e,i,n,r){var a=!1,s=this._subDatas[t];if(!s)return a;var o=s.vfm,c=o.element(e);if(!c)return a;var l=_[c.type];if(!l)return a;var h=this._getAttrMeshData(t,e),u=s.vData.byteLength/o._bytes,f=c.bytes/c.num;if(h.length>0){for(var p=new DataView(i,r),m=n,v=c.num,g=0;g<u;++g)for(var y=g*v,T=0;T<v;++T){var A=y+T,b=m*g+f*T;p[l](b,h[A],d)}a=!0}return a},copyIndices:function(t,e){var i=this._subDatas[t];if(!i)return!1;for(var r=i.iData,a=r.length/2,s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=f[n.default.INDEX_FMT_UINT8],c=0;c<a;++c)e[c]=s[o](2*c);return!0}});cc.Mesh=e.exports=p}),{"../../renderer/core/input-assembler":280,"../../renderer/gfx":290,"../event/event-target":141,"../renderer":199,"./mesh-data":165}],163:[(function(t,e){"use strict";var i=a(t("../../renderer/gfx")),n=(a(t("../../renderer/core/input-assembler")),a(t("../geom-utils/aabb"))),r=(a(t("../value-types/vec3")),a(t("../value-types/mat4")),a(t("../assets/material/material-variant")));function a(t){return t&&t.__esModule?t:{default:t}}var s=t("../components/CCRenderComponent"),o=t("./CCMesh"),c=t("../renderer/render-flow"),l=(t("../renderer"),t("../assets/material/CCMaterial")),h=cc.Enum({OFF:0,ON:1}),u=cc.Class({name:"cc.MeshRenderer",extends:s,editor:!1,properties:{_mesh:{default:null,type:o},_receiveShadows:!1,_shadowCastingMode:h.OFF,_enableAutoBatch:!1,mesh:{get:function(){return this._mesh},set:function(t){this._mesh!==t&&(this._setMesh(t),t?(this.markForRender(!0),this.node._renderFlag|=c.FLAG_TRANSFORM):this.disableRender())},type:o,animatable:!1},textures:{default:[],type:cc.Texture2D,visible:!1},receiveShadows:{get:function(){return this._receiveShadows},set:function(t){this._receiveShadows=t,this._updateReceiveShadow()},animatable:!1},shadowCastingMode:{get:function(){return this._shadowCastingMode},set:function(t){this._shadowCastingMode=t,this._updateCastShadow()},type:h,animatable:!1},enableAutoBatch:{get:function(){return this._enableAutoBatch},set:function(t){this._enableAutoBatch=t}}},statics:{ShadowCastingMode:h},ctor:function(){this._boundingBox=cc.geomUtils&&new n.default},onEnable:function(){var t=this;this._super(),this._mesh&&!this._mesh.loaded?(this.disableRender(),this._mesh.once("load",(function(){t.isValid&&(t._setMesh(t._mesh),t.markForRender(!0))})),cc.assetManager.postLoadNative(this._mesh)):this._setMesh(this._mesh),this._updateRenderNode(),this._updateMaterial()},onDestroy:function(){this._setMesh(null),cc.pool.assembler.put(this._assembler)},_updateRenderNode:function(){this._assembler.setRenderNode(this.node)},_setMesh:function(t){cc.geomUtils&&t&&n.default.fromPoints(this._boundingBox,t._minPos,t._maxPos),this._mesh&&this._mesh.off("init-format",this._updateMeshAttribute,this),t&&t.on("init-format",this._updateMeshAttribute,this),this._mesh=t,this._assembler&&(this._assembler._worldDatas={}),this._updateMeshAttribute()},_getDefaultMaterial:function(){return l.getBuiltinMaterial("unlit")},_validateRender:function(){var t=this._mesh;t&&t._subDatas.length>0||this.disableRender()},_updateMaterial:function(){var t=this.textures;if(t&&t.length>0)for(var e=this._getDefaultMaterial(),i=0;i<t.length;i++){var n=this._materials[i];n&&n._uuid!==e._uuid||(n||(n=r.default.create(e,this),this.setMaterial(i,n)),n.setProperty("diffuseTexture",t[i]))}this._updateReceiveShadow(),this._updateCastShadow(),this._updateMeshAttribute()},_updateReceiveShadow:function(){for(var t=this.getMaterials(),e=0;e<t.length;e++)t[e].define("CC_USE_SHADOW_MAP",this._receiveShadows,void 0,!0)},_updateCastShadow:function(){for(var t=this.getMaterials(),e=0;e<t.length;e++)t[e].define("CC_CASTING_SHADOW",this._shadowCastingMode===h.ON,void 0,!0)},_updateMeshAttribute:function(){var t=this._mesh&&this._mesh.subDatas;if(t)for(var e=this.getMaterials(),n=0;n<e.length&&t[n];n++){var r=t[n].vfm,a=e[n];a.define("CC_USE_ATTRIBUTE_COLOR",!!r.element(i.default.ATTR_COLOR),void 0,!0),a.define("CC_USE_ATTRIBUTE_UV0",!!r.element(i.default.ATTR_UV0),void 0,!0),a.define("CC_USE_ATTRIBUTE_NORMAL",!!r.element(i.default.ATTR_NORMAL),void 0,!0),a.define("CC_USE_ATTRIBUTE_TANGENT",!!r.element(i.default.ATTR_TANGENT),void 0,!0)}},_checkBacth:function(){}});cc.MeshRenderer=e.exports=u}),{"../../renderer/core/input-assembler":280,"../../renderer/gfx":290,"../assets/material/CCMaterial":81,"../assets/material/material-variant":88,"../components/CCRenderComponent":115,"../geom-utils/aabb":145,"../renderer":199,"../renderer/render-flow":200,"../value-types/mat4":259,"../value-types/vec3":267,"./CCMesh":162}],164:[(function(t){"use strict";t("./CCMesh"),t("./CCMeshRenderer"),t("./mesh-renderer")}),{"./CCMesh":162,"./CCMeshRenderer":163,"./mesh-renderer":166}],165:[(function(t,e,i){"use strict";i.__esModule=!0,i.BufferRange=void 0,i.MeshData=l,i.VertexFormat=i.VertexBundle=i.Primitive=void 0;var n,r=(n=t("../../renderer/gfx"))&&n.__esModule?n:{default:n},a=cc.Class({name:"cc.BufferRange",properties:{offset:0,length:0}});i.BufferRange=a;var s=cc.Class({name:"cc.mesh.VertexFormat",properties:{name:"",type:-1,num:-1,normalize:!1}});i.VertexFormat=s;var o=cc.Class({name:"cc.mesh.VertexBundle",properties:{data:{default:null,type:a},formats:{default:[],type:s},verticesCount:0}});i.VertexBundle=o;var c=cc.Class({name:"cc.mesh.Primitive",properties:{vertexBundleIndices:{default:[],type:cc.Float},data:{default:null,type:a},indexUnit:r.default.INDEX_FMT_UINT16,topology:r.default.PT_TRIANGLES}});function l(){this.vData=null,this.float32VData=null,this.uint32VData=null,this.iData=null,this.uint16IData=null,this.vfm=null,this.offset=0,this.vb=null,this.ib=null,this.vDirty=!1,this.iDirty=!1,this.enable=!0}i.Primitive=c,l.prototype.setVData=function(t){this.vData=t,this.float32VData=null,this.uint32VData=null},l.prototype.getVData=function(t){return t===Float32Array?(this.float32VData||(this.float32VData=new Float32Array(this.vData.buffer,this.vData.byteOffset,this.vData.byteLength/4)),this.float32VData):t===Uint32Array?(this.uint32VData||(this.uint32VData=new Uint32Array(this.vData.buffer,this.vData.byteOffset,this.vData.byteLength/4)),this.uint32VData):this.vData},l.prototype.getIData=function(t){return t===Uint16Array?(this.uint16IData||(this.uint16IData=new Uint16Array(this.iData.buffer,this.iData.byteOffset,this.iData.byteLength/2)),this.uint16IData):this.iData}}),{"../../renderer/gfx":290}],166:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../renderer/assembler")),r=s(t("../../renderer/gfx")),a=s(t("../value-types/vec3"));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var c=t("./CCMeshRenderer"),l=new a.default,h=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,o(e,i);var s=n.prototype;return s.init=function(e){t.prototype.init.call(this,e),this._worldDatas={},this._renderNode=null},s.setRenderNode=function(t){this._renderNode=t},s.fillBuffers=function(t,e){if(t.mesh){t.mesh._uploadData();for(var i=e.cullingMask===t.node._cullingMask,n=t.enableAutoBatch,a=t._materials,s=t.mesh._subMeshes,o=t.mesh.subDatas,c=0;c<s.length;c++){var l=s[c],h=o[c],u=a[c]||a[0];n&&h.canBatch&&l._primitiveType===r.default.PT_TRIANGLES?(i&&u.getHash()===e.material.getHash()||e._flush(),e.material=u,e.cullingMask=t.node._cullingMask,e.node=e._dummyNode,this._fillBuffer(t,h,e,c)):(e._flush(),e.material=u,e.cullingMask=t.node._cullingMask,e.node=this._renderNode,e._flushIA(l))}}},s._fillBuffer=function(t,e,i,n){var r=e.getVData(Float32Array),a=e.vfm,s=r.byteLength/a._bytes|0,o=e.getIData(Uint16Array),c=o.length,l=i.getBuffer("mesh",a),h=l.request(s,c),u=h.indiceOffset,f=h.byteOffset>>2,_=h.vertexOffset,d=l._vData,p=l._iData;!i.worldMatDirty&&this._worldDatas[n]||this._updateWorldVertices(n,s,r,a,t.node._worldMatrix),d.set(this._worldDatas[n],f);for(var m=0;m<c;m++)p[u+m]=_+o[m]},s._updateWorldVertices=function(t,e,i,n,s){var o=this._worldDatas[t];o||(o=this._worldDatas[t]=new Float32Array(i.length)).set(i);for(var c=n._bytes/4,h=n._elements,u=0,f=h.length;u<f;u++){var _=h[u],d=_.offset/4;if(_.name===r.default.ATTR_POSITION||_.name===r.default.ATTR_NORMAL)for(var p=_.name===r.default.ATTR_NORMAL?a.default.transformMat4Normal:a.default.transformMat4,m=0;m<e;m++){var v=m*c+d;l.x=i[v],l.y=i[v+1],l.z=i[v+2],p(l,l,s),o[v]=l.x,o[v+1]=l.y,o[v+2]=l.z}}},s._drawDebugDatas=function(t,e,i){var n=t._debugDatas[i];if(n)for(var r=0;r<n.length;r++){var a=n[r];if(a){var s=a.material;e.material=s,e._flushIA(a.ia)}}},n})(n.default);i.default=h,n.default.register(c,h),e.exports=i.default}),{"../../renderer/gfx":290,"../renderer/assembler":196,"../value-types/vec3":267,"./CCMeshRenderer":163}],167:[(function(t,e){"use strict";var i=t("./component-scheduler"),n=t("./platform/CCObject").Flags,r=t("./platform/js"),a=n.IsPreloadStarted,s=n.IsOnLoadStarted,o=n.IsOnLoadCalled,c=n.Deactivating,l=cc.Class({extends:i.LifeCycleInvoker,add:function(t){this._zero.array.push(t)},remove:function(t){this._zero.fastRemove(t)},cancelInactive:function(t){i.LifeCycleInvoker.stableRemoveInactive(this._zero,t)},invoke:function(){this._invoke(this._zero),this._zero.array.length=0}}),h=i.createInvokeImpl((function(t){t.__preload()}),!1,void 0,(function(t){var e=t.array;for(t.i=0;t.i<e.length;++t.i)e[t.i].__preload()})),u=i.createInvokeImpl((function(t){t.onLoad(),t._objFlags|=o}),!1,o,(function(t){var e=t.array;for(t.i=0;t.i<e.length;++t.i){var i=e[t.i];i.onLoad(),i._objFlags|=o}})),f=new r.Pool(4);function _(t,e,i){e?t._removeComponent(e):r.array.removeAt(t._components,i)}function d(){this._activatingStack=[]}f.get=function(){var t=this._get()||{preload:new l(h),onLoad:new i.OneOffInvoker(u),onEnable:new i.OneOffInvoker(i.invokeOnEnable)};t.preload._zero.i=-1;var e=t.onLoad;return e._zero.i=-1,e._neg.i=-1,e._pos.i=-1,(e=t.onEnable)._zero.i=-1,e._neg.i=-1,e._pos.i=-1,t};var p=cc.Class({ctor:d,reset:d,_activateNodeRecursively:function(t,e,i,n){if(t._objFlags&c)cc.errorID(3816,t.name);else{t._activeInHierarchy=!0;for(var r=t._components.length,a=0;a<r;++a){var s=t._components[a];s instanceof cc.Component?this.activateComp(s,e,i,n):(_(t,s,a),--a,--r)}t._childArrivalOrder=t._children.length;for(var o=0,l=t._children.length;o<l;++o){var h=t._children[o];h._localZOrder=4294901760&h._localZOrder|o+1,h._active&&this._activateNodeRecursively(h,e,i,n)}t._onPostActivated(!0)}},_deactivateNodeRecursively:function(t){t._objFlags|=c,t._activeInHierarchy=!1;for(var e=t._components.length,i=0;i<e;++i){var n=t._components[i];if(n._enabled&&(cc.director._compScheduler.disableComp(n),t._activeInHierarchy))return void(t._objFlags&=~c)}for(var r=0,a=t._children.length;r<a;++r){var s=t._children[r];if(s._activeInHierarchy&&(this._deactivateNodeRecursively(s),t._activeInHierarchy))return void(t._objFlags&=~c)}t._onPostActivated(!1),t._objFlags&=~c},activateNode:function(t,e){if(e){var i=f.get();this._activatingStack.push(i),this._activateNodeRecursively(t,i.preload,i.onLoad,i.onEnable),i.preload.invoke(),i.onLoad.invoke(),i.onEnable.invoke(),this._activatingStack.pop(),f.put(i)}else{this._deactivateNodeRecursively(t);for(var n=this._activatingStack,r=0;r<n.length;r++){var o=n[r];o.preload.cancelInactive(a),o.onLoad.cancelInactive(s),o.onEnable.cancelInactive()}}t.emit("active-in-hierarchy-changed",t)},activateComp:function(t,e,i,n){if(cc.isValid(t,!0)&&(t._objFlags&a||(t._objFlags|=a,t.__preload&&(e?e.add(t):t.__preload())),t._objFlags&s||(t._objFlags|=s,t.onLoad?i?i.add(t):(t.onLoad(),t._objFlags|=o):t._objFlags|=o),t._enabled)){if(!t.node._activeInHierarchy)return;cc.director._compScheduler.enableComp(t,n)}},destroyComp:function(t){cc.director._compScheduler.disableComp(t),t.onDestroy&&t._objFlags&o&&t.onDestroy()},resetComp:!1});e.exports=p}),{"./component-scheduler":100,"./platform/CCObject":174,"./platform/js":189,"./utils/misc":242}],168:[(function(t,e){"use strict";var i=t("./js"),n=t("./CCEnum"),r=t("./utils"),a=(r.isPlainEmptyObj_DEV,r.cloneable_DEV,t("./attribute")),s=a.DELIMETER,o=t("./preprocess-class");t("./requiring-frame");var c=["name","extends","mixins","ctor","__ctor__","properties","statics","editor","__ES6__"];function l(t,e){t.indexOf(e)<0&&t.push(e)}var h={datas:null,push:function(t){if(this.datas)this.datas.push(t);else{this.datas=[t];var e=this;setTimeout((function(){e.init()}),0)}},init:function(){var t=this.datas;if(t){for(var e=0;e<t.length;++e){var n=t[e],r=n.cls,a=n.props;"function"==typeof a&&(a=a());var s=i.getClassName(r);a?C(r,s,a,r.$super,n.mixins):cc.errorID(3633,s)}this.datas=null}}};function u(t,e){l(t.__props__,e)}function f(t,e,i,n){var r=n.default;a.setClassAttr(t,i,"default",r),u(t,i),w(t,n,0,i)}function _(t,e,n,r,s){var o=r.get,c=r.set,l=t.prototype,h=!Object.getOwnPropertyDescriptor(l,n);o&&(w(t,r,0,n),a.setClassAttr(t,n,"serializable",!1),s||i.get(l,n,o,h,h)),c&&(s||i.set(l,n,c,h,h))}function d(t){return"function"==typeof t?t():t}function p(t,e,n){for(var r in e)t.hasOwnProperty(r)||n&&!n(r)||Object.defineProperty(t,r,i.getPropertyDescriptor(e,r))}function m(t,e,n,r){var s,o,c=r.__ctor__,l=r.ctor,h=r.__ES6__;h?(s=[l],o=l):(s=c?[c]:A(e,n,r),o=T(s,e,t,r),i.value(o,"extend",(function(t){return t.extends=this,x(t)}),!0)),i.value(o,"__ctors__",s.length>0?s:null,!0);var u=o.prototype;if(e&&(h||(i.extend(o,e),u=o.prototype),o.$super=e),n){for(var f=n.length-1;f>=0;f--){var _=n[f];p(u,_.prototype),p(o,_,(function(t){return _.hasOwnProperty(t)&&!0})),x._isCCClass(_)&&p(a.getClassAttrs(o),a.getClassAttrs(_))}u.constructor=o}return h||(u.__initProps__=y),i.setClassName(t,o),o}function v(t,e,n,r){var a=cc.Component,s=cc._RF.peek();if(s&&i.isChildClassOf(e,a)){if(i.isChildClassOf(s.cls,a))return cc.errorID(3615),null;t=t||s.script}var o=m(t,e,n,r);if(s)if(i.isChildClassOf(e,a)){var c=s.uuid;c&&i._setClassId(c,o),s.cls=o}else i.isChildClassOf(s.cls,a)||(s.cls=o);return o}function g(t,e){var i=null,n=0,r=0;return (function(){for(var a=null,o=null,c=null,l=0;l<e.length;++l){var h=e[l],u=h+s+"default";if(u in t){var f=t[u];"object"==typeof f&&f||"function"==typeof f?f instanceof cc.ValueType?(o||(o=[]),o.push(h,f)):(c||(c=[]),c.push(h,f)):(a||(a=[]),a.push(h,f))}}n=a?a.length:0;var _=(r=n+(o?o.length:0))+(c?c.length:0);i=new Array(_);for(var d=0;d<n;++d)i[d]=a[d];for(var p=n;p<r;++p)i[p]=o[p-n];for(var m=r;m<_;++m)i[m]=c[m-r]})(),function(){for(var t=0;t<n;t+=2)this[i[t]]=i[t+1];for(;t<r;t+=2)this[i[t]]=i[t+1].clone();for(;t<i.length;t+=2){var e,a=i[t+1];Array.isArray(a)?this[i[t]]=[]:(e="object"==typeof a?{}:a(),this[i[t]]=e)}}}function y(t){var e=a.getClassAttrs(t),i=t.__props__;null===i&&(h.init(),i=t.__props__);var n=g(e,i);t.prototype.__initProps__=n,n.call(this)}var T=function(t,e,i,n){var r,a=e&&E(e,n),s=t.length;return r=s>0?a?2===s?function(){this._super=null,this.__initProps__(r),t[0].apply(this,arguments),t[1].apply(this,arguments)}:function(){this._super=null,this.__initProps__(r);for(var e=0;e<t.length;++e)t[e].apply(this,arguments)}:3===s?function(){this.__initProps__(r),t[0].apply(this,arguments),t[1].apply(this,arguments),t[2].apply(this,arguments)}:function(){this.__initProps__(r);for(var t=r.__ctors__,e=0;e<t.length;++e)t[e].apply(this,arguments)}:function(){a&&(this._super=null),this.__initProps__(r)}};function A(t,e,i){for(var n,r=[],a=[t].concat(e),s=0;s<a.length;s++){var o=a[s];if(o)for(var c=(n=o,x._isCCClass(n)?n.__ctors__||[]:[n]),h=0;h<c.length;h++)l(r,c[h])}var u=i.ctor;return u&&r.push(u),r}var b=/xyz/.test((function(){xyz}))?/\b\._super\b/:/.*/;function E(t,e){var n=!1;for(var r in e)if(!(c.indexOf(r)>=0)){var a=e[r];if("function"==typeof a){var s=i.getPropertyDescriptor(t.prototype,r);if(s){var o=s.value;if("function"==typeof o){b.test(a)&&(n=!0,e[r]=(function(t,e){return function(){var i=this._super;this._super=t;var n=e.apply(this,arguments);return this._super=i,n}})(o,a));continue}}}}return n}function C(t,e,i,n,r,c){if(t.__props__=[],n&&n.__props__&&(t.__props__=n.__props__.slice()),r)for(var l=0;l<r.length;++l){var h=r[l];h.__props__&&(t.__props__=t.__props__.concat(h.__props__.filter((function(e){return t.__props__.indexOf(e)<0}))))}if(i)for(var u in o.preprocessAttrs(i,e,t,c),i){var d=i[u];"default"in d?f(t,0,u,d):_(t,0,u,d,c)}var p=a.getClassAttrs(t);t.__values__=t.__props__.filter((function(t){return!1!==p[t+s+"serializable"]}))}function x(t){var e=(t=t||{}).name,n=t.extends,r=t.mixins,a=v(e,n,r,t);e||(e=cc.js.getClassName(a)),a._sealed=!0,n&&(n._sealed=!1);var s=t.properties;"function"==typeof s||n&&null===n.__props__||r&&r.some((function(t){return null===t.__props__}))?(h.push({cls:a,props:s,mixins:r}),a.__props__=a.__values__=null):C(a,e,s,n,t.mixins,t.__ES6__);var l,u=t.statics;if(u)for(l in u)a[l]=u[l];for(var f in t)if(!(c.indexOf(f)>=0)){var _=t[f];o.validateMethodWithProps(_,f,e,a,n)&&i.value(a.prototype,f,_,!0,!0)}var d=t.editor;return d&&cc.Component._registerEditorProps(a,d),a}/xyz/.test((function(){xyz})),x._isCCClass=function(t){return t&&t.hasOwnProperty("__ctors__")},x._fastDefine=function(t,e,n){i.setClassName(t,e);for(var r=e.__props__=e.__values__=Object.keys(n),o=a.getClassAttrs(e),c=0;c<r.length;c++){var l=r[c];o[l+s+"visible"]=!1,o[l+s+"default"]=n[l]}},x.Attr=a,x.attr=a.attr,x.getInheritanceChain=function(t){for(var e=[];t=i.getSuper(t);)t!==Object&&e.push(t);return e};var S={Integer:"Number",Float:"Number",Boolean:"Boolean",String:"String"};function w(t,e,i,r){var o=null,c="";function l(){return c=r+s,o=a.getClassAttrs(t)}var h=e.type;h&&(S[h]?(o||l())[c+"type"]=h:"Object"===h||(h===a.ScriptUuid?((o||l())[c+"type"]="Script",o[c+"ctor"]=cc.ScriptAsset):"object"==typeof h?n.isEnum(h)&&((o||l())[c+"type"]="Enum",o[c+"enumList"]=n.getList(h)):"function"==typeof h&&((o||l())[c+"type"]="Object",o[c+"ctor"]=h)));function u(t,i){if(t in e){var n=e[t];typeof n===i&&((o||l())[c+t]=n)}}e.editorOnly&&((o||l())[c+"editorOnly"]=!0),!1===e.serializable&&((o||l())[c+"serializable"]=!1),u("formerlySerializedAs","string");var f=e.range;f&&Array.isArray(f)&&f.length>=2&&((o||l())[c+"min"]=f[0],o[c+"max"]=f[1],f.length>2&&(o[c+"step"]=f[2])),u("min","number"),u("max","number"),u("step","number"),u("userData","object")}cc.Class=x,e.exports={isArray:function(t){return t=d(t),Array.isArray(t)},fastDefine:x._fastDefine,getNewValueTypeCode:!1,IDENTIFIER_RE:/^[A-Za-z_$][0-9A-Za-z_$]*$/,escapeForJS:function(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},getDefault:d}}),{"./CCEnum":170,"./attribute":180,"./js":189,"./preprocess-class":190,"./requiring-frame":191,"./utils":192}],169:[(function(t,e){"use strict";t("./CCClass");var i=t("./preprocess-class"),n=t("./js"),r="__ccclassCache__";function a(t){return t}function s(t,e){return t[e]||(t[e]={})}function o(t){return function(e){return"function"==typeof e?t(e):function(i){return t(i,e)}}}function c(t,e){return function(t){return function(i){return e(i,t)}}}var l=c.bind(null,!1);function h(){return c.bind(null,!1)}var u=h(),f=h();function _(t){return s(t,r)}function d(t){var e;try{e=t()}catch(i){return t}return"object"!=typeof e||null===e?e:t}function p(t){var e;try{e=new t}catch(i){return{}}return e}function m(t,e,r,a,s,o){var c,l=s&&(s.get||s.set);a&&(c=i.getFullFormOfProperty(a,l));var h=e[r],u=n.mixin(h||{},c||a||{});if(l)s.get&&(u.get=s.get),s.set&&(u.set=s.set);else{var f=void 0;if(s)s.initializer&&(f=d(s.initializer));else{var _=o.default||(o.default=p(t));_.hasOwnProperty(r)&&(f=_[r])}u.default=f}e[r]=u}var v=o((function(t,e){var i=n.getSuper(t);i===Object&&(i=null);var a={name:e,extends:i,ctor:t,__ES6__:!0},s=t[r];if(s){var o=s.proto;o&&n.mixin(a,o),t[r]=void 0}return cc.Class(a)}));function g(t,e,i){return t((function(t,n){var r=_(t);if(r){var a=void 0!==i?i:n,o=s(r,"proto");s(o,"editor")[e]=a}}),e)}function y(t){return t(a)}var T=y(o),A=g(l,"requireComponent"),b=y(u),E=g(f,"executionOrder"),C=y(o),x=y(o),S=y(u),w=y(u),D=y(u);cc._decorator=e.exports={ccclass:v,property:function(t,e,i){var n=null;function r(t,e,i){var r=_(t.constructor);if(r){var a=s(r,"proto"),o=s(a,"properties");m(t.constructor,o,e,n,i,r)}}if(void 0===e)return n=t,r;r(t,e,i)},executeInEditMode:T,requireComponent:A,menu:b,executionOrder:E,disallowMultiple:C,playOnFocus:x,inspector:S,icon:w,help:D,mixins:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var i=_(e);i&&(s(i,"proto").mixins=t)}}}}),{"./CCClass":168,"./js":189,"./preprocess-class":190,"./utils":192}],170:[(function(t,e){"use strict";var i=t("./js");function n(t){if("__enums__"in t)return t;i.value(t,"__enums__",null,!0);for(var e=-1,n=Object.keys(t),r=0;r<n.length;r++){var a=n[r],s=t[a];if(-1===s)s=++e,t[a]=s;else if("number"==typeof s)e=s;else if("string"==typeof s&&Number.isInteger(parseFloat(a)))continue;var o=""+s;a!==o&&i.value(t,o,a)}return t}n.isEnum=function(t){return t&&t.hasOwnProperty("__enums__")},n.getList=function(t){if(t.__enums__)return t.__enums__;var e=t.__enums__=[];for(var i in t){var n=t[i];Number.isInteger(n)&&e.push({name:i,value:n})}return e.sort((function(t,e){return t.value-e.value})),e},e.exports=cc.Enum=n}),{"./js":189}],171:[(function(t){"use strict";var e,i=t("../event-manager"),n=t("./CCInputManager");cc.Acceleration=function(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.timestamp=n||0},n.setAccelerometerEnabled=function(t){var e=this;if(e._accelEnabled!==t){e._accelEnabled=t;var i=cc.director.getScheduler();i.enableForTarget(e),e._accelEnabled?(e._registerAccelerometerEvent(),e._accelCurTime=0,i.scheduleUpdate(e)):(e._unregisterAccelerometerEvent(),e._accelCurTime=0,i.unscheduleUpdate(e))}},n.setAccelerometerInterval=function(t){this._accelInterval!==t&&(this._accelInterval=t)},n._registerKeyboardEvent=function(){cc.game.canvas.addEventListener("keydown",(function(t){i.dispatchEvent(new cc.Event.EventKeyboard(t.keyCode,!0)),t.stopPropagation(),t.preventDefault()}),!1),cc.game.canvas.addEventListener("keyup",(function(t){i.dispatchEvent(new cc.Event.EventKeyboard(t.keyCode,!1)),t.stopPropagation(),t.preventDefault()}),!1)},n._registerAccelerometerEvent=function(){var t=window,i=this;i._acceleration=new cc.Acceleration,i._accelDeviceEvent=t.DeviceMotionEvent||t.DeviceOrientationEvent,cc.sys.browserType===cc.sys.BROWSER_TYPE_MOBILE_QQ&&(i._accelDeviceEvent=window.DeviceOrientationEvent);var n=i._accelDeviceEvent===t.DeviceMotionEvent?"devicemotion":"deviceorientation",r=navigator.userAgent;(/Android/.test(r)||/Adr/.test(r)&&cc.sys.browserType===cc.BROWSER_TYPE_UC)&&(i._minus=-1),e=i.didAccelerate.bind(i),t.addEventListener(n,e,!1)},n._unregisterAccelerometerEvent=function(){var t=window,i=this._accelDeviceEvent===t.DeviceMotionEvent?"devicemotion":"deviceorientation";e&&t.removeEventListener(i,e,!1)},n.didAccelerate=function(t){var e=this,i=window;if(e._accelEnabled){var n,r,a,s=e._acceleration;if(e._accelDeviceEvent===window.DeviceMotionEvent){var o=t.accelerationIncludingGravity;n=e._accelMinus*o.x*.1,r=e._accelMinus*o.y*.1,a=.1*o.z}else n=t.gamma/90*.981,r=-t.beta/90*.981,a=t.alpha/90*.981;if(cc.view._isRotated){var c=n;n=-r,r=c}s.x=n,s.y=r,s.z=a,s.timestamp=t.timeStamp||Date.now();var l=s.x;90===i.orientation?(s.x=-s.y,s.y=l):-90===i.orientation?(s.x=s.y,s.y=-l):180===i.orientation&&(s.x=-s.x,s.y=-s.y),cc.sys.os!==cc.sys.OS_ANDROID&&cc.sys.os!==cc.sys.OS_OPENHARMONY||cc.sys.browserType===cc.sys.BROWSER_TYPE_MOBILE_QQ||(s.x=-s.x,s.y=-s.y)}}}),{"../event-manager":139,"./CCInputManager":172}],172:[(function(t,e){"use strict";var i=t("./CCMacro"),n=t("./CCSys"),r=t("../event-manager"),a=cc.v2(),s={_mousePressed:!1,_isRegisterEvent:!1,_preTouchPoint:cc.v2(0,0),_prevMousePoint:cc.v2(0,0),_preTouchPool:[],_preTouchPoolPointer:0,_touches:[],_maxTouches:10,_touchesIntegerDict:{},_indexBitsUsed:0,_touchesCache:{},_touchCount:0,_accelEnabled:!1,_accelInterval:.2,_accelMinus:1,_accelCurTime:0,_acceleration:null,_accelDeviceEvent:null,_canvasBoundingRect:{left:0,top:0,adjustedLeft:0,adjustedTop:0,width:0,height:0},_getUnUsedIndex:function(){for(var t=cc.sys.now(),e=i.TOUCH_TIMEOUT,n=this._indexBitsUsed,r=-1,a=this._touches,s=this._touchesIntegerDict,o=this._touchesCache,c=0;c<this._maxTouches;c++){if(1&n){var l=a[c];if(l&&t-l._lastModified>e){var h=l.getID();delete s[h],delete o[h],this._touchCount--,-1===r?(r=c,this._indexBitsUsed|=1<<c):this._indexBitsUsed&=~(1<<c)}}else-1===r&&(r=c,this._indexBitsUsed|=1<<c);n>>=1}return r},_glView:null,_updateCanvasBoundingRect:function(){var t=cc.game.canvas,e=this._canvasBoundingRect,i=document.documentElement,n=window.pageXOffset-i.clientLeft,r=window.pageYOffset-i.clientTop;if(t.getBoundingClientRect){var a=t.getBoundingClientRect();e.left=a.left+n,e.top=a.top+r,e.width=a.width,e.height=a.height}else t instanceof HTMLCanvasElement?(e.left=n,e.top=r,e.width=t.width,e.height=t.height):(e.left=n,e.top=r,e.width=parseInt(t.style.width),e.height=parseInt(t.style.height))},handleTouchesBegin:function(t){for(var e,i,a=n.now(),s=[],o=this._touches,c=this._touchesIntegerDict,l=this._touchesCache,h=0,u=t.length;h<u;h++)if(void 0===c[i=(e=t[h]).getID()]){var f=this._getUnUsedIndex();if(-1===f){cc.logID(2300,f);continue}var _=new cc.Touch(e._point.x,e._point.y,i);_._setPrevPoint(e._prevPoint),_._lastModified=a,o[f]=_,c[i]=f,l[i]=_,this._touchCount++,s.push(_)}if(s.length>0){this._glView._convertTouchesWithScale(s);var d=new cc.Event.EventTouch(s);d._eventCode=cc.Event.EventTouch.BEGAN,r.dispatchEvent(d)}},handleTouchesMove:function(t){for(var e,i,a=n.now(),s=[],o=this._touches,c=this._touchesIntegerDict,l=0,h=t.length;l<h;l++)if(void 0!==(i=c[(e=t[l]).getID()])){var u=o[i];u&&(u._setPoint(e._point),u._setPrevPoint(e._prevPoint),u._lastModified=a,s.push(u))}if(s.length>0){this._glView._convertTouchesWithScale(s);var f=new cc.Event.EventTouch(s);f._eventCode=cc.Event.EventTouch.MOVED,r.dispatchEvent(f)}},handleTouchesEnd:function(t){var e=this.getSetOfTouchesEndOrCancel(t);if(e.length>0){this._glView._convertTouchesWithScale(e);var i=new cc.Event.EventTouch(e);i._eventCode=cc.Event.EventTouch.ENDED,r.dispatchEvent(i)}this._preTouchPool.length=0},handleTouchesCancel:function(t){var e=this.getSetOfTouchesEndOrCancel(t);if(e.length>0){this._glView._convertTouchesWithScale(e);var i=new cc.Event.EventTouch(e);i._eventCode=cc.Event.EventTouch.CANCELED,r.dispatchEvent(i)}this._preTouchPool.length=0},getSetOfTouchesEndOrCancel:function(t){for(var e,i,n,r=[],a=this._touches,s=this._touchesIntegerDict,o=this._touchesCache,c=0,l=t.length;c<l;c++)if(void 0!==(i=s[n=(e=t[c]).getID()])){var h=a[i];h&&(h._setPoint(e._point),h._setPrevPoint(e._prevPoint),r.push(h),delete s[n],delete o[n],this._touchCount--,this._indexBitsUsed&=~(1<<i))}return r},getGlobalTouchCount:function(){return this._touchCount},getGlobalTouches:function(){return this._touchesCache},getPreTouch:function(t){for(var e=null,i=this._preTouchPool,n=t.getID(),r=i.length-1;r>=0;r--)if(i[r].getID()===n){e=i[r];break}return e||(e=t),e},setPreTouch:function(t){for(var e=!1,i=this._preTouchPool,n=t.getID(),r=i.length-1;r>=0;r--)if(i[r].getID()===n){i[r]=t,e=!0;break}e||(i.length<=50?i.push(t):(i[this._preTouchPoolPointer]=t,this._preTouchPoolPointer=(this._preTouchPoolPointer+1)%50))},getTouchByXY:function(t,e,i){var n=this._preTouchPoint,r=this._glView.convertToLocationInView(t,e,i),a=new cc.Touch(r.x,r.y,0);return a._setPrevPoint(n.x,n.y),n.x=r.x,n.y=r.y,a},getMouseEvent:function(t,e,i){var n=this._prevMousePoint,r=new cc.Event.EventMouse(i);return r._setPrevCursor(n.x,n.y),n.x=t.x,n.y=t.y,this._glView._convertMouseToLocationInView(n,e),r.setLocation(n.x,n.y),r},getPointByEvent:function(t,e){return cc.sys.browserType!==cc.sys.BROWSER_TYPE_QQ&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_UC&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_SAFARI||this._updateCanvasBoundingRect(),null!=t.pageX?{x:t.pageX,y:t.pageY}:(e.left-=document.body.scrollLeft,e.top-=document.body.scrollTop,{x:t.clientX,y:t.clientY})},getTouchesByEvent:function(t,e){for(var i,r,s,o=[],c=this._glView,l=this._preTouchPoint,h=t.changedTouches.length,u=0;u<h;u++)if(i=t.changedTouches[u]){var f;f=n.BROWSER_TYPE_FIREFOX===n.browserType?c.convertToLocationInView(i.pageX,i.pageY,e,a):c.convertToLocationInView(i.clientX,i.clientY,e,a),null!=i.identifier?(r=new cc.Touch(f.x,f.y,i.identifier),s=this.getPreTouch(r).getLocation(),r._setPrevPoint(s.x,s.y),this.setPreTouch(r)):(r=new cc.Touch(f.x,f.y))._setPrevPoint(l.x,l.y),l.x=f.x,l.y=f.y,o.push(r)}return o},registerSystemEvent:function(t){if(!this._isRegisterEvent){this._glView=cc.view;var e=this,i=this._canvasBoundingRect;window.addEventListener("resize",this._updateCanvasBoundingRect.bind(this));var a=n.isMobile,s="mouse"in n.capabilities,o="touches"in n.capabilities;if(s){a||(window.addEventListener("mousedown",(function(){e._mousePressed=!0}),!1),window.addEventListener("mouseup",(function(t){if(e._mousePressed){e._mousePressed=!1;var n=e.getPointByEvent(t,i);if(!cc.rect(i.left,i.top,i.width,i.height).contains(n)){e.handleTouchesEnd([e.getTouchByXY(n.x,n.y,i)]);var a=e.getMouseEvent(n,i,cc.Event.EventMouse.UP);a.setButton(t.button),r.dispatchEvent(a)}}}),!1));for(var c=cc.Event.EventMouse,l=[!a&&["mousedown",c.DOWN,function(i,n,r,a){e._mousePressed=!0,e.handleTouchesBegin([e.getTouchByXY(r.x,r.y,a)]),t.focus()}],!a&&["mouseup",c.UP,function(t,i,n,r){e._mousePressed=!1,e.handleTouchesEnd([e.getTouchByXY(n.x,n.y,r)])}],!a&&["mousemove",c.MOVE,function(t,i,n,r){e.handleTouchesMove([e.getTouchByXY(n.x,n.y,r)]),e._mousePressed||i.setButton(null)}],["mousewheel",c.SCROLL,function(t,e){e.setScrollData(0,t.wheelDelta)}],["DOMMouseScroll",c.SCROLL,function(t,e){e.setScrollData(0,-120*t.detail)}]],h=function(){var n=l[u];if(n){var a=n[0],s=n[1],o=n[2];t.addEventListener(a,(function(t){var n=e.getPointByEvent(t,i),a=e.getMouseEvent(n,i,s),l=t.button;s===c.MOVE&&(1&t.buttons?l=c.BUTTON_LEFT:2&t.buttons?l=c.BUTTON_RIGHT:4&t.buttons&&(l=c.BUTTON_MIDDLE)),a.setButton(l),o(t,a,n,i),r.dispatchEvent(a),t.stopPropagation(),t.preventDefault()}),!1)}},u=0;u<l.length;++u)h()}if(window.navigator.msPointerEnabled){var f={MSPointerDown:e.handleTouchesBegin,MSPointerMove:e.handleTouchesMove,MSPointerUp:e.handleTouchesEnd,MSPointerCancel:e.handleTouchesCancel},_=function(){var n=f[d];t.addEventListener(d,(function(t){var r=document.documentElement;i.adjustedLeft=i.left-r.scrollLeft,i.adjustedTop=i.top-r.scrollTop,n.call(e,[e.getTouchByXY(t.clientX,t.clientY,i)]),t.stopPropagation()}),!1)};for(var d in f)_()}if(o){var p={touchstart:function(i){e.handleTouchesBegin(i),t.focus()},touchmove:function(t){e.handleTouchesMove(t)},touchend:function(t){e.handleTouchesEnd(t)},touchcancel:function(t){e.handleTouchesCancel(t)}},m=function(n){var r=p[n];t.addEventListener(n,(function(t){if(t.changedTouches){var n=document.body;i.adjustedLeft=i.left-(n.scrollLeft||window.scrollX||0),i.adjustedTop=i.top-(n.scrollTop||window.scrollY||0),r(e.getTouchesByEvent(t,i)),t.stopPropagation(),t.preventDefault()}}),!1)};for(var v in p)m(v)}this._registerKeyboardEvent(),this._isRegisterEvent=!0}},_registerKeyboardEvent:function(){},_registerAccelerometerEvent:function(){},update:function(t){this._accelCurTime>this._accelInterval&&(this._accelCurTime-=this._accelInterval,r.dispatchEvent(new cc.Event.EventAcceleration(this._acceleration))),this._accelCurTime+=t}};e.exports=cc.internal.inputManager=s}),{"../event-manager":139,"./CCMacro":173,"./CCSys":177}],173:[(function(t,e){"use strict";cc.macro={RAD:Math.PI/180,DEG:180/Math.PI,REPEAT_FOREVER:Number.MAX_VALUE-1,FLT_EPSILON:1.192092896e-7,MIN_ZINDEX:-Math.pow(2,15),MAX_ZINDEX:Math.pow(2,15)-1,ONE:1,ZERO:0,SRC_ALPHA:770,SRC_ALPHA_SATURATE:776,SRC_COLOR:768,DST_ALPHA:772,DST_COLOR:774,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_COLOR:769,ONE_MINUS_DST_ALPHA:773,ONE_MINUS_DST_COLOR:775,ONE_MINUS_CONSTANT_ALPHA:32772,ONE_MINUS_CONSTANT_COLOR:32770,ORIENTATION_PORTRAIT:1,ORIENTATION_LANDSCAPE:2,ORIENTATION_AUTO:3,DENSITYDPI_DEVICE:"device-dpi",DENSITYDPI_HIGH:"high-dpi",DENSITYDPI_MEDIUM:"medium-dpi",DENSITYDPI_LOW:"low-dpi",FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX:!0,DIRECTOR_STATS_POSITION:cc.v2(0,0),ENABLE_STACKABLE_ACTIONS:!0,TOUCH_TIMEOUT:5e3,BATCH_VERTEX_COUNT:2e4,ENABLE_TILEDMAP_CULLING:!0,ENABLE_TRANSPARENT_CANVAS:!1,ENABLE_WEBGL_ANTIALIAS:!1,ENABLE_CULLING:!1,CLEANUP_IMAGE_CACHE:!1,SHOW_MESH_WIREFRAME:!1,SHOW_MESH_NORMAL:!1,ENABLE_MULTI_TOUCH:!0,ALLOW_IMAGE_BITMAP:!cc.sys.isMobile,ENABLE_NATIVE_TTF_RENDERER:!0},Object.defineProperty(cc.macro,"ROTATE_ACTION_CCW",{set:function(t){cc.RotateTo&&cc.RotateBy&&(cc.RotateTo._reverse=cc.RotateBy._reverse=t)}}),cc.macro.SUPPORT_TEXTURE_FORMATS=[".astc",".pkm",".pvr",".webp",".jpg",".jpeg",".bmp",".png"],cc.macro.KEY={none:0,back:6,menu:18,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pause:19,capslock:20,escape:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,select:41,insert:45,Delete:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,num0:96,num1:97,num2:98,num3:99,num4:100,num5:101,num6:102,num7:103,num8:104,num9:105,"*":106,"+":107,"-":109,numdel:110,"/":111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,";":186,semicolon:186,equal:187,"=":187,",":188,comma:188,dash:189,".":190,period:190,forwardslash:191,grave:192,"[":219,openbracket:219,backslash:220,"]":221,closebracket:221,quote:222,dpadLeft:1e3,dpadRight:1001,dpadUp:1003,dpadDown:1004,dpadCenter:1005},cc.macro.ImageFormat=cc.Enum({JPG:0,PNG:1,TIFF:2,WEBP:3,PVR:4,ETC:5,S3TC:6,ATITC:7,TGA:8,RAWDATA:9,UNKNOWN:10}),cc.macro.BlendFactor=cc.Enum({ONE:1,ZERO:0,SRC_ALPHA:770,SRC_COLOR:768,DST_ALPHA:772,DST_COLOR:774,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_COLOR:769,ONE_MINUS_DST_ALPHA:773,ONE_MINUS_DST_COLOR:775}),cc.macro.TextAlignment=cc.Enum({LEFT:0,CENTER:1,RIGHT:2}),cc.macro.VerticalTextAlignment=cc.Enum({TOP:0,CENTER:1,BOTTOM:2}),e.exports=cc.macro}),{}],174:[(function(t,e){"use strict";var i=t("./js"),n=t("./CCClass"),r=1;function a(){this._name="",this._objFlags=0}n.fastDefine("cc.Object",a,{_name:"",_objFlags:0}),i.value(a,"Flags",{Destroyed:r,DontSave:8,EditorOnly:16,Dirty:32,DontDestroy:64,PersistentMask:-4192741,Destroying:128,Deactivating:256,LockedInEditor:512,HideInHierarchy:1024,IsPreloadStarted:8192,IsOnLoadStarted:32768,IsOnLoadCalled:16384,IsOnEnableCalled:2048,IsStartCalled:65536,IsEditorOnEnableCalled:4096,IsPositionLocked:1<<21,IsRotationLocked:1<<17,IsScaleLocked:1<<18,IsAnchorLocked:1<<19,IsSizeLocked:1<<20});var s=[];i.value(a,"_deferredDestroy",(function(){for(var t=s.length,e=0;e<t;++e){var i=s[e];i._objFlags&r||i._destroyImmediate()}t===s.length?s.length=0:s.splice(0,t)}));var o=a.prototype;function c(t,e){var i,n=t instanceof cc._BaseNode||t instanceof cc.Component,r=n?"_id":null,a={};for(i in t)if(t.hasOwnProperty(i)){if(i===r)continue;switch(typeof t[i]){case"string":a[i]="";break;case"object":case"function":a[i]=null}}if(cc.Class._isCCClass(e))for(var s=cc.Class.Attr.getClassAttrs(e),o=e.__props__,c=0;c<o.length;c++){var l=(i=o[c])+cc.Class.Attr.DELIMETER+"default";if(l in s){if(n&&"_id"===i)continue;switch(typeof s[l]){case"string":a[i]="";break;case"object":case"function":a[i]=null;break;case"undefined":a[i]=void 0}}}return function(t){for(var e in a)t[e]=a[e]}}i.getset(o,"name",(function(){return this._name}),(function(t){this._name=t}),!0),i.get(o,"isValid",(function(){return!(this._objFlags&r)}),!0),o.destroy=function(){return this._objFlags&r?(cc.warnID(5e3),!1):!(4&this._objFlags||(this._objFlags|=4,s.push(this),0))},o._destruct=function(){var t=this.constructor,e=t.__destruct__;e||(e=c(this,t),i.value(t,"__destruct__",e,!0)),e(this)},o._onPreDestroy=null,o._destroyImmediate=function(){this._objFlags&r?cc.errorID(5e3):(this._onPreDestroy&&this._onPreDestroy(),this._destruct(),this._objFlags|=r)},o._deserialize=null,cc.isValid=function(t,e){return"object"==typeof t?!(!t||t._objFlags&(e?4|r:r)):void 0!==t},cc.Object=e.exports=a}),{"./CCClass":168,"./js":189}],175:[(function(t,e){"use strict";var i=t("../platform/js");cc.SAXParser=function(){window.DOMParser?(this._isSupportDOMParser=!0,this._parser=new DOMParser):(this._isSupportDOMParser=!1,this._parser=null)},cc.SAXParser.prototype={constructor:cc.SAXParser,parse:function(t){return this._parseXML(t)},_parseXML:function(t){var e;return this._isSupportDOMParser?e=this._parser.parseFromString(t,"text/xml"):((e=new ActiveXObject("Microsoft.XMLDOM")).async="false",e.loadXML(t)),e}},cc.PlistParser=function(){cc.SAXParser.call(this)},i.extend(cc.PlistParser,cc.SAXParser),i.mixin(cc.PlistParser.prototype,{parse:function(t){var e=this._parseXML(t),i=e.documentElement;if("plist"!==i.tagName)return cc.warnID(5100),{};for(var n=null,r=0,a=i.childNodes.length;r<a&&1!==(n=i.childNodes[r]).nodeType;r++);return e=null,this._parseNode(n)},_parseNode:function(t){var e=null,i=t.tagName;if("dict"===i)e=this._parseDict(t);else if("array"===i)e=this._parseArray(t);else if("string"===i)if(1===t.childNodes.length)e=t.firstChild.nodeValue;else{e="";for(var n=0;n<t.childNodes.length;n++)e+=t.childNodes[n].nodeValue}else"false"===i?e=!1:"true"===i?e=!0:"real"===i?e=parseFloat(t.firstChild.nodeValue):"integer"===i&&(e=parseInt(t.firstChild.nodeValue,10));return e},_parseArray:function(t){for(var e=[],i=0,n=t.childNodes.length;i<n;i++){var r=t.childNodes[i];1===r.nodeType&&e.push(this._parseNode(r))}return e},_parseDict:function(t){for(var e={},i=null,n=0,r=t.childNodes.length;n<r;n++){var a=t.childNodes[n];1===a.nodeType&&("key"===a.tagName?i=a.firstChild.nodeValue:e[i]=this._parseNode(a))}return e}}),cc.saxParser=new cc.SAXParser,cc.plistParser=new cc.PlistParser,e.exports={saxParser:cc.saxParser,plistParser:cc.plistParser}}),{"../platform/js":189}],176:[(function(){"use strict";cc.screen={_supportsFullScreen:!1,_onfullscreenchange:null,_onfullscreenerror:null,_preOnFullScreenChange:null,_preOnFullScreenError:null,_preOnTouch:null,_touchEvent:"",_fn:null,_fnMap:[["requestFullscreen","exitFullscreen","fullscreenchange","fullscreenEnabled","fullscreenElement","fullscreenerror"],["requestFullScreen","exitFullScreen","fullScreenchange","fullScreenEnabled","fullScreenElement","fullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange","webkitIsFullScreen","webkitCurrentFullScreenElement","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozFullScreen","mozFullScreenElement","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","MSFullscreenChange","msFullscreenEnabled","msFullscreenElement","msfullscreenerror"]],init:function(){this._fn={};var t,e,i,n,r=this._fnMap;for(t=0,e=r.length;t<e;t++)if((i=r[t])&&void 0!==document[i[1]]){for(t=0,n=i.length;t<n;t++)this._fn[r[0][t]]=i[t];break}this._supportsFullScreen=void 0!==this._fn.requestFullscreen,this._touchEvent="ontouchend"in window?"touchend":"mousedown"},fullScreen:function(){return!!this._supportsFullScreen&&!!(document[this._fn.fullscreenElement]||document[this._fn.webkitFullscreenElement]||document[this._fn.mozFullScreenElement])},requestFullScreen:function(t,e,i){if(t&&"video"===t.tagName.toLowerCase()){if(cc.sys.os===cc.sys.OS_IOS&&cc.sys.isBrowser&&t.readyState>0)return void(t.webkitEnterFullscreen&&t.webkitEnterFullscreen());t.setAttribute("x5-video-player-fullscreen","true")}if(this._supportsFullScreen){if(t=t||document.documentElement,e){var n=this._fn.fullscreenchange;this._onfullscreenchange&&document.removeEventListener(n,this._onfullscreenchange),this._onfullscreenchange=e,document.addEventListener(n,e,!1)}if(i){var r=this._fn.fullscreenerror;this._onfullscreenerror&&document.removeEventListener(r,this._onfullscreenerror),this._onfullscreenerror=i,document.addEventListener(r,i,{once:!0})}var a=t[this._fn.requestFullscreen]();void 0===document[this._fn.fullscreenerror]&&window.Promise&&a instanceof Promise&&a.catch((function(){}))}},exitFullScreen:function(t){if(t&&"video"===t.tagName.toLowerCase()){if(cc.sys.os===cc.sys.OS_IOS&&cc.sys.isBrowser)return void(t.webkitExitFullscreen&&t.webkitExitFullscreen());t.setAttribute("x5-video-player-fullscreen","false")}return!this._supportsFullScreen||document[this._fn.exitFullscreen]()},autoFullScreen:function(t,e){t=t||document.body,this._ensureFullScreen(t,e),this.requestFullScreen(t,e)},disableAutoFullScreen:function(t){var e=cc.game.canvas||t,i=this._touchEvent;this._preOnTouch&&(e.removeEventListener(i,this._preOnTouch),this._preOnTouch=null)},_ensureFullScreen:function(t,e){var i=this,n=cc.game.canvas||t,r=this._fn.fullscreenerror,a=this._touchEvent;function s(){i._preOnFullScreenError=null,i._preOnTouch&&n.removeEventListener(a,i._preOnTouch),i._preOnTouch=function(){i._preOnTouch=null,i.requestFullScreen(t,e)},n.addEventListener(a,i._preOnTouch,{once:!0})}this._preOnFullScreenError&&t.removeEventListener(r,this._preOnFullScreenError),this._preOnFullScreenError=s,t.addEventListener(r,s,{once:!0})}},cc.screen.init()}),{}],177:[(function(t,e){"use strict";window._CCSettings&&_CCSettings.platform;var i="undefined"==typeof window?global:window,n=cc&&cc.sys?cc.sys:(function(){cc.sys={};var t,e,n=cc.sys;if(n.LANGUAGE_ENGLISH="en",n.LANGUAGE_CHINESE="zh",n.LANGUAGE_FRENCH="fr",n.LANGUAGE_ITALIAN="it",n.LANGUAGE_GERMAN="de",n.LANGUAGE_SPANISH="es",n.LANGUAGE_DUTCH="du",n.LANGUAGE_RUSSIAN="ru",n.LANGUAGE_KOREAN="ko",n.LANGUAGE_JAPANESE="ja",n.LANGUAGE_HUNGARIAN="hu",n.LANGUAGE_PORTUGUESE="pt",n.LANGUAGE_ARABIC="ar",n.LANGUAGE_NORWEGIAN="no",n.LANGUAGE_POLISH="pl",n.LANGUAGE_TURKISH="tr",n.LANGUAGE_UKRAINIAN="uk",n.LANGUAGE_ROMANIAN="ro",n.LANGUAGE_BULGARIAN="bg",n.LANGUAGE_UNKNOWN="unknown",n.OS_OPENHARMONY="OpenHarmony",n.OS_IOS="iOS",n.OS_ANDROID="Android",n.OS_WINDOWS="Windows",n.OS_MARMALADE="Marmalade",n.OS_LINUX="Linux",n.OS_BADA="Bada",n.OS_BLACKBERRY="Blackberry",n.OS_OSX="OS X",n.OS_WP8="WP8",n.OS_WINRT="WINRT",n.OS_UNKNOWN="Unknown",n.UNKNOWN=-1,n.WIN32=0,n.LINUX=1,n.MACOS=2,n.ANDROID=3,n.IPHONE=4,n.IPAD=5,n.BLACKBERRY=6,n.NACL=7,n.EMSCRIPTEN=8,n.TIZEN=9,n.WINRT=10,n.WP8=11,n.OPENHARMONY=12,n.MOBILE_BROWSER=100,n.DESKTOP_BROWSER=101,n.EDITOR_PAGE=102,n.EDITOR_CORE=103,n.WECHAT_GAME=104,n.QQ_PLAY=105,n.FB_PLAYABLE_ADS=106,n.BAIDU_GAME=107,n.VIVO_GAME=108,n.OPPO_GAME=109,n.HUAWEI_GAME=110,n.XIAOMI_GAME=111,n.JKW_GAME=112,n.ALIPAY_GAME=113,n.WECHAT_GAME_SUB=114,n.BAIDU_GAME_SUB=115,n.QTT_GAME=116,n.BYTEDANCE_GAME=117,n.BYTEDANCE_GAME_SUB=118,n.LINKSURE=119,n.TAOBAO=120,n.TAOBAO_MINIGAME=121,n.MIGU_MINIGAME=122,n.HONOR_MINIGAME=123,n.BROWSER_TYPE_WECHAT="wechat",n.BROWSER_TYPE_ANDROID="androidbrowser",n.BROWSER_TYPE_IE="ie",n.BROWSER_TYPE_EDGE="edge",n.BROWSER_TYPE_QQ="qqbrowser",n.BROWSER_TYPE_MOBILE_QQ="mqqbrowser",n.BROWSER_TYPE_UC="ucbrowser",n.BROWSER_TYPE_UCBS="ucbs",n.BROWSER_TYPE_360="360browser",n.BROWSER_TYPE_BAIDU_APP="baiduboxapp",n.BROWSER_TYPE_BAIDU="baidubrowser",n.BROWSER_TYPE_MAXTHON="maxthon",n.BROWSER_TYPE_OPERA="opera",n.BROWSER_TYPE_OUPENG="oupeng",n.BROWSER_TYPE_MIUI="miuibrowser",n.BROWSER_TYPE_FIREFOX="firefox",n.BROWSER_TYPE_SAFARI="safari",n.BROWSER_TYPE_CHROME="chrome",n.BROWSER_TYPE_LIEBAO="liebao",n.BROWSER_TYPE_QZONE="qzone",n.BROWSER_TYPE_SOUGOU="sogou",n.BROWSER_TYPE_HUAWEI="huawei",n.BROWSER_TYPE_UNKNOWN="unknown",n.isNative=!1,n.isBrowser="object"==typeof window&&"object"==typeof document&&!0,n.glExtension=function(t){return!!cc.renderer.device.ext(t)},n.getMaxJointMatrixSize=function(){if(!n._maxJointMatrixSize){var t=cc.game._renderContext,e=Math.floor(t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS)/4)-10;n._maxJointMatrixSize=e<50?0:50}return n._maxJointMatrixSize},n.getSafeAreaRect=function(){var t=cc.view.getVisibleSize();return cc.rect(0,0,t.width,t.height)},i.__globalAdapter&&i.__globalAdapter.adaptSys)i.__globalAdapter.adaptSys(n);else{var r=window,a=r.navigator,s=document,o=s.documentElement,c=a.userAgent.toLowerCase(),l=a.language;l=l||a.browserLanguage,n.languageCode=l.toLowerCase(),l=l?l.split("-")[0]:n.LANGUAGE_ENGLISH,n.language=l;var h=!1,u=!1,f="",_=0,d=/android\s*(\d+(?:\.\d+)*)/i.exec(c)||/android\s*(\d+(?:\.\d+)*)/i.exec(a.platform);d&&(h=!0,f=d[1]||"",_=parseInt(f)||0),(d=/(iPad|iPhone|iPod).*OS ((\d+_?){2,3})/i.exec(c))?(u=!0,f=d[2]||"",_=parseInt(f)||0):(/(iPhone|iPad|iPod)/.exec(a.platform)||/iphone|ipad|ipod/.test(c)||("MacIntel"===a.platform||/mac os/.test(c))&&a.maxTouchPoints&&a.maxTouchPoints>2)&&(u=!0,f="",_=0);var p=n.OS_UNKNOWN;-1!==a.appVersion.indexOf("Win")?p=n.OS_WINDOWS:u?p=n.OS_IOS:-1!==a.appVersion.indexOf("Mac")?p=n.OS_OSX:-1!==a.appVersion.indexOf("X11")&&-1===a.appVersion.indexOf("Linux")?p=n.OS_UNIX:h?p=n.OS_ANDROID:-1===a.appVersion.indexOf("Linux")&&-1===c.indexOf("ubuntu")||(p=n.OS_LINUX),n.os=p,n.osVersion=f,n.osMainVersion=_,n.isMobile=u||/mobile|android|iphone|ipad/.test(c),"undefined"!=typeof FbPlayableAd?n.platform=n.FB_PLAYABLE_ADS:n.platform=n.isMobile?n.MOBILE_BROWSER:n.DESKTOP_BROWSER,n.browserType=n.BROWSER_TYPE_UNKNOWN,(function(){var t=/mqqbrowser|micromessenger|qqbrowser|sogou|qzone|liebao|maxthon|ucbs|360 aphone|360browser|baiduboxapp|baidubrowser|maxthon|mxbrowser|miuibrowser/i.exec(c)||/qq|ucbrowser|ubrowser|edge|HuaweiBrowser/i.exec(c)||/chrome|safari|firefox|trident|opera|opr\/|oupeng/i.exec(c),e=t?t[0].toLowerCase():n.BROWSER_TYPE_UNKNOWN;"safari"===e&&h?e=n.BROWSER_TYPE_ANDROID:"qq"===e&&c.match(/android.*applewebkit/i)&&(e=n.BROWSER_TYPE_ANDROID);var i={micromessenger:n.BROWSER_TYPE_WECHAT,trident:n.BROWSER_TYPE_IE,edge:n.BROWSER_TYPE_EDGE,"360 aphone":n.BROWSER_TYPE_360,mxbrowser:n.BROWSER_TYPE_MAXTHON,"opr/":n.BROWSER_TYPE_OPERA,ubrowser:n.BROWSER_TYPE_UC,huaweibrowser:n.BROWSER_TYPE_HUAWEI};"qqbrowser"!==e&&"mqqbrowser"!==e||c.match(/wechat|micromessenger/i)&&(e=n.BROWSER_TYPE_WECHAT),n.browserType=i[e]||e})(),n.browserVersion="",(e=c.match(/(mqqbrowser|micromessenger|qqbrowser|sogou|qzone|liebao|maxthon|uc|ucbs|360 aphone|360|baiduboxapp|baidu|maxthon|mxbrowser|miui(?:.hybrid)?)(mobile)?(browser)?\/?([\d.]+)/i))||(e=c.match(/(qq|chrome|safari|firefox|trident|opera|opr\/|oupeng)(mobile)?(browser)?\/?([\d.]+)/i)),n.browserVersion=e?e[4]:"";var m=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,g=window.devicePixelRatio||1;n.windowPixelResolution={width:g*m,height:g*v},n._checkWebGLRenderMode=function(){if(cc.game.renderType!==cc.game.RENDER_TYPE_WEBGL)throw new Error("This feature supports WebGL render mode only.")};var y=document.createElement("canvas");try{var T=n.localStorage=r.localStorage;T.setItem("storage",""),T.removeItem("storage"),T=null}catch(D){var A=function(){cc.warnID(5200)};n.localStorage={getItem:A,setItem:A,removeItem:A,clear:A}}var b=y.toDataURL("image/webp").startsWith("data:image/webp"),E=!!y.getContext("2d"),C=!1;r.WebGLRenderingContext&&(C=!0);var x,S=n.capabilities={canvas:E,opengl:C,webp:b,imageBitmap:!1};"undefined"!=typeof createImageBitmap&&"undefined"!=typeof Blob&&(y.width=y.height=2,createImageBitmap(y,{}).then((function(t){S.imageBitmap=!0,t.close&&t.close()})).catch((function(){}))),(void 0!==o.ontouchstart||void 0!==s.ontouchstart||a.msPointerEnabled||"string"==typeof __wxjs_environment&&"miniprogram"===__wxjs_environment)&&(S.touches=!0),void 0!==o.onmouseup&&(S.mouse=!0),void 0!==o.onkeyup&&(S.keyboard=!0),(r.DeviceMotionEvent||r.DeviceOrientationEvent)&&(S.accelerometer=!0),(function(){n.browserVersion;var t=!!(window.AudioContext||window.webkitAudioContext||window.mozAudioContext);x={ONLY_ONE:!1,WEB_AUDIO:t,DELAY_CREATE_CTX:!1},n.os===n.OS_IOS&&(x.USE_LOADER_EVENT="loadedmetadata"),n.browserType===n.BROWSER_TYPE_FIREFOX&&(x.DELAY_CREATE_CTX=!0,x.USE_LOADER_EVENT="canplay"),n.os===n.OS_ANDROID&&n.browserType===n.BROWSER_TYPE_UC&&(x.ONE_SOURCE=!0)})();try{x.WEB_AUDIO&&(x.context=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext),x.DELAY_CREATE_CTX&&setTimeout((function(){x.context=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext)}),0))}catch(M){x.WEB_AUDIO=!1,cc.logID(5201)}var w=[];(t=document.createElement("audio")).canPlayType&&(t.canPlayType('audio/ogg; codecs="vorbis"')&&w.push(".ogg"),t.canPlayType("audio/mpeg")&&w.push(".mp3"),t.canPlayType('audio/wav; codecs="1"')&&w.push(".wav"),t.canPlayType("audio/mp4")&&w.push(".mp4"),t.canPlayType("audio/x-m4a")&&w.push(".m4a")),x.format=w,n.__audioSupport=x}return n.NetworkType={NONE:0,LAN:1,WWAN:2},n.getNetworkType=function(){return n.NetworkType.LAN},n.getBatteryLevel=function(){return 1},n.garbageCollect=function(){},n.restartVM=function(){},n.isObjectValid=function(t){return!!t},n.dump=function(){var t="";t+="isMobile : "+this.isMobile+"\r\n",t+="language : "+this.language+"\r\n",t+="browserType : "+this.browserType+"\r\n",t+="browserVersion : "+this.browserVersion+"\r\n",t+="capabilities : "+JSON.stringify(this.capabilities)+"\r\n",t+="os : "+this.os+"\r\n",t+="osVersion : "+this.osVersion+"\r\n",t+="platform : "+this.platform+"\r\n",t+="Using "+(cc.game.renderType===cc.game.RENDER_TYPE_WEBGL?"WEBGL":"CANVAS")+" renderer.\r\n",cc.log(t)},n.openURL=function(t){window.open(t)},n.now=function(){return Date.now?Date.now():+new Date},n})();e.exports=n}),{}],178:[(function(t,e){"use strict";var i=t("../event/event-target"),n=t("../platform/js"),r=t("../renderer");t("../platform/CCClass");var a={init:function(){this.html=document.getElementsByTagName("html")[0]},availWidth:function(t){return t&&t!==this.html?t.clientWidth:window.innerWidth},availHeight:function(t){return t&&t!==this.html?t.clientHeight:window.innerHeight},meta:{width:"device-width"},adaptationType:cc.sys.browserType};switch(cc.sys.os===cc.sys.OS_IOS&&(a.adaptationType=cc.sys.BROWSER_TYPE_SAFARI),a.adaptationType){case cc.sys.BROWSER_TYPE_SAFARI:case cc.sys.BROWSER_TYPE_SOUGOU:case cc.sys.BROWSER_TYPE_UC:a.meta["minimal-ui"]="true",a.availWidth=function(t){return t.clientWidth},a.availHeight=function(t){return t.clientHeight}}var s=null,o=function(){i.call(this);var t=this,e=cc.ContainerStrategy,n=cc.ContentStrategy;a.init(this),t._frameSize=cc.size(0,0),t._designResolutionSize=cc.size(0,0),t._originalDesignResolutionSize=cc.size(0,0),t._scaleX=1,t._scaleY=1,t._viewportRect=cc.rect(0,0,0,0),t._visibleRect=cc.rect(0,0,0,0),t._autoFullScreen=!1,t._devicePixelRatio=1,t._maxPixelRatio=2,t._retinaEnabled=!1,t._resizeCallback=null,t._resizing=!1,t._resizeWithBrowserSize=!1,t._orientationChanging=!0,t._isRotated=!1,t._orientation=cc.macro.ORIENTATION_AUTO,t._isAdjustViewport=!0,t._antiAliasEnabled=!1,t._resolutionPolicy=null,t._rpExactFit=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,n.EXACT_FIT),t._rpShowAll=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,n.SHOW_ALL),t._rpNoBorder=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,n.NO_BORDER),t._rpFixedHeight=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,n.FIXED_HEIGHT),t._rpFixedWidth=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,n.FIXED_WIDTH),cc.game.once(cc.game.EVENT_ENGINE_INITED,this.init,this)};cc.js.extend(o,i),cc.js.mixin(o.prototype,{init:function(){this._initFrameSize();var t=cc.game.canvas.width,e=cc.game.canvas.height;this._designResolutionSize.width=t,this._designResolutionSize.height=e,this._originalDesignResolutionSize.width=t,this._originalDesignResolutionSize.height=e,this._viewportRect.width=t,this._viewportRect.height=e,this._visibleRect.width=t,this._visibleRect.height=e,cc.winSize.width=this._visibleRect.width,cc.winSize.height=this._visibleRect.height,cc.visibleRect&&cc.visibleRect.init(this._visibleRect)},_resizeEvent:function(t){var e;e=this.setDesignResolutionSize?this:cc.view;var i=cc.sys;if(i.browserType!==i.BROWSER_TYPE_UC||i.os!==i.OS_IOS){var n=e._frameSize.width,r=e._frameSize.height,a=e._isRotated;if(cc.sys.isMobile){var s=cc.game.container.style,o=s.margin;s.margin="0",s.display="none",e._initFrameSize(),s.margin=o,s.display="block"}else e._initFrameSize();if(!0===t||e._isRotated!==a||e._frameSize.width!==n||e._frameSize.height!==r){var c=e._originalDesignResolutionSize.width,l=e._originalDesignResolutionSize.height;e._resizing=!0,c>0&&e.setDesignResolutionSize(c,l,e._resolutionPolicy),e._resizing=!1,e.emit("canvas-resize"),e._resizeCallback&&e._resizeCallback.call()}}else setTimeout((function(){e._resizeEvent(t)}),0)},_orientationChange:function(){cc.view._orientationChanging=!0,cc.view._resizeEvent(!0),cc.sys.browserType===cc.sys.BROWSER_TYPE_SAFARI&&cc.sys.isMobile&&setTimeout((function(){window.innerHeight>window.innerWidth&&window.scrollTo(0,1)}),500)},_resize:function(){cc.view._resizeEvent(!1)},resizeWithBrowserSize:function(t){t?this._resizeWithBrowserSize||(this._resizeWithBrowserSize=!0,window.addEventListener("resize",this._resize),window.addEventListener("orientationchange",this._orientationChange)):this._resizeWithBrowserSize&&(this._resizeWithBrowserSize=!1,window.removeEventListener("resize",this._resize),window.removeEventListener("orientationchange",this._orientationChange))},setResizeCallback:function(t){"function"!=typeof t&&null!=t||(this._resizeCallback=t)},setOrientation:function(t){if((t&=cc.macro.ORIENTATION_AUTO)&&this._orientation!==t){this._orientation=t;var e=this._originalDesignResolutionSize.width,i=this._originalDesignResolutionSize.height;this.setDesignResolutionSize(e,i,this._resolutionPolicy)}},_initFrameSize:function(){var t=this._frameSize,e=a.availWidth(cc.game.frame),i=a.availHeight(cc.game.frame),n=e>=i;!cc.sys.isMobile||n&&this._orientation&cc.macro.ORIENTATION_LANDSCAPE||!n&&this._orientation&cc.macro.ORIENTATION_PORTRAIT?(t.width=e,t.height=i,cc.game.container.style["-webkit-transform"]="rotate(0deg)",cc.game.container.style.transform="rotate(0deg)",this._isRotated=!1):(t.width=i,t.height=e,cc.game.container.style["-webkit-transform"]="rotate(90deg)",cc.game.container.style.transform="rotate(90deg)",cc.game.container.style["-webkit-transform-origin"]="0px 0px 0px",cc.game.container.style.transformOrigin="0px 0px 0px",this._isRotated=!0),this._orientationChanging&&setTimeout((function(){cc.view._orientationChanging=!1}),1e3)},_setViewportMeta:function(t,e){var i=document.getElementById("cocosMetaElement");i&&e&&document.head.removeChild(i);var n,r,a,s=document.getElementsByName("viewport"),o=s?s[0]:null;for(r in n=o?o.content:"",(i=i||document.createElement("meta")).id="cocosMetaElement",i.name="viewport",i.content="",t)-1==n.indexOf(r)?n+=","+r+"="+t[r]:e&&(a=new RegExp(r+"s*=s*[^,]+"),n=n.replace(a,r+"="+t[r]));/^,/.test(n)&&(n=n.substr(1)),i.content=n,o&&(o.content=n),document.head.appendChild(i)},_adjustViewportMeta:function(){this._isAdjustViewport&&(this._setViewportMeta(a.meta,!1),this._isAdjustViewport=!1)},adjustViewportMeta:function(t){this._isAdjustViewport=t},enableRetina:function(t){this._retinaEnabled=!!t},isRetinaEnabled:function(){return this._retinaEnabled},enableAntiAlias:function(t){if(cc.warnID(9200),this._antiAliasEnabled!==t)if(this._antiAliasEnabled=t,cc.game.renderType===cc.game.RENDER_TYPE_WEBGL)cc.assetManager.assets.forEach((function(e){if(e instanceof cc.Texture2D){var i=cc.Texture2D.Filter;t?e.setFilters(i.LINEAR,i.LINEAR):e.setFilters(i.NEAREST,i.NEAREST)}}));else if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS){var e=cc.game.canvas.getContext("2d");e.imageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t}},isAntiAliasEnabled:function(){return this._antiAliasEnabled},enableAutoFullScreen:function(t){t&&t!==this._autoFullScreen&&cc.sys.isMobile?(this._autoFullScreen=!0,cc.screen.autoFullScreen(cc.game.frame)):(this._autoFullScreen=!1,cc.screen.disableAutoFullScreen(cc.game.frame))},isAutoFullScreenEnabled:function(){return this._autoFullScreen},setCanvasSize:function(t,e){var i=cc.game.canvas,n=cc.game.container;i.width=t*this._devicePixelRatio,i.height=e*this._devicePixelRatio,i.style.width=t+"px",i.style.height=e+"px",n.style.width=t+"px",n.style.height=e+"px",this._resizeEvent()},getCanvasSize:function(){return cc.size(cc.game.canvas.width,cc.game.canvas.height)},getFrameSize:function(){return cc.size(this._frameSize.width,this._frameSize.height)},setFrameSize:function(t,e){this._frameSize.width=t,this._frameSize.height=e,cc.game.frame.style.width=t+"px",cc.game.frame.style.height=e+"px",this._resizeEvent(!0)},getVisibleSize:function(){return cc.size(this._visibleRect.width,this._visibleRect.height)},getVisibleSizeInPixel:function(){return cc.size(this._visibleRect.width*this._scaleX,this._visibleRect.height*this._scaleY)},getVisibleOrigin:function(){return cc.v2(this._visibleRect.x,this._visibleRect.y)},getVisibleOriginInPixel:function(){return cc.v2(this._visibleRect.x*this._scaleX,this._visibleRect.y*this._scaleY)},getResolutionPolicy:function(){return this._resolutionPolicy},setResolutionPolicy:function(t){var e=this;if(t instanceof cc.ResolutionPolicy)e._resolutionPolicy=t;else{var i=cc.ResolutionPolicy;t===i.EXACT_FIT&&(e._resolutionPolicy=e._rpExactFit),t===i.SHOW_ALL&&(e._resolutionPolicy=e._rpShowAll),t===i.NO_BORDER&&(e._resolutionPolicy=e._rpNoBorder),t===i.FIXED_HEIGHT&&(e._resolutionPolicy=e._rpFixedHeight),t===i.FIXED_WIDTH&&(e._resolutionPolicy=e._rpFixedWidth)}},setDesignResolutionSize:function(t,e,i){if(t>0&&e>0){this.setResolutionPolicy(i);var n=this._resolutionPolicy;if(n&&n.preApply(this),cc.sys.isMobile&&this._adjustViewportMeta(),this._orientationChanging=!0,this._resizing||this._initFrameSize(),n){this._originalDesignResolutionSize.width=this._designResolutionSize.width=t,this._originalDesignResolutionSize.height=this._designResolutionSize.height=e;var a=n.apply(this,this._designResolutionSize);if(a.scale&&2===a.scale.length&&(this._scaleX=a.scale[0],this._scaleY=a.scale[1]),a.viewport){var s=this._viewportRect,o=this._visibleRect,c=a.viewport;s.x=c.x,s.y=c.y,s.width=c.width,s.height=c.height,o.x=0,o.y=0,o.width=c.width/this._scaleX,o.height=c.height/this._scaleY}n.postApply(this),cc.winSize.width=this._visibleRect.width,cc.winSize.height=this._visibleRect.height,cc.visibleRect&&cc.visibleRect.init(this._visibleRect),r.updateCameraViewport(),cc.internal.inputManager._updateCanvasBoundingRect(),this.emit("design-resolution-changed")}else cc.logID(2201)}else cc.errorID(2200)},getDesignResolutionSize:function(){return cc.size(this._designResolutionSize.width,this._designResolutionSize.height)},setRealPixelResolution:function(t,e,i){this._setViewportMeta({width:t},!0),document.documentElement.style.width=t+"px",document.body.style.width=t+"px",document.body.style.left="0px",document.body.style.top="0px",this.setDesignResolutionSize(t,e,i)},setViewportInPoints:function(t,e,i,n){var r=this._scaleX,a=this._scaleY;cc.game._renderContext.viewport(t*r+this._viewportRect.x,e*a+this._viewportRect.y,i*r,n*a)},setScissorInPoints:function(t,e,i,n){var r=this._scaleX,a=this._scaleY,o=Math.ceil(t*r+this._viewportRect.x),c=Math.ceil(e*a+this._viewportRect.y),l=Math.ceil(i*r),h=Math.ceil(n*a),u=cc.game._renderContext;if(!s){var f=u.getParameter(u.SCISSOR_BOX);s=cc.rect(f[0],f[1],f[2],f[3])}s.x===o&&s.y===c&&s.width===l&&s.height===h||(s.x=o,s.y=c,s.width=l,s.height=h,u.scissor(o,c,l,h))},isScissorEnabled:function(){return cc.game._renderContext.isEnabled(gl.SCISSOR_TEST)},getScissorRect:function(){if(!s){var t=gl.getParameter(gl.SCISSOR_BOX);s=cc.rect(t[0],t[1],t[2],t[3])}var e=1/this._scaleX,i=1/this._scaleY;return cc.rect((s.x-this._viewportRect.x)*e,(s.y-this._viewportRect.y)*i,s.width*e,s.height*i)},getViewportRect:function(){return this._viewportRect},getScaleX:function(){return this._scaleX},getScaleY:function(){return this._scaleY},getDevicePixelRatio:function(){return this._devicePixelRatio},convertToLocationInView:function(t,e,i,n){var r=n||cc.v2(),a=i.adjustedLeft?i.adjustedLeft:i.left,s=i.adjustedTop?i.adjustedTop:i.top,o=this._devicePixelRatio*(t-a),c=this._devicePixelRatio*(s+i.height-e);return this._isRotated?(r.x=cc.game.canvas.width-c,r.y=o):(r.x=o,r.y=c),r},_convertMouseToLocationInView:function(t,e){var i=this._viewportRect;t.x=(this._devicePixelRatio*(t.x-e.left)-i.x)/this._scaleX,t.y=(this._devicePixelRatio*(e.top+e.height-t.y)-i.y)/this._scaleY},_convertPointWithScale:function(t){var e=this._viewportRect;t.x=(t.x-e.x)/this._scaleX,t.y=(t.y-e.y)/this._scaleY},_convertTouchesWithScale:function(t){for(var e,i,n,r=this._viewportRect,a=this._scaleX,s=this._scaleY,o=0;o<t.length;o++)i=(e=t[o])._point,n=e._prevPoint,i.x=(i.x-r.x)/a,i.y=(i.y-r.y)/s,n.x=(n.x-r.x)/a,n.y=(n.y-r.y)/s}}),cc.ContainerStrategy=cc.Class({name:"ContainerStrategy",preApply:function(){},apply:function(){},postApply:function(){},_setupContainer:function(t,e,i){var n=cc.game.canvas;this._setupStyle(t,e,i);var r=t._devicePixelRatio=1;t.isRetinaEnabled()&&(r=t._devicePixelRatio=Math.min(t._maxPixelRatio,window.devicePixelRatio||1)),n.width=e*r,n.height=i*r},_setupStyle:function(t,e,i){var n=cc.game.canvas,r=cc.game.container;cc.sys.os===cc.sys.OS_ANDROID&&(document.body.style.width=(t._isRotated?i:e)+"px",document.body.style.height=(t._isRotated?e:i)+"px"),r.style.width=n.style.width=e+"px",r.style.height=n.style.height=i+"px"},_fixContainer:function(){document.body.insertBefore(cc.game.container,document.body.firstChild);var t=document.body.style;t.width=window.innerWidth+"px",t.height=window.innerHeight+"px",t.overflow="hidden";var e=cc.game.container.style;e.position="fixed",e.left=e.top="0px",document.body.scrollTop=0}}),cc.ContentStrategy=cc.Class({name:"ContentStrategy",ctor:function(){this._result={scale:[1,1],viewport:null}},_buildResult:function(t,e,i,n,r,a){Math.abs(t-i)<2&&(i=t),Math.abs(e-n)<2&&(n=e);var s=cc.rect((t-i)/2,(e-n)/2,i,n);return cc.game.renderType,cc.game.RENDER_TYPE_CANVAS,this._result.scale=[r,a],this._result.viewport=s,this._result},preApply:function(){},apply:function(){return{scale:[1,1]}},postApply:function(){}}),(function(){var t=cc.Class({name:"EqualToFrame",extends:cc.ContainerStrategy,apply:function(t){var e=t._frameSize.height,i=cc.game.container.style;this._setupContainer(t,t._frameSize.width,t._frameSize.height),t._isRotated?i.margin="0 0 0 "+e+"px":i.margin="0px",i.padding="0px"}}),e=cc.Class({name:"ProportionalToFrame",extends:cc.ContainerStrategy,apply:function(t,e){var i,n,r=t._frameSize.width,a=t._frameSize.height,s=cc.game.container.style,o=e.width,c=e.height,l=r/o,h=a/c;l<h?(i=r,n=c*l):(i=o*h,n=a);var u=Math.round((r-i)/2),f=Math.round((a-n)/2);i=r-2*u,n=a-2*f,this._setupContainer(t,i,n),t._isRotated?s.margin="0 0 0 "+a+"px":s.margin="0px",s.paddingLeft=u+"px",s.paddingRight=u+"px",s.paddingTop=f+"px",s.paddingBottom=f+"px"}}),i=(cc.Class({name:"EqualToWindow",extends:t,preApply:function(t){this._super(t),cc.game.frame=document.documentElement},apply:function(t){this._super(t),this._fixContainer()}}),cc.Class({name:"ProportionalToWindow",extends:e,preApply:function(t){this._super(t),cc.game.frame=document.documentElement},apply:function(t,e){this._super(t,e),this._fixContainer()}}),cc.Class({name:"OriginalContainer",extends:cc.ContainerStrategy,apply:function(t){this._setupContainer(t,cc.game.canvas.width,cc.game.canvas.height)}})),n=("undefined"==typeof window?global:window).__globalAdapter;n&&(n.adaptContainerStrategy&&n.adaptContainerStrategy(cc.ContainerStrategy.prototype),n.adaptView&&n.adaptView(o.prototype)),cc.ContainerStrategy.EQUAL_TO_FRAME=new t,cc.ContainerStrategy.PROPORTION_TO_FRAME=new e,cc.ContainerStrategy.ORIGINAL_CONTAINER=new i;var r=cc.Class({name:"ExactFit",extends:cc.ContentStrategy,apply:function(t,e){var i=cc.game.canvas.width,n=cc.game.canvas.height,r=i/e.width,a=n/e.height;return this._buildResult(i,n,i,n,r,a)}}),a=cc.Class({name:"ShowAll",extends:cc.ContentStrategy,apply:function(t,e){var i,n,r=cc.game.canvas.width,a=cc.game.canvas.height,s=e.width,o=e.height,c=r/s,l=a/o,h=0;return c<l?(i=r,n=o*(h=c)):(i=s*(h=l),n=a),this._buildResult(r,a,i,n,h,h)}}),s=cc.Class({name:"NoBorder",extends:cc.ContentStrategy,apply:function(t,e){var i,n,r,a=cc.game.canvas.width,s=cc.game.canvas.height,o=e.width,c=e.height,l=a/o,h=s/c;return l<h?(n=o*(i=h),r=s):(n=a,r=c*(i=l)),this._buildResult(a,s,n,r,i,i)}}),c=cc.Class({name:"FixedHeight",extends:cc.ContentStrategy,apply:function(t,e){var i=cc.game.canvas.width,n=cc.game.canvas.height,r=n/e.height,a=i,s=n;return this._buildResult(i,n,a,s,r,r)}}),l=cc.Class({name:"FixedWidth",extends:cc.ContentStrategy,apply:function(t,e){var i=cc.game.canvas.width,n=cc.game.canvas.height,r=i/e.width,a=i,s=n;return this._buildResult(i,n,a,s,r,r)}});cc.ContentStrategy.EXACT_FIT=new r,cc.ContentStrategy.SHOW_ALL=new a,cc.ContentStrategy.NO_BORDER=new s,cc.ContentStrategy.FIXED_HEIGHT=new c,cc.ContentStrategy.FIXED_WIDTH=new l})(),cc.ResolutionPolicy=cc.Class({name:"cc.ResolutionPolicy",ctor:function(t,e){this._containerStrategy=null,this._contentStrategy=null,this.setContainerStrategy(t),this.setContentStrategy(e)},preApply:function(t){this._containerStrategy.preApply(t),this._contentStrategy.preApply(t)},apply:function(t,e){return this._containerStrategy.apply(t,e),this._contentStrategy.apply(t,e)},postApply:function(t){this._containerStrategy.postApply(t),this._contentStrategy.postApply(t)},setContainerStrategy:function(t){t instanceof cc.ContainerStrategy&&(this._containerStrategy=t)},setContentStrategy:function(t){t instanceof cc.ContentStrategy&&(this._contentStrategy=t)}}),n.get(cc.ResolutionPolicy.prototype,"canvasSize",(function(){return cc.v2(cc.game.canvas.width,cc.game.canvas.height)})),cc.ResolutionPolicy.EXACT_FIT=0,cc.ResolutionPolicy.NO_BORDER=1,cc.ResolutionPolicy.SHOW_ALL=2,cc.ResolutionPolicy.FIXED_HEIGHT=3,cc.ResolutionPolicy.FIXED_WIDTH=4,cc.ResolutionPolicy.UNKNOWN=5,cc.view=new o,cc.winSize=cc.size(),e.exports=cc.view}),{"../event/event-target":141,"../platform/CCClass":168,"../platform/js":189,"../renderer":199}],179:[(function(){"use strict";cc.visibleRect={topLeft:cc.v2(0,0),topRight:cc.v2(0,0),top:cc.v2(0,0),bottomLeft:cc.v2(0,0),bottomRight:cc.v2(0,0),bottom:cc.v2(0,0),center:cc.v2(0,0),left:cc.v2(0,0),right:cc.v2(0,0),width:0,height:0,init:function(t){var e=this.width=t.width,i=this.height=t.height,n=t.x,r=t.y,a=r+i,s=n+e;this.topLeft.x=n,this.topLeft.y=a,this.topRight.x=s,this.topRight.y=a,this.top.x=n+e/2,this.top.y=a,this.bottomLeft.x=n,this.bottomLeft.y=r,this.bottomRight.x=s,this.bottomRight.y=r,this.bottom.x=n+e/2,this.bottom.y=r,this.center.x=n+e/2,this.center.y=r+i/2,this.left.x=n,this.left.y=r+i/2,this.right.x=s,this.right.y=r+i/2}}}),{}],180:[(function(t,e){"use strict";var i=t("./js"),n=(t("./utils").isPlainEmptyObj_DEV,"$_$");function r(t,e){var n=e?Object.create(e):{};return i.value(t,"__attrs__",n),n}function a(t){if("function"!=typeof t)return r(t,s(t.constructor));for(var e,i=cc.Class.getInheritanceChain(t),n=i.length-1;n>=0;n--){var a=i[n];a.hasOwnProperty("__attrs__")&&a.__attrs__||r(a,(e=i[n+1])&&e.__attrs__)}return r(t,(e=i[0])&&e.__attrs__),t.__attrs__}function s(t){return t.hasOwnProperty("__attrs__")&&t.__attrs__||a(t)}function o(t,e){this.name=t,this.default=e}o.prototype.toString=function(){return this.name},cc.Integer=new o("Integer",0),cc.Float=new o("Float",0),cc.Boolean=new o("Boolean",!1),cc.String=new o("String",""),e.exports={PrimitiveType:o,attr:function(t,e){var i=s(t),r=e+n,a={};for(var o in i)o.startsWith(r)&&(a[o.slice(r.length)]=i[o]);return a},getClassAttrs:s,setClassAttr:function(t,e,i,r){s(t)[e+n+i]=r},DELIMETER:n,getTypeChecker_ET:!1,getObjTypeChecker_ET:!1,ScriptUuid:{}}}),{"./CCClass":168,"./js":189,"./utils":192}],181:[(function(t,e){"use strict";var i=t("./js"),n=i.array.fastRemoveAt;function r(){}function a(){this.callback=r,this.target=void 0,this.once=!1}a.prototype.set=function(t,e,i){this.callback=t,this.target=e,this.once=!!i};var s=new i.Pool(function(t){return t.callback=r,t.target=void 0,t.once=!1,!0},32);function o(){this.callbackInfos=[],this.isInvoking=!1,this.containCanceled=!1}s.get=function(){return this._get()||new a};var c=o.prototype;c.removeByCallback=function(t){for(var e=0;e<this.callbackInfos.length;++e){var i=this.callbackInfos[e];i&&i.callback===t&&(s.put(i),n(this.callbackInfos,e),--e)}},c.removeByTarget=function(t){for(var e=0;e<this.callbackInfos.length;++e){var i=this.callbackInfos[e];i&&i.target===t&&(s.put(i),n(this.callbackInfos,e),--e)}},c.cancel=function(t){var e=this.callbackInfos[t];e&&(s.put(e),this.callbackInfos[t]=null),this.containCanceled=!0},c.cancelAll=function(){for(var t=0;t<this.callbackInfos.length;t++){var e=this.callbackInfos[t];e&&(s.put(e),this.callbackInfos[t]=null)}this.containCanceled=!0},c.purgeCanceled=function(){for(var t=this.callbackInfos.length-1;t>=0;--t)this.callbackInfos[t]||n(this.callbackInfos,t);this.containCanceled=!1},c.clear=function(){this.cancelAll(),this.callbackInfos.length=0,this.isInvoking=!1,this.containCanceled=!1};var l=new i.Pool(function(t){return t.callbackInfos=[],t.isInvoking=!1,t.containCanceled=!1,!0},16);function h(){this._callbackTable=i.createMap(!0)}l.get=function(){return this._get()||new o},(c=h.prototype).on=function(t,e,i,n){var r=this._callbackTable[t];r||(r=this._callbackTable[t]=l.get());var a=s.get();a.set(e,i,n),r.callbackInfos.push(a)},c.hasEventListener=function(t,e,i){var n=this._callbackTable[t];if(!n)return!1;var r=n.callbackInfos;if(!e){if(n.isInvoking){for(var a=0;a<r.length;++a)if(r[a])return!0;return!1}return r.length>0}for(var s=0;s<r.length;++s){var o=r[s];if(o&&o.callback===e&&o.target===i)return!0}return!1},c.removeAll=function(t){if("string"==typeof t){var e=this._callbackTable[t];e&&(e.isInvoking?e.cancelAll():(e.clear(),l.put(e),delete this._callbackTable[t]))}else if(t)for(var i in this._callbackTable){var n=this._callbackTable[i];if(n.isInvoking)for(var r=n.callbackInfos,a=0;a<r.length;++a){var s=r[a];s&&s.target===t&&n.cancel(a)}else n.removeByTarget(t)}},c.off=function(t,e,i){var r=this._callbackTable[t];if(r)for(var a=r.callbackInfos,o=0;o<a.length;++o){var c=a[o];if(c&&c.callback===e&&c.target===i){r.isInvoking?r.cancel(o):(n(a,o),s.put(c));break}}},c.emit=function(t,e,i,n,r,a){var s=this._callbackTable[t];if(s){var o=!s.isInvoking;s.isInvoking=!0;for(var c=s.callbackInfos,l=0,h=c.length;l<h;++l){var u=c[l];if(u){var f=u.target,_=u.callback;u.once&&this.off(t,_,f),f?_.call(f,e,i,n,r,a):_(e,i,n,r,a)}}o&&(s.isInvoking=!1,s.containCanceled&&s.purgeCanceled())}},e.exports=h}),{"./js":189}],182:[(function(t,e){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?i(t,r):t.push(r)}}e.exports={flattenCodeArray:function(t){var e=[];return i(e,t),e.join("")}}}),{}],183:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=N,i.getDependUuidList=function(t){var e=t[1];return t[10].map((function(t){return e[t]}))},i.hasNativeDep=function(t){var e=t[5],i=e[e.length-1];return"number"==typeof i&&i<0},i.packCustomObjData=function(t,e,i){return[1,_,_,[t],_,i?[e,-1]:[e],[0],_,[],[],[]]},i.unpackJSONs=function(t,e){if(t[0]<1)throw new Error(cc.debug.getError(5304,t[0]));I(t,!0,e),O(t);for(var i=new F(t[0]),n=t[1],r=t[2],a=t[3],s=t[4],o=t[g],c=0;c<o.length;++c)o[c].unshift(i,n,r,a,s);return o};var n=f(t("./js")),r=f(t("../value-types/vec2")),a=f(t("../value-types/vec3")),s=f(t("../value-types/vec4")),o=f(t("../value-types/color")),c=f(t("../value-types/size")),l=f(t("../value-types/rect")),h=f(t("../value-types/quat")),u=f(t("../value-types/mat4"));function f(t){return t&&t.__esModule?t:{default:t}}var _=0,d=[r.default,a.default,s.default,h.default,o.default,c.default,l.default,u.default];function p(t,e){t.x=e[1],t.y=e[2],t.z=e[3],t.w=e[4]}var m=[function(t,e){t.x=e[1],t.y=e[2]},function(t,e){t.x=e[1],t.y=e[2],t.z=e[3]},p,p,function(t,e){t._val=e[1]},function(t,e){t.width=e[1],t.height=e[2]},function(t,e){t.x=e[1],t.y=e[2],t.width=e[3],t.height=e[4]},function(t,e){u.default.fromArray(t,e,1)}],v=0,g=5,y=(function(){function t(){this.uuidObjList=null,this.uuidPropList=null,this.uuidList=null}var e=t.prototype;return e.init=function(t){this.uuidObjList=t[8],this.uuidPropList=t[9],this.uuidList=t[10]},e.reset=function(){this.uuidList=null,this.uuidObjList=null,this.uuidPropList=null},e.push=function(t,e,i){this.uuidObjList.push(t),this.uuidPropList.push(e),this.uuidList.push(i)},t})();function T(t,e,i){for(var n=t.length-1,r=0,a=3*t[n];r<a;r+=3){var s=t[r],o=e[t[r+2]],c=t[r+1];c>=0?s[i[c]]=o:s[~c]=o}for(;r<n;r+=3){var l=e[t[r]],h=e[t[r+2]],u=t[r+1];u>=0?l[i[u]]=h:l[~u]=h}}function A(t,e){for(var i=t[4][e[0]],n=i[0],r=new(0,n[0]),a=n[1],s=n[2],o=i[i.length-1],c=1;c<o;++c)r[a[i[c]]]=e[c];for(;c<e.length;++c){var l=a[i[c]],h=n[i[c]+s];(0,w[h])(t,r,l,e[c])}return r}function b(t,e,i){var r=new e;return r._deserialize?r._deserialize(i,t[0]):cc.errorID(5303,n.default.getClassName(e)),r}function E(t,e,i,n){n>=0?e[i]=t[5][n]:t[7][3*~n]=e}function C(t){return function(e,i,n,r){i[n]=r;for(var a=0;a<r.length;++a)t(e,r,a,r[a])}}function x(t,e,i,n){e[i]=null,t[8][n]=e}function S(t,e,i,n){e[i]=A(t,n)}y.pool=new n.default.Pool(function(t){t.reset()},5),y.pool.get=function(){return this._get()||new y};var w=new Array(13);function D(t){var e=t[5],i=t[6],n=0===i?0:i.length,r=e[e.length-1],a=e.length-n;"number"!=typeof r?r=0:(r<0&&(r=~r),--a);for(var s=0;s<a;++s)e[s]=A(t,e[s]);for(var o=t[3],c=0;c<n;++c,++s){var l=i[c],h=e[s];if(l>=0){var u=o[l];e[s]=b(t,u,h)}else(0,w[l=~l])(t,e,s,h)}return r}function M(t,e){return t||N.reportMissingClass(e),Object}function R(t,e,i,n,r,a){var s=t(e);if(!s){if(r)return void(i[n]=(function(e,i,n){return function(){var r=t(n)||M(a,n);return e[i]=r,new r}})(i,n,e));s=M(a,e)}i[n]=s}function I(t,e,i){for(var r=i||n.default._getClassById,a=t[3],s=0;s<a.length;++s){var o=a[s];"string"!=typeof o?R(r,o[0],o,v,e,i):R(r,o,a,s,e,i)}}function O(t){var e=t[4];if(e)for(var i=t[3],n=0;n<e.length;++n){var r=e[n];r[0]=i[r[0]]}}function P(t){for(var e=t[5],i=t[2],n=t[1],r=t[8],a=t[9],s=t[10],o=0;o<r.length;++o){var c=r[o];"number"==typeof c&&(r[o]=e[c]);var l=a[o];"number"==typeof l&&(l=l>=0?i[l]:~l,a[o]=l);var h=s[o];"number"==typeof h&&(s[o]=n[h])}}function N(t,e,i){"string"==typeof t&&(t=JSON.parse(t));var n=!e;(e=e||y.pool.get()).init(t),i=i||{};var r=t[0],a=!1;if("object"==typeof r&&(a=r.preprocessed,r=r.version),r<1)throw new Error(cc.debug.getError(5304,r));i._version=r,i.result=e,t[0]=i,a||(I(t,!1,i.classFinder),O(t)),cc.game._isCloning=!0;var s=t[5],o=D(t);return cc.game._isCloning=!1,t[7]&&T(t[7],s,t[2]),P(t),n&&y.pool.put(e),s[o]}w[0]=function(t,e,i,n){e[i]=n},w[1]=E,w[2]=C(E),w[3]=C(x),w[4]=S,w[5]=function(t,e,i,n){m[n[0]](e[i],n)},w[6]=x,w[7]=function(t,e,i,n){e[i].set(n)},w[8]=function(t,e,i,n){var r=new d[n[0]];m[n[0]](r,n),e[i]=r},w[9]=C(S),w[10]=function(t,e,i,n){var r=t[3][n[0]];e[i]=b(t,r,n[1])},w[11]=function(t,e,i,n){var r=n[0];e[i]=r;for(var a=1;a<n.length;a+=3){var s=n[a],o=n[a+1],c=n[a+2];(0,w[o])(t,r,s,c)}},w[12]=function(t,e,i,n){var r=n[0];e[i]=r;for(var a=0;a<r.length;++a){var s=r[a],o=n[a+1];0!==o&&(0,w[o])(t,r,a,s)}},N.Details=y;var F=function(t){this.preprocessed=!0,this.version=t}}),{"../value-types/color":256,"../value-types/mat4":259,"../value-types/quat":260,"../value-types/rect":261,"../value-types/size":262,"../value-types/vec2":266,"../value-types/vec3":267,"../value-types/vec4":268,"./js":189}],184:[(function(t){"use strict";var e,i=(e=t("./deserialize-compiled"))&&e.__esModule?e:{default:e};i.default.reportMissingClass=function(t){cc.warnID(5302,t)},cc.deserialize=i.default}),{"./deserialize-compiled":183,"./deserialize-editor":void 0}],185:[(function(t,e){"use strict";var i=".";function n(t){this.id=0|998*Math.random(),this.prefix=t?t+i:""}n.prototype.getNewId=function(){return this.prefix+ ++this.id},n.global=new n("global"),e.exports=n}),{}],186:[(function(t){"use strict";t("./js"),t("./CCClass"),t("./CCClassDecorator"),t("./CCEnum"),t("./CCObject"),t("./callbacks-invoker"),t("./deserialize"),t("./instantiate"),t("./instantiate-jit"),t("./requiring-frame"),t("./CCSys"),t("./CCMacro"),t("./CCVisibleRect")}),{"./CCClass":168,"./CCClassDecorator":169,"./CCEnum":170,"./CCMacro":173,"./CCObject":174,"./CCSys":177,"./CCVisibleRect":179,"./callbacks-invoker":181,"./deserialize":184,"./instantiate":188,"./instantiate-jit":187,"./js":189,"./requiring-frame":191}],187:[(function(t,e){"use strict";var i=t("./CCObject"),n=i.Flags.Destroyed,r=i.Flags.PersistentMask,a=t("./attribute"),s=t("./js"),o=t("./CCClass"),c=t("./compiler"),l=a.DELIMETER+"default",h=o.IDENTIFIER_RE,u=o.escapeForJS,f="var ",_="o",d="t",p={"cc.Node":"cc.Node","cc.Sprite":"cc.Sprite","cc.Label":"cc.Label","cc.Button":"cc.Button","cc.Widget":"cc.Widget","cc.Animation":"cc.Animation","cc.ClickEvent":!1,"cc.PrefabInfo":!1};try{!Float32Array.name&&(Float32Array.name="Float32Array"),!Float64Array.name&&(Float64Array.name="Float64Array"),!Int8Array.name&&(Int8Array.name="Int8Array"),!Int16Array.name&&(Int16Array.name="Int16Array"),!Int32Array.name&&(Int32Array.name="Int32Array"),!Uint8Array.name&&(Uint8Array.name="Uint8Array"),!Uint16Array.name&&(Uint16Array.name="Uint16Array"),!Uint32Array.name&&(Uint32Array.name="Uint32Array"),!Uint8ClampedArray.name&&(Uint8ClampedArray.name="Uint8ClampedArray")}catch(x){}function m(t){if(t===Float32Array)return"Float32Array";if(t===Float64Array)return"Float64Array";if(t===Int8Array)return"Int8Array";if(t===Int16Array)return"Int16Array";if(t===Int32Array)return"Int32Array";if(t===Uint8Array)return"Uint8Array";if(t===Uint16Array)return"Uint16Array";if(t===Uint32Array)return"Uint32Array";if(t===Uint8ClampedArray)return"Uint8ClampedArray";throw new Error("Unknown TypedArray to instantiate: "+t)}function v(t,e){this.varName=t,this.expression=e}function g(t,e){return e instanceof v?new v(e.varName,t+e.expression):t+e}function y(t,e,i){Array.isArray(i)?(i[0]=g(e,i[0]),t.push(i)):t.push(g(e,i)+";")}function T(t){this._exps=[],this._targetExp=t}function A(t,e){if("function"==typeof t)try{t=t()}catch(x){return!1}if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e&&t.constructor===e.constructor)if(t instanceof cc.ValueType){if(t.equals(e))return!0}else{if(Array.isArray(t))return 0===t.length&&0===e.length;if(t.constructor===Object)return s.isEmptyObject(t)&&s.isEmptyObject(e)}return!1}function b(t){return h.test(t)?"."+t:"["+u(t)+"]"}function E(t,e){var i;this.parent=e,this.objsToClear_iN$t=[],this.codeArray=[],this.objs=[],this.funcs=[],this.funcModuleCache=s.createMap(),s.mixin(this.funcModuleCache,p),this.globalVariables=[],this.globalVariableId=0,this.localVariableId=0,this.codeArray.push(f+_+","+d+";","if(R){",_+"=R;","}else{",_+"=R=new "+this.getFuncModule(t.constructor,!0)+"();","}"),s.value(t,"_iN$t",{globalVar:"R"},!0),this.objsToClear_iN$t.push(t),this.enumerateObject(this.codeArray,t),this.globalVariables.length>0&&(i=f+this.globalVariables.join(",")+";");var n=c.flattenCodeArray(["return (function(R){",i||[],this.codeArray,"return o;","})"]);this.result=Function("O","F",n)(this.objs,this.funcs);for(var r=0,a=this.objsToClear_iN$t.length;r<a;++r)this.objsToClear_iN$t[r]._iN$t=null;this.objsToClear_iN$t.length=0}v.prototype.toString=function(){return f+this.varName+"="+this.expression+";"},T.prototype.append=function(t,e){this._exps.push([t,e])},T.prototype.writeCode=function(t){var e;if(this._exps.length>1)t.push(d+"="+this._targetExp+";"),e=d;else{if(1!==this._exps.length)return;e=this._targetExp}for(var i=0;i<this._exps.length;i++){var n=this._exps[i];y(t,e+b(n[0])+"=",n[1])}},T.pool=new s.Pool(function(t){t._exps.length=0,t._targetExp=null},1),T.pool.get=function(t){var e=this._get()||new T;return e._targetExp=t,e};var C=E.prototype;C.getFuncModule=function(t,e){var i=s.getClassName(t);if(i){var n=this.funcModuleCache[i];if(n)return n;if(void 0===n){var r=-1!==i.indexOf(".");if(r)try{if(r=t===Function("return "+i)())return this.funcModuleCache[i]=i,i}catch(x){}}}var a=this.funcs.indexOf(t);a<0&&(a=this.funcs.length,this.funcs.push(t));var o="F["+a+"]";return e&&(o="("+o+")"),this.funcModuleCache[i]=o,o},C.getObjRef=function(t){var e=this.objs.indexOf(t);return e<0&&(e=this.objs.length,this.objs.push(t)),"O["+e+"]"},C.setValueType=function(t,e,i,n){var r=T.pool.get(n),a=e.constructor.__props__;a||(a=Object.keys(e));for(var s=0;s<a.length;s++){var o=a[s],c=i[o];if(e[o]!==c){var l=this.enumerateField(i,o,c);r.append(o,l)}}r.writeCode(t),T.pool.put(r)},C.enumerateCCClass=function(t,e,i){for(var n=i.__values__,r=a.getClassAttrs(i),s=0;s<n.length;s++){var c=n[s],h=e[c],u=r[c+l];if(!A(u,h))if("object"==typeof h&&h instanceof cc.ValueType&&(u=o.getDefault(u))&&u.constructor===h.constructor){var f=_+b(c);this.setValueType(t,u,h,f)}else this.setObjProp(t,e,c,h)}},C.instantiateArray=function(t){if(0===t.length)return"[]";var e="a"+ ++this.localVariableId,i=[new v(e,"new Array("+t.length+")")];s.value(t,"_iN$t",{globalVar:"",source:i},!0),this.objsToClear_iN$t.push(t);for(var n=0;n<t.length;++n)y(i,e+"["+n+"]=",this.enumerateField(t,n,t[n]));return i},C.instantiateTypedArray=function(t){var e=t.constructor.name||m(t.constructor);if(0===t.length)return"new "+e;var i="a"+ ++this.localVariableId,n=[new v(i,"new "+e+"("+t.length+")")];t._iN$t={globalVar:"",source:n},this.objsToClear_iN$t.push(t);for(var r=0;r<t.length;++r)0!==t[r]&&y(n,i+"["+r+"]=",t[r]);return n},C.enumerateField=function(t,e,n){if("object"==typeof n&&n){var a=n._iN$t;if(a){var s=a.globalVar;if(!s){s=a.globalVar="v"+ ++this.globalVariableId,this.globalVariables.push(s);var o=a.source[0];a.source[0]=g(s+"=",o)}return s}return ArrayBuffer.isView(n)?this.instantiateTypedArray(n):Array.isArray(n)?this.instantiateArray(n):this.instantiateObj(n)}return"function"==typeof n?this.getFuncModule(n):"string"==typeof n?u(n):("_objFlags"===e&&t instanceof i&&(n&=r),n)},C.setObjProp=function(t,e,i,n){y(t,_+b(i)+"=",this.enumerateField(e,i,n))},C.enumerateObject=function(t,e){var i=e.constructor;if(cc.Class._isCCClass(i))this.enumerateCCClass(t,e,i);else for(var n in e)if(e.hasOwnProperty(n)&&(95!==n.charCodeAt(0)||95!==n.charCodeAt(1)||"__type__"===n)){var r=e[n];"object"==typeof r&&r&&r===e._iN$t||this.setObjProp(t,e,n,r)}},C.instantiateObj=function(t){if(t instanceof cc.ValueType)return o.getNewValueTypeCode(t);if(t instanceof cc.Asset)return this.getObjRef(t);if(t._objFlags&n)return null;var e,i=t.constructor;if(cc.Class._isCCClass(i)){if(this.parent)if(this.parent instanceof cc.Component){if(t instanceof cc._BaseNode||t instanceof cc.Component)return this.getObjRef(t)}else if(this.parent instanceof cc._BaseNode)if(t instanceof cc._BaseNode){if(!t.isChildOf(this.parent))return this.getObjRef(t)}else if(t instanceof cc.Component){var r;if(null==(r=t.node)||!r.isChildOf(this.parent))return this.getObjRef(t)}e=new v(_,"new "+this.getFuncModule(i,!0)+"()")}else if(i===Object)e=new v(_,"{}");else{if(i)return this.getObjRef(t);e=new v(_,"Object.create(null)")}var a=[e];return s.value(t,"_iN$t",{globalVar:"",source:a},!0),this.objsToClear_iN$t.push(t),this.enumerateObject(a,t),["(function(){",a,"return o;})();"]},e.exports={compile:function(t){return new E(t,t instanceof cc._BaseNode&&t).result},equalsToDefault:A}}),{"./CCClass":168,"./CCObject":174,"./attribute":180,"./compiler":182,"./js":189}],188:[(function(t,e){"use strict";var i=t("./CCObject"),n=t("../value-types/value-type"),r=i.Flags.Destroyed,a=i.Flags.PersistentMask,s=t("./utils").isDomNode,o=t("./js");function c(t,e){if(!e){if("object"!=typeof t||Array.isArray(t))return null;if(!t)return null;if(!cc.isValid(t))return null}var n;if(t instanceof i){if(t._instantiate)return cc.game._isCloning=!0,n=t._instantiate(null,!0),cc.game._isCloning=!1,n;if(t instanceof cc.Asset)return null}return cc.game._isCloning=!0,n=h(t),cc.game._isCloning=!1,n}var l=[];function h(t,e){if(Array.isArray(t))return null;if(s&&s(t))return null;var i;f(t,i=t._iN$t?t._iN$t:t.constructor?new(0,t.constructor):Object.create(null),e);for(var n=0,r=l.length;n<r;++n)l[n]._iN$t=null;return l.length=0,i}function u(t,e,i,r){for(var a=t.__values__,s=0;s<a.length;s++){var o=a[s],c=e[o];if("object"==typeof c&&c){var l=i[o];l instanceof n&&l.constructor===c.constructor?l.set(c):i[o]=c._iN$t||_(c,r)}else i[o]=c}}function f(t,e,n){o.value(t,"_iN$t",e,!0),l.push(t);var r=t.constructor;if(cc.Class._isCCClass(r))u(r,t,e,n);else for(var s in t)if(t.hasOwnProperty(s)&&(95!==s.charCodeAt(0)||95!==s.charCodeAt(1)||"__type__"===s)){var c=t[s];if("object"==typeof c&&c){if(c===e)continue;e[s]=c._iN$t||_(c,n)}else e[s]=c}t instanceof i&&(e._objFlags&=a)}function _(t,e){if(t instanceof n)return t.clone();if(t instanceof cc.Asset)return t;var i;if(ArrayBuffer.isView(t)){var a=t.length;i=new t.constructor(a),t._iN$t=i,l.push(t);for(var s=0;s<a;++s)i[s]=t[s];return i}if(Array.isArray(t)){var c=t.length;i=new Array(c),o.value(t,"_iN$t",i,!0),l.push(t);for(var h=0;h<c;++h){var u=t[h];i[h]="object"==typeof u&&u?u._iN$t||_(u,e):u}return i}if(t._objFlags&r)return null;var d=t.constructor;if(cc.Class._isCCClass(d)){if(e)if(e instanceof cc.Component){if(t instanceof cc._BaseNode||t instanceof cc.Component)return t}else if(e instanceof cc._BaseNode)if(t instanceof cc._BaseNode){if(!t.isChildOf(e))return t}else if(t instanceof cc.Component){var p;if(null==(p=t.node)||!p.isChildOf(e))return t}i=new d}else if(d===Object)i={};else{if(d)return t;i=Object.create(null)}return f(t,i,e),i}c._clone=h,cc.instantiate=c,e.exports=c}),{"../value-types/value-type":265,"./CCObject":174,"./js":189,"./utils":192}],189:[(function(t,e){"use strict";var i=new(t("./id-generater"))("TmpCId.");function n(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}return null}function r(t,e,i){var r=n(e,t);Object.defineProperty(i,t,r)}var a={isNumber:function(t){return"number"==typeof t||t instanceof Number},isString:function(t){return"string"==typeof t||t instanceof String},addon:function(t){t=t||{};for(var e=1,i=arguments.length;e<i;e++){var n=arguments[e];if(n){if("object"!=typeof n){cc.errorID(5402,n);continue}for(var a in n)a in t||r(a,n,t)}}return t},mixin:function(t){t=t||{};for(var e=1,i=arguments.length;e<i;e++){var n=arguments[e];if(n){if("object"!=typeof n){cc.errorID(5403,n);continue}for(var a in n)r(a,n,t)}}return t},extend:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t.prototype=Object.create(e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),t},getSuper:function(t){var e=t.prototype,i=e&&Object.getPrototypeOf(e);return i&&i.constructor},isChildClassOf:function(t,e){if(t&&e){if("function"!=typeof t)return!1;if("function"!=typeof e)return!1;if(t===e)return!0;for(;;){if(!(t=a.getSuper(t)))return!1;if(t===e)return!0}}return!1},clear:function(t){for(var e=Object.keys(t),i=0;i<e.length;i++)delete t[e[i]]},isEmptyObject:function(t){for(var e in t)return!1;return!0},getPropertyDescriptor:n},s={value:void 0,enumerable:!1,writable:!1,configurable:!0};a.value=function(t,e,i,n,r){s.value=i,s.writable=n,s.enumerable=r,Object.defineProperty(t,e,s),s.value=void 0};var o={get:null,set:null,enumerable:!1};a.getset=function(t,e,i,n,r,a){"function"!=typeof n&&(r=n,n=void 0),o.get=i,o.set=n,o.enumerable=r,o.configurable=a,Object.defineProperty(t,e,o),o.get=null,o.set=null};var c={get:null,enumerable:!1,configurable:!1};a.get=function(t,e,i,n,r){c.get=i,c.enumerable=n,c.configurable=r,Object.defineProperty(t,e,c),c.get=null};var l={set:null,enumerable:!1,configurable:!1};a.set=function(t,e,i,n,r){l.set=i,l.enumerable=n,l.configurable=r,Object.defineProperty(t,e,l),l.set=null},a.getClassName=function(t){if("function"==typeof t){var e=t.prototype;if(e&&e.hasOwnProperty("__classname__")&&e.__classname__)return e.__classname__;var i="";if(t.name&&(i=t.name),t.toString){var n,r=t.toString();(n="["===r.charAt(0)?r.match(/\[\w+\s*(\w+)\]/):r.match(/function\s*(\w+)/))&&2===n.length&&(i=n[1])}return"Object"!==i?i:""}return t&&t.constructor?a.getClassName(t.constructor):""},(function(){var t={},e={};function n(t,e,i){return a.getset(a,e,(function(){return Object.assign({},i)}),(function(t){a.clear(i),Object.assign(i,t)})),function(e,n){if(n.prototype.hasOwnProperty(t)&&delete i[n.prototype[t]],a.value(n.prototype,t,e),e){var r=i[e];if(r&&r!==n){var s="A Class already exists with the same "+t+' : "'+e+'".';cc.error(s)}else i[e]=n}}}a._setClassId=n("__cid__","_registeredClassIds",t);var r=n("__classname__","_registeredClassNames",e);a.setClassName=function(t,e){if(r(t,e),!e.prototype.hasOwnProperty("__cid__")){var n=t||i.getNewId();n&&a._setClassId(n,e)}},a.unregisterClass=function(){for(var i=0;i<arguments.length;i++){var n=arguments[i].prototype,r=n.__cid__;r&&delete t[r];var a=n.__classname__;a&&delete e[a]}},a._getClassById=function(e){return t[e]},a.getClassByName=function(t){return e[t]},a._getClassId=function(t,e){if(e=void 0===e||e,"function"==typeof t&&t.prototype.hasOwnProperty("__cid__"))return t.prototype.__cid__;if(t&&t.constructor){var i=t.constructor.prototype;if(i&&i.hasOwnProperty("__cid__"))return t.__cid__}return""}})(),a.obsolete=function(t,e,i,n){var r=/([^.]+)$/,s=r.exec(e)[0],o=r.exec(i)[0];function c(){return this[o]}n?a.getset(t,s,c,(function(t){this[o]=t})):a.get(t,s,c)},a.obsoletes=function(t,e,i,n){for(var r in i){var s=i[r];a.obsolete(t,e+"."+r,s,n)}};var h=/(%d)|(%s)/,u=/%s/;function f(t,e){t.splice(e,1)}function _(t,e){var i=t.indexOf(e);return i>=0&&(f(t,i),!0)}function d(t,e){void 0===e&&(e=t,t=null),this.get=null,this.count=0,this._pool=new Array(e),this._cleanup=t}a.formatStr=function(){var t=arguments.length;if(0===t)return"";var e=arguments[0];if(1===t)return""+e;var i="string"==typeof e&&h.test(e);if(i)for(var n=1;n<t;++n){var r=arguments[n],a="number"==typeof r?h:u;if(a.test(e)){var s=""+r;e=e.replace(a,s)}else e+=" "+r}else for(var o=1;o<t;++o)e+=" "+arguments[o];return e},a.shiftArguments=function(){for(var t=arguments.length-1,e=new Array(t),i=0;i<t;++i)e[i]=arguments[i+1];return e},a.createMap=function(t){var e=Object.create(null);return t&&(e["."]=!0,e["/"]=!0,delete e["."],delete e["/"]),e},a.array={remove:_,fastRemove:function(t,e){var i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],--t.length)},removeAt:f,fastRemoveAt:function(t,e){var i=t.length;e<0||e>=i||(t[e]=t[i-1],t.length=i-1)},contains:function(t,e){return t.indexOf(e)>=0},verifyType:function(t,e){if(t&&t.length>0)for(var i=0;i<t.length;i++)if(!(t[i]instanceof e))return cc.logID(1300),!1;return!0},removeArray:function(t,e){for(var i=0,n=e.length;i<n;i++)_(t,e[i])},appendObjectsAt:function(t,e,i){return t.splice.apply(t,[i,0].concat(e)),t},copy:function(t){var e,i=t.length,n=new Array(i);for(e=0;e<i;e+=1)n[e]=t[e];return n},MutableForwardIterator:t("../utils/mutable-forward-iterator")},d.prototype._get=function(){if(this.count>0){--this.count;var t=this._pool[this.count];return this._pool[this.count]=null,t}return null},d.prototype.put=function(t){var e=this._pool;if(this.count<e.length){if(this._cleanup&&!1===this._cleanup(t))return;e[this.count]=t,++this.count}},d.prototype.resize=function(t){t>=0&&(this._pool.length=t,this.count>t&&(this.count=t))},a.Pool=d,cc.js=a,e.exports=a}),{"../utils/mutable-forward-iterator":243,"./id-generater":185}],190:[(function(t,e,i){"use strict";var n=t("./js"),r=t("./attribute"),a={default:{},serializable:{},editorOnly:{},formerlySerializedAs:{}};function s(t,e,i,n){if(!t.get&&!t.set&&t.hasOwnProperty("default")){var r="_N$"+e;t.get=function(){return this[r]},t.set=function(t){var e=this[r];this[r]=t,i.call(this,e)};var s={};for(var o in n[r]=s,a){var c=a[o];t.hasOwnProperty(o)&&(s[o]=t[o],c.canUsedInGet||delete t[o])}}}function o(t,e,i,n){if(Array.isArray(e)){if(!(e.length>0))return cc.errorID(5508,i,n);t.type=e=e[0]}"function"==typeof e&&(e===String?t.type=cc.String:e===Boolean?t.type=cc.Boolean:e===Number&&(t.type=cc.Float))}function c(t,e,i){var n=t?{_short:!0}:{_short:!0,default:e};return i&&(n.type=i),n}i.getFullFormOfProperty=function(t,e){return t&&t.constructor===Object?null:Array.isArray(t)&&t.length>0?c(e,[],t):"function"==typeof t?c(e,n.isChildClassOf(t,cc.ValueType)?new t:null,t):t instanceof r.PrimitiveType?c(e,t.default):c(e,t)},i.preprocessAttrs=function(t,e){for(var n in t){var r=t[n],a=i.getFullFormOfProperty(r,!1);if(a&&(r=t[n]=a),r){var c=r.notify;c&&s(r,n,c,t),"type"in r&&o(r,r.type,e,n)}}},i.validateMethodWithProps=function(t){return"function"==typeof t||null===t}}),{"./CCClass":168,"./attribute":180,"./js":189}],191:[(function(){"use strict";var t=[];cc._RF={push:function(e,i,n){void 0===n&&(n=i,i=""),t.push({uuid:i,script:n,module:e,exports:e.exports,beh:null})},pop:function(){var e=t.pop(),i=e.module,n=i.exports;if(n===e.exports){for(var r in n)return;i.exports=n=e.cls}},peek:function(){return t[t.length-1]}}}),{}],192:[(function(t,e){"use strict";t("./js"),e.exports={contains:function(t,e){if("function"==typeof t.contains)return t.contains(e);if("function"==typeof t.compareDocumentPosition)return!!(16&t.compareDocumentPosition(e));var i=e.parentNode;if(i)do{if(i===t)return!0;i=i.parentNode}while(null!==i);return!1},isDomNode:"object"==typeof window&&("function"==typeof Node?function(t){return t instanceof Node}:function(t){return t&&"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName}),callInNextTick:function(t,e,i){t&&setTimeout((function(){t(e,i)}),0)}}}),{"./js":189}],193:[(function(t){"use strict";t("./platform/js"),t("./value-types"),t("./utils"),t("./platform/CCInputManager"),t("./platform/CCInputExtension"),t("./event"),t("./platform/CCSys"),t("./platform/CCMacro"),t("./asset-manager"),t("./CCDirector"),t("./renderer"),t("./platform/CCView"),t("./platform/CCScreen"),t("./CCScheduler"),t("./event-manager")}),{"./CCDirector":27,"./CCScheduler":32,"./asset-manager":50,"./event":143,"./event-manager":139,"./platform/CCInputExtension":171,"./platform/CCInputManager":172,"./platform/CCMacro":173,"./platform/CCScreen":176,"./platform/CCSys":177,"./platform/CCView":178,"./platform/js":189,"./renderer":199,"./utils":241,"./value-types":257}],194:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("./assembler")),r=s(t("./utils/dynamic-atlas/manager")),a=s(t("./webgl/render-data"));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=c(n.key,"string"))?r:String(r)),n)}var r}function c(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var u=(function(t){var e,i;function n(){var e;return(e=t.call(this)||this)._renderData=new a.default,e._renderData.init(l(e)),e.initData(),e.initLocal(),e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,h(e,i);var s,c,u=n.prototype;return u.initData=function(){this._renderData.createQuadData(0,this.verticesFloats,this.indicesCount)},u.initLocal=function(){this._local=[],this._local.length=4},u.updateColor=function(t,e){var i=this._renderData.uintVDatas[0];if(i){e=null!=e?e:t.node.color._val;for(var n=this.floatsPerVert,r=this.colorOffset,a=i.length;r<a;r+=n)i[r]=e}},u.getBuffer=function(){return cc.renderer._handle._meshBuffer},u.updateWorldVerts=function(t){var e=this._local,i=this._renderData.vDatas[0],n=t.node._worldMatrix.m,r=n[0],a=n[1],s=n[4],o=n[5],c=n[12],l=n[13],h=e[0],u=e[2],f=e[1],_=e[3],d=this.floatsPerVert,p=0;if(1===r&&0===a&&0===s&&1===o)i[p]=h+c,i[p+1]=f+l,i[p+=d]=u+c,i[p+1]=f+l,i[p+=d]=h+c,i[p+1]=_+l,i[p+=d]=u+c,i[p+1]=_+l;else{var m=r*h,v=r*u,g=a*h,y=a*u,T=s*f,A=s*_,b=o*f,E=o*_;i[p]=m+T+c,i[p+1]=g+b+l,i[p+=d]=v+T+c,i[p+1]=y+b+l,i[p+=d]=m+A+c,i[p+1]=g+E+l,i[p+=d]=v+A+c,i[p+1]=y+E+l}},u.fillBuffers=function(t,e){e.worldMatDirty&&this.updateWorldVerts(t);var i=this._renderData,n=i.vDatas[0],r=i.iDatas[0],a=this.getBuffer(e),s=a.request(this.verticesCount,this.indicesCount),o=s.byteOffset>>2,c=a._vData;n.length+o>c.length?c.set(n.subarray(0,c.length-o),o):c.set(n,o);for(var l=a._iData,h=s.indiceOffset,u=s.vertexOffset,f=0,_=Math.min(this.indicesCount,r.length);f<_;f++)l[h++]=u+r[f]},u.packToDynamicAtlas=function(t,e){if(!e._original&&r.default&&e._texture.packable&&e._texture.loaded){var i=r.default.insertSpriteFrame(e);i&&e._setDynamicAtlasFrame(i)}var n=t._materials[0];n&&n.getProperty("texture")!==e._texture._texture&&(t._vertsDirty=!0,t._updateMaterial())},s=n,(c=[{key:"verticesFloats",get:function(){return this.verticesCount*this.floatsPerVert}}])&&o(s.prototype,c),Object.defineProperty(s,"prototype",{writable:!1}),n})(n.default);i.default=u,cc.js.addon(u.prototype,{floatsPerVert:5,verticesCount:4,indicesCount:6,uvOffset:2,colorOffset:4}),cc.Assembler2D=u,e.exports=i.default}),{"./assembler":196,"./utils/dynamic-atlas/manager":202,"./webgl/render-data":230}],195:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../utils/pool"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=0;function o(t){return Object.getOwnPropertyDescriptor(t,"__assemblerId__")||(t.__assemblerId__=++s),t.__assemblerId__}var c=new(function(t){var e,i;function n(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this)._pool={},e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.put=function(t){if(t&&this.enabled){var e=o(t.constructor),i=this._pool;i[e]||(i[e]=[]),this.count>this.maxSize||(this._clean(t),i[e].push(t),this.count++)}},r.get=function(t){var e;if(this.enabled){var i=this._pool,n=o(t);e=i[n]&&i[n].pop()}return e?this.count--:e=new t,e},r.clear=function(){this._pool={},this.count=0},r._clean=function(t){t._renderComp=null},n}(r.default));r.default.register("assembler",c);var l=c;i.default=l,e.exports=i.default}),{"../utils/pool":244}],196:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./webgl/vertex-format"),a=(n=t("./assembler-pool"))&&n.__esModule?n:{default:n},s=(function(){function t(){this._extendNative&&this._extendNative()}var e=t.prototype;return e.init=function(t){this._renderComp=t},e.updateRenderData=function(){},e.fillBuffers=function(){},e.getVfmt=function(){return r.vfmtPosUvColor},t})();i.default=s,s.register=function(t,e){t.__assembler__=e},s.init=function(t){for(var e=t.constructor,i=e.__assembler__;!i;){if(!(e=e.$super))return void cc.warn("Can not find assembler for render component : ["+cc.js.getClassName(t)+"]");i=e.__assembler__}if(i.getConstructor&&(i=i.getConstructor(t)),!t._assembler||t._assembler.constructor!==i){var n=a.default.get(i);n.init(t),t._assembler=n}},cc.Assembler=s,e.exports=i.default}),{"./assembler-pool":195,"./webgl/vertex-format":232}],197:[(function(t,e){"use strict";var i=function(t){var e;try{e=t.getContext("2d")}catch(i){return void console.error(i)}this._canvas=t,this._ctx=e,this._caps={},this._stats={drawcalls:0},this._vx=this._vy=this._vw=this._vh=0,this._sx=this._sy=this._sw=this._sh=0};i.prototype._restoreTexture=function(){},i.prototype.setViewport=function(t,e,i,n){this._vx===t&&this._vy===e&&this._vw===i&&this._vh===n||(this._vx=t,this._vy=e,this._vw=i,this._vh=n)},i.prototype.setScissor=function(t,e,i,n){this._sx===t&&this._sy===e&&this._sw===i&&this._sh===n||(this._sx=t,this._sy=e,this._sw=i,this._sh=n)},i.prototype.clear=function(t){var e=this._ctx;e.clearRect(this._vx,this._vy,this._vw,this._vh),!t||0===t[0]&&0===t[1]&&0===t[2]||(e.fillStyle="rgb("+t[0]+","+t[1]+","+t[2]+")",e.globalAlpha=t[3],e.fillRect(this._vx,this._vy,this._vw,this._vh))},i.prototype.resetDrawCalls=function(){this._stats.drawcalls=0},i.prototype.getDrawCalls=function(){return this._stats.drawcalls},e.exports=i}),{}],198:[(function(t,e){"use strict";var i=function(t,e){this._device=t,this._width=4,this._height=4,this._image=null,e&&(void 0!==e.width&&(this._width=e.width),void 0!==e.height&&(this._height=e.height),this.updateImage(e))};i.prototype.update=function(t){this.updateImage(t)},i.prototype.updateImage=function(t){if(t.images&&t.images[0]){var e=t.images[0];e&&e!==this._image&&(this._image=e)}},i.prototype.destroy=function(){this._image=null},e.exports=i}),{}],199:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../../renderer/gfx")),r=s(t("../../renderer/core/input-assembler")),a=s(t("../../renderer/core/pass"));function s(t){return t&&t.__esModule?t:{default:t}}var o=cc.renderer={Texture2D:null,InputAssembler:r.default,Pass:a.default,renderEngine:null,canvas:null,device:null,scene:null,drawCalls:0,_handle:null,_cameraNode:null,_camera:null,_forward:null,_flow:null,initWebGL:function(e,i){t("./webgl/assemblers");var r=t("./webgl/model-batcher");this.Texture2D=n.default.Texture2D,this.canvas=e,this._flow=cc.RenderFlow;var a=t("../../renderer/scene/scene"),s=t("../../renderer/renderers/forward-renderer");this.device=new n.default.Device(e,i),this.scene=new a;var o,c=(o=this.device,{defaultTexture:new n.default.Texture2D(o,{images:[],width:128,height:128,wrapS:n.default.WRAP_REPEAT,wrapT:n.default.WRAP_REPEAT,format:n.default.TEXTURE_FMT_RGB8,genMipmaps:!1}),programTemplates:[],programChunks:{}});this._forward=new s(this.device,c),this._handle=new r(this.device,this.scene),this._flow.init(this._handle,this._forward)},initCanvas:function(e){var i=t("./canvas"),n=t("./canvas/Texture2D"),r=t("./canvas/Device");this.Device=r,this.Texture2D=n,this.canvas=e,this.device=new r(e),this._camera={a:1,b:0,c:0,d:1,tx:0,ty:0},this._handle=new i.RenderComponentHandle(this.device,this._camera),this._forward=new i.ForwardRenderer,this._flow=cc.RenderFlow,this._flow.init(this._handle,this._forward)},updateCameraViewport:function(){if(cc.director){var t=cc.director.getScene();t&&t.setScale(1,1,1)}if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS){var e=cc.view.getViewportRect();this.device.setViewport(e.x,e.y,e.width,e.height),this._camera.a=cc.view.getScaleX(),this._camera.d=cc.view.getScaleY(),this._camera.tx=e.x,this._camera.ty=e.y+e.height}},render:function(t,e){this.device.resetDrawCalls(),t&&(this._flow.render(t,e),this.drawCalls=this.device.getDrawCalls())},clear:function(){this._handle.reset(),this._forward.clear()}};i.default=o,e.exports=i.default}),{"../../renderer/core/input-assembler":280,"../../renderer/core/pass":281,"../../renderer/gfx":290,"../../renderer/renderers/forward-renderer":309,"../../renderer/scene/scene":312,"./canvas":void 0,"./canvas/Device":197,"./canvas/Texture2D":198,"./webgl/assemblers":211,"./webgl/model-batcher":228}],200:[(function(t,e){"use strict";var i,n,r=0,a=1<<r++,s=1<<r++,o=1<<r++,c=1<<r++,l=o|c,h=1<<r++,u=1<<r++,f=1<<r++,_=u|f,d=1<<r++,p=1<<r++,m=1<<r++,v=1<<r++,g=0;function y(){this._func=x,this._next=null}var T=y.prototype;T._doNothing=function(){},T._localTransform=function(t){t._updateLocalMatrix(),t._renderFlag&=~o,this._next._func(t)},T._worldTransform=function(t){i.worldMatDirty++;var e=t._matrix,n=t._trs,r=e.m;r[12]=n[0],r[13]=n[1],r[14]=n[2],t._mulMat(t._worldMatrix,t._parent._worldMatrix,e),t._renderFlag&=~c,this._next._func(t),i.worldMatDirty--},T._updateRenderData=function(t){var e=t._renderComponent;e._assembler.updateRenderData(e),t._renderFlag&=~h,this._next._func(t)},T._opacity=function(t){i.parentOpacityDirty++,this._next._func(t),t._renderFlag&=~u,i.parentOpacityDirty--},T._color=function(t){var e=t._renderComponent;e&&e._updateColor(),t._renderFlag&=~f,this._next._func(t)},T._render=function(t){var e=t._renderComponent;e._checkBacth(i,t._cullingMask),e._assembler.fillBuffers(e,i),this._next._func(t)},T._children=function(t){for(var e=g,n=i,r=n.parentOpacity,a=n.parentOpacity*=t._opacity/255,s=(n.worldMatDirty?c:0)|(n.parentOpacityDirty?_:0),o=t._children,l=0,h=o.length;l<h;l++){var u=o[l];if(u._renderFlag|=s,u._activeInHierarchy&&0!==u._opacity){g=u._cullingMask=0===u.groupIndex?e:1<<u.groupIndex;var f=u._color._val;u._color._fastSetA(u._opacity*a),b[u._renderFlag]._func(u),u._color._val=f}}n.parentOpacity=r,this._next._func(t)},T._postRender=function(t){var e=t._renderComponent;e._checkBacth(i,t._cullingMask),e._assembler.postFillBuffers(e,i),this._next._func(t)};var A=new y;A._func=A._doNothing,A._next=A;var b={};function E(t,e){if(t===a||t===s)return A;var i=new y;switch(i._next=e||A,t){case o:i._func=i._localTransform;break;case c:i._func=i._worldTransform;break;case h:i._func=i._updateRenderData;break;case u:i._func=i._opacity;break;case f:i._func=i._color;break;case d:i._func=i._render;break;case p:i._func=i._children;break;case m:i._func=i._postRender}return i}function C(t){for(var e=null,i=v;i>0;)i&t&&(e=E(i,e)),i>>=1;return e}function x(t){var e=t._renderFlag;(b[e]=C(e))._func(t)}y.flows=b,y.createFlow=E;var S=[];y.registerValidate=function(t){t._inValidateList||(S.push(t),t._inValidateList=!0)},y.validateRenderers=function(){for(var t=0,e=S.length;t<e;t++){var i=S[t];i.isValid&&(i.enabledInHierarchy?i._validateRender():i.disableRender(),i._inValidateList=!1)}S.length=0},y.visitRootNode=function(t){y.validateRenderers();var e=g;g=t._cullingMask,t._renderFlag&c?(i.worldMatDirty++,t._calculWorldMatrix(),t._renderFlag&=~c,b[t._renderFlag]._func(t),i.worldMatDirty--):b[t._renderFlag]._func(t),g=e},y.render=function(t,e){i.reset(),i.walking=!0,y.visitRootNode(t),i.terminate(),i.walking=!1,n.render(i._renderScene,e)},y.renderCamera=function(t,e){i.reset(),i.walking=!0,y.visitRootNode(e),i.terminate(),i.walking=!1,n.renderCamera(t,i._renderScene)},y.init=function(t,e){i=t,n=e,b[0]=A;for(var r=1;r<v;r++)b[r]=new y},y.getBachther=function(){return i},y.FLAG_DONOTHING=a,y.FLAG_BREAK_FLOW=s,y.FLAG_LOCAL_TRANSFORM=o,y.FLAG_WORLD_TRANSFORM=c,y.FLAG_TRANSFORM=l,y.FLAG_UPDATE_RENDER_DATA=h,y.FLAG_OPACITY=u,y.FLAG_COLOR=f,y.FLAG_OPACITY_COLOR=_,y.FLAG_RENDER=d,y.FLAG_CHILDREN=p,y.FLAG_POST_RENDER=m,y.FLAG_FINAL=v,e.exports=cc.RenderFlow=y}),{}],201:[(function(t,e){"use strict";var i=t("../../../assets/CCRenderTexture"),n=2;function r(t,e){var r=new i;r.initWithSize(t,e),r.update(),this._texture=r,this._x=n,this._y=n,this._nexty=n,this._width=t,this._height=e,this._innerTextureInfos={},this._innerSpriteFrames=[],this._count=0}r.DEFAULT_HASH=(new i)._getHash(),cc.js.mixin(r.prototype,{insertSpriteFrame:function(t){var e=t._rect,i=t._texture,r=this._innerTextureInfos[i._id],a=e.x,s=e.y;if(r)a+=r.x,s+=r.y;else{var o=i.width,c=i.height;if(this._x+o+n>this._width&&(this._x=n,this._y=this._nexty),this._y+c+n>this._nexty&&(this._nexty=this._y+c+n),this._nexty>this._height)return null;cc.dynamicAtlasManager.textureBleeding&&((o<=8||c<=8)&&(this._texture.drawTextureAt(i,this._x-1,this._y-1),this._texture.drawTextureAt(i,this._x-1,this._y+1),this._texture.drawTextureAt(i,this._x+1,this._y-1),this._texture.drawTextureAt(i,this._x+1,this._y+1)),this._texture.drawTextureAt(i,this._x-1,this._y),this._texture.drawTextureAt(i,this._x+1,this._y),this._texture.drawTextureAt(i,this._x,this._y-1),this._texture.drawTextureAt(i,this._x,this._y+1)),this._texture.drawTextureAt(i,this._x,this._y),this._innerTextureInfos[i._id]={x:this._x,y:this._y,texture:i},this._count++,a+=this._x,s+=this._y,this._x+=o+n,this._dirty=!0}var l={x:a,y:s,texture:this._texture};return this._innerSpriteFrames.push(t),l},update:function(){this._dirty&&(this._texture.update(),this._dirty=!1)},deleteInnerTexture:function(t){t&&this._innerTextureInfos[t._id]&&(delete this._innerTextureInfos[t._id],this._count--)},isEmpty:function(){return this._count<=0},reset:function(){this._x=n,this._y=n,this._nexty=n;for(var t=this._innerSpriteFrames,e=0,i=t.length;e<i;e++){var r=t[e];r.isValid&&r._resetDynamicAtlasFrame()}this._innerSpriteFrames.length=0,this._innerTextureInfos={}},destroy:function(){this.reset(),this._texture.destroy()}}),e.exports=r}),{"../../../assets/CCRenderTexture":70}],202:[(function(t,e){"use strict";var i=t("./atlas"),n=[],r=-1,a=5,s=2048,o=512,c=!0,l=null;function h(){var t=n[++r];return t||(t=new i(s,s),n.push(t)),t}function u(){_.reset()}var f=!1,_={Atlas:i,get enabled(){return f},set enabled(t){f!==t&&(t?(this.reset(),cc.director.on(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,u)):cc.director.off(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,u),f=t)},get maxAtlasCount(){return a},set maxAtlasCount(t){a=t},get atlasCount(){return n.length},get textureBleeding(){return c},set textureBleeding(t){c=t},get textureSize(){return s},set textureSize(t){s=t},get maxFrameSize(){return o},set maxFrameSize(t){o=t},insertSpriteFrame:function(t){if(!f||r===a||!t||t._original)return null;if(!t._texture.packable)return null;var e=n[r];e||(e=h());var i=e.insertSpriteFrame(t);return i||r===a?i:(e=h()).insertSpriteFrame(t)},reset:function(){for(var t=0,e=n.length;t<e;t++)n[t].destroy();n.length=0,r=-1},deleteAtlasSpriteFrame:function(t){if(t._original){var e=t._original._texture;this.deleteAtlasTexture(e)}},deleteAtlasTexture:function(t){if(t)for(var e=n.length-1;e>=0;e--)n[e].deleteInnerTexture(t),n[e].isEmpty()&&(n[e].destroy(),n.splice(e,1),r--)},showDebug:function(t){if(t){if(!l||!l.isValid){var e=cc.visibleRect.width,i=cc.visibleRect.height;(l=new cc.Node("DYNAMIC_ATLAS_DEBUG_NODE")).width=e,l.height=i,l.x=e/2,l.y=i/2,l.zIndex=cc.macro.MAX_ZINDEX,l.parent=cc.director.getScene(),l.groupIndex=cc.Node.BuiltinGroupIndex.DEBUG,cc.Camera._setupDebugCamera();var a=l.addComponent(cc.ScrollView),o=new cc.Node("CONTENT"),c=o.addComponent(cc.Layout);c.type=cc.Layout.Type.VERTICAL,c.resizeMode=cc.Layout.ResizeMode.CONTAINER,o.parent=l,o.width=s,o.anchorY=1,o.x=s,a.content=o;for(var h=0;h<=r;h++){var u=new cc.Node("ATLAS"),f=(n[h]._texture,new cc.SpriteFrame);f.setTexture(n[h]._texture),u.addComponent(cc.Sprite).spriteFrame=f,u.parent=o}}return l}l&&(l.parent=null,l=null)},update:function(){if(this.enabled)for(var t=0;t<=r;t++)n[t].update()}};e.exports=cc.dynamicAtlasManager=_}),{"./atlas":201}],203:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../assembler-2d"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=t("../../../utils/text-utils"),o=t("../../../platform/CCMacro"),c=t("../../../components/CCLabel").Overflow,l=t("../utils").shareLabelInfo,h=function(){this.char="",this.valid=!0,this.x=0,this.y=0,this.line=0,this.hash=""},u=cc.rect(),f=null,_=[],d=[],p=[],m=[],v=null,g=0,y=0,T=0,A=0,b=0,E=1,C=null,x=cc.size(),S="",w=0,D=0,M=0,R=0,I=0,O=0,P=0,N=!1,F=0,L=0,B=0,k=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.updateRenderData=function(t){t._vertsDirty&&f!==t&&(f=t,this._reserveQuads(t,t.string.toString().length),this._updateFontFamily(t),this._updateProperties(t),this._updateLabelInfo(t),this._updateContent(),this.updateWorldVerts(t),f._actualFontSize=w,f.node.setContentSize(x),f._vertsDirty=!1,f=null,this._resetProperties())},r._updateFontScale=function(){E=w/D},r._updateFontFamily=function(t){var e=t.font;C=e.spriteFrame,v=e._fntConfig,l.fontAtlas=e._fontDefDictionary,this.packToDynamicAtlas(t,C)},r._updateLabelInfo=function(){l.hash="",l.margin=0},r._updateProperties=function(t){S=t.string.toString(),w=t.fontSize,D=v?v.fontSize:t.fontSize,M=t.horizontalAlign,R=t.verticalAlign,I=t.spacingX,P=t.overflow,O=t._lineHeight,x.width=t.node.width,x.height=t.node.height,P===c.NONE?(N=!1,x.width+=2*l.margin,x.height+=2*l.margin):P===c.RESIZE_HEIGHT?(N=!0,x.height+=2*l.margin):N=t.enableWrapText,l.lineHeight=O,l.fontSize=w,this._setupBMFontOverflowMetrics()},r._resetProperties=function(){v=null,C=null,l.hash="",l.margin=0},r._updateContent=function(){this._updateFontScale(),this._computeHorizontalKerningForText(),this._alignText()},r._computeHorizontalKerningForText=function(){var t,e=S,i=e.length,n=_;if(v&&(t=v.kerningDict),t&&!cc.js.isEmptyObject(t))for(var r=-1,a=0;a<i;++a){var s=e.charCodeAt(a),o=t[r<<16|65535&s]||0;n[a]=a<i-1?o:0,r=s}else n.length=0},r._clearHorizontalKerning=function(){_.length=0},r._multilineTextWrap=function(t){for(var e=S.length,i=0,n=0,r=0,a=0,o=0,h=0,u=0,f=null,d=cc.v2(0,0),m=0;m<e;){var T=S.charAt(m);if("\n"!==T){for(var C=t(S,m,e),w=h,D=u,M=o,R=n,k=!1,V=0;V<C;++V){var U=m+V;if("\r"!==(T=S.charAt(U)))if(f=l.fontAtlas.getLetterDefinitionForChar(T,l)){var z=R+f.offsetX*E-l.margin;if(N&&B>0&&n>0&&z+f.w*E>B&&!s.isUnicodeSpace(T)){p.push(o),o=0,i++,n=0,r-=O*this._getFontScale()+0,k=!0;break}d.x=z,d.y=r-f.offsetY*E+l.margin,this._recordLetterInfo(d,T,U,i),U+1<_.length&&U<e-1&&(R+=_[U+1]),R+=f.xAdvance*E+I-2*l.margin,M=d.x+f.w*E-l.margin,w<d.y&&(w=d.y),D>d.y-f.h*E&&(D=d.y-f.h*E)}else{this._recordPlaceholderInfo(U,T);var G="";v&&(G=v.atlasName),console.log("Can't find letter definition in texture atlas "+G+" for letter:"+T)}else this._recordPlaceholderInfo(U,T)}k||(n=R,h<w&&(h=w),u>D&&(u=D),a<(o=M)&&(a=o),m+=C)}else p.push(o),o=0,i++,n=0,r-=O*this._getFontScale()+0,this._recordPlaceholderInfo(m,T),m++}return p.push(o),y=(g=i+1)*O*this._getFontScale(),g>1&&(y+=0*(g-1)),x.width=F,x.height=L,F<=0&&(x.width=parseFloat(a.toFixed(2))+2*l.margin),L<=0&&(x.height=parseFloat(y.toFixed(2))+2*l.margin),A=x.height,b=0,P!==c.CLAMP&&(h>0&&(A=x.height+h),u<-y&&(b=y+u)),!0},r._getFirstCharLen=function(){return 1},r._getFontScale=function(){return P===c.SHRINK?E:1},r._getFirstWordLen=function(t,e,i){var n=t.charAt(e);if(s.isUnicodeCJK(n)||"\n"===n||s.isUnicodeSpace(n))return 1;var r=1,a=l.fontAtlas.getLetterDefinitionForChar(n,l);if(!a)return r;for(var o=a.xAdvance*E+I,c=e+1;c<i&&(n=t.charAt(c),a=l.fontAtlas.getLetterDefinitionForChar(n,l));++c){if(o+a.offsetX*E+a.w*E>B&&!s.isUnicodeSpace(n)&&B>0)return r;if(o+=a.xAdvance*E+I,"\n"===n||s.isUnicodeSpace(n)||s.isUnicodeCJK(n))break;r++}return r},r._multilineTextWrapByWord=function(){return this._multilineTextWrap(this._getFirstWordLen)},r._multilineTextWrapByChar=function(){return this._multilineTextWrap(this._getFirstCharLen)},r._recordPlaceholderInfo=function(t,e){if(t>=d.length){var i=new h;d.push(i)}d[t].char=e,d[t].hash=e.charCodeAt(0)+l.hash,d[t].valid=!1},r._recordLetterInfo=function(t,e,i,n){if(i>=d.length){var r=new h;d.push(r)}var a=e.charCodeAt(0)+l.hash;d[i].line=n,d[i].char=e,d[i].hash=a,d[i].valid=l.fontAtlas.getLetter(a).valid,d[i].x=t.x,d[i].y=t.y},r._alignText=function(){y=0,p.length=0,this._multilineTextWrapByWord(),this._computeAlignmentOffset(),P===c.SHRINK&&w>0&&this._isVerticalClamp()&&this._shrinkLabelToContentSize(this._isVerticalClamp),this._updateQuads()||P===c.SHRINK&&this._shrinkLabelToContentSize(this._isHorizontalClamp)},r._scaleFontSizeDown=function(t){var e=!0;t||(t=.1,e=!1),w=t,e&&this._updateContent()},r._shrinkLabelToContentSize=function(t){for(var e=0,i=0|w,n=0;e<i;){var r=n=e+i+1>>1;if(r<=0)break;E=r/D,this._multilineTextWrapByWord(),this._computeAlignmentOffset(),t()?i=n-1:e=n}var a=e;a>=0&&this._scaleFontSizeDown(a)},r._isVerticalClamp=function(){return y>x.height},r._isHorizontalClamp=function(){for(var t=!1,e=0,i=S.length;e<i;++e){var n=d[e];if(n.valid){var r=l.fontAtlas.getLetter(n.hash),a=n.x+r.w*E,s=n.line;if(F>0)if(N){if(p[s]>x.width&&(a>x.width||a<0)){t=!0;break}}else if(a>x.width){t=!0;break}}}return t},r._isHorizontalClamped=function(t,e){var i=p[e],n=t>x.width||t<0;return N?i>x.width&&n:n},r._updateQuads=function(){var t=C?C._texture:l.fontAtlas.getTexture(),e=f.node;this.verticesCount=this.indicesCount=0,this._renderData&&(this._renderData.dataLength=0);for(var i=x,n=e._anchorPoint.x*i.width,r=e._anchorPoint.y*i.height,a=!0,s=0,o=S.length;s<o;++s){var h=d[s];if(h.valid){var _=l.fontAtlas.getLetter(h.hash);u.height=_.h,u.width=_.w,u.x=_.u,u.y=_.v;var p=h.y+T;if(L>0){if(p>A){var v=p-A;u.y+=v,u.height-=v,p-=v}p-_.h*E<b&&P===c.CLAMP&&(u.height=p<b?0:(p-b)/E)}var g=h.line,y=h.x+_.w/2*E+m[g];if(F>0&&this._isHorizontalClamped(y,g))if(P===c.CLAMP)u.width=0;else if(P===c.SHRINK){if(x.width>_.w){a=!1;break}u.width=0}if(u.height>0&&u.width>0){var w=this._determineRect(u),D=h.x+m[h.line];this.appendQuad(f,t,u,w,D-n,p-r,E)}}}return this._quadsUpdated(f),a},r._determineRect=function(t){var e=C.isRotated(),i=C._originalSize,n=C._rect,r=C._offset,a=r.x+(i.width-n.width)/2,s=r.y-(i.height-n.height)/2;if(e){var o=t.x;t.x=n.x+n.height-t.y-t.height-s,t.y=o+n.y-a,t.y<0&&(t.height=t.height+s)}else t.x+=n.x-a,t.y+=n.y+s;return e},r._computeAlignmentOffset=function(){switch(m.length=0,M){case o.TextAlignment.LEFT:for(var t=0;t<g;++t)m.push(0);break;case o.TextAlignment.CENTER:for(var e=0,i=p.length;e<i;e++)m.push((x.width-p[e])/2);break;case o.TextAlignment.RIGHT:for(var n=0,r=p.length;n<r;n++)m.push(x.width-p[n])}if(T=x.height,R!==o.VerticalTextAlignment.TOP){var a=x.height-y+O*this._getFontScale()-D*E;R===o.VerticalTextAlignment.BOTTOM?T-=a:T-=a/2}},r._setupBMFontOverflowMetrics=function(){var t=x.width,e=x.height;P===c.RESIZE_HEIGHT&&(e=0),P===c.NONE&&(t=0,e=0),F=t,L=e,B=t},r.updateWorldVerts=function(){},r.appendQuad=function(){},r._quadsUpdated=function(){},r._reserveQuads=function(){},n})(r.default);i.default=k,e.exports=i.default}),{"../../../components/CCLabel":108,"../../../platform/CCMacro":173,"../../../utils/text-utils":249,"../../assembler-2d":194,"../utils":207}],204:[(function(t,e){"use strict";function i(){this._rect=null,this.uv=[],this._texture=null,this._original=null}i.prototype={constructor:i,getRect:function(){return cc.rect(this._rect)},setRect:function(t){this._rect=t,this._texture&&this._calculateUV()},_setDynamicAtlasFrame:function(t){t&&(this._original={_texture:this._texture,_x:this._rect.x,_y:this._rect.y},this._texture=t.texture,this._rect.x=t.x,this._rect.y=t.y,this._calculateUV())},_resetDynamicAtlasFrame:function(){this._original&&(this._rect.x=this._original._x,this._rect.y=this._original._y,this._texture=this._original._texture,this._original=null,this._calculateUV())},_refreshTexture:function(t){this._texture=t,this._rect=cc.rect(0,0,t.width,t.height),this._calculateUV()},_calculateUV:function(){var t=this._rect,e=this._texture,i=this.uv,n=e.width,r=e.height,a=0===n?0:t.x/n,s=0===n?0:(t.x+t.width)/n,o=0===r?0:(t.y+t.height)/r,c=0===r?0:t.y/r;i[0]=a,i[1]=o,i[2]=s,i[3]=o,i[4]=a,i[5]=c,i[6]=s,i[7]=c}},e.exports=i}),{}],205:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../webgl/assemblers/label/2d/bmfont"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=t("../../../components/CCLabel"),o=t("../../../components/CCLabelOutline"),c=t("../../../utils/text-utils"),l=t("../../../components/CCComponent"),h=t("../../../assets/CCRenderTexture"),u=cc.js.isChildClassOf(o,l),f=t("../utils").getFontFamily,_=t("../utils").shareLabelInfo,d=cc.BitmapFont.FontLetterDefinition,p=cc.BitmapFont.FontAtlas,m=cc.Color.WHITE,v=0,g=(1/255).toFixed(3);function y(t,e){this._texture=null,this._labelInfo=e,this._char=t,this._hash=null,this._data=null,this._canvas=null,this._context=null,this._width=0,this._height=0,this._offsetY=0,this._hash=t.charCodeAt(0)+e.hash}function T(t,e){var i=new h;i.initWithSize(t,e),i.update(),this._fontDefDictionary=new p(i),this._x=v,this._y=v,this._nexty=v,this._width=t,this._height=e,cc.director.on(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,this.beforeSceneLoad,this)}y.prototype={constructor:y,updateRenderData:function(){this._updateProperties(),this._updateTexture()},_updateProperties:function(){this._texture=new cc.Texture2D,this._data=s._canvasPool.get(),this._canvas=this._data.canvas,this._context=this._data.context,this._context.font=this._labelInfo.fontDesc;var t=c.safeMeasureText(this._context,this._char,this._labelInfo.fontDesc),e=2*this._labelInfo.margin+2;this._width=parseFloat(t.toFixed(2))+e,this._height=(1+c.BASELINE_RATIO)*this._labelInfo.fontSize+e,this._offsetY=-this._labelInfo.fontSize*c.BASELINE_RATIO/2,this._canvas.width!==this._width&&(this._canvas.width=this._width),this._canvas.height!==this._height&&(this._canvas.height=this._height),this._texture.initWithElement(this._canvas)},_updateTexture:function(){var t=this._context,e=this._labelInfo,i=this._canvas.width,n=this._canvas.height,r=this._labelInfo.fontSize,a=i/2,s=n/2+r*c.MIDDLE_RATIO+r*c.BASELINE_OFFSET,o=e.color;if(t.lineJoin="round",t.textAlign="center",t.clearRect(0,0,i,n),t.fillStyle="rgba("+o.r+", "+o.g+", "+o.b+", "+g+")",t.fillRect(0,0,i,n),t.font=e.fontDesc,t.fillStyle="rgba("+o.r+", "+o.g+", "+o.b+", 1)",e.isOutlined&&e.margin>0){var l=e.out||m;t.strokeStyle="rgba("+l.r+", "+l.g+", "+l.b+", "+l.a/255+")",t.lineWidth=2*e.margin,t.strokeText(this._char,a,s)}t.fillText(this._char,a,s),this._texture.handleLoadedTexture()},destroy:function(){this._texture.destroy(),this._texture=null,s._canvasPool.put(this._data),this._data=null}},cc.js.mixin(T.prototype,{insertLetterTexture:function(t){var e=t._texture,i=e.width,n=e.height;if(this._x+i+v>this._width&&(this._x=v,this._y=this._nexty),this._y+n>this._nexty&&(this._nexty=this._y+n+v),this._nexty>this._height)return null;this._fontDefDictionary._texture.drawTextureAt(e,this._x,this._y),this._dirty=!0;var r=new d;return r.u=this._x+1,r.v=this._y+1,r.texture=this._fontDefDictionary._texture,r.valid=!0,r.w=t._width-2,r.h=t._height-2,r.xAdvance=r.w,r.offsetY=t._offsetY,this._x+=i+v,this._fontDefDictionary.addLetterDefinitions(t._hash,r),r},update:function(){this._dirty&&(this._fontDefDictionary._texture.update(),this._dirty=!1)},reset:function(){this._x=v,this._y=v,this._nexty=v;for(var t=this._fontDefDictionary._letterDefinitions,e=0,i=t.length;e<i;e++){var n=t[e];n.isValid&&n.destroy()}this._fontDefDictionary.clear()},destroy:function(){this.reset(),this._fontDefDictionary._texture.destroy(),this._fontDefDictionary._texture=null},beforeSceneLoad:function(){this.clearAllCache()},clearAllCache:function(){this.destroy();var t=new h;t.initWithSize(this._width,this._height),t.update(),this._fontDefDictionary._texture=t},getLetter:function(t){return this._fontDefDictionary._letterDefinitions[t]},getTexture:function(){return this._fontDefDictionary.getTexture()},getLetterDefinitionForChar:function(t,e){var i=t.charCodeAt(0)+e.hash,n=this._fontDefDictionary._letterDefinitions[i];if(!n){var r=new y(t,e);r.updateRenderData(),n=this.insertLetterTexture(r),r.destroy()}return n}});var A=null,b=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r._getAssemblerData=function(){return A||(A=new T(2048,2048),cc.Label._shareAtlas=A),A.getTexture()},r._updateFontFamily=function(t){_.fontAtlas=A,_.fontFamily=f(t);var e=u&&t.getComponent(o);e&&e.enabled?(_.isOutlined=!0,_.margin=e.width,_.out=e.color.clone(),_.out.a=e.color.a*t.node.color.a/255):(_.isOutlined=!1,_.margin=0)},r._updateLabelInfo=function(t){var e,i,n;_.fontDesc=this._getFontDesc(),_.color=t.node.color,_.hash=(i=(e=_).color.toHEX(),n="",e.isOutlined&&e.margin>0&&(n=n+e.margin+e.out.toHEX()),""+e.fontSize+e.fontFamily+i+n)},r._getFontDesc=function(){return _.fontSize.toString()+"px "+_.fontFamily},r._computeHorizontalKerningForText=function(){this._clearHorizontalKerning()},r._determineRect=function(){return!1},n})(r.default);i.default=b,e.exports=i.default}),{"../../../assets/CCRenderTexture":70,"../../../components/CCComponent":106,"../../../components/CCLabel":108,"../../../components/CCLabelOutline":109,"../../../utils/text-utils":249,"../../webgl/assemblers/label/2d/bmfont":212,"../utils":207}],206:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../assembler-2d"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s,o=t("../../../utils/text-utils"),c=t("../../../platform/CCMacro"),l=t("../../../components/CCLabel"),h=t("../../../components/CCLabelOutline"),u=t("../../../components/CCLabelShadow"),f=l.Overflow,_=t("../utils").deleteFromDynamicAtlas,d=t("../utils").getFontFamily,p=(1/255).toFixed(3),m=null,v=null,g=null,y="",T="",A=0,b=0,E=[],C=cc.Size.ZERO,x=0,S=0,w=0,D=null,M="",R=f.NONE,I=!1,O=!1,P=null,N=cc.Color.WHITE,F=null,L=cc.Color.BLACK,B=cc.rect(),k=cc.Size.ZERO,V=cc.Size.ZERO,U=!1,z=!1,G=!1,H=0,W=cc.Vec2.ZERO,j=0,Y=["left","center","right"],X=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r._getAssemblerData=function(){return(s=l._canvasPool.get()).canvas.width=s.canvas.height=1,s},r._resetAssemblerData=function(t){t&&l._canvasPool.put(t)},r.updateRenderData=function(e){t.prototype.updateRenderData.call(this,e),e._vertsDirty&&(this._updateProperties(e),this._calculateLabelFont(),this._updateLabelDimensions(),this._updateTexture(e),this._calDynamicAtlas(e),e._actualFontSize=A,e.node.setContentSize(V),this.updateVerts(e),e._vertsDirty=!1,m=null,v=null,g=null)},r.updateVerts=function(){},r._updatePaddingRect=function(){var t=0,e=0,i=0,n=0,r=0;if(k.width=k.height=0,P&&(t=e=i=n=r=P.width,k.width=k.height=2*r),F){var a=F.blur+r;i=Math.max(i,-F._offset.x+a),n=Math.max(n,F._offset.x+a),t=Math.max(t,F._offset.y+a),e=Math.max(e,-F._offset.y+a)}if(z){var s=b*Math.tan(.20943951);n+=s,k.width+=s}B.x=i,B.y=t,B.width=i+n,B.height=t+e},r._updateProperties=function(t){var e=t._assemblerData;m=e.context,v=e.canvas,g=t._frame._original?t._frame._original._texture:t._frame._texture,T=t.string.toString(),A=t._fontSize,b=A,H=t.underlineHeight||b/8,R=t.overflow,C.width=t.node.width,C.height=t.node.height,V=t.node.getContentSize(),x=t._lineHeight,S=t.horizontalAlign,w=t.verticalAlign,D=t.node.color,U=t.enableBold,z=t.enableItalic,G=t.enableUnderline,M=d(t),O=t.srcBlendFactor===cc.macro.BlendFactor.ONE,I=R!==f.NONE&&(R===f.RESIZE_HEIGHT||t.enableWrapText),(P=(P=h&&t.getComponent(h))&&P.enabled&&P.width>0?P:null)&&N.set(P.color),(F=(F=u&&t.getComponent(u))&&F.enabled?F:null)&&(L.set(F.color),L.a=L.a*t.node.color.a/255),this._updatePaddingRect()},r._calculateFillTextStartPosition=function(){var t=0;S===c.TextAlignment.RIGHT?t=C.width-B.width:S===c.TextAlignment.CENTER&&(t=(C.width-B.width)/2);var e=this._getLineHeight()*(E.length-1),i=A*(1-o.BASELINE_RATIO/2);if(w!==c.VerticalTextAlignment.TOP){var n=e+B.height+A-C.height;w===c.VerticalTextAlignment.BOTTOM?i-=n+=o.BASELINE_RATIO/2*A:i-=n/2}return i+=o.BASELINE_OFFSET*A,cc.v2(t+B.x,i+B.y)},r._setupOutline=function(){m.strokeStyle="rgba("+N.r+", "+N.g+", "+N.b+", "+N.a/255+")",m.lineWidth=2*P.width},r._setupShadow=function(){m.shadowColor="rgba("+L.r+", "+L.g+", "+L.b+", "+L.a/255+")",m.shadowBlur=F.blur,m.shadowOffsetX=F.offset.x,m.shadowOffsetY=-F.offset.y},r._drawTextEffect=function(t,e){if(F||P||G){var i=E.length>1&&F,n=this._measureText(m,y),r=0,a=0;F&&this._setupShadow(),P&&this._setupOutline();for(var s=0;s<E.length;++s)r=t.x,a=t.y+s*e,i&&(P&&m.strokeText(E[s],r,a),m.fillText(E[s],r,a)),G&&(j=n(E[s]),S===c.TextAlignment.RIGHT?W.x=t.x-j:S===c.TextAlignment.CENTER?W.x=t.x-j/2:W.x=t.x,W.y=a+b/8,m.fillRect(W.x,W.y,j,H));i&&(m.shadowColor="transparent")}},r._updateTexture=function(){if(m.clearRect(0,0,v.width,v.height),m.lineJoin="round",O)m.fillStyle="rgba("+D.r+", "+D.g+", "+D.b+", "+D.a/255+")";else{var t=P?N:D;m.fillStyle="rgba("+t.r+", "+t.g+", "+t.b+", "+p+")",m.fillRect(0,0,v.width,v.height),m.fillStyle="rgba("+D.r+", "+D.g+", "+D.b+", 1)"}var e=this._calculateFillTextStartPosition(),i=this._getLineHeight(),n=e.x,r=0;this._drawTextEffect(e,i);for(var a=0;a<E.length;++a)r=e.y+a*i,P&&m.strokeText(E[a],n,r),m.fillText(E[a],n,r);F&&(m.shadowColor="transparent"),g.handleLoadedTexture()},r._calDynamicAtlas=function(t){if(t.cacheMode===l.CacheMode.BITMAP){var e=t._frame;_(t,e),e._original||e.setRect(cc.rect(0,0,v.width,v.height)),this.packToDynamicAtlas(t,e)}},r._updateLabelDimensions=function(){var t=cc.renderer.device.caps?cc.renderer.device.caps.maxTextureSize:2048;(C.width>t||C.height>t)&&cc.warn("The maximum texture size supported by the device is "+t),C.width=Math.min(C.width,t),C.height=Math.min(C.height,t);var e=!1;v.width!==C.width&&(v.width=C.width,e=!0),v.height!==C.height&&(v.height=C.height,e=!0),e&&(m.font=y),m.textAlign=Y[S]},r._getFontDesc=function(){var t=A.toString()+"px ";return t+=M,U&&(t="bold "+t),z&&(t="italic "+t),t},r._getLineHeight=function(){return 0|(0===x?A:x*A/b)},r._calculateParagraphLength=function(t,e){for(var i=[],n=0;n<t.length;++n){var r=o.safeMeasureText(e,t[n],y);i.push(r)}return i},r._measureText=function(t,e){return function(i){return o.safeMeasureText(t,i,e)}},r._calculateShrinkFont=function(t){var e=this._calculateParagraphLength(t,m),i=0,n=0,r=0;if(I){var a=V.width,s=V.height;if(a<0||s<0)return;n=s+1;for(var c=0,l=0|A+1,h=0;c<l;){if((h=c+l+1>>1)<=0){cc.logID(4003);break}A=h,y=this._getFontDesc(),m.font=y;var u=this._getLineHeight();for(n=0,i=0;i<t.length;++i){var f=o.safeMeasureText(m,t[i],y);n+=o.fragmentText(t[i],f,a,this._measureText(m,y)).length*u}n>s?l=h-1:c=h}0===c?cc.logID(4003):(A=c,y=this._getFontDesc(),m.font=y)}else{for(n=t.length*this._getLineHeight(),i=0;i<t.length;++i)r<e[i]&&(r=e[i]);var _=(C.width-B.width)/r,d=C.height/n;A=b*Math.min(1,_,d)|0,y=this._getFontDesc(),m.font=y}},r._calculateWrapText=function(t){if(I){E=[];for(var e=V.width,i=0;i<t.length;++i){var n=o.safeMeasureText(m,t[i],y),r=o.fragmentText(t[i],n,e,this._measureText(m,y));E=E.concat(r)}}},r._calculateLabelFont=function(){var t=T.split("\n");switch(E=t,y=this._getFontDesc(),m.font=y,R){case f.NONE:for(var e=0,i=0,n=0;n<t.length;++n){var r=o.safeMeasureText(m,t[n],y);e=e>r?e:r}i=(E.length+o.BASELINE_RATIO)*this._getLineHeight();var a=parseFloat(e.toFixed(2)),s=parseFloat(i.toFixed(2));C.width=a+B.width,C.height=s+B.height,V.width=a+k.width,V.height=s+k.height;break;case f.SHRINK:this._calculateShrinkFont(t),this._calculateWrapText(t);break;case f.CLAMP:this._calculateWrapText(t);break;case f.RESIZE_HEIGHT:this._calculateWrapText(t);var c=(E.length+o.BASELINE_RATIO)*this._getLineHeight();C.height=c+B.height,V.height=c+k.height}},n})(r.default);i.default=X,e.exports=i.default}),{"../../../components/CCLabel":108,"../../../components/CCLabelOutline":109,"../../../components/CCLabelShadow":110,"../../../platform/CCMacro":173,"../../../utils/text-utils":249,"../../assembler-2d":194,"../utils":207}],207:[(function(t,e){"use strict";var i=t("./dynamic-atlas/manager"),n=cc.Color.WHITE,r={fontAtlas:null,fontSize:0,lineHeight:0,hAlign:0,vAlign:0,hash:"",fontFamily:"",fontDesc:"Arial",color:n,isOutlined:!1,out:n,margin:0};e.exports={deleteFromDynamicAtlas:function(t,e){e&&e._original&&i&&(i.deleteAtlasSpriteFrame(e),e._resetDynamicAtlasFrame())},getFontFamily:function(t){return t.useSystemFont?t.fontFamily||"Arial":t.font?t.font._nativeAsset?t.font._nativeAsset:(cc.assetManager.postLoadNative(t.font,(function(){t.isValid&&t.setVertsDirty()})),"Arial"):"Arial"},shareLabelInfo:r}}),{"./dynamic-atlas/manager":202}],208:[(function(t,e){"use strict";function i(t,e,i){i=i||2;var r,s,o,c,l,u,f,_=e&&e.length,d=_?e[0]*i:t.length,p=n(t,0,d,i,!0),m=[];if(!p)return m;if(_&&(p=h(t,e,p,i)),t.length>80*i){r=o=t[0],s=c=t[1];for(var v=i;v<d;v+=i)(l=t[v])<r&&(r=l),(u=t[v+1])<s&&(s=u),l>o&&(o=l),u>c&&(c=u);f=Math.max(o-r,c-s)}return a(p,m,i,r,s,f),m}function n(t,e,i,n,r){var a,s;if(r===R(t,e,i,n)>0)for(a=e;a<i;a+=n)s=w(a,t[a],t[a+1],s);else for(a=i-n;a>=e;a-=n)s=w(a,t[a],t[a+1],s);return s&&A(s,s.next)&&(D(s),s=s.next),s}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!A(n,n.next)&&0!==T(n.prev,n,n.next))n=n.next;else{if(D(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function a(t,e,i,n,h,u,f){if(t){!f&&u&&d(t,n,h,u);for(var _,p,m=t;t.prev!==t.next;)if(_=t.prev,p=t.next,u?o(t,n,h,u):s(t))e.push(_.i/i),e.push(t.i/i),e.push(p.i/i),D(t),t=p.next,m=p.next;else if((t=p)===m){f?1===f?a(t=c(t,e,i),e,i,n,h,u,2):2===f&&l(t,e,i,n,h,u):a(r(t),e,i,n,h,u,1);break}}}function s(t){var e=t.prev,i=t,n=t.next;if(T(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&T(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function o(t,e,i,n){var r=t.prev,a=t,s=t.next;if(T(r,a,s)>=0)return!1;for(var o=r.x<a.x?r.x<s.x?r.x:s.x:a.x<s.x?a.x:s.x,c=r.y<a.y?r.y<s.y?r.y:s.y:a.y<s.y?a.y:s.y,l=r.x>a.x?r.x>s.x?r.x:s.x:a.x>s.x?a.x:s.x,h=r.y>a.y?r.y>s.y?r.y:s.y:a.y>s.y?a.y:s.y,u=m(o,c,e,i,n),f=m(l,h,e,i,n),_=t.nextZ;_&&_.z<=f;){if(_!==t.prev&&_!==t.next&&g(r.x,r.y,a.x,a.y,s.x,s.y,_.x,_.y)&&T(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(_=t.prevZ;_&&_.z>=u;){if(_!==t.prev&&_!==t.next&&g(r.x,r.y,a.x,a.y,s.x,s.y,_.x,_.y)&&T(_.prev,_,_.next)>=0)return!1;_=_.prevZ}return!0}function c(t,e,i){var n=t;do{var r=n.prev,a=n.next.next;!A(r,a)&&b(r,n,n.next,a)&&C(r,a)&&C(a,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(a.i/i),D(n),D(n.next),n=t=a),n=n.next}while(n!==t);return n}function l(t,e,i,n,s,o){var c=t;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&y(c,l)){var h=S(c,l);return c=r(c,c.next),h=r(h,h.next),a(c,e,i,n,s,o),void a(h,e,i,n,s,o)}l=l.next}c=c.next}while(c!==t)}function h(t,e,i,a){var s,o,c,l=[];for(s=0,o=e.length;s<o;s++)(c=n(t,e[s]*a,s<o-1?e[s+1]*a:t.length,a,!1))===c.next&&(c.steiner=!0),l.push(v(c));for(l.sort(u),s=0;s<l.length;s++)f(l[s],i),i=r(i,i.next);return i}function u(t,e){return t.x-e.x}function f(t,e){if(e=_(t,e)){var i=S(e,t);r(i,i.next)}}function _(t,e){var i,n=e,r=t.x,a=t.y,s=-1/0;do{if(a<=n.y&&a>=n.next.y){var o=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=r&&o>s){if(s=o,o===r){if(a===n.y)return n;if(a===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===s)return i.prev;var c,l=i,h=i.x,u=i.y,f=1/0;for(n=i.next;n!==l;)r>=n.x&&n.x>=h&&g(a<u?r:s,a,h,u,a<u?s:r,a,n.x,n.y)&&((c=Math.abs(a-n.y)/(r-n.x))<f||c===f&&n.x>i.x)&&C(n,t)&&(i=n,f=c),n=n.next;return i}function d(t,e,i,n){var r=t;do{null===r.z&&(r.z=m(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,p(r)}function p(t){var e,i,n,r,a,s,o,c,l=1;do{for(i=t,t=null,a=null,s=0;i;){for(s++,n=i,o=0,e=0;e<l&&(o++,n=n.nextZ);e++);for(c=l;o>0||c>0&&n;)0===o?(r=n,n=n.nextZ,c--):0!==c&&n?i.z<=n.z?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,c--):(r=i,i=i.nextZ,o--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;i=n}a.nextZ=null,l*=2}while(s>1);return t}function m(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function v(t){var e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,n,r,a,s,o){return(r-s)*(e-o)-(t-s)*(a-o)>=0&&(t-s)*(n-o)-(i-s)*(e-o)>=0&&(i-s)*(a-o)-(r-s)*(n-o)>=0}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!E(t,e)&&C(t,e)&&C(e,t)&&x(t,e)}function T(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,i,n){return!!(A(t,e)&&A(i,n)||A(t,n)&&A(i,e))||T(t,e,i)>0!=T(t,e,n)>0&&T(i,n,t)>0!=T(i,n,e)>0}function E(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&b(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function C(t,e){return T(t.prev,t,t.next)<0?T(t,e,t.next)>=0&&T(t,t.prev,e)>=0:T(t,e,t.prev)<0||T(t,t.next,e)<0}function x(t,e){var i=t,n=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}function S(t,e){var i=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function w(t,e,i,n){var r=new M(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function D(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function R(t,e,i,n){for(var r=0,a=e,s=i-n;a<i;a+=n)r+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return r}cc.Graphics.earcut=e.exports=i,i.deviation=function(t,e,i,n){var r=e&&e.length,a=r?e[0]*i:t.length,s=Math.abs(R(t,0,a,i));if(r)for(var o=0,c=e.length;o<c;o++){var l=e[o]*i,h=o<c-1?e[o+1]*i:t.length;s-=Math.abs(R(t,l,h,i))}var u=0;for(o=0;o<n.length;o+=3){var f=n[o]*i,_=n[o+1]*i,d=n[o+2]*i;u+=Math.abs((t[f]-t[d])*(t[_+1]-t[f+1])-(t[f]-t[_])*(t[d+1]-t[f+1]))}return 0===s&&0===u?0:Math.abs((u-s)/s)},i.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var a=0;a<t[r].length;a++)for(var s=0;s<e;s++)i.vertices.push(t[r][a][s]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i}}),{}],209:[(function(t,e){"use strict";var i=t("../../../../graphics/helper"),n=t("../../../../graphics/types").PointFlags,r=cc.Graphics.Point=cc.Class({name:"cc.GraphicsPoint",extends:cc.Vec2,ctor:function(){this.reset()},reset:function(){this.dx=0,this.dy=0,this.dmx=0,this.dmy=0,this.flags=0,this.len=0}});function a(){this.reset()}function s(){this._tessTol=.25,this._distTol=.01,this._updatePathOffset=!1,this._paths=null,this._pathLength=0,this._pathOffset=0,this._points=null,this._pointsOffset=0,this._commandx=0,this._commandy=0,this._paths=[],this._points=[]}cc.js.mixin(a.prototype,{reset:function(){this.closed=!1,this.nbevel=0,this.complex=!0,this.points?this.points.length=0:this.points=[]}}),cc.js.mixin(s.prototype,{moveTo:function(t,e){this._updatePathOffset&&(this._pathOffset=this._pathLength,this._updatePathOffset=!1),this._addPath(),this._addPoint(t,e,n.PT_CORNER),this._commandx=t,this._commandy=e},lineTo:function(t,e){this._addPoint(t,e,n.PT_CORNER),this._commandx=t,this._commandy=e},bezierCurveTo:function(t,e,r,a,s,o){var c=this._curPath,l=c.points[c.points.length-1];l.x!==t||l.y!==e||r!==s||a!==o?(i.tesselateBezier(this,l.x,l.y,t,e,r,a,s,o,0,n.PT_CORNER),this._commandx=s,this._commandy=o):this.lineTo(s,o)},quadraticCurveTo:function(t,e,i,n){var r=this._commandx,a=this._commandy;this.bezierCurveTo(r+2/3*(t-r),a+2/3*(e-a),i+2/3*(t-i),n+2/3*(e-n),i,n)},arc:function(t,e,n,r,a,s){i.arc(this,t,e,n,r,a,s)},ellipse:function(t,e,n,r){i.ellipse(this,t,e,n,r),this._curPath.complex=!1},circle:function(t,e,n){i.ellipse(this,t,e,n,n),this._curPath.complex=!1},rect:function(t,e,i,n){this.moveTo(t,e),this.lineTo(t,e+n),this.lineTo(t+i,e+n),this.lineTo(t+i,e),this.close(),this._curPath.complex=!1},roundRect:function(t,e,n,r,a){i.roundRect(this,t,e,n,r,a),this._curPath.complex=!1},clear:function(t){this._pathLength=0,this._pathOffset=0,this._pointsOffset=0,this._curPath=null,t&&(this._paths.length=0,this._points.length=0)},close:function(){this._curPath.closed=!0},_addPath:function(){var t=this._pathLength,e=this._paths[t];return e?e.reset():(e=new a,this._paths.push(e)),this._pathLength++,this._curPath=e,e},_addPoint:function(t,e,i){var n=this._curPath;if(n){var a,s=this._points,o=n.points;(a=s[this._pointsOffset++])?(a.x=t,a.y=e):(a=new r(t,e),s.push(a)),a.flags=i,o.push(a)}}}),cc.Graphics._Impl=s,e.exports=s}),{"../../../../graphics/helper":158,"../../../../graphics/types":160}],210:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../../assembler")),r=a(t("../../../../../renderer/core/input-assembler"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var o=t("../../mesh-buffer"),c=t("../../../index"),l=t("../../../../graphics/graphics"),h=t("../../../../graphics/types").PointFlags,u=l.LineJoin,f=l.LineCap,_=t("./earcut");t("./impl");var d=Math.PI,p=Math.min,m=Math.max,v=Math.ceil,g=Math.acos,y=Math.cos,T=Math.sin,A=Math.atan2;function b(t,e,i){return t<e?e:t>i?i:t}var E=cc.gfx,C=new E.VertexFormat([{name:E.ATTR_POSITION,type:E.ATTR_TYPE_FLOAT32,num:2},{name:E.ATTR_COLOR,type:E.ATTR_TYPE_UINT8,num:4,normalize:!0},{name:"a_dist",type:E.ATTR_TYPE_FLOAT32,num:1}]);C.name="vfmtPosColorSdf";var x=(function(t){var e,i;function n(e){var i;return(i=t.call(this,e)||this)._buffer=null,i._buffers=[],i._bufferOffset=0,i}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,s(e,i);var a=n.prototype;return a.getVfmt=function(){return C},a.getVfmtFloatCount=function(){return 4},a.requestBuffer=function(){var t={indiceStart:0,vertexStart:0},e=new o(c._handle,this.getVfmt());t.meshbuffer=e;var i=new r.default(e._vb,e._ib);return t.ia=i,this._buffers.push(t),t},a.getBuffers=function(){return 0===this._buffers.length&&this.requestBuffer(),this._buffers},a.clear=function(t){this._bufferOffset=0;var e=this._buffers;if(t){for(var i=0,n=e.length;i<n;i++){var r=e[i];r.meshbuffer.destroy(),r.meshbuffer=null}e.length=0}else for(var a=0,s=e.length;a<s;a++){var o=e[a];o.indiceStart=0,o.vertexStart=0,o.meshbuffer.reset()}},a.fillBuffers=function(t,e){e._flush(),e.node=t.node,e.material=t._materials[0];for(var i=this.getBuffers(),n=0,r=i.length;n<r;n++){var a=i[n],s=a.meshbuffer;a.ia._count=a.indiceStart,e._flushIA(a.ia),s.uploadData()}},a.genBuffer=function(t,e){var i=this.getBuffers(),n=i[this._bufferOffset],r=n.meshbuffer,a=n.vertexStart+e;return(a>65535||3*a>131070)&&(++this._bufferOffset,a=e,this._bufferOffset<i.length?n=i[this._bufferOffset]:(n=this.requestBuffer(t),i[this._bufferOffset]=n),r=n.meshbuffer),a>r.vertexOffset&&r.requestStatic(e,3*e),this._buffer=n,n},a.stroke=function(t){this._curColor=t._strokeColor._val,this._flattenPaths(t._impl),this._expandStroke(t),t._impl._updatePathOffset=!0},a.fill=function(t){this._curColor=t._fillColor._val,this._expandFill(t),t._impl._updatePathOffset=!0},a._expandStroke=function(t){var e,i,n,r,a=.5*t.lineWidth,s=t.lineCap,o=t.lineJoin,c=t.miterLimit,l=t._impl,_=(e=a,i=d,n=l._tessTol,r=2*g(e/(e+n)),m(2,v(i/r)));this._calculateJoins(l,a,o,c);for(var p=l._paths,y=0,T=l._pathOffset,A=l._pathLength;T<A;T++){var b=p[T],E=b.points.length;o===u.ROUND?y+=2*(E+b.nbevel*(_+2)+1):y+=2*(E+5*b.nbevel+1),b.closed||(s===f.ROUND?y+=2*(2*_+2):y+=12)}for(var C=this.genBuffer(t,y),x=C.meshbuffer,S=x._vData,w=x._iData,D=l._pathOffset,M=l._pathLength;D<M;D++){var R,I=p[D],O=I.points,P=O.length,N=C.vertexStart,F=void 0,L=void 0,B=void 0,k=void 0;if((R=I.closed)?(F=O[P-1],L=O[0],B=0,k=P):(F=O[0],L=O[1],B=1,k=P-1),L=L||F,!R){var V=L.sub(F);V.normalizeSelf();var U=V.x,z=V.y;s===f.BUTT?this._buttCapStart(F,U,z,a,0):s===f.SQUARE?this._buttCapStart(F,U,z,a,a):s===f.ROUND&&this._roundCapStart(F,U,z,a,_)}for(var G=B;G<k;++G)o===u.ROUND?this._roundJoin(F,L,a,a,_):0!=(L.flags&(h.PT_BEVEL|h.PT_INNERBEVEL))?this._bevelJoin(F,L,a,a):(this._vset(L.x+L.dmx*a,L.y+L.dmy*a,1),this._vset(L.x-L.dmx*a,L.y-L.dmy*a,-1)),F=L,L=O[G+1];if(R){var H=this.getVfmtFloatCount(),W=N*H;this._vset(S[W],S[W+1],1),this._vset(S[W+H],S[W+H+1],-1)}else{var j=L.sub(F);j.normalizeSelf();var Y=j.x,X=j.y;s===f.BUTT?this._buttCapEnd(L,Y,X,a,0):s===f.SQUARE?this._buttCapEnd(L,Y,X,a,a):s===f.ROUND&&this._roundCapEnd(L,Y,X,a,_)}for(var q=C.indiceStart,Z=N+2,K=C.vertexStart;Z<K;Z++)w[q++]=Z-2,w[q++]=Z-1,w[q++]=Z;C.indiceStart=q}},a._expandFill=function(t){for(var e=t._impl,i=e._paths,n=0,r=e._pathOffset,a=e._pathLength;r<a;r++)n+=i[r].points.length;for(var s=this.genBuffer(t,n),o=s.meshbuffer,c=o._vData,l=o._iData,h=e._pathOffset,u=e._pathLength;h<u;h++){var f=i[h],d=f.points,p=d.length;if(0!==p){for(var m=s.vertexStart,v=0;v<p;++v)this._vset(d[v].x,d[v].y);var g=s.indiceStart;if(f.complex){for(var y=[],T=this.getVfmtFloatCount(),A=m,b=s.vertexStart;A<b;A++){var E=A*T;y.push(c[E]),y.push(c[E+1])}var C=_(y,null,2);if(!C||0===C.length)continue;for(var x=0,S=C.length;x<S;x++)l[g++]=C[x]+m}else for(var w=m,D=m+2,M=s.vertexStart;D<M;D++)l[g++]=w,l[g++]=D-1,l[g++]=D;s.indiceStart=g}}},a._calculateJoins=function(t,e,i,n){var r=0,a=e*e;e>0&&(r=1/e);for(var s=t._paths,o=t._pathOffset,c=t._pathLength;o<c;o++){var l=s[o],f=l.points,_=f.length,d=f[_-1],v=f[0];l.nbevel=0;for(var g=0;g<_;g++){var y,T,A=d.dy,b=-d.dx,E=v.dy,C=-v.dx;if(v.dmx=.5*(A+E),v.dmy=.5*(b+C),(y=v.dmx*v.dmx+v.dmy*v.dmy)>1e-6){var x=1/y;x>600&&(x=600),v.dmx*=x,v.dmy*=x}v.dx*d.dy-d.dx*v.dy>0&&(v.flags|=h.PT_LEFT),y*(T=m(11,p(d.len,v.len)*r))*T<1&&(v.flags|=h.PT_INNERBEVEL);var S=v.dmx*e,w=v.dmy*e,D=S*S+w*w;D>v.len*v.len+a&&D>d.len*d.len+a&&(v.flags|=h.PT_INNERBEVEL),v.flags&h.PT_CORNER&&(y*n*n<1||i===u.BEVEL||i===u.ROUND)&&(v.flags|=h.PT_BEVEL),0!=(v.flags&(h.PT_BEVEL|h.PT_INNERBEVEL))&&l.nbevel++,d=v,v=f[g+1]}}},a._flattenPaths=function(t){for(var e=t._paths,i=t._pathOffset,n=t._pathLength;i<n;i++){var r=e[i],a=r.points,s=a[a.length-1],o=a[0];a.length>2&&s.equals(o)&&(r.closed=!0,a.pop(),s=a[a.length-1]);for(var c=0,l=a.length;c<l;c++){var h=o.sub(s);s.len=h.mag(),(h.x||h.y)&&h.normalizeSelf(),s.dx=h.x,s.dy=h.y,s=o,o=a[c+1]}}},a._chooseBevel=function(t,e,i,n){var r,a,s,o,c=i.x,l=i.y;return 0!==t?(r=c+e.dy*n,a=l-e.dx*n,s=c+i.dy*n,o=l-i.dx*n):(r=s=c+i.dmx*n,a=o=l+i.dmy*n),[r,a,s,o]},a._buttCapStart=function(t,e,i,n,r){var a=t.x-e*r,s=t.y-i*r,o=i,c=-e;this._vset(a+o*n,s+c*n,1),this._vset(a-o*n,s-c*n,-1)},a._buttCapEnd=function(t,e,i,n,r){var a=t.x+e*r,s=t.y+i*r,o=i,c=-e;this._vset(a+o*n,s+c*n,1),this._vset(a-o*n,s-c*n,-1)},a._roundCapStart=function(t,e,i,n,r){for(var a=t.x,s=t.y,o=i,c=-e,l=0;l<r;l++){var h=l/(r-1)*d,u=y(h)*n,f=T(h)*n;this._vset(a-o*u-e*f,s-c*u-i*f,1),this._vset(a,s,0)}this._vset(a+o*n,s+c*n,1),this._vset(a-o*n,s-c*n,-1)},a._roundCapEnd=function(t,e,i,n,r){var a=t.x,s=t.y,o=i,c=-e;this._vset(a+o*n,s+c*n,1),this._vset(a-o*n,s-c*n,-1);for(var l=0;l<r;l++){var h=l/(r-1)*d,u=y(h)*n,f=T(h)*n;this._vset(a,s,0),this._vset(a-o*u+e*f,s-c*u+i*f,1)}},a._roundJoin=function(t,e,i,n,r){var a=t.dy,s=-t.dx,o=e.dy,c=-e.dx,l=e.x,u=e.y;if(0!=(e.flags&h.PT_LEFT)){var f=this._chooseBevel(e.flags&h.PT_INNERBEVEL,t,e,i),_=f[0],p=f[1],m=f[2],g=f[3],E=A(-s,-a),C=A(-c,-o);C>E&&(C-=2*d),this._vset(_,p,1),this._vset(l-a*n,e.y-s*n,-1);for(var x=b(v((E-C)/d)*r,2,r),S=0;S<x;S++){var w=E+S/(x-1)*(C-E),D=l+y(w)*n,M=u+T(w)*n;this._vset(l,u,0),this._vset(D,M,-1)}this._vset(m,g,1),this._vset(l-o*n,u-c*n,-1)}else{var R=this._chooseBevel(e.flags&h.PT_INNERBEVEL,t,e,-n),I=R[0],O=R[1],P=R[2],N=R[3],F=A(s,a),L=A(c,o);L<F&&(L+=2*d),this._vset(l+a*n,u+s*n,1),this._vset(I,O,-1);for(var B=b(v((L-F)/d)*r,2,r),k=0;k<B;k++){var V=F+k/(B-1)*(L-F),U=l+y(V)*i,z=u+T(V)*i;this._vset(U,z,1),this._vset(l,u,0)}this._vset(l+o*n,u+c*n,1),this._vset(P,N,-1)}},a._bevelJoin=function(t,e,i,n){var r,a,s,o,c,l,u,f,_=t.dy,d=-t.dx,p=e.dy,m=-e.dx;if(e.flags&h.PT_LEFT){var v=this._chooseBevel(e.flags&h.PT_INNERBEVEL,t,e,i);c=v[0],l=v[1],u=v[2],f=v[3],this._vset(c,l,1),this._vset(e.x-_*n,e.y-d*n,-1),this._vset(u,f,1),this._vset(e.x-p*n,e.y-m*n,-1)}else{var g=this._chooseBevel(e.flags&h.PT_INNERBEVEL,t,e,-n);r=g[0],a=g[1],s=g[2],o=g[3],this._vset(e.x+_*i,e.y+d*i,1),this._vset(r,a,-1),this._vset(e.x+p*i,e.y+m*i,1),this._vset(s,o,-1)}},a._vset=function(t,e,i){void 0===i&&(i=0);var n=this._buffer,r=n.meshbuffer,a=n.vertexStart*this.getVfmtFloatCount(),s=r._vData,o=r._uintVData;s[a]=t,s[a+1]=e,o[a+2]=this._curColor,s[a+3]=i,n.vertexStart++,r._dirty=!0},n})(n.default);i.default=x,n.default.register(cc.Graphics,x),e.exports=i.default}),{"../../../../../renderer/core/input-assembler":280,"../../../../graphics/graphics":157,"../../../../graphics/types":160,"../../../assembler":196,"../../../index":199,"../../mesh-buffer":227,"./earcut":208,"./impl":209}],211:[(function(t){"use strict";cc.assemblers={},t("./sprite"),t("./mask-assembler"),t("./graphics"),t("./label"),t("./motion-streak")}),{"./graphics":210,"./label":216,"./mask-assembler":217,"./motion-streak":218,"./sprite":225}],212:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../../../utils/label/bmfont"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=0,o=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.initData=function(){this._renderData.createFlexData(0,4,6,this.getVfmt())},r._reserveQuads=function(t,e){var i=4*e,n=6*e,r=this._renderData._flexBuffer;r.reserve(i,n),r.used(i,n);for(var a=this._renderData.iDatas[0],o=0,c=0,l=n;o<l;o+=6,c+=4)a[o]=c,a[o+1]=c+1,a[o+2]=c+2,a[o+3]=c+1,a[o+4]=c+3,a[o+5]=c+2;s=0},r._quadsUpdated=function(){s=0,this._renderData._flexBuffer.used(this.verticesCount,this.indicesCount)},r._getColor=function(t){return t.node._color._val},r.appendQuad=function(t,e,i,n,r,a,o){var c=this._renderData,l=c.vDatas[0],h=c.uintVDatas[0];this.verticesCount+=4,this.indicesCount=this.verticesCount/2*3;var u,f,_,d,p=e.width,m=e.height,v=i.width,g=i.height,y=this._getColor(t),T=this.floatsPerVert,A=s+this.uvOffset;n?(u=i.x/p,_=(i.x+g)/p,f=(i.y+v)/m,d=i.y/m,l[A]=u,l[A+1]=d,l[A+=T]=u,l[A+1]=f,l[A+=T]=_,l[A+1]=d,l[A+=T]=_,l[A+1]=f):(u=i.x/p,_=(i.x+v)/p,f=(i.y+g)/m,d=i.y/m,l[A]=u,l[A+1]=f,l[A+=T]=_,l[A+1]=f,l[A+=T]=u,l[A+1]=d,l[A+=T]=_,l[A+1]=d),u=r,_=r+v*o,f=a-g*o,d=a,this.appendVerts(t,s,u,_,f,d);for(var b=s+this.colorOffset,E=0;E<4;E++)h[b]=y,b+=T;s+=4*this.floatsPerVert},r.appendVerts=function(t,e,i,n,r,a){var s=this._local,o=this.floatsPerVert;s[e]=i,s[e+1]=r,s[e+=o]=n,s[e+1]=r,s[e+=o]=i,s[e+1]=a,s[e+=o]=n,s[e+1]=a},r.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],a=e[5],s=e[12],o=e[13],c=this._local,l=this._renderData.vDatas[0],h=this.floatsPerVert,u=0;u<c.length;u+=h){var f=c[u],_=c[u+1];l[u]=f*i+_*r+s,l[u+1]=f*n+_*a+o}},n})(r.default);i.default=o,e.exports=i.default}),{"../../../../utils/label/bmfont":203}],213:[(function(t,e,i){"use strict";function n(t,e){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0,t("../../../../../platform/js"),t("./bmfont");var r=t("../../../../utils/label/letter-font"),a=cc.color(255,255,255,255),s=(function(t){var e,i;function r(){return t.apply(this,arguments)||this}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,n(e,i);var s=r.prototype;return s.createData=function(t){return t.requestRenderData()},s._getColor=function(t){return a._fastSetA(t.node._color.a),a._val},s.updateColor=function(e){var i=this._getColor(e);t.prototype.updateColor.call(this,e,i)},r})(r);i.default=s,e.exports=i.default}),{"../../../../../platform/js":189,"../../../../utils/label/letter-font":205,"./bmfont":212}],214:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../../../../assets/material/material-variant"))&&n.__esModule?n:{default:n};t("../../../../../components/CCLabel"),t("../../../../../components/CCLabelShadow"),t("../../../../../components/CCLabelOutline"),t("../../../../../assets/material/CCMaterial");var a=(function(){function t(){}var e=t.prototype;return e.init=function(t){this.labelMaterial=null,this._label=this._renderComp=t,renderer.CustomAssembler.prototype.ctor.call(this),t.node._proxy.setAssembler(this),this._layout=new jsb.LabelRenderer,this._layout.init(t),this._cfg=new DataView(this._layout._cfg),this._layoutInfo=new DataView(this._layout._layout),this._cfgFields="string"==typeof jsb.LabelRenderer._cfgFields?JSON.parse(jsb.LabelRenderer._cfgFields):jsb.LabelRenderer._cfgFields,this._layoutFields="string"==typeof jsb.LabelRenderer._layoutFields?JSON.parse(jsb.LabelRenderer._layoutFields):jsb.LabelRenderer._layoutFields,this._layout.bindNodeProxy(t.node._proxy),this._bindMaterial(t)},e._setBufferFlag=function(t,e,i,n,r){if("int8"==n&&1==i){var a=t.getInt8(e);t.setInt8(e,r|a)}else if("int32"==n&&4==i){var s=t.getInt32(e,jsb.__isLittleEndian__);t.setInt32(e,r|s,jsb.__isLittleEndian__)}else cc.warn("flag storage type should be int8/int32 only, type/size -> "+n+"/"+i+".")},e._updateCfgFlag=function(t){var e=this._cfgFields.updateFlags;this._setBufferFlag(this._cfg,e.offset,e.size,e.type,t)},e._setBufferValue=function(t,e,i,n,r){"float"==n&&4==i?t.setFloat32(e,r,jsb.__isLittleEndian__):"int32"==n&&4==i?t.setInt32(e,r,jsb.__isLittleEndian__):"bool"==n&&1==i?t.setInt8(e,r?1:0,jsb.__isLittleEndian__):"Color4B"==n&&4==i?(t.setUint8(e,r.r),t.setUint8(e+1,r.g),t.setUint8(e+2,r.b),t.setUint8(e+3,r.a)):"int8"==n&&1==i?t.setUint8(e,r):cc.warn("dont know how to set value to buffer, type/size -> "+n+"/"+i+".")},e._setFieldValue=function(t,e,i,n){var r=e[i];this._setBufferValue(t,r.offset,r.size,r.type,n)},e._getBufferValue=function(t,e,i,n){return"float"==n&&4==i?t.getFloat32(e,jsb.__isLittleEndian__):"int32"==n&&4==i?t.getInt32(e,jsb.__isLittleEndian__):"bool"==n&&1==i?0!=t.getInt8(e,jsb.__isLittleEndian__):"Color4B"==n&&4==i?{r:t.getUint8(e),g:t.getUint8(e+1),b:t.getUint8(e+2),a:t.getUint8(e+3)}:"int8"==n&&1==i?t.getUint8(e):void cc.warn("dont know how to get value from buffer, type/size -> "+n+"/"+i+".")},e._getFieldValue=function(t,e,i){var n=e[i];return this._getBufferValue(t,n.offset,n.size,n.type)},e._getLayoutValue=function(t){return this._getFieldValue(this._layoutInfo,this._layoutFields,t)},e._setLayoutValue=function(t,e){return this._setFieldValue(this._layoutInfo,this._layoutFields,t,e)},e._updateCfgFlag_Content=function(){this._updateCfgFlag(1)},e._updateCfgFlag_Font=function(){this._updateCfgFlag(2)},e._colorEqual=function(t,e){return t.r==e.r&&t.g==e.g&&t.b==e.b&&t.a==e.a},e._colorToObj=function(t,e,i,n){return{r:t,g:e,b:i,a:n}},e.setString=function(t){t!=this._layout.string&&(this._layout.string=t,this._updateCfgFlag_Content())},e.setFontPath=function(t){t!=this._layout.fontPath&&(this._layout.fontPath=t,this._updateCfgFlag_Font())},e.setFontSize=function(t,e){this._getFieldValue(this._cfg,this._cfgFields,"fontSize")!=t&&(this._setFieldValue(this._cfg,this._cfgFields,"fontSize",t),this._setFieldValue(this._cfg,this._cfgFields,"fontSizeRetina",e),this._updateCfgFlag_Font())},e.setOutline=function(t){var e=this._getLayoutValue("outlineSize");e>0!=t>0&&this._updateCfgFlag_Font(),e!=t&&(this._updateCfgFlag_Content(),this._setLayoutValue("outlineSize",t))},e.setOutlineColor=function(t){var e=this._getLayoutValue("outlineColor");this._colorEqual(e,t)||(this._setLayoutValue("outlineColor",t),this._updateCfgFlag_Content())},e.setLineHeight=function(t){this._getLayoutValue("lineHeight")!=t&&(this._setLayoutValue("lineHeight",t),this._updateCfgFlag_Content())},e.setOverFlow=function(t){this._getLayoutValue("overflow")!=t&&(this._setLayoutValue("overflow",t),this._updateCfgFlag_Content())},e.setEnableWrap=function(t){this._getLayoutValue("wrap")!=t&&(this._setLayoutValue("wrap",t),this._updateCfgFlag_Content())},e.setVerticalAlign=function(t){this._getLayoutValue("valign")!=t&&(this._setLayoutValue("valign",t),this._updateCfgFlag_Content())},e.setHorizontalAlign=function(t){this._getLayoutValue("halign")!=t&&(this._setLayoutValue("halign",t),this._updateCfgFlag_Content())},e.setContentSize=function(t,e){var i=this._getLayoutValue("width"),n=this._getLayoutValue("height");i==t&&n==e||(this._setLayoutValue("height",e),this._setLayoutValue("width",t),this._updateCfgFlag_Content())},e.setAnchorPoint=function(t,e){var i=this._getLayoutValue("anchorX"),n=this._getLayoutValue("anchorY");i==t&&n==e||(this._setLayoutValue("anchorX",t),this._setLayoutValue("anchorY",e),this._updateCfgFlag_Content())},e.setColor=function(t){var e=this._getLayoutValue("color");this._colorEqual(e,t)||(this._setLayoutValue("color",t),this._updateCfgFlag_Content())},e.setShadow=function(t,e,i){var n=this._getLayoutValue("shadowBlur"),r=this._getLayoutValue("shadowX"),a=this._getLayoutValue("shadowY");n>0!=i>0&&this._updateCfgFlag_Font();var s=!1;n!=i&&(this._setLayoutValue("shadowBlur",i),s=!0),r!=t&&(this._setLayoutValue("shadowX",t),s=!0),a!=e&&(this._setLayoutValue("shadowY",e),s=!0),s&&this._updateCfgFlag_Content()},e.setShadowColor=function(t){var e=this._getLayoutValue("shadowColor");this._colorEqual(e,t)||(this._setLayoutValue("shadowColor",t),this._updateCfgFlag_Content())},e.setItalic=function(t){this._getLayoutValue("italic")!=t&&(this._setLayoutValue("italic",t),this._updateCfgFlag_Content())},e.setBold=function(t){this._getLayoutValue("bold")!=t&&(this._setLayoutValue("bold",t),this._updateCfgFlag_Content(),this._updateCfgFlag_Font())},e.setUnderline=function(t){this._getLayoutValue("underline")!=t&&(this._setLayoutValue("underline",t),this._updateCfgFlag_Content())},e.setSpacingX=function(t){this._getLayoutValue("spaceX")==t||"number"!=typeof t||isNaN(t)||(this._setLayoutValue("spaceX",t),this._updateCfgFlag_Content())},e.updateRenderData=function(t){if(t._vertsDirty){t.font&&t.font.nativeUrl&&this.setFontPath(cc.assetManager.cacheManager.getCache(t.font.nativeUrl)||t.font.nativeUrl);var e=this._layout,i=t.node.color,n=t.node,r=t.fontSize;this.setString(t.string),this.setFontSize(t.fontSize,r/72*t.fontSize),this.setLineHeight(t.lineHeight),this.setEnableWrap(t.enableWrapText),this.setItalic(t.enableItalic),this.setUnderline(t.enableUnderline),this.setBold(t.enableBold),this.setOverFlow(t.overflow),this.setVerticalAlign(t.verticalAlign),this.setHorizontalAlign(t.horizontalAlign),this.setSpacingX(t.spacingX),this.setContentSize(n.getContentSize().width,n.getContentSize().height),this.setAnchorPoint(n.anchorX,n.anchorY),this.setColor(this._colorToObj(i.getR(),i.getG(),i.getB(),Math.ceil(i.getA()*n.opacity/255)));var a=n.getComponent(cc.LabelShadow);if(a&&a.enabled){var s=a.color;this.setShadow(a.offset.x,a.offset.y,a.blur),this.setShadowColor(this._colorToObj(s.getR(),s.getG(),s.getB(),Math.ceil(s.getA()*n.opacity/255)))}else this.setShadow(0,0,-1);this._updateTTFMaterial(t),e.render()}},e._bindMaterial=function(t){var e=this.labelMaterial;return e||(e=r.default.createWithBuiltin("2d-label",t),this.labelMaterial=e),e},e._updateTTFMaterial=function(t){var e=this._bindMaterial(t),i=this._label.node,n=this._layout,r=i.getComponent(cc.LabelOutline),a=0;if(r&&r.enabled&&r.width>0){a=Math.max(Math.min(r.width/10,.4),.1);var s=r.color;this.setOutlineColor(this._colorToObj(s.getR(),s.getG(),s.getB(),Math.ceil(s.getA()*i.opacity/255)))}this.setOutline(a),e.define("CC_USE_MODEL",!0),e.define("USE_TEXTURE_ALPHAONLY",!0),e.define("USE_SDF",a>0||t.enableBold),e.define("USE_SDF_EXTEND",t.enableBold?1:0),void 0!==e.getDefine("CC_SUPPORT_standard_derivatives")&&cc.sys.glExtension("OES_standard_derivatives")&&e.define("CC_SUPPORT_standard_derivatives",!0),n.setEffect(e.effect._nativeObj)},e.fillBuffers=function(){this._layout.render()},e.getVfmt=function(){},t})();i.default=a,e.exports=i.default}),{"../../../../../assets/material/CCMaterial":81,"../../../../../assets/material/material-variant":88,"../../../../../components/CCLabel":108,"../../../../../components/CCLabelOutline":109,"../../../../../components/CCLabelShadow":110}],215:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../../../utils/label/ttf"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=t("../../../../../components/CCLabelShadow"),o=cc.color(255,255,255,255),c=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.updateUVs=function(t){for(var e=this._renderData.vDatas[0],i=t._frame.uv,n=this.uvOffset,r=this.floatsPerVert,a=0;a<4;a++){var s=2*a,o=r*a+n;e[o]=i[s],e[o+1]=i[s+1]}},r.updateColor=function(e){o._fastSetA(e.node._color.a);var i=o._val;t.prototype.updateColor.call(this,e,i)},r.updateVerts=function(t){var e=t.node,i=t._ttfTexture.width,n=t._ttfTexture.height,r=e.anchorX*e.width,a=e.anchorY*e.height,o=s&&t.getComponent(s);if(o&&o._enabled){var c=(i-e.width)/2,l=(n-e.height)/2,h=o.offset;-h.x>c?r+=i-e.width:c>h.x&&(r+=c-h.x),-h.y>l?a+=n-e.height:l>h.y&&(a+=l-h.y)}var u=this._local;u[0]=-r,u[1]=-a,u[2]=i-r,u[3]=n-a,this.updateUVs(t),this.updateWorldVerts(t)},n})(r.default);i.default=c,e.exports=i.default}),{"../../../../../components/CCLabelShadow":110,"../../../../utils/label/ttf":206}],216:[(function(t){"use strict";var e=l(t("../../../assembler")),i=l(t("../../../../components/CCLabel")),n=l(t("./2d/ttf")),r=l(t("./2d/bmfont")),a=l(t("./2d/letter")),s=l(t("./3d/ttf")),o=l(t("./3d/bmfont")),c=l(t("./3d/letter"));function l(t){return t&&t.__esModule?t:{default:t}}i.default._canvasPool={pool:[],get:function(){var t=this.pool.pop();if(!t){var e=document.createElement("canvas"),i=e.getContext("2d");t={canvas:e,context:i},i.textBaseline="alphabetic"}return t},put:function(t){this.pool.length>=32||this.pool.push(t)}},e.default.register(cc.Label,{getConstructor:function(t){var e=t.node.is3DNode,l=e?s.default:n.default;return t.font instanceof cc.BitmapFont?l=e?o.default:r.default:t.cacheMode===i.default.CacheMode.CHAR&&(cc.sys.platform===cc.sys.WECHAT_GAME_SUB?cc.warn("sorry, subdomain does not support CHAR mode currently!"):l=e?c.default:a.default),l},TTF:n.default,Bmfont:r.default,Letter:a.default,TTF3D:s.default,Bmfont3D:o.default,Letter3D:c.default,NativeTTF:void 0})}),{"../../../../components/CCLabel":108,"../../../assembler":196,"./2d/bmfont":212,"./2d/letter":213,"./2d/nativeTTF":214,"./2d/ttf":215,"./3d/bmfont":void 0,"./3d/letter":void 0,"./3d/ttf":void 0}],217:[(function(t,e,i){"use strict";i.__esModule=!0,i.MaskAssembler=void 0;var n,r=(n=t("../../assembler"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=t("../../../components/CCMask"),o=t("../../render-flow"),c=t("./sprite/2d/simple"),l=t("./graphics"),h=t("../../../../renderer/gfx"),u=t("../vertex-format").vfmtPos,f=8,_=[];function d(){return 1<<_.length-1}function p(){for(var t=0,e=0;e<_.length;++e)t+=1<<e;return t}function m(t,e,i,n,r,a){var s=t.effect,o=h.STENCIL_OP_KEEP,c=h.STENCIL_OP_KEEP;s.setStencil(h.STENCIL_ENABLE,e,n,r,i,o,c,a)}function v(t){_.length+1>f&&cc.errorID(9e3,f),_.push(t)}function g(t,e){0===_.length&&cc.errorID(9001),_.pop(),0===_.length?e._flushMaterial(t._exitMaterial):A(e)}function y(t,e){var i=h.DS_FUNC_NEVER,n=d(),r=n,a=n,s=t.inverted?h.STENCIL_OP_REPLACE:h.STENCIL_OP_ZERO;m(t._clearMaterial,i,s,n,r,a);var o=e.getBuffer("mesh",u),c=o.request(4,6),l=c.indiceOffset,f=c.byteOffset>>2,_=c.vertexOffset,p=o._vData,v=o._iData;p[f++]=-1,p[f++]=-1,p[f++]=-1,p[f++]=1,p[f++]=1,p[f++]=1,p[f++]=1,p[f++]=-1,v[l++]=_,v[l++]=_+3,v[l++]=_+1,v[l++]=_+1,v[l++]=_+3,v[l++]=_+2,e.node=e._dummyNode,e.material=t._clearMaterial,e._flush()}function T(t,e){var i=h.DS_FUNC_NEVER,n=d(),r=n,a=n,o=t.inverted?h.STENCIL_OP_ZERO:h.STENCIL_OP_REPLACE;m(t._materials[0],i,o,n,r,a),e.material=t._materials[0],t._type===s.Type.IMAGE_STENCIL?(e.node=e._dummyNode,c.prototype.fillBuffers.call(t._assembler,t,e),e._flush()):(e.node=t.node,l.prototype.fillBuffers.call(t._graphics._assembler,t._graphics,e))}function A(t){var e=h.DS_FUNC_EQUAL,i=h.STENCIL_OP_KEEP,n=p(),r=n,a=d(),s=_[_.length-1];m(s._enableMaterial,e,i,n,r,a),t._flushMaterial(s._enableMaterial)}var b=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.updateRenderData=function(t){t._type===s.Type.IMAGE_STENCIL?t.spriteFrame?c.prototype.updateRenderData.call(this,t):t.setMaterial(0,null):(t._graphics.setMaterial(0,t._materials[0]),l.prototype.updateRenderData.call(t._graphics._assembler,t._graphics,t._graphics))},r.fillBuffers=function(t,e){(t._type!==s.Type.IMAGE_STENCIL||t.spriteFrame)&&(v(t),y(t,e),T(t,e),A(e)),t.node._renderFlag|=o.FLAG_UPDATE_RENDER_DATA},r.postFillBuffers=function(t,e){(t._type!==s.Type.IMAGE_STENCIL||t.spriteFrame)&&g(t,e),t.node._renderFlag|=o.FLAG_UPDATE_RENDER_DATA},n})(c);i.MaskAssembler=b,r.default.register(s,b)}),{"../../../../renderer/gfx":290,"../../../components/CCMask":112,"../../assembler":196,"../../render-flow":200,"../vertex-format":232,"./graphics":210,"./sprite/2d/simple":222}],218:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../assembler-2d")),r=a(t("../../../value-types/mat4"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var o=t("../../../components/CCMotionStreak"),c=t("../../render-flow");function l(t,e){this.point=t||cc.v2(),this.dir=e||cc.v2(),this.distance=0,this.time=0}l.prototype.setPoint=function(t,e){this.point.x=t,this.point.y=e},l.prototype.setDir=function(t,e){this.dir.x=t,this.dir.y=e},cc.v2(),cc.v2();var h=cc.v2(),u=cc.v2(),f=new r.default;function _(t,e){return t.x=-e.y,t.y=e.x,t}var d=(function(t){var e,i;function n(){var e;return(e=t.call(this)||this)._tailShortenTime=0,e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,s(e,i);var r=n.prototype;return r.initData=function(){this._renderData.createFlexData(0,16,42)},r.update=function(t,e){var i=t._stroke/2;t.node.getWorldMatrix(f);var n=f.m[12],r=f.m[13],a=t._points,s=t._lastWPos,o=t._fadeTime;if(t._lastWPosUpdated&&(s.x!==n||s.y!==r)){var c,d=!1;if(0===a.length){var p=new l;p.setPoint(s.x,s.y),this._tailShortenTime=p.time=o,a.push(p),c=new l,a.unshift(c)}else{c=a[0];var m=a[1],v=m.point.x-n,g=m.point.y-r;d=v*v+g*g>=t.minSeg*t.minSeg}c.setPoint(n,r),c.time=o+e;var y=a[1];if(c.distance=c.point.sub(y.point,u).mag(),u.normalizeSelf(),c.setDir(u.x,u.y),2===a.length&&y.setDir(u.x,u.y),d){var T=new l(c.point.clone(),c.dir.clone());T.distance=c.distance,T.time=c.time,a.unshift(T)}}if(s.x=n,s.y=r,t._lastWPosUpdated=!0,!(a.length<2)){var A,b=t._color,E=b.a,C=b.b<<16|b.g<<8|b.r,x=0,S=this._renderData._flexBuffer;S.reserve(2*a.length,6*(a.length-1));for(var w=S.vData,D=S.uintVData,M=a.length-1;M>=0;M--){var R=a[M],I=R.point,O=R.dir;R.time-=e;var P=M===a.length-1;if(R.time<=0)P&&M-1>=0&&(this._tailShortenTime=a[M-1].time-e),a.splice(M,1);else{var N=R.time/o;if(P){var F=a[M-1];if(!F){a.splice(M,1);continue}if(a.length>=3){var L=R.time/this._tailShortenTime;L<=1&&(I.x=F.point.x-F.distance*F.dir.x*L,I.y=F.point.y-F.distance*F.dir.y*L)}else this._tailShortenTime=R.time}_(h,O);var B=N*E<<24>>>0|C,k=5*x;w[k]=I.x+h.x*i,w[k+1]=I.y+h.y*i,w[k+2]=1,w[k+3]=N,D[k+4]=B,w[k+=5]=I.x-h.x*i,w[k+1]=I.y-h.y*i,w[k+2]=0,w[k+3]=N,D[k+4]=B,x+=2}}A=x<=2?0:3*(x-2),S.used(x,A)}},r.fillBuffers=function(t,e){var i=this._renderData._flexBuffer,n=i.vData,r=i.usedVertices,a=i.usedIndices,s=i.usedVerticesFloats,o=e._meshBuffer,l=o.request(r,a),h=l.byteOffset>>2,u=o._vData;n.length+h>u.length?u.set(n.subarray(0,s),h):u.set(n,h);for(var f=o._iData,_=l.indiceOffset,d=l.vertexOffset,p=0,m=r;p<m;p+=2){var v=d+p;f[_++]=v,f[_++]=v+2,f[_++]=v+1,f[_++]=v+1,f[_++]=v+2,f[_++]=v+3}t.node._renderFlag|=c.FLAG_UPDATE_RENDER_DATA},n})(n.default);i.default=d,d.register(o,d),e.exports=i.default}),{"../../../components/CCMotionStreak":113,"../../../value-types/mat4":259,"../../assembler-2d":194,"../../render-flow":200}],219:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=t("../../../../../components/CCSprite").FillType,o=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.updateRenderData=function(t){var e=t._spriteFrame;if(this.packToDynamicAtlas(t,e),t._vertsDirty){var i=t._fillStart,n=t._fillRange;n<0&&(i+=n,n=-n),n=(n=(n=i+n)>1?1:n)<0?0:n;var r=(i=(i=i>1?1:i)<0?0:i)+(n=(n-=i)<0?0:n);r=r>1?1:r,this.updateUVs(t,i,r),this.updateVerts(t,i,r),t._vertsDirty=!1}},r.updateUVs=function(t,e,i){var n,r,a,o,c,l,h,u,f,_,d=t._spriteFrame,p=d._texture.width,m=d._texture.height,v=d._rect;d._rotated?(n=v.x/p,r=(v.y+v.width)/m,a=c=n,h=f=(v.x+v.height)/p,l=_=r,o=u=v.y/m):(n=v.x/p,r=(v.y+v.height)/m,a=h=n,c=f=(v.x+v.width)/p,o=l=r,u=_=v.y/m);var g=this._renderData.vDatas[0],y=this.uvOffset,T=this.floatsPerVert;switch(t._fillType){case s.HORIZONTAL:g[y]=a+(c-a)*e,g[y+1]=o+(l-o)*e,g[y+T]=a+(c-a)*i,g[y+T+1]=o+(l-o)*i,g[y+2*T]=h+(f-h)*e,g[y+2*T+1]=u+(_-u)*e,g[y+3*T]=h+(f-h)*i,g[y+3*T+1]=u+(_-u)*i;break;case s.VERTICAL:g[y]=a+(h-a)*e,g[y+1]=o+(u-o)*e,g[y+T]=c+(f-c)*e,g[y+T+1]=l+(_-l)*e,g[y+2*T]=a+(h-a)*i,g[y+2*T+1]=o+(u-o)*i,g[y+3*T]=c+(f-c)*i,g[y+3*T+1]=l+(_-l)*i;break;default:cc.errorID(2626)}},r.updateVerts=function(t,e,i){var n,r=t.node,a=r.width,o=r.height,c=r.anchorX*a,l=r.anchorY*o,h=-c,u=-l,f=a-c,_=o-l;switch(t._fillType){case s.HORIZONTAL:n=h+(f-h)*i,h+=(f-h)*e,f=n;break;case s.VERTICAL:n=u+(_-u)*i,u+=(_-u)*e,_=n;break;default:cc.errorID(2626)}var d=this._local;d[0]=h,d[1]=u,d[2]=f,d[3]=_,this.updateWorldVerts(t)},n})(r.default);i.default=o,e.exports=i.default}),{"../../../../../components/CCSprite":120,"../../../../assembler-2d":194}],220:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var a=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,r(e,i);var a=n.prototype;return a.initData=function(){this._renderData.createFlexData(0,4,6,this.getVfmt())},a.updateRenderData=function(t){this.packToDynamicAtlas(t,t._spriteFrame);var e=t.spriteFrame;if(e){var i=e.vertices;if(i){this.verticesCount=i.x.length,this.indicesCount=i.triangles.length;var n=this._renderData._flexBuffer;n.reserve(this.verticesCount,this.indicesCount)&&(this.updateColor(t),t._vertsDirty=!0),n.used(this.verticesCount,this.indicesCount),this.updateIndices(i.triangles),t._vertsDirty&&(this.updateUVs(t),this.updateVerts(t),this.updateWorldVerts(t),t._vertsDirty=!1)}}},a.updateIndices=function(t){this._renderData.iDatas[0].set(t)},a.updateUVs=function(t){for(var e=t.spriteFrame.vertices,i=e.nu,n=e.nv,r=this.uvOffset,a=this.floatsPerVert,s=this._renderData.vDatas[0],o=0;o<i.length;o++){var c=a*o+r;s[c]=i[o],s[c+1]=n[o]}},a.updateVerts=function(t){var e=t.node,i=Math.abs(e.width),n=Math.abs(e.height),r=e.anchorX*i,a=e.anchorY*n,s=t.spriteFrame,o=s.vertices,c=o.x,l=o.y,h=s._originalSize.width,u=s._originalSize.height,f=s._rect.width,_=s._rect.height,d=s._offset.x+(h-f)/2,p=s._offset.y+(u-_)/2,m=i/(t.trim?f:h),v=n/(t.trim?_:u),g=this._local;if(t.trim)for(var y=0,T=c.length;y<T;y++){var A=2*y;g[A]=(c[y]-d)*m-r,g[A+1]=(u-l[y]-p)*v-a}else for(var b=0,E=c.length;b<E;b++){var C=2*b;g[C]=c[b]*m-r,g[C+1]=(u-l[b])*v-a}if(s._flipX)for(var x=0,S=this.verticesCount;x<S;x++)g[2*x]=i-g[2*x]-2*r;if(s._flipY)for(var w=0,D=this.verticesCount;w<D;w++)g[2*w+1]=n-g[2*w+1]-2*a},a.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],a=e[5],s=e[12],o=e[13],c=this._local,l=this._renderData.vDatas[0],h=this.floatsPerVert,u=0,f=this.verticesCount;u<f;u++){var _=c[2*u],d=c[2*u+1];l[h*u]=_*i+d*r+s,l[h*u+1]=_*n+d*a+o}},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=a,e.exports=i.default}),{"../../../../assembler-2d":194}],221:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=2*Math.PI,o=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],c=[0,0,0,0],l=[0,0,0,0,0,0,0,0],h=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],u=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],f=cc.v2(0,0),_=[];function d(t,e,i,n,r,a,s){var o,c,l=Math.sin(a),h=Math.cos(a);if(0!==Math.cos(a)){if(o=l/h,(t-r.x)*h>0){var u=r.y+o*(t-r.x);s[0].x=t,s[0].y=u}if((e-r.x)*h>0){var f=r.y+o*(e-r.x);s[2].x=e,s[2].y=f}}if(0!==Math.sin(a)){if(c=h/l,(n-r.y)*l>0){var _=r.x+c*(n-r.y);s[3].x=_,s[3].y=n}if((i-r.y)*l>0){var d=r.x+c*(i-r.y);s[1].x=d,s[1].y=i}}}function p(t){var e=t.node,i=e.width,n=e.height,r=e.anchorX*i,a=e.anchorY*n,s=-r,l=-a,h=i-r,u=n-a,d=c;d[0]=s,d[1]=l,d[2]=h,d[3]=u;var p=t._fillCenter,m=f.x=Math.min(Math.max(0,p.x),1)*(h-s)+s,v=f.y=Math.min(Math.max(0,p.y),1)*(u-l)+l;o[0].x=o[3].x=s,o[1].x=o[2].x=h,o[0].y=o[1].y=l,o[2].y=o[3].y=u,_.length=0,m!==d[0]&&(_[0]=[3,0]),m!==d[2]&&(_[2]=[1,2]),v!==d[1]&&(_[1]=[0,1]),v!==d[3]&&(_[3]=[2,3])}function m(t,e){var i,n;if(i=e.x-t.x,n=e.y-t.y,0!==i||0!==n){if(0===i)return n>0?.5*Math.PI:1.5*Math.PI;var r=Math.atan(n/i);return i<0&&(r+=Math.PI),r}}var v=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.initData=function(){this._renderData.createFlexData(0,4,6,this.getVfmt()),this.updateIndices()},r.updateRenderData=function(e){t.prototype.updateRenderData.call(this,e);var i,n,r,a,o,_,m,v,g,y=e.spriteFrame;if(this.packToDynamicAtlas(e,y),e._vertsDirty){var T=e._fillStart,A=e._fillRange;for(A<0&&(T+=A,A=-A);T>=1;)T-=1;for(;T<0;)T+=1;T*=s,A*=s,p(e),_=(i=y)._texture.width,m=i._texture.height,v=i._rect,g=l,i._rotated?(n=v.x/_,r=(v.x+v.height)/_,a=v.y/m,o=(v.y+v.width)/m,g[0]=g[2]=n,g[4]=g[6]=r,g[3]=g[7]=o,g[1]=g[5]=a):(n=v.x/_,r=(v.x+v.width)/_,a=v.y/m,o=(v.y+v.height)/m,g[0]=g[4]=n,g[2]=g[6]=r,g[1]=g[3]=o,g[5]=g[7]=a),d(c[0],c[2],c[1],c[3],f,T,h),d(c[0],c[2],c[1],c[3],f,T+A,u),this.updateVerts(e,T,A),e._vertsDirty=!1}},r.updateVerts=function(t,e,i){var n=e+i,r=this._local;r.length=0;for(var a=0,c=3*this.floatsPerVert,l=0;l<4;++l){var d=_[l];if(d)if(i>=s)r.length=a+c,this._generateTriangle(r,a,f,o[d[0]],o[d[1]]),a+=c;else{var p=m(f,o[d[0]]),v=m(f,o[d[1]]);v<p&&(v+=s),p-=s,v-=s;for(var g=0;g<3;++g)p>=n||(p>=e?(r.length=a+c,v>=n?this._generateTriangle(r,a,f,o[d[0]],u[l]):this._generateTriangle(r,a,f,o[d[0]],o[d[1]]),a+=c):v<=e||(v<=n?(r.length=a+c,this._generateTriangle(r,a,f,h[l],o[d[1]]),a+=c):(r.length=a+c,this._generateTriangle(r,a,f,h[l],u[l]),a+=c))),p+=s,v+=s}}this.allocWorldVerts(t),this.updateWorldVerts(t)},r.allocWorldVerts=function(t){var e=t.node._color._val,i=this._renderData,n=this.floatsPerVert,r=this._local,a=r.length/n;this.verticesCount=this.indicesCount=a;var s=i._flexBuffer;s.reserve(a,a)&&this.updateIndices(),s.used(this.verticesCount,this.indicesCount);for(var o=i.vDatas[0],c=i.uintVDatas[0],l=this.uvOffset,h=0;h<r.length;h+=n){var u=h+l;o[u]=r[u],o[u+1]=r[u+1],c[u+2]=e}},r.updateIndices=function(){for(var t=this._renderData.iDatas[0],e=0;e<t.length;e++)t[e]=e},r.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],a=e[5],s=e[12],o=e[13],c=this._local,l=this._renderData.vDatas[0],h=this.floatsPerVert,u=0;u<c.length;u+=h){var f=c[u],_=c[u+1];l[u]=f*i+_*r+s,l[u+1]=f*n+_*a+o}},r._generateTriangle=function(t,e,i,n,r){var a=c,s=a[0],o=a[1],l=a[2],h=a[3],u=this.floatsPerVert;t[e]=i.x,t[e+1]=i.y,t[e+u]=n.x,t[e+u+1]=n.y,t[e+2*u]=r.x,t[e+2*u+1]=r.y;var f,_,d=this.uvOffset;f=(i.x-s)/(l-s),_=(i.y-o)/(h-o),this._generateUV(f,_,t,e+d),f=(n.x-s)/(l-s),_=(n.y-o)/(h-o),this._generateUV(f,_,t,e+u+d),f=(r.x-s)/(l-s),_=(r.y-o)/(h-o),this._generateUV(f,_,t,e+2*u+d)},r._generateUV=function(t,e,i,n){var r=l[0]+(l[2]-l[0])*t,a=l[4]+(l[6]-l[4])*t,s=l[1]+(l[3]-l[1])*t,o=l[5]+(l[7]-l[5])*t;i[n]=r+(a-r)*e,i[n+1]=s+(o-s)*e},n})(r.default);i.default=v,e.exports=i.default}),{"../../../../assembler-2d":194}],222:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var a=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,r(e,i);var a=n.prototype;return a.updateRenderData=function(t){this.packToDynamicAtlas(t,t._spriteFrame),t._vertsDirty&&(this.updateUVs(t),this.updateVerts(t),t._vertsDirty=!1)},a.updateUVs=function(t){for(var e=t._spriteFrame.uv,i=this.uvOffset,n=this.floatsPerVert,r=this._renderData.vDatas[0],a=0;a<4;a++){var s=2*a,o=n*a+i;r[o]=e[s],r[o+1]=e[s+1]}},a.updateVerts=function(t){var e,i,n,r,a=t.node,s=a.width,o=a.height,c=a.anchorX*s,l=a.anchorY*o;if(t.trim)e=-c,i=-l,n=s-c,r=o-l;else{var h=t.spriteFrame,u=h._originalSize.width,f=h._originalSize.height,_=h._rect.width,d=h._rect.height,p=h._offset,m=s/u,v=o/f,g=p.x+(u-_)/2,y=p.x-(u-_)/2;e=g*m-c,i=(p.y+(f-d)/2)*v-l,n=s+y*m-c,r=o+(p.y-(f-d)/2)*v-l}var T=this._local;T[0]=e,T[1]=i,T[2]=n,T[3]=r,this.updateWorldVerts(t)},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=a,e.exports=i.default}),{"../../../../assembler-2d":194}],223:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var a=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,r(e,i);var a=n.prototype;return a.initData=function(){if(!(this._renderData.meshCount>0)){this._renderData.createData(0,this.verticesFloats,this.indicesCount);for(var t=this._renderData.iDatas[0],e=0,i=0;i<3;++i)for(var n=0;n<3;++n){var r=4*i+n;t[e++]=r,t[e++]=r+1,t[e++]=r+4,t[e++]=r+1,t[e++]=r+5,t[e++]=r+4}}},a.initLocal=function(){this._local=[],this._local.length=8},a.updateRenderData=function(t){var e=t._spriteFrame;this.packToDynamicAtlas(t,e),t._vertsDirty&&(this.updateUVs(t),this.updateVerts(t),t._vertsDirty=!1)},a.updateVerts=function(t){var e=t.node,i=e.width,n=e.height,r=e.anchorX*i,a=e.anchorY*n,s=t.spriteFrame,o=s.insetLeft,c=s.insetRight,l=s.insetTop,h=s.insetBottom,u=i-o-c,f=n-l-h,_=i/(o+c),d=n/(l+h);_=isNaN(_)||_>1?1:_,d=isNaN(d)||d>1?1:d,u=u<0?0:u,f=f<0?0:f;var p=this._local;p[0]=-r,p[1]=-a,p[2]=o*_-r,p[3]=h*d-a,p[4]=p[2]+u,p[5]=p[3]+f,p[6]=i-r,p[7]=n-a,this.updateWorldVerts(t)},a.updateUVs=function(t){for(var e=this._renderData.vDatas[0],i=t.spriteFrame.uvSliced,n=this.uvOffset,r=this.floatsPerVert,a=0;a<4;++a)for(var s=0;s<4;++s){var o=4*a+s,c=i[o],l=o*r;e[l+n]=c.u,e[l+n+1]=c.v}},a.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],a=e[5],s=e[12],o=e[13],c=this._local,l=this._renderData.vDatas[0],h=this.floatsPerVert,u=0;u<4;++u)for(var f=c[2*u+1],_=0;_<4;++_){var d=c[2*_],p=(4*u+_)*h;l[p]=d*i+f*r+s,l[p+1]=d*n+f*a+o}},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=a,Object.assign(a.prototype,{verticesCount:16,indicesCount:54}),e.exports=i.default}),{"../../../../assembler-2d":194}],224:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var a=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,r(e,i);var a=n.prototype;return a.initData=function(){this.verticesCount=0,this.contentWidth=0,this.contentHeight=0,this.rectWidth=0,this.rectHeight=0,this.hRepeat=0,this.vRepeat=0,this.row=0,this.col=0,this._renderData.createFlexData(0,4,6,this.getVfmt()),this._updateIndices()},a.initLocal=function(){this._local={x:[],y:[]}},a._updateIndices=function(){for(var t=this._renderData.iDatas[0],e=0,i=0,n=t.length;e<n;e+=6,i+=4)t[e]=i,t[e+1]=i+1,t[e+2]=i+2,t[e+3]=i+1,t[e+4]=i+3,t[e+5]=i+2},a.updateRenderData=function(t){var e=t._spriteFrame;this.packToDynamicAtlas(t,e);var i=t.node,n=this.contentWidth=Math.abs(i.width),r=this.contentHeight=Math.abs(i.height),a=e._rect,s=e.insetLeft,o=e.insetRight,c=a.width-s-o,l=e.insetTop,h=e.insetBottom,u=a.height-l-h;this.sizableWidth=n-s-o,this.sizableHeight=r-l-h,this.sizableWidth=this.sizableWidth>0?this.sizableWidth:0,this.sizableHeight=this.sizableHeight>0?this.sizableHeight:0;var f=this.hRepeat=0===c?this.sizableWidth:this.sizableWidth/c,_=this.vRepeat=0===u?this.sizableHeight:this.sizableHeight/u,d=(this.row=Math.ceil(_+2))*(this.col=Math.ceil(f+2));this.verticesCount=4*d,this.indicesCount=6*d;var p=this._renderData._flexBuffer;p.reserve(this.verticesCount,this.indicesCount)&&(this._updateIndices(),this.updateColor(t)),p.used(this.verticesCount,this.indicesCount),t._vertsDirty&&(this.updateUVs(t),this.updateVerts(t),t._vertsDirty=!1)},a.updateVerts=function(t){var e=t._spriteFrame,i=e._rect,n=t.node,r=n.anchorX*n.width,a=n.anchorY*n.height,s=this.row,o=this.col,c=this.contentWidth,l=this.contentHeight,h=this._local,u=h.x,f=h.y;u.length=f.length=0;var _,d,p=e.insetLeft,m=e.insetRight,v=i.width-p-m,g=e.insetTop,y=e.insetBottom,T=i.height-g-y,A=n.width/(p+m)>1?1:n.width/(p+m),b=n.height/(g+y)>1?1:n.height/(g+y);_=v>0?Math.floor(1e3*this.sizableWidth)/1e3%v==0?v:this.sizableWidth%v:this.sizableWidth,d=T>0?Math.floor(1e3*this.sizableHeight)/1e3%T==0?T:this.sizableHeight%T:this.sizableHeight;for(var E=0;E<=o;E++)0===E?u[E]=-r:E>0&&E<o?u[E]=1===E?p*A+Math.min(v,this.sizableWidth)-r:v>0?E===o-1?p+_+v*(E-2)-r:p+Math.min(v,this.sizableWidth)+v*(E-2)-r:p+this.sizableWidth-r:E===o&&(u[E]=Math.min(p+this.sizableWidth+m,c)-r);for(var C=0;C<=s;C++)0===C?f[C]=-a:C>0&&C<s?f[C]=1===C?y*b+Math.min(T,this.sizableHeight)-a:T>0?C===s-1?y+d+(C-2)*T-a:y+Math.min(T,this.sizableHeight)+(C-2)*T-a:y+this.sizableHeight-a:C===s&&(f[C]=Math.min(y+this.sizableHeight+g,l)-a);this.updateWorldVerts(t)},a.updateWorldVerts=function(t){for(var e,i,n,r,a=this._renderData,s=this._local,o=s.x,c=s.y,l=a.vDatas[0],h=this.row,u=this.col,f=t.node._worldMatrix.m,_=f[0],d=f[1],p=f[4],m=f[5],v=f[12],g=f[13],y=this.floatsPerVert,T=0,A=0,b=h;A<b;++A){n=c[A],r=c[A+1];for(var E=0,C=u;E<C;++E)e=o[E],i=o[E+1],l[T]=e*_+n*p+v,l[T+1]=e*d+n*m+g,l[T+=y]=i*_+n*p+v,l[T+1]=i*d+n*m+g,l[T+=y]=e*_+r*p+v,l[T+1]=e*d+r*m+g,l[T+=y]=i*_+r*p+v,l[T+1]=i*d+r*m+g,T+=y}},a.updateUVs=function(t){var e=this._renderData.vDatas[0];if(e)for(var i=t._spriteFrame,n=i._rect,r=i.insetLeft,a=i.insetRight,s=n.width-r-a,o=i.insetTop,c=i.insetBottom,l=n.height-o-c,h=this.row,u=this.col,f=this.hRepeat,_=this.vRepeat,d=0,p=0,m=t.spriteFrame.uv,v=t.spriteFrame.uvSliced,g=t.spriteFrame._rotated,y=this.floatsPerVert,T=this.uvOffset,A=[],b=[],E=0,C=h;E<C;++E){p=this.sizableHeight>l?this.sizableHeight>=E*l?1:_%1:_;for(var x=0,S=u;x<S;++x)d=this.sizableWidth>s?this.sizableWidth>=x*s?1:f%1:f,g?(0===E?(A[0]=v[0].u,A[1]=v[0].u,A[2]=v[4].u+(v[8].u-v[4].u)*p):E<h-1?(A[0]=v[4].u,A[1]=v[4].u,A[2]=v[4].u+(v[8].u-v[4].u)*p):E===h-1&&(A[0]=v[8].u,A[1]=v[8].u,A[2]=v[12].u),0===x?(b[0]=v[0].v,b[1]=v[1].v+(v[2].v-v[1].v)*d,b[2]=v[0].v):x<u-1?(b[0]=v[1].v,b[1]=v[1].v+(v[2].v-v[1].v)*d,b[2]=v[1].v):x===u-1&&(b[0]=v[2].v,b[1]=v[3].v,b[2]=v[2].v),A[3]=A[2],b[3]=b[1]):(0===x?(A[0]=v[0].u,A[1]=v[1].u+(v[2].u-v[1].u)*d,A[2]=m[0]):x<u-1?(A[0]=v[1].u,A[1]=v[1].u+(v[2].u-v[1].u)*d,A[2]=v[1].u):x===u-1&&(A[0]=v[2].u,A[1]=v[3].u,A[2]=v[2].u),0===E?(b[0]=v[0].v,b[1]=v[0].v,b[2]=v[4].v+(v[8].v-v[4].v)*p):E<h-1?(b[0]=v[4].v,b[1]=v[4].v,b[2]=v[4].v+(v[8].v-v[4].v)*p):E===h-1&&(b[0]=v[8].v,b[1]=v[8].v,b[2]=v[12].v),A[3]=A[1],b[3]=b[2]),e[T]=A[0],e[T+1]=b[0],e[T+=y]=A[1],e[T+1]=b[1],e[T+=y]=A[2],e[T+1]=b[2],e[T+=y]=A[3],e[T+1]=b[3],T+=y}},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=a,e.exports=i.default}),{"../../../../assembler-2d":194}],225:[(function(t){"use strict";var e=p(t("../../../assembler")),i=t("../../../../components/CCSprite"),n=p(t("./2d/simple")),r=p(t("./2d/sliced")),a=p(t("./2d/tiled")),s=p(t("./2d/radial-filled")),o=p(t("./2d/bar-filled")),c=p(t("./2d/mesh")),l=p(t("./3d/simple")),h=p(t("./3d/sliced")),u=p(t("./3d/tiled")),f=p(t("./3d/radial-filled")),_=p(t("./3d/bar-filled")),d=p(t("./3d/mesh"));function p(t){return t&&t.__esModule?t:{default:t}}var m={getConstructor:function(t){var e=t.node.is3DNode,p=e?l.default:n.default;switch(t.type){case i.Type.SLICED:p=e?h.default:r.default;break;case i.Type.TILED:p=e?u.default:a.default;break;case i.Type.FILLED:p=t._fillType===i.FillType.RADIAL?e?f.default:s.default:e?_.default:o.default;break;case i.Type.MESH:p=e?d.default:c.default}return p},Simple:n.default,Sliced:r.default,Tiled:a.default,RadialFilled:s.default,BarFilled:o.default,Mesh:c.default,Simple3D:l.default,Sliced3D:h.default,Tiled3D:u.default,RadialFilled3D:f.default,BarFilled3D:_.default,Mesh3D:d.default};e.default.register(cc.Sprite,m)}),{"../../../../components/CCSprite":120,"../../../assembler":196,"./2d/bar-filled":219,"./2d/mesh":220,"./2d/radial-filled":221,"./2d/simple":222,"./2d/sliced":223,"./2d/tiled":224,"./3d/bar-filled":void 0,"./3d/mesh":void 0,"./3d/radial-filled":void 0,"./3d/simple":void 0,"./3d/sliced":void 0,"./3d/tiled":void 0}],226:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(t,e,i,n,r){this._handler=t,this._index=e,this._vfmt=r,this._verticesBytes=r._bytes,this._initVerticesCount=i,this._initIndicesCount=n,this.reset()}var e=t.prototype;return e._reallocVData=function(t,e){this.vData=new Float32Array(t),this.uintVData=new Uint32Array(this.vData.buffer),e&&this.vData.set(e),this._handler.updateMesh(this._index,this.vData,this.iData)},e._reallocIData=function(t,e){this.iData=new Uint16Array(t),e&&this.iData.set(e),this._handler.updateMesh(this._index,this.vData,this.iData)},e.reserve=function(t,e){var i=t*this._verticesBytes>>2,n=this.vData.length,r=!1;if(i>n){for(;n<i;)n*=2;this._reallocVData(n,this.vData),r=!0}var a=this.iData.length;if(e>a){for(;a<e;)a*=2;this._reallocIData(e,this.iData),r=!0}return r},e.used=function(t,e){this.usedVertices=t,this.usedIndices=e,this.usedVerticesFloats=t*this._verticesBytes>>2,this._handler.updateMeshRange(t,e)},e.reset=function(){var t=this._initVerticesCount*this._verticesBytes>>2;this._reallocVData(t),this._reallocIData(this._initIndicesCount),this.usedVertices=0,this.usedVerticesFloats=0,this.usedIndices=0},t})();i.default=n,cc.FlexBuffer=n,e.exports=i.default}),{}],227:[(function(t,e){"use strict";var i,n,r,a=(i=t("../../../renderer/gfx"))&&i.__esModule?i:{default:i};n=cc.sys.platform===cc.sys.WECHAT_GAME?(cc.sys.os===cc.sys.OS_IOS||cc.sys.os===cc.sys.OS_OSX)&&(null==(r=GameGlobal)?void 0:r.isIOSHighPerformanceMode)&&/(OS 1[4-9])|(Version\/1[4-9])/.test(window.navigator.userAgent):(cc.sys.os===cc.sys.OS_IOS||cc.sys.os===cc.sys.OS_OSX)&&cc.sys.isBrowser&&/(OS 1[4-9])|(Version\/1[4-9])/.test(window.navigator.userAgent);var s=cc.Class({name:"cc.MeshBuffer",ctor:function(t,e){this.init(t,e)},init:function(t,e){this.byteOffset=0,this.indiceOffset=0,this.vertexOffset=0,this.indiceStart=0,this._dirty=!1,this._vertexFormat=e,this._vertexBytes=this._vertexFormat._bytes,this._arrOffset=0,this._vbArr=[],this._vb=new a.default.VertexBuffer(t._device,e,a.default.USAGE_DYNAMIC,new ArrayBuffer,0),this._vbArr[0]=this._vb,this._ibArr=[],this._ib=new a.default.IndexBuffer(t._device,a.default.INDEX_FMT_UINT16,a.default.USAGE_STATIC,new ArrayBuffer,0),this._ibArr[0]=this._ib,this._vData=null,this._uintVData=null,this._iData=null,this._batcher=t,this._initVDataCount=256*e._bytes,this._initIDataCount=1536,this._offsetInfo={byteOffset:0,vertexOffset:0,indiceOffset:0},this._reallocBuffer()},uploadData:function(){if(0!==this.byteOffset&&this._dirty){var t=new Float32Array(this._vData.buffer,0,this.byteOffset>>2),e=new Uint16Array(this._iData.buffer,0,this.indiceOffset);this._vb.update(0,t),this._ib.update(0,e),this._dirty=!1}},switchBuffer:function(){var t=++this._arrOffset;this.byteOffset=0,this.vertexOffset=0,this.indiceOffset=0,this.indiceStart=0,t<this._vbArr.length?(this._vb=this._vbArr[t],this._ib=this._ibArr[t]):(this._vb=new a.default.VertexBuffer(this._batcher._device,this._vertexFormat,a.default.USAGE_DYNAMIC,new ArrayBuffer,0),this._vbArr[t]=this._vb,this._ib=new a.default.IndexBuffer(this._batcher._device,a.default.INDEX_FMT_UINT16,a.default.USAGE_STATIC,new ArrayBuffer,0),this._ibArr[t]=this._ib)},checkAndSwitchBuffer:function(t){this.vertexOffset+t>65535&&(this.uploadData(),this._batcher._flush(),this.switchBuffer())},requestStatic:function(t,e){this.checkAndSwitchBuffer(t);var i=this.byteOffset+t*this._vertexBytes,n=this.indiceOffset+e,r=this._vData.byteLength,a=this._iData.length;if(i>r||n>a){for(;r<i||a<n;)this._initVDataCount*=2,this._initIDataCount*=2,r=4*this._initVDataCount,a=this._initIDataCount;this._reallocBuffer()}this._updateOffset(t,e,i)},_updateOffset:function(t,e,i){var n=this._offsetInfo;n.vertexOffset=this.vertexOffset,this.vertexOffset+=t,n.indiceOffset=this.indiceOffset,this.indiceOffset+=e,n.byteOffset=this.byteOffset,this.byteOffset=i,this._dirty=!0},request:function(t,e){return this._batcher._buffer!==this&&(this._batcher._flush(),this._batcher._buffer=this),this.requestStatic(t,e),this._offsetInfo},_reallocBuffer:function(){this._reallocVData(!0),this._reallocIData(!0)},_reallocVData:function(t){var e;this._vData&&(e=new Uint8Array(this._vData.buffer)),this._vData=new Float32Array(this._initVDataCount),this._uintVData=new Uint32Array(this._vData.buffer);var i=new Uint8Array(this._uintVData.buffer);if(e&&t)for(var n=0,r=e.length;n<r;n++)i[n]=e[n]},_reallocIData:function(t){var e=this._iData;if(this._iData=new Uint16Array(this._initIDataCount),e&&t)for(var i=this._iData,n=0,r=e.length;n<r;n++)i[n]=e[n]},reset:function(){this._arrOffset=0,this._vb=this._vbArr[0],this._ib=this._ibArr[0],this.byteOffset=0,this.indiceOffset=0,this.vertexOffset=0,this.indiceStart=0,this._dirty=!1},destroy:function(){this.reset();for(var t=0;t<this._vbArr.length;t++)this._vbArr[t].destroy();this._vbArr=null;for(var e=0;e<this._ibArr.length;e++)this._ibArr[e].destroy();this._ibArr=null,this._ib=null,this._vb=null},forwardIndiceStartToOffset:function(){this.indiceStart=this.indiceOffset}});n&&(s.prototype.checkAndSwitchBuffer=function(t){this.vertexOffset+t>65535&&(this.uploadData(),this._batcher._flush())},s.prototype.forwardIndiceStartToOffset=function(){this.uploadData(),this.switchBuffer()}),cc.MeshBuffer=e.exports=s}),{"../../../renderer/gfx":290}],228:[(function(t,e){"use strict";var i=a(t("../../../renderer/core/input-assembler")),n=a(t("../../../renderer/memop/recycle-pool")),r=a(t("../../../renderer/scene/model"));function a(t){return t&&t.__esModule?t:{default:t}}var s=t("./vertex-format"),o=s.vfmtPosUvColor,c=s.vfmt3D,l=t("./quad-buffer"),h=t("./mesh-buffer"),u=t("./spine-buffer"),f=t("../../assets/material/CCMaterial"),_=(new(t("../../platform/id-generater"))("VertextFormat"),{}),d=new f,p=new i.default;p._count=0;var m=function(t,e){this._renderScene=e,this._device=t,this.walking=!1,this.material=d,this.cullingMask=1,this._iaPool=new n.default(function(){return new i.default},16),this._modelPool=new n.default(function(){return new r.default},16),this._quadBuffer=this.getBuffer("quad",o),this._meshBuffer=this.getBuffer("mesh",o),this._quadBuffer3D=this.getBuffer("quad",c),this._meshBuffer3D=this.getBuffer("mesh",c),this._buffer=this._meshBuffer,this._batchedModels=[],this._dummyNode=new cc.Node,this._sortKey=0,this.node=this._dummyNode,this.parentOpacity=1,this.parentOpacityDirty=0,this.worldMatDirty=0};m.prototype={constructor:m,reset:function(){this._iaPool.reset();for(var t=this._renderScene,e=this._batchedModels,i=0;i<e.length;++i)e[i].setInputAssembler(null),e[i].setEffect(null),t.removeModel(e[i]);for(var n in this._modelPool.reset(),e.length=0,this._sortKey=0,_)_[n].reset();this._buffer=this._meshBuffer,this.node=this._dummyNode,this.material=d,this.cullingMask=1,this.parentOpacity=1,this.parentOpacityDirty=0,this.worldMatDirty=0},_flushMaterial:function(t){if(t){this.material=t;var e=t.effect;if(e){var i=this._modelPool.add();this._batchedModels.push(i),i.sortKey=this._sortKey++,i._cullingMask=this.cullingMask,i.setNode(this.node),i.setEffect(e,null),i.setInputAssembler(p),this._renderScene.addModel(i)}}},_flush:function(){var t=this.material,e=this._buffer,i=e.indiceOffset-e.indiceStart;if(this.walking&&t&&!(i<=0)){var n=t.effect;if(n){var r=this._iaPool.add();r._vertexBuffer=e._vb,r._indexBuffer=e._ib,r._start=e.indiceStart,r._count=i;var a=this._modelPool.add();this._batchedModels.push(a),a.sortKey=this._sortKey++,a._cullingMask=this.cullingMask,a.setNode(this.node),a.setEffect(n),a.setInputAssembler(r),this._renderScene.addModel(a),e.forwardIndiceStartToOffset()}}},_flushIA:function(t){if(t){var e=this.material.effect;if(e){var i=this._modelPool.add();this._batchedModels.push(i),i.sortKey=this._sortKey++,i._cullingMask=this.cullingMask,i.setNode(this.node),i.setEffect(e),i.setInputAssembler(t),this._renderScene.addModel(i)}}},terminate:function(){for(var t in cc.dynamicAtlasManager&&cc.dynamicAtlasManager.enabled&&cc.dynamicAtlasManager.update(),this._flush(),_)_[t].uploadData();this.walking=!1},getBuffer:function(t,e){var i=t+e.getHash(),n=_[i];if(!n){if("mesh"===t)n=new h(this,e);else if("quad"===t)n=new l(this,e);else{if("spine"!==t)return cc.error("Not support buffer type ["+t+"]"),null;n=new u(this,e)}_[i]=n}return n}},e.exports=m}),{"../../../renderer/core/input-assembler":280,"../../../renderer/memop/recycle-pool":305,"../../../renderer/scene/model":311,"../../assets/material/CCMaterial":81,"../../platform/id-generater":185,"./mesh-buffer":227,"./quad-buffer":229,"./spine-buffer":231,"./vertex-format":232}],229:[(function(t,e){"use strict";var i=t("./mesh-buffer"),n=cc.Class({name:"cc.QuadBuffer",extends:i,_fillQuadBuffer:function(){for(var t=this._initIDataCount/6,e=this._iData,i=0,n=0;i<t;i++){var r=4*i;e[n++]=r,e[n++]=r+1,e[n++]=r+2,e[n++]=r+1,e[n++]=r+3,e[n++]=r+2}var a=new Uint16Array(this._iData.buffer,0,6*t);this._ib.update(0,a)},uploadData:function(){if(0!==this.byteOffset&&this._dirty){var t=new Float32Array(this._vData.buffer,0,this.byteOffset>>2);this._vb.update(0,t),this._dirty=!1}},switchBuffer:function(){this._super();var t=new Uint16Array(this._iData.buffer,0,this._initIDataCount);this._ib.update(0,t)},_reallocBuffer:function(){this._reallocVData(!0),this._reallocIData(),this._fillQuadBuffer()}});cc.QuadBuffer=e.exports=n}),{"./mesh-buffer":227}],230:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=s;var n,r=(n=t("./flex-buffer"))&&n.__esModule?n:{default:n},a=t("./vertex-format");function s(){this.vDatas=[],this.uintVDatas=[],this.iDatas=[],this.meshCount=0,this._infos=null,this._flexBuffer=null}cc.js.mixin(s.prototype,{init:function(){},clear:function(){this.vDatas.length=0,this.iDatas.length=0,this.uintVDatas.length=0,this.meshCount=0,this._infos=null,this._flexBuffer&&this._flexBuffer.reset()},updateMesh:function(t,e,i){this.vDatas[t]=e,this.uintVDatas[t]=new Uint32Array(e.buffer,0,e.length),this.iDatas[t]=i,this.meshCount=this.vDatas.length},updateMeshRange:function(){},createData:function(t,e,i){var n=new Float32Array(e),r=new Uint16Array(i);this.updateMesh(t,n,r)},createQuadData:function(t,e,i){this.createData(t,e,i),this.initQuadIndices(this.iDatas[t])},createFlexData:function(t,e,i,n){n=n||a.vfmtPosUvColor,this._flexBuffer=new r.default(this,t,e,i,n)},initQuadIndices:function(t){for(var e=t.length/6,i=0,n=0;i<e;i++){var r=4*i;t[n++]=r,t[n++]=r+1,t[n++]=r+2,t[n++]=r+1,t[n++]=r+3,t[n++]=r+2}}}),cc.RenderData=s,e.exports=i.default}),{"./flex-buffer":226,"./vertex-format":232}],231:[(function(t,e){"use strict";var i=cc.Class({name:"cc.SpineBuffer",extends:t("./mesh-buffer"),requestStatic:function(t,e){this.checkAndSwitchBuffer(t);var i=this.byteOffset+t*this._vertexBytes,n=this.indiceOffset+e,r=this._vData.byteLength,a=this._iData.length;if(i>r||n>a){for(;r<i||a<n;)this._initVDataCount*=2,this._initIDataCount*=2,r=4*this._initVDataCount,a=this._initIDataCount;this._reallocBuffer()}var s=this._offsetInfo;s.vertexOffset=this.vertexOffset,s.indiceOffset=this.indiceOffset,s.byteOffset=this.byteOffset},adjust:function(t,e){this.vertexOffset+=t,this.indiceOffset+=e,this.byteOffset=this.byteOffset+t*this._vertexBytes,this._dirty=!0}});cc.SpineBuffer=e.exports=i}),{"./mesh-buffer":227}],232:[(function(t,e){"use strict";var i,n=(i=t("../../../renderer/gfx"))&&i.__esModule?i:{default:i},r=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:3},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0}]);r.name="vfmt3D",n.default.VertexFormat.XYZ_UV_Color=r;var a=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0}]);a.name="vfmtPosUvColor",n.default.VertexFormat.XY_UV_Color=a;var s=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0},{name:n.default.ATTR_COLOR0,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0}]);s.name="vfmtPosUvTwoColor",n.default.VertexFormat.XY_UV_Two_Color=s;var o=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2}]);o.name="vfmtPosUv",n.default.VertexFormat.XY_UV=o;var c=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:2},{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0}]);c.name="vfmtPosColor",n.default.VertexFormat.XY_Color=c;var l=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:2}]);l.name="vfmtPos",n.default.VertexFormat.XY=l,e.exports={vfmt3D:r,vfmtPosUvColor:a,vfmtPosUvTwoColor:s,vfmtPosUv:o,vfmtPosColor:c,vfmtPos:l}}),{"../../../renderer/gfx":290}],233:[(function(t,e){"use strict";t("../platform/CCSys");var i=/(\.[^\.\/\?\\]*)(\?.*)?$/,n=/((.*)(\/|\\|\\\\))?(.*?\..*$)?/,r=/[^\.\/]+\/\.\.\//;cc.path={join:function(){for(var t=arguments.length,e="",i=0;i<t;i++)e=(e+(""===e?"":"/")+arguments[i]).replace(/(\/|\\\\)$/,"");return e},extname:function(t){var e=i.exec(t);return e?e[1]:""},mainFileName:function(t){if(t){var e=t.lastIndexOf(".");if(-1!==e)return t.substring(0,e)}return t},basename:function(t,e){var i=t.indexOf("?");i>0&&(t=t.substring(0,i));var n=/(\/|\\)([^\/\\]+)$/g.exec(t.replace(/(\/|\\)$/,""));if(!n)return t;var r=n[2];return e&&t.substring(t.length-e.length).toLowerCase()===e.toLowerCase()?r.substring(0,r.length-e.length):r},dirname:function(t){var e=n.exec(t);return e?e[2]:""},changeExtname:function(t,e){e=e||"";var i=t.indexOf("?"),n="";return i>0&&(n=t.substring(i),t=t.substring(0,i)),(i=t.lastIndexOf("."))<0?t+e+n:t.substring(0,i)+e+n},changeBasename:function(t,e,i){if(0===e.indexOf("."))return this.changeExtname(t,e);var n=t.indexOf("?"),r="",a=i?this.extname(t):"";return n>0&&(r=t.substring(n),t=t.substring(0,n)),n=(n=t.lastIndexOf("/"))<=0?0:n+1,t.substring(0,n)+e+a+r},_normalize:function(t){var e=t=String(t);do{e=t,t=t.replace(r,"")}while(e.length!==t.length);return t},sep:cc.sys.os===cc.sys.OS_WINDOWS?"\\":"/",stripSep:function(t){return t.replace(/[\/\\]$/,"")}},e.exports=cc.path}),{"../platform/CCSys":177}],234:[(function(t,e){"use strict";var i=function(t,e,i,n,r,a){this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=a};i.create=function(t,e,i,n,r,a){return{a:t,b:e,c:i,d:n,tx:r,ty:a}},i.identity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}},i.clone=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,tx:t.tx,ty:t.ty}},i.concat=function(t,e,i){var n=e.a,r=e.b,a=e.c,s=e.d,o=e.tx,c=e.ty;return t.a=n*i.a+r*i.c,t.b=n*i.b+r*i.d,t.c=a*i.a+s*i.c,t.d=a*i.b+s*i.d,t.tx=o*i.a+c*i.c+i.tx,t.ty=o*i.b+c*i.d+i.ty,t},i.invert=function(t,e){var i=e.a,n=e.b,r=e.c,a=e.d,s=1/(i*a-n*r),o=e.tx,c=e.ty;return t.a=s*a,t.b=-s*n,t.c=-s*r,t.d=s*i,t.tx=s*(r*c-a*o),t.ty=s*(n*o-i*c),t},i.fromMat4=function(t,e){var i=e.m;return t.a=i[0],t.b=i[1],t.c=i[4],t.d=i[5],t.tx=i[12],t.ty=i[13],t},i.transformVec2=function(t,e,i,n){var r,a;return void 0===n?(n=i,r=e.x,a=e.y):(r=e,a=i),t.x=n.a*r+n.c*a+n.tx,t.y=n.b*r+n.d*a+n.ty,t},i.transformSize=function(t,e,i){return t.width=i.a*e.width+i.c*e.height,t.height=i.b*e.width+i.d*e.height,t},i.transformRect=function(t,e,i){var n=e.x,r=e.y,a=n+e.width,s=r+e.height,o=i.a*n+i.c*r+i.tx,c=i.b*n+i.d*r+i.ty,l=i.a*a+i.c*r+i.tx,h=i.b*a+i.d*r+i.ty,u=i.a*n+i.c*s+i.tx,f=i.b*n+i.d*s+i.ty,_=i.a*a+i.c*s+i.tx,d=i.b*a+i.d*s+i.ty,p=Math.min(o,l,u,_),m=Math.max(o,l,u,_),v=Math.min(c,h,f,d),g=Math.max(c,h,f,d);return t.x=p,t.y=v,t.width=m-p,t.height=g-v,t},i.transformObb=function(t,e,i,n,r,a){var s=r.x,o=r.y,c=r.width,l=r.height,h=a.a*s+a.c*o+a.tx,u=a.b*s+a.d*o+a.ty,f=a.a*c,_=a.b*c,d=a.c*l,p=a.d*l;e.x=h,e.y=u,i.x=f+h,i.y=_+u,t.x=d+h,t.y=p+u,n.x=f+d+h,n.y=_+p+u},cc.AffineTransform=e.exports=i}),{}],235:[(function(t,e){"use strict";var i=t("../platform/CCObject").Flags,n=t("./misc"),r=t("../platform/js"),a=t("../platform/id-generater"),s=t("../event-manager"),o=t("../renderer/render-flow"),c=i.Destroying,l=i.DontDestroy,h=i.Deactivating,u=new a("Node");function f(t){return t?"string"==typeof t?r.getClassByName(t):t:(cc.errorID(3804),null)}function _(t,e){if(e._sealed)for(var i=0;i<t._components.length;++i){var n=t._components[i];if(n.constructor===e)return n}else for(var r=0;r<t._components.length;++r){var a=t._components[r];if(a instanceof e)return a}return null}function d(t,e,i){if(e._sealed)for(var n=0;n<t._components.length;++n){var r=t._components[n];r.constructor===e&&i.push(r)}else for(var a=0;a<t._components.length;++a){var s=t._components[a];s instanceof e&&i.push(s)}}function p(t,e){for(var i=0;i<t.length;++i){var n=t[i],r=_(n,e);if(r)return r;if(n._children.length>0&&(r=p(n._children,e)))return r}return null}function m(t,e,i){for(var n=0;n<t.length;++n){var r=t[n];d(r,e,i),r._children.length>0&&m(r._children,e,i)}}var v=cc.Class({name:"cc._BaseNode",extends:cc.Object,properties:{_parent:null,_children:[],_active:!0,_components:[],_prefab:null,_persistNode:{get:function(){return(this._objFlags&l)>0},set:function(t){t?this._objFlags|=l:this._objFlags&=~l}},name:{get:function(){return this._name},set:function(t){this._name=t}},uuid:{get:function(){return this._id}},children:{get:function(){return this._children}},childrenCount:{get:function(){return this._children.length}},active:{get:function(){return this._active},set:function(t){if(t=!!t,this._active!==t){this._active=t;var e=this._parent;e&&e._activeInHierarchy&&cc.director._nodeActivator.activateNode(this,t)}}},activeInHierarchy:{get:function(){return this._activeInHierarchy}}},ctor:function(t){this._name=void 0!==t?t:"New Node",this._activeInHierarchy=!1,this._id=u.getNewId(),cc.director._scheduler&&cc.director._scheduler.enableForTarget(this),this.__eventTargets=[]},getParent:function(){return this._parent},setParent:function(t){if(this._parent!==t){var e=this._parent;if(this._parent=t||null,this._onSetParent(t),t&&(s._setDirtyForNode(this),t._children.push(this),t.emit&&t.emit("child-added",this),t._renderFlag|=o.FLAG_CHILDREN),e){if(!(e._objFlags&c)){var i=e._children.indexOf(this);e._children.splice(i,1),e.emit&&e.emit("child-removed",this),this._onHierarchyChanged(e),0===e._children.length&&(e._renderFlag&=~o.FLAG_CHILDREN)}}else t&&this._onHierarchyChanged(null)}},attr:function(t){r.mixin(this,t)},getChildByUuid:function(t){if(!t)return cc.log("Invalid uuid"),null;for(var e=this._children,i=0,n=e.length;i<n;i++)if(e[i]._id===t)return e[i];return null},getChildByName:function(t){if(!t)return cc.log("Invalid name"),null;for(var e=this._children,i=0,n=e.length;i<n;i++)if(e[i]._name===t)return e[i];return null},addChild:function(t){cc.assertID(t,1606),cc.assertID(null===t._parent,1605),t.setParent(this)},insertChild:function(t,e){t.parent=this,t.setSiblingIndex(e)},getSiblingIndex:function(){return this._parent?this._parent._children.indexOf(this):0},setSiblingIndex:function(t){if(this._parent)if(this._parent._objFlags&h)cc.errorID(3821);else{var e=this._parent._children;t=-1!==t?t:e.length-1;var i=e.indexOf(this);t!==i&&(e.splice(i,1),t<e.length?e.splice(t,0,this):e.push(this),this._onSiblingIndexChanged&&this._onSiblingIndexChanged(t))}},walk:function(t,e){var i,n,r,a,s=cc._BaseNode,o=1,c=s._stacks[s._stackId];c||(c=[],s._stacks.push(c)),s._stackId++,c.length=0,c[0]=this;var l=null;for(a=!1;o;)if(n=c[--o])if(!a&&t?t(n):a&&e&&e(n),c[o]=null,a){if(l===this._parent)break;if(a=!1,i)if(i[++r])c[o]=i[r],o++;else if(l&&(c[o]=l,o++,a=!0,l._parent?(r=(i=l._parent._children).indexOf(l),l=l._parent):(l=null,i=null),r<0))break}else n._children.length>0?(l=n,i=n._children,r=0,c[o]=i[r],o++):(c[o]=n,o++,a=!0);c.length=0,s._stackId--},cleanup:function(){},removeFromParent:function(t){this._parent&&(void 0===t&&(t=!0),this._parent.removeChild(this,t))},removeChild:function(t,e){this._children.indexOf(t)>-1&&((e||void 0===e)&&t.cleanup(),t.parent=null)},removeAllChildren:function(t){var e=this._children;void 0===t&&(t=!0);for(var i=e.length-1;i>=0;i--){var n=e[i];n&&(t&&n.cleanup(),n.parent=null)}this._children.length=0},isChildOf:function(t){var e=this;do{if(e===t)return!0;e=e._parent}while(e);return!1},getComponent:function(t){var e=f(t);return e?_(this,e):null},getComponents:function(t){var e=f(t),i=[];return e&&d(this,e,i),i},getComponentInChildren:function(t){var e=f(t);return e?p(this._children,e):null},getComponentsInChildren:function(t){var e=f(t),i=[];return e&&(d(this,e,i),m(this._children,e,i)),i},_checkMultipleComp:!1,addComponent:function(t){var e;if("string"==typeof t){if(!(e=r.getClassByName(t)))return cc.errorID(3807,t),cc._RFpeek()&&cc.errorID(3808,t),null}else{if(!t)return cc.errorID(3804),null;e=t}if("function"!=typeof e)return cc.errorID(3809),null;if(!r.isChildClassOf(e,cc.Component))return cc.errorID(3810),null;var i=e._requireComponent;if(i&&!this.getComponent(i)&&!this.addComponent(i))return null;var n=new e;return n.node=this,this._components.push(n),this._activeInHierarchy&&cc.director._nodeActivator.activateComp(n),n},_addComponentAt:!1,removeComponent:function(t){t?(t instanceof cc.Component||(t=this.getComponent(t)),t&&t.destroy()):cc.errorID(3813)},_getDependComponent:!1,_removeComponent:function(t){if(t){if(!(this._objFlags&c)){var e=this._components.indexOf(t);-1!==e?this._components.splice(e,1):t.node!==this&&cc.errorID(3815)}}else cc.errorID(3814)},destroy:function(){cc.Object.prototype.destroy.call(this)&&(this.active=!1)},destroyAllChildren:function(){for(var t=this._children,e=0;e<t.length;++e)t[e].destroy()},_onSetParent:function(){},_onPostActivated:function(){},_onBatchCreated:function(){},_onHierarchyChanged:function(){var t=this._parent;!this._persistNode||t instanceof cc.Scene||cc.game.removePersistRootNode(this);var e=this._active&&!(!t||!t._activeInHierarchy);this._activeInHierarchy!==e&&cc.director._nodeActivator.activateNode(this,e)},_instantiate:function(t,e){return t||(t=cc.instantiate._clone(this,this)),t._prefab,t._parent=null,t._onBatchCreated(e),t},_registerIfAttached:!1,_onPreDestroy:function(){var t,e;this._objFlags|=c;var i=this._parent,n=i&&i._objFlags&c,r=this._children;for(t=0,e=r.length;t<e;++t)r[t]._destroyImmediate();for(t=0,e=this._components.length;t<e;++t)this._components[t]._destroyImmediate();var a=this.__eventTargets;for(t=0,e=a.length;t<e;++t){var s=a[t];s&&s.targetOff(this)}if(a.length=0,this._persistNode&&cc.game.removePersistRootNode(this),!n&&i){var o=i._children.indexOf(this);i._children.splice(o,1),i.emit&&i.emit("child-removed",this)}return n},onRestore:!1});v.idGenerater=u,v._stacks=[[]],v._stackId=0,v.prototype._onPreDestroyBase=v.prototype._onPreDestroy,v.prototype._onHierarchyChangedBase=v.prototype._onHierarchyChanged,n.propertyDefine(v,["parent","name","children","childrenCount"],{}),cc._BaseNode=e.exports=v}),{"../event-manager":139,"../platform/CCObject":174,"../platform/id-generater":185,"../platform/js":189,"../renderer/render-flow":200,"./misc":242}],236:[(function(t,e){"use strict";e.exports={binarySearchEpsilon:function(t,e){for(var i=0,n=t.length-1,r=n>>>1;i<=n;r=i+n>>>1){var a=t[r];if(a>e+1e-6)n=r-1;else{if(!(a<e-1e-6))return r;i=r+1}}return~i}}}),{}],237:[(function(t,e){"use strict";var i=t("../components/CCRenderComponent"),n=t("../platform/CCMacro").BlendFactor,r=t("../../renderer/gfx"),a=cc.Class({properties:{_srcBlendFactor:n.SRC_ALPHA,_dstBlendFactor:n.ONE_MINUS_SRC_ALPHA,srcBlendFactor:{get:function(){return this._srcBlendFactor},set:function(t){this._srcBlendFactor!==t&&(this._srcBlendFactor=t,this._updateBlendFunc(!0),this._onBlendChanged&&this._onBlendChanged())},animatable:!1,type:n,tooltip:!1,visible:!0},dstBlendFactor:{get:function(){return this._dstBlendFactor},set:function(t){this._dstBlendFactor!==t&&(this._dstBlendFactor=t,this._updateBlendFunc(!0))},animatable:!1,type:n,tooltip:!1,visible:!0}},setMaterial:function(t,e){var r=i.prototype.setMaterial.call(this,t,e);return this._srcBlendFactor===n.SRC_ALPHA&&this._dstBlendFactor===n.ONE_MINUS_SRC_ALPHA||this._updateMaterialBlendFunc(r),r},_updateMaterial:function(){this._updateBlendFunc()},_updateBlendFunc:function(t){if(t||this._srcBlendFactor!==n.SRC_ALPHA||this._dstBlendFactor!==n.ONE_MINUS_SRC_ALPHA)for(var e=this.getMaterials(),i=0;i<e.length;i++){var r=e[i];this._updateMaterialBlendFunc(r)}},_updateMaterialBlendFunc:function(t){t.setBlend(!0,r.BLEND_FUNC_ADD,this._srcBlendFactor,this._dstBlendFactor,r.BLEND_FUNC_ADD,this._srcBlendFactor,this._dstBlendFactor)}});e.exports=cc.BlendFunc=a}),{"../../renderer/gfx":290,"../components/CCRenderComponent":115,"../platform/CCMacro":173}],238:[(function(t,e){"use strict";var i=t("./misc").BASE64_VALUES,n="0123456789abcdef".split(""),r=["","","",""],a=r.concat(r,"-",r,"-",r,"-",r,"-",r,r,r),s=a.map((function(t,e){return"-"===t?NaN:e})).filter(isFinite);e.exports=function(t){if(22!==t.length)return t;a[0]=t[0],a[1]=t[1];for(var e=2,r=2;e<22;e+=2){var o=i[t.charCodeAt(e)],c=i[t.charCodeAt(e+1)];a[s[r++]]=n[o>>2],a[s[r++]]=n[(3&o)<<2|c>>4],a[s[r++]]=n[15&c]}return a.join("")}}),{"./misc":242}],239:[(function(t,e){"use strict";cc.find=e.exports=function(t,e){if(null==t)return cc.errorID(3814),null;if(e);else{var i=cc.director.getScene();if(!i)return null;e=i}for(var n=e,r="/"!==t[0]?0:1,a=t.split("/"),s=r;s<a.length;s++){var o=a[s],c=n._children;n=null;for(var l=0,h=c.length;l<h;++l){var u=c[l];if(u.name===o){n=u;break}}if(!n)return null}return n}}),{}],240:[(function(t,e){"use strict";var i,n=(i=t("../assets/material/material-variant"))&&i.__esModule?i:{default:i},r=t("../assets/material/CCMaterial"),a=cc.Class({properties:{_normalMaterial:null,normalMaterial:{get:function(){return this._normalMaterial},set:function(t){this._normalMaterial=t,this._updateDisabledState&&this._updateDisabledState()},type:r,tooltip:!1,animatable:!1},_grayMaterial:null,grayMaterial:{get:function(){return this._grayMaterial},set:function(t){this._grayMaterial=t,this._updateDisabledState&&this._updateDisabledState()},type:r,tooltip:!1,animatable:!1}},_switchGrayMaterial:function(t,e){var i;t?((i=this._grayMaterial)||(i=r.getBuiltinMaterial("2d-gray-sprite")),i=this._grayMaterial=n.default.create(i,e)):((i=this._normalMaterial)||(i=r.getBuiltinMaterial("2d-sprite",e)),i=this._normalMaterial=n.default.create(i,e)),e.setMaterial(0,i)}});e.exports=a}),{"../assets/material/CCMaterial":81,"../assets/material/material-variant":88}],241:[(function(t){"use strict";t("./CCPath"),t("./profiler/CCProfiler"),t("./find"),t("./mutable-forward-iterator")}),{"./CCPath":233,"./find":239,"./mutable-forward-iterator":243,"./profiler/CCProfiler":246}],242:[(function(t,e){"use strict";for(var i=t("../platform/js"),n={propertyDefine:function(t,e,n){function r(t,e,n,r){var a=Object.getOwnPropertyDescriptor(t,e);if(a)a.get&&(t[n]=a.get),a.set&&r&&(t[r]=a.set);else{var s=t[n];i.getset(t,e,s,t[r])}}for(var a,s=t.prototype,o=0;o<e.length;o++){var c=(a=e[o])[0].toUpperCase()+a.slice(1);r(s,a,"get"+c,"set"+c)}for(a in n){var l=n[a];r(s,a,l[0],l[1])}},NextPOT:function(t){return t-=1,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,1+(t|=t>>16)},BUILTIN_CLASSID_RE:/^(?:cc|dragonBones|sp|ccsg)\..+/},r=new Array(123),a=0;a<123;++a)r[a]=64;for(var s=0;s<64;++s)r["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charCodeAt(s)]=s;n.BASE64_VALUES=r,n.pushToMap=function(t,e,i,n){var r=t[e];r?Array.isArray(r)?n?(r.push(r[0]),r[0]=i):r.push(i):t[e]=n?[i,r]:[r,i]:t[e]=i},n.clampf=function(t,e,i){if(e>i){var n=e;e=i,i=n}return t<e?e:t<i?t:i},n.clamp01=function(t){return t<0?0:t<1?t:1},n.lerp=function(t,e,i){return t+(e-t)*i},n.degreesToRadians=function(t){return t*cc.macro.RAD},n.radiansToDegrees=function(t){return t*cc.macro.DEG},cc.misc=e.exports=n}),{"../platform/js":189}],243:[(function(t,e){"use strict";function i(t){this.i=0,this.array=t}var n=i.prototype;n.remove=function(t){var e=this.array.indexOf(t);e>=0&&this.removeAt(e)},n.removeAt=function(t){this.array.splice(t,1),t<=this.i&&--this.i},n.fastRemove=function(t){var e=this.array.indexOf(t);e>=0&&this.fastRemoveAt(e)},n.fastRemoveAt=function(t){var e=this.array;e[t]=e[e.length-1],--e.length,t<=this.i&&--this.i},n.push=function(t){this.array.push(t)},e.exports=i}),{}],244:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(){this.enabled=!1,this.count=0,this.maxSize=1024}var e=t.prototype;return e.get=function(){},e.put=function(){},e.clear=function(){},t})();i.default=n,cc.pool={},n.register=function(t,e){cc.pool[t]=e},e.exports=i.default}),{}],245:[(function(t,e){"use strict";cc._PrefabInfo=cc.Class({name:"cc.PrefabInfo",properties:{root:null,asset:null,fileId:"",sync:!1}}),e.exports={syncWithPrefab:function(t){var e=t._prefab;if(!e.asset)return cc.errorID(3701,t.name),void(t._prefab=null);var i=t._objFlags,n=t._parent,r=t._id,a=t._name,s=t._active,o=t._eulerAngles.x,c=t._eulerAngles.y,l=t._eulerAngles.z,h=t._localZOrder,u=t._trs,f=u[0],_=u[1],d=u[2];cc.game._isCloning=!0;var p=e.asset.data;p._iN$t=t,cc.instantiate._clone(p,p),cc.game._isCloning=!1,t._objFlags=i,t._parent=n,t._id=r,t._prefab=e,t._name=a,t._active=s,t._localZOrder=h,(u=t._trs)[0]=f,u[1]=_,u[2]=d,t._eulerAngles.x=o,t._eulerAngles.y=c,t._eulerAngles.z=l}}}),{}],246:[(function(t,e){"use strict";var i=t("../../platform/CCMacro"),n=t("./perf-counter"),r=!1,a=15,s=null,o=null,c=null;function l(){if(!s){s={fps:{desc:"Framerate (FPS)",below:30,average:500},draws:{desc:"Draw Call"},frame:{desc:"Frame time (ms)",min:0,max:50,average:500},logic:{desc:"Game Logic (ms)",min:0,max:50,average:500,color:"#080"},render:{desc:"Renderer (ms)",min:0,max:50,average:500,color:"#f90"},mode:{desc:cc.game.renderType===cc.game.RENDER_TYPE_WEBGL?"WebGL":"Canvas",min:1}};var t=performance.now();for(var e in s)s[e]._counter=new n(e,s[e],t)}}function h(){if(!o||!o.isValid){(o=new cc.Node("PROFILER-NODE")).x=o.y=10,o.groupIndex=cc.Node.BuiltinGroupIndex.DEBUG,cc.Camera._setupDebugCamera(),o.zIndex=i.MAX_ZINDEX,cc.game.addPersistRootNode(o);var t=new cc.Node("LEFT-PANEL");t.anchorX=t.anchorY=0;var e=t.addComponent(cc.Label);e.fontSize=a,e.lineHeight=a,t.parent=o;var n=new cc.Node("RIGHT-PANEL");n.anchorX=1,n.anchorY=0,n.x=200;var r=n.addComponent(cc.Label);r.horizontalAlign=cc.Label.HorizontalAlign.RIGHT,r.fontSize=a,r.lineHeight=a,n.parent=o,cc.sys.platform!==cc.sys.BAIDU_GAME_SUB&&cc.sys.platform!==cc.sys.WECHAT_GAME_SUB&&(e.cacheMode=cc.Label.CacheMode.CHAR,r.cacheMode=cc.Label.CacheMode.CHAR),c={left:e,right:r}}}function u(){h();var t=cc.director._lastUpdate;s.frame._counter.start(t),s.logic._counter.start(t)}function f(){var t=performance.now();cc.director.isPaused()?s.frame._counter.start(t):s.logic._counter.end(t),s.render._counter.start(t)}function _(){var t=performance.now();s.render._counter.end(t),s.draws._counter.value=cc.renderer.drawCalls,s.frame._counter.end(t),s.fps._counter.frame(t);var e="",i="";for(var n in s){var r=s[n];r._counter.sample(t),e+=r.desc+"\n",i+=r._counter.human()+"\n"}c&&(c.left.string=e,c.right.string=i)}cc.profiler=e.exports={isShowingStats:function(){return r},hideStats:function(){r&&(o&&(o.active=!1),cc.director.off(cc.Director.EVENT_BEFORE_UPDATE,u),cc.director.off(cc.Director.EVENT_AFTER_UPDATE,f),cc.director.off(cc.Director.EVENT_AFTER_DRAW,_),r=!1)},showStats:function(){r||(l(),o&&(o.active=!0),cc.director.on(cc.Director.EVENT_BEFORE_UPDATE,u),cc.director.on(cc.Director.EVENT_AFTER_UPDATE,f),cc.director.on(cc.Director.EVENT_AFTER_DRAW,_),r=!0)}}}),{"../../platform/CCMacro":173,"./perf-counter":248}],247:[(function(t,e){"use strict";var i=cc.Class({name:"cc.Counter",ctor:function(t,e,i){this._id=t,this._opts=e||{},this._value=0,this._total=0,this._averageValue=0,this._accumValue=0,this._accumSamples=0,this._accumStart=i},properties:{value:{get:function(){return this._value},set:function(t){this._value=t}}},_average:function(t,e){if(this._opts.average){this._accumValue+=t,++this._accumSamples;var i=e;i-this._accumStart>=this._opts.average&&(this._averageValue=this._accumValue/this._accumSamples,this._accumValue=0,this._accumStart=i,this._accumSamples=0)}},sample:function(t){this._average(this._value,t)},human:function(){var t=this._opts.average?this._averageValue:this._value;return Math.round(100*t)/100},alarm:function(){return this._opts.below&&this._value<this._opts.below||this._opts.over&&this._value>this._opts.over}});e.exports=i}),{}],248:[(function(t,e){"use strict";var i=t("./counter"),n=cc.Class({name:"cc.PerfCounter",extends:i,ctor:function(t,e,i){this._time=i},start:function(t){this._time=t},end:function(t){this._value=t-this._time,this._average(this._value)},tick:function(){this.end(),this.start()},frame:function(t){var e=t,i=e-this._time;this._total++,i>(this._opts.average||1e3)&&(this._value=1e3*this._total/i,this._total=0,this._time=e,this._average(this._value))}});e.exports=n}),{"./counter":247}],249:[(function(t,e){"use strict";var i,n=new(((i=t("../platform/js"))&&i.__esModule?i:{default:i}).default.Pool)(2);function r(t){this.count=0,this.limit=t,this.datas={},this.head=null,this.tail=null}n.get=function(){return this._get()||{key:null,value:null,prev:null,next:null}},r.prototype.moveToHead=function(t){t.next=this.head,t.prev=null,null!==this.head&&(this.head.prev=t),this.head=t,null===this.tail&&(this.tail=t),this.count++,this.datas[t.key]=t},r.prototype.put=function(t,e){var i=n.get();if(i.key=t,i.value=e,this.count>=this.limit){var r=this.tail;delete this.datas[r.key],this.count--,this.tail=r.prev,this.tail.next=null,r.prev=null,r.next=null,n.put(r)}this.moveToHead(i)},r.prototype.remove=function(t){null!==t.prev?t.prev.next=t.next:this.head=t.next,null!==t.next?t.next.prev=t.prev:this.tail=t.prev,delete this.datas[t.key],this.count--},r.prototype.get=function(t){var e=this.datas[t];return e?(this.remove(e),this.moveToHead(e),e.value):null},r.prototype.clear=function(){this.count=0,this.datas={},this.head=null,this.tail=null},r.prototype.has=function(t){return!!this.datas[t]},r.prototype.delete=function(t){var e=this.datas[t];this.remove(e)};var a=new r(100),s={BASELINE_RATIO:.26,MIDDLE_RATIO:.37,BASELINE_OFFSET:0,label_wordRex:/([a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430-\u044f\u0410-\u042f\u0401\u0451\u0600-\u06ff]+|\S)/,label_symbolRex:/^[!,.:;'}\]%\?>\u3001\u2018\u201c\u300b\uff1f\u3002\uff0c\uff01]/,label_lastWordRex:/([a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u0179\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451\u0600-\u06ff]+|\S)$/,label_lastEnglish:/[a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u0179\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451\u0600-\u06ff]+$/,label_firstEnglish:/^[a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u0179\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451\u0600-\u06ff]/,highSurrogateRex:/[\uD800-\uDBFF]/,lowSurrogateRex:/[\uDC00-\uDFFF]/,label_wrapinspection:!0,__CHINESE_REG:/^[\u4E00-\u9FFF\u3400-\u4DFF]+$/,__JAPANESE_REG:/[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g,__KOREAN_REG:/^[\u1100-\u11FF]|[\u3130-\u318F]|[\uA960-\uA97F]|[\uAC00-\uD7AF]|[\uD7B0-\uD7FF]+$/,isUnicodeCJK:function(t){return this.__CHINESE_REG.test(t)||this.__JAPANESE_REG.test(t)||this.__KOREAN_REG.test(t)},isUnicodeSpace:function(t){return(t=t.charCodeAt(0))>=9&&t<=13||32===t||133===t||160===t||5760===t||t>=8192&&t<=8202||8232===t||8233===t||8239===t||8287===t||12288===t},safeMeasureText:function(t,e,i){var n=(i||t.font)+"\ud83c\udfae"+e,r=a.get(n);if(null!==r)return r;var s=t.measureText(e),o=s&&s.width||0;return a.put(n,o),o},_safeSubstring:function(t,e,i){var n=e,r=i,a=t[e];if(this.lowSurrogateRex.test(a)&&n--,void 0!==i)if(i-1!==e){var s=t[i-1];this.highSurrogateRex.test(s)&&r--}else this.highSurrogateRex.test(a)&&r++;return t.substring(n,r)},fragmentText:function(t,e,i,n){var r=[];if(0===t.length||i<0)return r.push(""),r;for(var a=t;e>i&&a.length>1;){for(var s=a.length*(i/e)|0,o=this._safeSubstring(a,s),c=e-n(o),l=o,h=0,u=0;c>i&&u++<10;)s*=i/c,s|=0,c=e-n(o=this._safeSubstring(a,s));for(u=0;c<=i&&u++<10;){if(o){var f=this.label_wordRex.exec(o);h=f?f[0].length:1,l=o}s+=h,c=e-n(o=this._safeSubstring(a,s))}0==(s-=h)?(s=1,l=this._safeSubstring(a,1)):1===s&&this.highSurrogateRex.test(a[0])&&(s=2,l=this._safeSubstring(a,2));var _,d=this._safeSubstring(a,0,s);this.label_wrapinspection&&this.label_symbolRex.test(l||o)&&(0==(s-=(_=this.label_lastWordRex.exec(d))?_[0].length:0)&&(s=1),l=this._safeSubstring(a,s),d=this._safeSubstring(a,0,s)),this.label_firstEnglish.test(l)&&(_=this.label_lastEnglish.exec(d))&&d!==_[0]&&(s-=_[0].length,l=this._safeSubstring(a,s),d=this._safeSubstring(a,0,s)),0===r.length?r.push(d):(d=d.trimLeft()).length>0&&r.push(d),e=n(a=l||o)}return 0===r.length?r.push(a):(a=a.trimLeft()).length>0&&r.push(a),r}};cc.textUtils=e.exports=s}),{"../platform/js":189}],250:[(function(t,e){"use strict";var i=t("../assets/CCTexture2D"),n={loadImage:function(t,e,i){cc.assertID(t,3103);var n=cc.assetManager.assets.get(t);if(n)return n.loaded?(e&&e.call(i,null,n),n):(n.once("load",(function(){e&&e.call(i,null,n)}),i),n);cc.assetManager.loadRemote(t,(function(t,n){e&&e.call(i,t,n)}))},cacheImage:function(t,e){if(t&&e){var n=new i;return n.initWithElement(e),cc.assetManager.assets.add(t,n),n}},postLoadTexture:function(t,e){t.loaded?e&&e():t.nativeUrl?cc.assetManager.postLoadNative(t,e):e&&e()}};e.exports=n}),{"../assets/CCTexture2D":77}],251:[(function(t,e){"use strict";var i=t("./node-unit"),n=t("./node-mem-pool");e.exports={NodeMemPool:new n(i)}}),{"./node-mem-pool":253,"./node-unit":254}],252:[(function(t,e){"use strict";var i=function(t){this._unitClass=t,this._pool=[],this._findOrder=[]},n=i.prototype;n._initNative=function(){this._nativeMemPool=new renderer.MemPool},n._buildUnit=function(t){return new this._unitClass(t,this)},n._destroyUnit=function(t){this._pool[t]=null;for(var e=0,i=this._findOrder.length;e<i;e++){var n=this._findOrder[e];if(n&&n.unitID==t){this._findOrder.splice(e,1);break}}},n._findUnitID=function(){for(var t=0,e=this._pool;e[t];)t++;return t},n.pop=function(){for(var t=null,e=0,i=this._findOrder,n=this._pool,r=i.length;e<r;e++){var a=i[e];if(a&&a.hasSpace()){t=a;break}}if(!t){var s=this._findUnitID();t=this._buildUnit(s),n[s]=t,i.push(t),e=i.length-1}var o=i[0];return o!==t&&(i[0]=t,i[e]=o),t.pop()},n.push=function(t){var e=this._pool[t.unitID];return e.push(t.index),this._findOrder.length>1&&e.isAllFree()&&this._destroyUnit(t.unitID),e},e.exports=i}),{}],253:[(function(t,e){"use strict";var i,n=t("./mem-pool"),r=function(t){n.call(this,t)};(i=function(){}).prototype=n.prototype;var a=r.prototype=new i;a._initNative=function(){this._nativeMemPool=new renderer.NodeMemPool},a._destroyUnit=function(t){n.prototype._destroyUnit.call(this,t)},e.exports=r}),{"./mem-pool":252}],254:[(function(t,e){"use strict";var i,n=t("../../value-types/utils"),r=(Uint32Array,10*n.FLOAT_BYTES),a=16*n.FLOAT_BYTES,s=16*n.FLOAT_BYTES,o=(Uint32Array,Uint32Array,Int32Array,Uint8Array,Uint8Array,Uint32Array,n.FLOAT_BYTES,t("./unit-base")),c=function(t,e){o.call(this,t,e);var i=this._contentNum;this.trsList=new n.FLOAT_ARRAY_TYPE(10*i),this.localMatList=new n.FLOAT_ARRAY_TYPE(16*i),this.worldMatList=new n.FLOAT_ARRAY_TYPE(16*i);for(var c=0;c<i;c++){var l=this._spacesData[c];l.trs=new n.FLOAT_ARRAY_TYPE(this.trsList.buffer,c*r,10),l.localMat=new n.FLOAT_ARRAY_TYPE(this.localMatList.buffer,c*a,16),l.worldMat=new n.FLOAT_ARRAY_TYPE(this.worldMatList.buffer,c*s,16)}};(i=function(){}).prototype=o.prototype,c.prototype=new i,e.exports=c}),{"../../value-types/utils":264,"./unit-base":255}],255:[(function(t,e){"use strict";var i=function(t,e,i){i=i||128,this.unitID=t,this._memPool=e,this._data=new Uint16Array(2),this._data[0]=0,this._data[1]=0,this._contentNum=i,this._signData=new Uint16Array(2*this._contentNum),this._spacesData=[];for(var n=0;n<i;n++){var r=2*n;this._signData[r+0]=n+1,this._signData[r+1]=0,this._spacesData[n]={index:n,unitID:t}}this._signData[2*(i-1)]=65535},n=i.prototype;n.hasSpace=function(){return 65535!==this._data[0]},n.isAllFree=function(){return 0==this._data[1]},n.pop=function(){var t=this._data[0];if(65535===t)return null;var e=t,i=2*e,n=this._spacesData[e];return this._signData[i+1]=1,this._data[0]=this._signData[i+0],this._data[1]++,n},n.push=function(t){var e=2*t;this._signData[e+1]=0,this._signData[e+0]=this._data[0],this._data[0]=t,this._data[1]--},n.dump=function(){for(var t=0,e=this._data[0],i="";65535!=e;)t++,i+=e+"->",e=this._signData[2*e+0];for(var n=0,r="",a=this._contentNum,s=0;s<a;s++)1==this._signData[2*s+1]&&(n++,r+=s+"->");var o=t+n;console.log("unitID:",this.unitID,"spaceNum:",t,"calc using num:",n,"store using num:",this._data[1],"calc total num:",o,"actually total num:",this._contentNum),console.log("free info:",i),console.log("using info:",r),n!=this._data[1]&&cc.error("using num error","calc using num:",n,"store using num:",this._data[1]),t+n!=this._contentNum&&cc.error("total num error","calc total num:",o,"actually total num:",this._contentNum)},e.exports=i}),{}],256:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("./value-type")),r=s(t("../platform/CCClass")),a=s(t("../utils/misc"));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=c(n.key,"string"))?r:String(r)),n)}var r}function c(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var h=(function(t){var e,i;function n(e,i,n,r){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=255),(a=t.call(this)||this)._val=0,"object"==typeof e&&(i=e.g,n=e.b,r=e.a,e=e.r),a._val=(r<<24>>>0)+(n<<16)+(i<<8)+(0|e),a}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,l(e,i),n.copy=function(t,e){return t.r=e.r,t.g=e.g,t.b=e.b,t.a=e.a,t},n.clone=function(t){return new n(t.r,t.g,t.b,t.a)},n.set=function(t,e,i,n,r){return void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===r&&(r=255),t.r=e,t.g=i,t.b=n,t.a=r,t},n.fromHex=function(t,e){var i=e>>24&255,n=e>>16&255,r=e>>8&255,a=255&e;return t.r=i,t.g=n,t.b=r,t.a=a,t},n.fromHEX=function(t,e){return e=0===e.indexOf("#")?e.substring(1):e,t.r=parseInt(e.substr(0,2),16)||0,t.g=parseInt(e.substr(2,2),16)||0,t.b=parseInt(e.substr(4,2),16)||0,t.a=parseInt(e.substr(6,2),16)||255,t._val=(t.a<<24>>>0)+(t.b<<16)+(t.g<<8)+t.r,t},n.add=function(t,e,i){return t.r=e.r+i.r,t.g=e.g+i.g,t.b=e.b+i.b,t.a=e.a+i.a,t},n.subtract=function(t,e,i){return t.r=e.r-i.r,t.g=e.g-i.g,t.b=e.b-i.b,t.a=e.a-i.a,t},n.multiply=function(t,e,i){return t.r=e.r*i.r,t.g=e.g*i.g,t.b=e.b*i.b,t.a=e.a*i.a,t},n.divide=function(t,e,i){return t.r=e.r/i.r,t.g=e.g/i.g,t.b=e.b/i.b,t.a=e.a/i.a,t},n.scale=function(t,e,i){return t.r=e.r*i,t.g=e.g*i,t.b=e.b*i,t.a=e.a*i,t},n.lerp=function(t,e,i,n){var r=e.r,a=e.g,s=e.b,o=e.a;return t.r=r+n*(i.r-r),t.g=a+n*(i.g-a),t.b=s+n*(i.b-s),t.a=o+n*(i.a-o),t},n.toArray=function(t,e,i){void 0===i&&(i=0);var r=e instanceof n||e.a>1?1/255:1;return t[i+0]=e.r*r,t[i+1]=e.g*r,t[i+2]=e.b*r,t[i+3]=e.a*r,t},n.fromArray=function(t,e,i){return void 0===i&&(i=0),e.r=255*t[i+0],e.g=255*t[i+1],e.b=255*t[i+2],e.a=255*t[i+3],e},n.premultiplyAlpha=function(t,e){var i=e.a/255;return t.r=e.r*i,t.g=e.g*i,t.b=e.b*i,t._fastSetA(e.a),t};var r,s,c,h=n.prototype;return h.clone=function(){var t=new n;return t._val=this._val,t},h.equals=function(t){return t&&this._val===t._val},h.lerp=function(t,e,i){i=i||new n;var r=this.r,a=this.g,s=this.b,o=this.a;return i.r=r+(t.r-r)*e,i.g=a+(t.g-a)*e,i.b=s+(t.b-s)*e,i.a=o+(t.a-o)*e,i},h.toString=function(){return"rgba("+this.r.toFixed()+", "+this.g.toFixed()+", "+this.b.toFixed()+", "+this.a.toFixed()+")"},h.getR=function(){return 255&this._val},h.setR=function(t){return t=~~a.default.clampf(t,0,255),this._val=(4294967040&this._val|t)>>>0,this},h.getG=function(){return(65280&this._val)>>8},h.setG=function(t){return t=~~a.default.clampf(t,0,255),this._val=(4294902015&this._val|t<<8)>>>0,this},h.getB=function(){return(16711680&this._val)>>16},h.setB=function(t){return t=~~a.default.clampf(t,0,255),this._val=(4278255615&this._val|t<<16)>>>0,this},h.getA=function(){return(4278190080&this._val)>>>24},h.setA=function(t){return t=~~a.default.clampf(t,0,255),this._val=(16777215&this._val|t<<24)>>>0,this},h.toCSS=function(t){return t&&"rgba"!==t?"rgb"===t?"rgb("+this.r+","+this.g+","+this.b+")":"#"+this.toHEX(t):"rgba("+this.r+","+this.g+","+this.b+","+(this.a/255).toFixed(2)+")"},h.fromHEX=function(t){t=0===t.indexOf("#")?t.substring(1):t;var e=parseInt(t.substr(0,2),16)||0,i=parseInt(t.substr(2,2),16)||0,n=parseInt(t.substr(4,2),16)||0,r=parseInt(t.substr(6,2),16)||255;return this._val=(r<<24>>>0)+(n<<16)+(i<<8)+e,this},h.toHEX=function(t){var e=[(this.r<16?"0":"")+this.r.toString(16),(this.g<16?"0":"")+this.g.toString(16),(this.b<16?"0":"")+this.b.toString(16)];return"#rgb"===t?(e[0]=e[0][0],e[1]=e[1][0],e[2]=e[2][0]):"#rrggbbaa"===t&&e.push((this.a<16?"0":"")+this.a.toString(16)),e.join("")},h.toRGBValue=function(){return 16777215&this._val},h.fromHSV=function(t,e,i){var n,r,a;if(0===e)n=r=a=i;else if(0===i)n=r=a=0;else{1===t&&(t=0),t*=6;var s=Math.floor(t),o=t-s,c=i*(1-e),l=i*(1-e*o),h=i*(1-e*(1-o));switch(s){case 0:n=i,r=h,a=c;break;case 1:n=l,r=i,a=c;break;case 2:n=c,r=i,a=h;break;case 3:n=c,r=l,a=i;break;case 4:n=h,r=c,a=i;break;case 5:n=i,r=c,a=l}}return n*=255,r*=255,a*=255,this._val=(this.a<<24>>>0)+(a<<16)+(r<<8)+(0|n),this},h.toHSV=function(){var t=this.r/255,e=this.g/255,i=this.b/255,n={h:0,s:0,v:0},r=Math.max(t,e,i),a=Math.min(t,e,i),s=0;return n.v=r,n.s=r?(r-a)/r:0,n.s?(s=r-a,n.h=t===r?(e-i)/s:e===r?2+(i-t)/s:4+(t-e)/s,n.h/=6,n.h<0&&(n.h+=1)):n.h=0,n},h.set=function(t){return t._val?this._val=t._val:(this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a),this},h._fastSetA=function(t){this._val=(16777215&this._val|t<<24)>>>0},h.multiply=function(t){var e=(255&this._val)*t.r>>8,i=(65280&this._val)*t.g>>8,n=(16711680&this._val)*t.b>>8,r=((4278190080&this._val)>>>8)*t.a;return this._val=4278190080&r|16711680&n|65280&i|255&e,this},r=n,c=[{key:"WHITE",get:function(){return new n(255,255,255,255)}},{key:"BLACK",get:function(){return new n(0,0,0,255)}},{key:"TRANSPARENT",get:function(){return new n(0,0,0,0)}},{key:"GRAY",get:function(){return new n(127.5,127.5,127.5)}},{key:"RED",get:function(){return new n(255,0,0)}},{key:"GREEN",get:function(){return new n(0,255,0)}},{key:"BLUE",get:function(){return new n(0,0,255)}},{key:"YELLOW",get:function(){return new n(255,235,4)}},{key:"ORANGE",get:function(){return new n(255,127,0)}},{key:"CYAN",get:function(){return new n(0,255,255)}},{key:"MAGENTA",get:function(){return new n(255,0,255)}}],(s=[{key:"r",get:function(){return this.getR()},set:function(t){this.setR(t)}},{key:"g",get:function(){return this.getG()},set:function(t){this.setG(t)}},{key:"b",get:function(){return this.getB()},set:function(t){this.setB(t)}},{key:"a",get:function(){return this.getA()},set:function(t){this.setA(t)}}])&&o(r.prototype,s),c&&o(r,c),Object.defineProperty(r,"prototype",{writable:!1}),n})(n.default);i.default=h,h.div=h.divide,h.sub=h.subtract,h.mul=h.multiply,h.WHITE_R=h.WHITE,h.BLACK_R=h.BLACK,h.TRANSPARENT_R=h.TRANSPARENT,h.GRAY_R=h.GRAY,h.RED_R=h.RED,h.GREEN_R=h.GREEN,h.BLUE_R=h.BLUE,h.YELLOW_R=h.YELLOW,h.ORANGE_R=h.ORANGE,h.CYAN_R=h.CYAN,h.MAGENTA_R=h.MAGENTA,r.default.fastDefine("cc.Color",h,{r:0,g:0,b:0,a:255}),cc.Color=h,cc.color=function(t,e,i,n){return"string"==typeof t?(new h).fromHEX(t):"object"==typeof t?new h(t.r,t.g,t.b,t.a):new h(t,e,i,n)},e.exports=i.default}),{"../platform/CCClass":168,"../utils/misc":242,"./value-type":265}],257:[(function(t,e,i){"use strict";i.__esModule=!0;var n={Vec2:!0,Vec3:!0,Vec4:!0,Mat4:!0,Mat3:!0,Rect:!0,Size:!0,Color:!0,Quat:!0,Trs:!0};i.Vec4=i.Vec3=i.Vec2=i.Trs=i.Size=i.Rect=i.Quat=i.Mat4=i.Mat3=i.Color=void 0;var r=p(t("./vec2"));i.Vec2=r.default;var a=p(t("./vec3"));i.Vec3=a.default;var s=p(t("./vec4"));i.Vec4=s.default;var o=p(t("./mat4"));i.Mat4=o.default;var c=p(t("./mat3"));i.Mat3=c.default;var l=p(t("./rect"));i.Rect=l.default;var h=p(t("./size"));i.Size=h.default;var u=p(t("./color"));i.Color=u.default;var f=p(t("./quat"));i.Quat=f.default;var _=p(t("./trs"));i.Trs=_.default;var d=t("./utils");function p(t){return t&&t.__esModule?t:{default:t}}Object.keys(d).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in i&&i[t]===d[t]||(i[t]=d[t]))})),cc.math=e.exports}),{"./color":256,"./mat3":258,"./mat4":259,"./quat":260,"./rect":261,"./size":262,"./trs":263,"./utils":264,"./vec2":266,"./vec3":267,"./vec4":268}],258:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types/utils"),a=(n=t("./vec3"))&&n.__esModule?n:{default:n},s=(function(){function t(t,e,i,n,a,s,o,c,l){if(void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===s&&(s=0),void 0===o&&(o=0),void 0===c&&(c=0),void 0===l&&(l=1),this.m=void 0,t instanceof r.FLOAT_ARRAY_TYPE)this.m=t;else{this.m=new r.FLOAT_ARRAY_TYPE(9);var h=this.m;h[0]=t,h[1]=e,h[2]=i,h[3]=n,h[4]=a,h[5]=s,h[6]=o,h[7]=c,h[8]=l}}return t.create=function(e,i,n,r,a,s,o,c,l){return void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===a&&(a=1),void 0===s&&(s=0),void 0===o&&(o=0),void 0===c&&(c=0),void 0===l&&(l=1),new t(e,i,n,r,a,s,o,c,l)},t.clone=function(e){var i=e.m;return new t(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},t.copy=function(t,e){return t.m.set(e.m),t},t.set=function(t,e,i,n,r,a,s,o,c,l){var h=t.m;return h[0]=e,h[1]=i,h[2]=n,h[3]=r,h[4]=a,h[5]=s,h[6]=o,h[7]=c,h[8]=l,t},t.identity=function(t){var e=t.m;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,t},t.transpose=function(t,e){var i=e.m,n=t.m;if(t===e){var r=i[1],a=i[2],s=i[5];n[1]=i[3],n[2]=i[6],n[3]=r,n[5]=i[7],n[6]=a,n[7]=s}else n[0]=i[0],n[1]=i[3],n[2]=i[6],n[3]=i[1],n[4]=i[4],n[5]=i[7],n[6]=i[2],n[7]=i[5],n[8]=i[8];return t},t.invert=function(t,e){var i=e.m,n=t.m,r=i[0],a=i[1],s=i[2],o=i[3],c=i[4],l=i[5],h=i[6],u=i[7],f=i[8],_=f*c-l*u,d=-f*o+l*h,p=u*o-c*h,m=r*_+a*d+s*p;return m?(m=1/m,n[0]=_*m,n[1]=(-f*a+s*u)*m,n[2]=(l*a-s*c)*m,n[3]=d*m,n[4]=(f*r-s*h)*m,n[5]=(-l*r+s*o)*m,n[6]=p*m,n[7]=(-u*r+a*h)*m,n[8]=(c*r-a*o)*m,t):t},t.adjoint=function(t,e){var i=e.m,n=t.m,r=i[0],a=i[1],s=i[2],o=i[3],c=i[4],l=i[5],h=i[6],u=i[7],f=i[8];return n[0]=c*f-l*u,n[1]=s*u-a*f,n[2]=a*l-s*c,n[3]=l*h-o*f,n[4]=r*f-s*h,n[5]=s*o-r*l,n[6]=o*u-c*h,n[7]=a*h-r*u,n[8]=r*c-a*o,t},t.determinant=function(t){var e=t.m,i=e[0],n=e[1],r=e[2],a=e[3],s=e[4],o=e[5],c=e[6],l=e[7],h=e[8];return i*(h*s-o*l)+n*(-h*a+o*c)+r*(l*a-s*c)},t.multiply=function(t,e,i){var n=e.m,r=i.m,a=t.m,s=n[0],o=n[1],c=n[2],l=n[3],h=n[4],u=n[5],f=n[6],_=n[7],d=n[8],p=r[0],m=r[1],v=r[2],g=r[3],y=r[4],T=r[5],A=r[6],b=r[7],E=r[8];return a[0]=p*s+m*l+v*f,a[1]=p*o+m*h+v*_,a[2]=p*c+m*u+v*d,a[3]=g*s+y*l+T*f,a[4]=g*o+y*h+T*_,a[5]=g*c+y*u+T*d,a[6]=A*s+b*l+E*f,a[7]=A*o+b*h+E*_,a[8]=A*c+b*u+E*d,t},t.multiplyMat4=function(t,e,i){var n=e.m,r=i.m,a=t.m,s=n[0],o=n[1],c=n[2],l=n[3],h=n[4],u=n[5],f=n[6],_=n[7],d=n[8],p=r[0],m=r[1],v=r[2],g=r[4],y=r[5],T=r[6],A=r[8],b=r[9],E=r[10];return a[0]=p*s+m*l+v*f,a[1]=p*o+m*h+v*_,a[2]=p*c+m*u+v*d,a[3]=g*s+y*l+T*f,a[4]=g*o+y*h+T*_,a[5]=g*c+y*u+T*d,a[6]=A*s+b*l+E*f,a[7]=A*o+b*h+E*_,a[8]=A*c+b*u+E*d,t},t.translate=function(t,e,i){var n=e.m,r=t.m,a=n[0],s=n[1],o=n[2],c=n[3],l=n[4],h=n[5],u=n[6],f=n[7],_=n[8],d=i.x,p=i.y;return r[0]=a,r[1]=s,r[2]=o,r[3]=c,r[4]=l,r[5]=h,r[6]=d*a+p*c+u,r[7]=d*s+p*l+f,r[8]=d*o+p*h+_,t},t.rotate=function(t,e,i){var n=e.m,r=t.m,a=n[0],s=n[1],o=n[2],c=n[3],l=n[4],h=n[5],u=n[6],f=n[7],_=n[8],d=Math.sin(i),p=Math.cos(i);return r[0]=p*a+d*c,r[1]=p*s+d*l,r[2]=p*o+d*h,r[3]=p*c-d*a,r[4]=p*l-d*s,r[5]=p*h-d*o,r[6]=u,r[7]=f,r[8]=_,t},t.scale=function(t,e,i){var n=i.x,r=i.y,a=e.m,s=t.m;return s[0]=n*a[0],s[1]=n*a[1],s[2]=n*a[2],s[3]=r*a[3],s[4]=r*a[4],s[5]=r*a[5],s[6]=a[6],s[7]=a[7],s[8]=a[8],t},t.fromMat4=function(t,e){var i=e.m,n=t.m;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[4],n[4]=i[5],n[5]=i[6],n[6]=i[8],n[7]=i[9],n[8]=i[10],t},t.fromTranslation=function(t,e){var i=t.m;return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=1,i[5]=0,i[6]=e.x,i[7]=e.y,i[8]=1,t},t.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e),r=t.m;return r[0]=n,r[1]=i,r[2]=0,r[3]=-i,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,t},t.fromScaling=function(t,e){var i=t.m;return i[0]=e.x,i[1]=0,i[2]=0,i[3]=0,i[4]=e.y,i[5]=0,i[6]=0,i[7]=0,i[8]=1,t},t.fromQuat=function(t,e){var i=t.m,n=e.x,r=e.y,a=e.z,s=e.w,o=n+n,c=r+r,l=a+a,h=n*o,u=r*o,f=r*c,_=a*o,d=a*c,p=a*l,m=s*o,v=s*c,g=s*l;return i[0]=1-f-p,i[3]=u-g,i[6]=_+v,i[1]=u+g,i[4]=1-h-p,i[7]=d-m,i[2]=_-v,i[5]=d+m,i[8]=1-h-f,t},t.fromViewUp=function(e,i,n){var s,o,c;return(s=new a.default(0,1,0),o=new a.default,c=new a.default,function(e,i,n){return a.default.lengthSqr(i)<r.EPSILON*r.EPSILON?(t.identity(e),e):(n=n||s,a.default.normalize(o,a.default.cross(o,n,i)),a.default.lengthSqr(o)<r.EPSILON*r.EPSILON?(t.identity(e),e):(a.default.cross(c,i,o),t.set(e,o.x,o.y,o.z,c.x,c.y,c.z,i.x,i.y,i.z),e))})(e,i,n)},t.normalFromMat4=function(t,e){var i=e.m,n=t.m,r=i[0],a=i[1],s=i[2],o=i[3],c=i[4],l=i[5],h=i[6],u=i[7],f=i[8],_=i[9],d=i[10],p=i[11],m=i[12],v=i[13],g=i[14],y=i[15],T=r*l-a*c,A=r*h-s*c,b=r*u-o*c,E=a*h-s*l,C=a*u-o*l,x=s*u-o*h,S=f*v-_*m,w=f*g-d*m,D=f*y-p*m,M=_*g-d*v,R=_*y-p*v,I=d*y-p*g,O=T*I-A*R+b*M+E*D-C*w+x*S;return O?(O=1/O,n[0]=(l*I-h*R+u*M)*O,n[1]=(h*D-c*I-u*w)*O,n[2]=(c*R-l*D+u*S)*O,n[3]=(s*R-a*I-o*M)*O,n[4]=(r*I-s*D+o*w)*O,n[5]=(a*D-r*R-o*S)*O,n[6]=(v*x-g*C+y*E)*O,n[7]=(g*b-m*x-y*A)*O,n[8]=(m*C-v*b+y*T)*O,t):t},t.frob=function(t){var e=t.m;return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))},t.add=function(t,e,i){var n=e.m,r=i.m,a=t.m;return a[0]=n[0]+r[0],a[1]=n[1]+r[1],a[2]=n[2]+r[2],a[3]=n[3]+r[3],a[4]=n[4]+r[4],a[5]=n[5]+r[5],a[6]=n[6]+r[6],a[7]=n[7]+r[7],a[8]=n[8]+r[8],t},t.subtract=function(t,e,i){var n=e.m,r=i.m,a=t.m;return a[0]=n[0]-r[0],a[1]=n[1]-r[1],a[2]=n[2]-r[2],a[3]=n[3]-r[3],a[4]=n[4]-r[4],a[5]=n[5]-r[5],a[6]=n[6]-r[6],a[7]=n[7]-r[7],a[8]=n[8]-r[8],t},t.multiplyScalar=function(t,e,i){var n=e.m,r=t.m;return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[3]=n[3]*i,r[4]=n[4]*i,r[5]=n[5]*i,r[6]=n[6]*i,r[7]=n[7]*i,r[8]=n[8]*i,t},t.multiplyScalarAndAdd=function(t,e,i,n){var r=e.m,a=i.m,s=t.m;return s[0]=r[0]+a[0]*n,s[1]=r[1]+a[1]*n,s[2]=r[2]+a[2]*n,s[3]=r[3]+a[3]*n,s[4]=r[4]+a[4]*n,s[5]=r[5]+a[5]*n,s[6]=r[6]+a[6]*n,s[7]=r[7]+a[7]*n,s[8]=r[8]+a[8]*n,t},t.exactEquals=function(t,e){var i=t.m,n=e.m;return i[0]===n[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3]&&i[4]===n[4]&&i[5]===n[5]&&i[6]===n[6]&&i[7]===n[7]&&i[8]===n[8]},t.equals=function(t,e){var i=t.m,n=e.m,a=i[0],s=i[1],o=i[2],c=i[3],l=i[4],h=i[5],u=i[6],f=i[7],_=i[8],d=n[0],p=n[1],m=n[2],v=n[3],g=n[4],y=n[5],T=n[6],A=n[7],b=n[8];return Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-p)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(c-v)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(l-g)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(h-y)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-T)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(f-A)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(_-b)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(b))},t.toArray=function(t,e,i){void 0===i&&(i=0);for(var n=e.m,r=0;r<9;r++)t[i+r]=n[r];return t},t.fromArray=function(t,e,i){void 0===i&&(i=0);for(var n=t.m,r=0;r<9;r++)n[r]=e[i+r];return t},t.prototype.toString=function(){var t=this.m;return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},t})();i.default=s,s.sub=s.subtract,s.mul=s.multiply,s.IDENTITY=Object.freeze(new s),cc.Mat3=s,e.exports=i.default}),{"../value-types/utils":264,"./vec3":267}],259:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=l(t("./value-type")),r=l(t("../platform/CCClass")),a=l(t("./vec3")),s=l(t("./quat")),o=t("./utils"),c=l(t("./mat3"));function l(t){return t&&t.__esModule?t:{default:t}}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var u=0,f=0,_=0,d=0,p=0,m=0,v=0,g=0,y=0,T=0,A=0,b=0,E=0,C=0,x=0,S=0,w=(function(t){var e,i;i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,h(e,i);var n=r.prototype;function r(e,i,n,r,a,s,c,l,h,u,f,_,d,p,m,v){var g;if(void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===a&&(a=0),void 0===s&&(s=1),void 0===c&&(c=0),void 0===l&&(l=0),void 0===h&&(h=0),void 0===u&&(u=0),void 0===f&&(f=1),void 0===_&&(_=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=0),void 0===v&&(v=1),(g=t.call(this)||this).m=void 0,e instanceof o.FLOAT_ARRAY_TYPE)g.m=e;else{g.m=new o.FLOAT_ARRAY_TYPE(16);var y=g.m;y[0]=e,y[1]=i,y[2]=n,y[3]=r,y[4]=a,y[5]=s,y[6]=c,y[7]=l,y[8]=h,y[9]=u,y[10]=f,y[11]=_,y[12]=d,y[13]=p,y[14]=m,y[15]=v}return g}return n.mul=function(t,e){return r.multiply(e||new r,this,t)},n.mulScalar=function(t,e){r.multiplyScalar(e||new r,this,t)},n.sub=function(t,e){r.subtract(e||new r,this,t)},r.clone=function(t){var e=t.m;return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},r.copy=function(t,e){var i=t.m,n=e.m;return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],t},r.set=function(t,e,i,n,r,a,s,o,c,l,h,u,f,_,d,p,m){var v=t.m;return v[0]=e,v[1]=i,v[2]=n,v[3]=r,v[4]=a,v[5]=s,v[6]=o,v[7]=c,v[8]=l,v[9]=h,v[10]=u,v[11]=f,v[12]=_,v[13]=d,v[14]=p,v[15]=m,t},r.identity=function(t){var e=t.m;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,t},r.transpose=function(t,e){var i=t.m,n=e.m;if(t===e){var r=n[1],a=n[2],s=n[3],o=n[6],c=n[7],l=n[11];i[1]=n[4],i[2]=n[8],i[3]=n[12],i[4]=r,i[6]=n[9],i[7]=n[13],i[8]=a,i[9]=o,i[11]=n[14],i[12]=s,i[13]=c,i[14]=l}else i[0]=n[0],i[1]=n[4],i[2]=n[8],i[3]=n[12],i[4]=n[1],i[5]=n[5],i[6]=n[9],i[7]=n[13],i[8]=n[2],i[9]=n[6],i[10]=n[10],i[11]=n[14],i[12]=n[3],i[13]=n[7],i[14]=n[11],i[15]=n[15];return t},r.invert=function(t,e){var i=e.m;u=i[0],f=i[1],_=i[2],d=i[3],p=i[4],m=i[5],v=i[6],g=i[7],y=i[8],T=i[9],A=i[10],b=i[11],E=i[12],C=i[13],x=i[14],S=i[15];var n=u*m-f*p,r=u*v-_*p,a=u*g-d*p,s=f*v-_*m,o=f*g-d*m,c=_*g-d*v,l=y*C-T*E,h=y*x-A*E,w=y*S-b*E,D=T*x-A*C,M=T*S-b*C,R=A*S-b*x,I=n*R-r*M+a*D+s*w-o*h+c*l;if(0===I)return null;I=1/I;var O=t.m;return O[0]=(m*R-v*M+g*D)*I,O[1]=(_*M-f*R-d*D)*I,O[2]=(C*c-x*o+S*s)*I,O[3]=(A*o-T*c-b*s)*I,O[4]=(v*w-p*R-g*h)*I,O[5]=(u*R-_*w+d*h)*I,O[6]=(x*a-E*c-S*r)*I,O[7]=(y*c-A*a+b*r)*I,O[8]=(p*M-m*w+g*l)*I,O[9]=(f*w-u*M-d*l)*I,O[10]=(E*o-C*a+S*n)*I,O[11]=(T*a-y*o-b*n)*I,O[12]=(m*h-p*D-v*l)*I,O[13]=(u*D-f*h+_*l)*I,O[14]=(C*r-E*s-x*n)*I,O[15]=(y*s-T*r+A*n)*I,t},r.determinant=function(t){var e=t.m;return u=e[0],f=e[1],_=e[2],d=e[3],p=e[4],m=e[5],v=e[6],g=e[7],y=e[8],T=e[9],A=e[10],b=e[11],E=e[12],C=e[13],x=e[14],S=e[15],(u*m-f*p)*(A*S-b*x)-(u*v-_*p)*(T*S-b*C)+(u*g-d*p)*(T*x-A*C)+(f*v-_*m)*(y*S-b*E)-(f*g-d*m)*(y*x-A*E)+(_*g-d*v)*(y*C-T*E)},r.multiply=function(t,e,i){var n=t.m,r=e.m,a=i.m;u=r[0],f=r[1],_=r[2],d=r[3],p=r[4],m=r[5],v=r[6],g=r[7],y=r[8],T=r[9],A=r[10],b=r[11],E=r[12],C=r[13],x=r[14],S=r[15];var s=a[0],o=a[1],c=a[2],l=a[3];return n[0]=s*u+o*p+c*y+l*E,n[1]=s*f+o*m+c*T+l*C,n[2]=s*_+o*v+c*A+l*x,n[3]=s*d+o*g+c*b+l*S,s=a[4],o=a[5],c=a[6],l=a[7],n[4]=s*u+o*p+c*y+l*E,n[5]=s*f+o*m+c*T+l*C,n[6]=s*_+o*v+c*A+l*x,n[7]=s*d+o*g+c*b+l*S,s=a[8],o=a[9],c=a[10],l=a[11],n[8]=s*u+o*p+c*y+l*E,n[9]=s*f+o*m+c*T+l*C,n[10]=s*_+o*v+c*A+l*x,n[11]=s*d+o*g+c*b+l*S,s=a[12],o=a[13],c=a[14],l=a[15],n[12]=s*u+o*p+c*y+l*E,n[13]=s*f+o*m+c*T+l*C,n[14]=s*_+o*v+c*A+l*x,n[15]=s*d+o*g+c*b+l*S,t},r.transform=function(t,e,i){var n=i.x,r=i.y,a=i.z,s=t.m,o=e.m;return e===t?(s[12]=o[0]*n+o[4]*r+o[8]*a+o[12],s[13]=o[1]*n+o[5]*r+o[9]*a+o[13],s[14]=o[2]*n+o[6]*r+o[10]*a+o[14],s[15]=o[3]*n+o[7]*r+o[11]*a+o[15]):(u=o[0],f=o[1],_=o[2],d=o[3],p=o[4],m=o[5],v=o[6],g=o[7],y=o[8],T=o[9],A=o[10],b=o[11],E=o[12],C=o[13],x=o[14],S=o[15],s[0]=u,s[1]=f,s[2]=_,s[3]=d,s[4]=p,s[5]=m,s[6]=v,s[7]=g,s[8]=y,s[9]=T,s[10]=A,s[11]=b,s[12]=u*n+p*r+y*a+o[12],s[13]=f*n+m*r+T*a+o[13],s[14]=_*n+v*r+A*a+o[14],s[15]=d*n+g*r+b*a+o[15]),t},r.translate=function(t,e,i){var n=t.m,r=e.m;return e===t?(n[12]+=i.x,n[13]+=i.y,n[14]+=i.z):(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]+=i.x,n[13]+=i.y,n[14]+=i.z,n[15]=r[15]),t},r.scale=function(t,e,i){var n=i.x,r=i.y,a=i.z,s=t.m,o=e.m;return s[0]=o[0]*n,s[1]=o[1]*n,s[2]=o[2]*n,s[3]=o[3]*n,s[4]=o[4]*r,s[5]=o[5]*r,s[6]=o[6]*r,s[7]=o[7]*r,s[8]=o[8]*a,s[9]=o[9]*a,s[10]=o[10]*a,s[11]=o[11]*a,s[12]=o[12],s[13]=o[13],s[14]=o[14],s[15]=o[15],t},r.rotate=function(t,e,i,n){var r=n.x,a=n.y,s=n.z,c=Math.sqrt(r*r+a*a+s*s);if(Math.abs(c)<o.EPSILON)return null;r*=c=1/c,a*=c,s*=c;var l=Math.sin(i),h=Math.cos(i),E=1-h,C=e.m;u=C[0],f=C[1],_=C[2],d=C[3],p=C[4],m=C[5],v=C[6],g=C[7],y=C[8],T=C[9],A=C[10],b=C[11];var x=r*r*E+h,S=a*r*E+s*l,w=s*r*E-a*l,D=r*a*E-s*l,M=a*a*E+h,R=s*a*E+r*l,I=r*s*E+a*l,O=a*s*E-r*l,P=s*s*E+h,N=t.m;return N[0]=u*x+p*S+y*w,N[1]=f*x+m*S+T*w,N[2]=_*x+v*S+A*w,N[3]=d*x+g*S+b*w,N[4]=u*D+p*M+y*R,N[5]=f*D+m*M+T*R,N[6]=_*D+v*M+A*R,N[7]=d*D+g*M+b*R,N[8]=u*I+p*O+y*P,N[9]=f*I+m*O+T*P,N[10]=_*I+v*O+A*P,N[11]=d*I+g*O+b*P,e!==t&&(N[12]=C[12],N[13]=C[13],N[14]=C[14],N[15]=C[15]),t},r.rotateX=function(t,e,i){var n=t.m,r=e.m,a=Math.sin(i),s=Math.cos(i),o=r[4],c=r[5],l=r[6],h=r[7],u=r[8],f=r[9],_=r[10],d=r[11];return e!==t&&(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15]),n[4]=o*s+u*a,n[5]=c*s+f*a,n[6]=l*s+_*a,n[7]=h*s+d*a,n[8]=u*s-o*a,n[9]=f*s-c*a,n[10]=_*s-l*a,n[11]=d*s-h*a,t},r.rotateY=function(t,e,i){var n=t.m,r=e.m,a=Math.sin(i),s=Math.cos(i),o=r[0],c=r[1],l=r[2],h=r[3],u=r[8],f=r[9],_=r[10],d=r[11];return e!==t&&(n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15]),n[0]=o*s-u*a,n[1]=c*s-f*a,n[2]=l*s-_*a,n[3]=h*s-d*a,n[8]=o*a+u*s,n[9]=c*a+f*s,n[10]=l*a+_*s,n[11]=h*a+d*s,t},r.rotateZ=function(t,e,i){var n=e.m,r=t.m,a=Math.sin(i),s=Math.cos(i),o=e.m[0],c=e.m[1],l=e.m[2],h=e.m[3],u=e.m[4],f=e.m[5],_=e.m[6],d=e.m[7];return e!==t&&(r[8]=n[8],r[9]=n[9],r[10]=n[10],r[11]=n[11],r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15]),r[0]=o*s+u*a,r[1]=c*s+f*a,r[2]=l*s+_*a,r[3]=h*s+d*a,r[4]=u*s-o*a,r[5]=f*s-c*a,r[6]=_*s-l*a,r[7]=d*s-h*a,t},r.fromTranslation=function(t,e){var i=t.m;return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,t},r.fromScaling=function(t,e){var i=t.m;return i[0]=e.x,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e.y,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e.z,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,t},r.fromRotation=function(t,e,i){var n=i.x,r=i.y,a=i.z,s=Math.sqrt(n*n+r*r+a*a);if(Math.abs(s)<o.EPSILON)return null;n*=s=1/s,r*=s,a*=s;var c=Math.sin(e),l=Math.cos(e),h=1-l,u=t.m;return u[0]=n*n*h+l,u[1]=r*n*h+a*c,u[2]=a*n*h-r*c,u[3]=0,u[4]=n*r*h-a*c,u[5]=r*r*h+l,u[6]=a*r*h+n*c,u[7]=0,u[8]=n*a*h+r*c,u[9]=r*a*h-n*c,u[10]=a*a*h+l,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,t},r.fromXRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e),r=t.m;return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=i,r[7]=0,r[8]=0,r[9]=-i,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,t},r.fromYRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e),r=t.m;return r[0]=n,r[1]=0,r[2]=-i,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=i,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,t},r.fromZRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e),r=t.m;return r[0]=n,r[1]=i,r[2]=0,r[3]=0,r[4]=-i,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,t},r.fromRT=function(t,e,i){var n=e.x,r=e.y,a=e.z,s=e.w,o=n+n,c=r+r,l=a+a,h=n*o,u=n*c,f=n*l,_=r*c,d=r*l,p=a*l,m=s*o,v=s*c,g=s*l,y=t.m;return y[0]=1-(_+p),y[1]=u+g,y[2]=f-v,y[3]=0,y[4]=u-g,y[5]=1-(h+p),y[6]=d+m,y[7]=0,y[8]=f+v,y[9]=d-m,y[10]=1-(h+_),y[11]=0,y[12]=i.x,y[13]=i.y,y[14]=i.z,y[15]=1,t},r.getTranslation=function(t,e){var i=e.m;return t.x=i[12],t.y=i[13],t.z=i[14],t},r.getScaling=function(t,e){var i=e.m,n=M.m,r=n[0]=i[0],a=n[1]=i[1],s=n[2]=i[2],o=n[3]=i[4],l=n[4]=i[5],h=n[5]=i[6],u=n[6]=i[8],f=n[7]=i[9],_=n[8]=i[10];return t.x=Math.sqrt(r*r+a*a+s*s),t.y=Math.sqrt(o*o+l*l+h*h),t.z=Math.sqrt(u*u+f*f+_*_),c.default.determinant(M)<0&&(t.x*=-1),t},r.getRotation=function(t,e){var i=e.m,n=i[0]+i[5]+i[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t.w=.25*r,t.x=(i[6]-i[9])/r,t.y=(i[8]-i[2])/r,t.z=(i[1]-i[4])/r):i[0]>i[5]&&i[0]>i[10]?(r=2*Math.sqrt(1+i[0]-i[5]-i[10]),t.w=(i[6]-i[9])/r,t.x=.25*r,t.y=(i[1]+i[4])/r,t.z=(i[8]+i[2])/r):i[5]>i[10]?(r=2*Math.sqrt(1+i[5]-i[0]-i[10]),t.w=(i[8]-i[2])/r,t.x=(i[1]+i[4])/r,t.y=.25*r,t.z=(i[6]+i[9])/r):(r=2*Math.sqrt(1+i[10]-i[0]-i[5]),t.w=(i[1]-i[4])/r,t.x=(i[8]+i[2])/r,t.y=(i[6]+i[9])/r,t.z=.25*r),t},r.toRTS=function(t,e,i,n){var r=t.m,o=M.m;n.x=a.default.set(D,r[0],r[1],r[2]).mag(),o[0]=r[0]/n.x,o[1]=r[1]/n.x,o[2]=r[2]/n.x,n.y=a.default.set(D,r[4],r[5],r[6]).mag(),o[3]=r[4]/n.y,o[4]=r[5]/n.y,o[5]=r[6]/n.y,n.z=a.default.set(D,r[8],r[9],r[10]).mag(),o[6]=r[8]/n.z,o[7]=r[9]/n.z,o[8]=r[10]/n.z,c.default.determinant(M)<0&&(n.x*=-1,o[0]*=-1,o[1]*=-1,o[2]*=-1),s.default.fromMat3(e,M),a.default.set(i,r[12],r[13],r[14])},r.fromRTS=function(t,e,i,n){var r=e.x,a=e.y,s=e.z,o=e.w,c=r+r,l=a+a,h=s+s,u=r*c,f=r*l,_=r*h,d=a*l,p=a*h,m=s*h,v=o*c,g=o*l,y=o*h,T=n.x,A=n.y,b=n.z,E=t.m;return E[0]=(1-(d+m))*T,E[1]=(f+y)*T,E[2]=(_-g)*T,E[3]=0,E[4]=(f-y)*A,E[5]=(1-(u+m))*A,E[6]=(p+v)*A,E[7]=0,E[8]=(_+g)*b,E[9]=(p-v)*b,E[10]=(1-(u+d))*b,E[11]=0,E[12]=i.x,E[13]=i.y,E[14]=i.z,E[15]=1,t},r.fromRTSOrigin=function(t,e,i,n,r){var a=e.x,s=e.y,o=e.z,c=e.w,l=a+a,h=s+s,u=o+o,f=a*l,_=a*h,d=a*u,p=s*h,m=s*u,v=o*u,g=c*l,y=c*h,T=c*u,A=n.x,b=n.y,E=n.z,C=r.x,x=r.y,S=r.z,w=t.m;return w[0]=(1-(p+v))*A,w[1]=(_+T)*A,w[2]=(d-y)*A,w[3]=0,w[4]=(_-T)*b,w[5]=(1-(f+v))*b,w[6]=(m+g)*b,w[7]=0,w[8]=(d+y)*E,w[9]=(m-g)*E,w[10]=(1-(f+p))*E,w[11]=0,w[12]=i.x+C-(w[0]*C+w[4]*x+w[8]*S),w[13]=i.y+x-(w[1]*C+w[5]*x+w[9]*S),w[14]=i.z+S-(w[2]*C+w[6]*x+w[10]*S),w[15]=1,t},r.fromQuat=function(t,e){var i=e.x,n=e.y,r=e.z,a=e.w,s=i+i,o=n+n,c=r+r,l=i*s,h=n*s,u=n*o,f=r*s,_=r*o,d=r*c,p=a*s,m=a*o,v=a*c,g=t.m;return g[0]=1-u-d,g[1]=h+v,g[2]=f-m,g[3]=0,g[4]=h-v,g[5]=1-l-d,g[6]=_+p,g[7]=0,g[8]=f+m,g[9]=_-p,g[10]=1-l-u,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,t},r.frustum=function(t,e,i,n,r,a,s){var o=1/(i-e),c=1/(r-n),l=1/(a-s),h=t.m;return h[0]=2*a*o,h[1]=0,h[2]=0,h[3]=0,h[4]=0,h[5]=2*a*c,h[6]=0,h[7]=0,h[8]=(i+e)*o,h[9]=(r+n)*c,h[10]=(s+a)*l,h[11]=-1,h[12]=0,h[13]=0,h[14]=s*a*2*l,h[15]=0,t},r.perspective=function(t,e,i,n,r){var a=1/Math.tan(e/2),s=1/(n-r),o=t.m;return o[0]=a/i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(r+n)*s,o[11]=-1,o[12]=0,o[13]=0,o[14]=2*r*n*s,o[15]=0,t},r.ortho=function(t,e,i,n,r,a,s){var o=1/(e-i),c=1/(n-r),l=1/(a-s),h=t.m;return h[0]=-2*o,h[1]=0,h[2]=0,h[3]=0,h[4]=0,h[5]=-2*c,h[6]=0,h[7]=0,h[8]=0,h[9]=0,h[10]=2*l,h[11]=0,h[12]=(e+i)*o,h[13]=(r+n)*c,h[14]=(s+a)*l,h[15]=1,t},r.lookAt=function(t,e,i,n){var r=e.x,a=e.y,s=e.z,o=n.x,c=n.y,l=n.z,h=r-i.x,u=a-i.y,f=s-i.z,_=1/Math.sqrt(h*h+u*u+f*f),d=c*(f*=_)-l*(u*=_),p=l*(h*=_)-o*f,m=o*u-c*h,v=u*(m*=_=1/Math.sqrt(d*d+p*p+m*m))-f*(p*=_),g=f*(d*=_)-h*m,y=h*p-u*d,T=t.m;return T[0]=d,T[1]=v,T[2]=h,T[3]=0,T[4]=p,T[5]=g,T[6]=u,T[7]=0,T[8]=m,T[9]=y,T[10]=f,T[11]=0,T[12]=-(d*r+p*a+m*s),T[13]=-(v*r+g*a+y*s),T[14]=-(h*r+u*a+f*s),T[15]=1,t},r.inverseTranspose=function(t,e){var i=e.m;u=i[0],f=i[1],_=i[2],d=i[3],p=i[4],m=i[5],v=i[6],g=i[7],y=i[8],T=i[9],A=i[10],b=i[11],E=i[12],C=i[13],x=i[14],S=i[15];var n=u*m-f*p,r=u*v-_*p,a=u*g-d*p,s=f*v-_*m,o=f*g-d*m,c=_*g-d*v,l=y*C-T*E,h=y*x-A*E,w=y*S-b*E,D=T*x-A*C,M=T*S-b*C,R=A*S-b*x,I=n*R-r*M+a*D+s*w-o*h+c*l;return I?(I=1/I,(i=t.m)[0]=(m*R-v*M+g*D)*I,i[1]=(v*w-p*R-g*h)*I,i[2]=(p*M-m*w+g*l)*I,i[3]=0,i[4]=(_*M-f*R-d*D)*I,i[5]=(u*R-_*w+d*h)*I,i[6]=(f*w-u*M-d*l)*I,i[7]=0,i[8]=(C*c-x*o+S*s)*I,i[9]=(x*a-E*c-S*r)*I,i[10]=(E*o-C*a+S*n)*I,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,t):null},r.add=function(t,e,i){var n=t.m,r=e.m,a=i.m;return n[0]=r[0]+a[0],n[1]=r[1]+a[1],n[2]=r[2]+a[2],n[3]=r[3]+a[3],n[4]=r[4]+a[4],n[5]=r[5]+a[5],n[6]=r[6]+a[6],n[7]=r[7]+a[7],n[8]=r[8]+a[8],n[9]=r[9]+a[9],n[10]=r[10]+a[10],n[11]=r[11]+a[11],n[12]=r[12]+a[12],n[13]=r[13]+a[13],n[14]=r[14]+a[14],n[15]=r[15]+a[15],t},r.subtract=function(t,e,i){var n=t.m,r=e.m,a=i.m;return n[0]=r[0]-a[0],n[1]=r[1]-a[1],n[2]=r[2]-a[2],n[3]=r[3]-a[3],n[4]=r[4]-a[4],n[5]=r[5]-a[5],n[6]=r[6]-a[6],n[7]=r[7]-a[7],n[8]=r[8]-a[8],n[9]=r[9]-a[9],n[10]=r[10]-a[10],n[11]=r[11]-a[11],n[12]=r[12]-a[12],n[13]=r[13]-a[13],n[14]=r[14]-a[14],n[15]=r[15]-a[15],t},r.multiplyScalar=function(t,e,i){var n=t.m,r=e.m;return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=r[3]*i,n[4]=r[4]*i,n[5]=r[5]*i,n[6]=r[6]*i,n[7]=r[7]*i,n[8]=r[8]*i,n[9]=r[9]*i,n[10]=r[10]*i,n[11]=r[11]*i,n[12]=r[12]*i,n[13]=r[13]*i,n[14]=r[14]*i,n[15]=r[15]*i,t},r.multiplyScalarAndAdd=function(t,e,i,n){var r=t.m,a=e.m,s=i.m;return r[0]=a[0]+s[0]*n,r[1]=a[1]+s[1]*n,r[2]=a[2]+s[2]*n,r[3]=a[3]+s[3]*n,r[4]=a[4]+s[4]*n,r[5]=a[5]+s[5]*n,r[6]=a[6]+s[6]*n,r[7]=a[7]+s[7]*n,r[8]=a[8]+s[8]*n,r[9]=a[9]+s[9]*n,r[10]=a[10]+s[10]*n,r[11]=a[11]+s[11]*n,r[12]=a[12]+s[12]*n,r[13]=a[13]+s[13]*n,r[14]=a[14]+s[14]*n,r[15]=a[15]+s[15]*n,t},r.strictEquals=function(t,e){var i=t.m,n=e.m;return i[0]===n[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3]&&i[4]===n[4]&&i[5]===n[5]&&i[6]===n[6]&&i[7]===n[7]&&i[8]===n[8]&&i[9]===n[9]&&i[10]===n[10]&&i[11]===n[11]&&i[12]===n[12]&&i[13]===n[13]&&i[14]===n[14]&&i[15]===n[15]},r.equals=function(t,e,i){void 0===i&&(i=o.EPSILON);var n=t.m,r=e.m;return Math.abs(n[0]-r[0])<=i*Math.max(1,Math.abs(n[0]),Math.abs(r[0]))&&Math.abs(n[1]-r[1])<=i*Math.max(1,Math.abs(n[1]),Math.abs(r[1]))&&Math.abs(n[2]-r[2])<=i*Math.max(1,Math.abs(n[2]),Math.abs(r[2]))&&Math.abs(n[3]-r[3])<=i*Math.max(1,Math.abs(n[3]),Math.abs(r[3]))&&Math.abs(n[4]-r[4])<=i*Math.max(1,Math.abs(n[4]),Math.abs(r[4]))&&Math.abs(n[5]-r[5])<=i*Math.max(1,Math.abs(n[5]),Math.abs(r[5]))&&Math.abs(n[6]-r[6])<=i*Math.max(1,Math.abs(n[6]),Math.abs(r[6]))&&Math.abs(n[7]-r[7])<=i*Math.max(1,Math.abs(n[7]),Math.abs(r[7]))&&Math.abs(n[8]-r[8])<=i*Math.max(1,Math.abs(n[8]),Math.abs(r[8]))&&Math.abs(n[9]-r[9])<=i*Math.max(1,Math.abs(n[9]),Math.abs(r[9]))&&Math.abs(n[10]-r[10])<=i*Math.max(1,Math.abs(n[10]),Math.abs(r[10]))&&Math.abs(n[11]-r[11])<=i*Math.max(1,Math.abs(n[11]),Math.abs(r[11]))&&Math.abs(n[12]-r[12])<=i*Math.max(1,Math.abs(n[12]),Math.abs(r[12]))&&Math.abs(n[13]-r[13])<=i*Math.max(1,Math.abs(n[13]),Math.abs(r[13]))&&Math.abs(n[14]-r[14])<=i*Math.max(1,Math.abs(n[14]),Math.abs(r[14]))&&Math.abs(n[15]-r[15])<=i*Math.max(1,Math.abs(n[15]),Math.abs(r[15]))},r.adjoint=function(t,e){var i=e.m,n=t.m,r=i[0],a=i[1],s=i[2],o=i[3],c=i[4],l=i[5],h=i[6],u=i[7],f=i[8],_=i[9],d=i[10],p=i[11],m=i[12],v=i[13],g=i[14],y=i[15];return n[0]=l*(d*y-p*g)-_*(h*y-u*g)+v*(h*p-u*d),n[1]=-(a*(d*y-p*g)-_*(s*y-o*g)+v*(s*p-o*d)),n[2]=a*(h*y-u*g)-l*(s*y-o*g)+v*(s*u-o*h),n[3]=-(a*(h*p-u*d)-l*(s*p-o*d)+_*(s*u-o*h)),n[4]=-(c*(d*y-p*g)-f*(h*y-u*g)+m*(h*p-u*d)),n[5]=r*(d*y-p*g)-f*(s*y-o*g)+m*(s*p-o*d),n[6]=-(r*(h*y-u*g)-c*(s*y-o*g)+m*(s*u-o*h)),n[7]=r*(h*p-u*d)-c*(s*p-o*d)+f*(s*u-o*h),n[8]=c*(_*y-p*v)-f*(l*y-u*v)+m*(l*p-u*_),n[9]=-(r*(_*y-p*v)-f*(a*y-o*v)+m*(a*p-o*_)),n[10]=r*(l*y-u*v)-c*(a*y-o*v)+m*(a*u-o*l),n[11]=-(r*(l*p-u*_)-c*(a*p-o*_)+f*(a*u-o*l)),n[12]=-(c*(_*g-d*v)-f*(l*g-h*v)+m*(l*d-h*_)),n[13]=r*(_*g-d*v)-f*(a*g-s*v)+m*(a*d-s*_),n[14]=-(r*(l*g-h*v)-c*(a*g-s*v)+m*(a*h-s*l)),n[15]=r*(l*d-h*_)-c*(a*d-s*_)+f*(a*h-s*l),t},r.toArray=function(t,e,i){void 0===i&&(i=0);for(var n=e.m,r=0;r<16;r++)t[i+r]=n[r];return t},r.fromArray=function(t,e,i){void 0===i&&(i=0);for(var n=t.m,r=0;r<16;r++)n[r]=e[i+r];return t},n.clone=function(){var t=this.m;return new r(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},n.set=function(t){var e=this.m,i=t.m;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},n.equals=function(t){return r.strictEquals(this,t)},n.fuzzyEquals=function(t){return r.equals(this,t)},n.toString=function(){var t=this.m;return t?"[\n"+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+",\n"+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+",\n"+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+",\n"+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+"\n]":"[\n1, 0, 0, 0\n0, 1, 0, 0\n0, 0, 1, 0\n0, 0, 0, 1\n]"},n.identity=function(){return r.identity(this)},n.transpose=function(t){return t=t||new r,r.transpose(t,this)},n.invert=function(t){return t=t||new r,r.invert(t,this)},n.adjoint=function(t){return t=t||new r,r.adjoint(t,this)},n.determinant=function(){return r.determinant(this)},n.add=function(t,e){return e=e||new r,r.add(e,this,t)},n.subtract=function(t){return r.subtract(this,this,t)},n.multiply=function(t){return r.multiply(this,this,t)},n.multiplyScalar=function(t){return r.multiplyScalar(this,this,t)},n.translate=function(t,e){return e=e||new r,r.translate(e,this,t)},n.scale=function(t,e){return e=e||new r,r.scale(e,this,t)},n.rotate=function(t,e,i){return i=i||new r,r.rotate(i,this,t,e)},n.getTranslation=function(t){return t=t||new a.default,r.getTranslation(t,this)},n.getScale=function(t){return t=t||new a.default,r.getScaling(t,this)},n.getRotation=function(t){return t=t||new s.default,r.getRotation(t,this)},n.fromRTS=function(t,e,i){return r.fromRTS(this,t,e,i)},n.fromQuat=function(t){return r.fromQuat(this,t)},r})(n.default);i.default=w,w.mul=w.multiply,w.sub=w.subtract,w.IDENTITY=Object.freeze(new w);var D=new a.default,M=new c.default;r.default.fastDefine("cc.Mat4",w,{m00:1,m01:0,m02:0,m03:0,m04:0,m05:1,m06:0,m07:0,m08:0,m09:0,m10:1,m11:0,m12:0,m13:0,m14:0,m15:1});for(var R=function(t){Object.defineProperty(w.prototype,"m"+t,{get:function(){return this.m[t]},set:function(e){this.m[t]=e}})},I=0;I<16;I++)R(I);cc.mat4=function(t,e,i,n,r,a,s,o,c,l,h,u,f,_,d,p){var m=new w(t,e,i,n,r,a,s,o,c,l,h,u,f,_,d,p);return void 0===t&&w.identity(m),m},cc.Mat4=w,e.exports=i.default}),{"../platform/CCClass":168,"./mat3":258,"./quat":260,"./utils":264,"./value-type":265,"./vec3":267}],260:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=c(t("./value-type")),r=c(t("../platform/CCClass")),a=c(t("./vec3")),s=c(t("./mat3")),o=t("./utils");function c(t){return t&&t.__esModule?t:{default:t}}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var h=0,u=0,f=0,_=0,d=(function(t){var e,i;i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,l(e,i);var n=r.prototype;function r(e,i,n,r){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1),(a=t.call(this)||this).x=void 0,a.y=void 0,a.z=void 0,a.w=void 0,e&&"object"==typeof e?(a.x=e.x,a.y=e.y,a.z=e.z,a.w=e.w):(a.x=e,a.y=i,a.z=n,a.w=r),a}return n.mul=function(t,e){return r.multiply(e||new r,this,t)},r.clone=function(t){return new r(t.x,t.y,t.z,t.w)},r.copy=function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t},r.set=function(t,e,i,n,r){return t.x=e,t.y=i,t.z=n,t.w=r,t},r.identity=function(t){return t.x=0,t.y=0,t.z=0,t.w=1,t},r.rotationTo=function(t,e,i){var n=a.default.dot(e,i);return n<-.999999?(a.default.cross(v,a.default.RIGHT,e),v.mag()<1e-6&&a.default.cross(v,a.default.UP,e),a.default.normalize(v,v),r.fromAxisAngle(t,v,Math.PI),t):n>.999999?(t.x=0,t.y=0,t.z=0,t.w=1,t):(a.default.cross(v,e,i),t.x=v.x,t.y=v.y,t.z=v.z,t.w=1+n,r.normalize(t,t))},r.getAxisAngle=function(t,e){var i=2*Math.acos(e.w),n=Math.sin(i/2);return 0!==n?(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n):(t.x=1,t.y=0,t.z=0),i},r.multiply=function(t,e,i){return h=e.x*i.w+e.w*i.x+e.y*i.z-e.z*i.y,u=e.y*i.w+e.w*i.y+e.z*i.x-e.x*i.z,f=e.z*i.w+e.w*i.z+e.x*i.y-e.y*i.x,_=e.w*i.w-e.x*i.x-e.y*i.y-e.z*i.z,t.x=h,t.y=u,t.z=f,t.w=_,t},r.multiplyScalar=function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=e.w*i,t},r.scaleAndAdd=function(t,e,i,n){return t.x=e.x+i.x*n,t.y=e.y+i.y*n,t.z=e.z+i.z*n,t.w=e.w+i.w*n,t},r.rotateX=function(t,e,i){i*=.5;var n=Math.sin(i),r=Math.cos(i);return h=e.x*r+e.w*n,u=e.y*r+e.z*n,f=e.z*r-e.y*n,_=e.w*r-e.x*n,t.x=h,t.y=u,t.z=f,t.w=_,t},r.rotateY=function(t,e,i){i*=.5;var n=Math.sin(i),r=Math.cos(i);return h=e.x*r-e.z*n,u=e.y*r+e.w*n,f=e.z*r+e.x*n,_=e.w*r-e.y*n,t.x=h,t.y=u,t.z=f,t.w=_,t},r.rotateZ=function(t,e,i){i*=.5;var n=Math.sin(i),r=Math.cos(i);return h=e.x*r+e.y*n,u=e.y*r-e.x*n,f=e.z*r+e.w*n,_=e.w*r-e.z*n,t.x=h,t.y=u,t.z=f,t.w=_,t},r.rotateAround=function(t,e,i,n){return r.invert(p,e),a.default.transformQuat(v,i,p),r.fromAxisAngle(p,v,n),r.multiply(t,e,p),t},r.rotateAroundLocal=function(t,e,i,n){return r.fromAxisAngle(p,i,n),r.multiply(t,e,p),t},r.calculateW=function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=Math.sqrt(Math.abs(1-e.x*e.x-e.y*e.y-e.z*e.z)),t},r.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},r.lerp=function(t,e,i,n){return t.x=e.x+n*(i.x-e.x),t.y=e.y+n*(i.y-e.y),t.z=e.z+n*(i.z-e.z),t.w=e.w+n*(i.w-e.w),t},r.slerp=function(t,e,i,n){var r=0,a=0,s=e.x*i.x+e.y*i.y+e.z*i.z+e.w*i.w;if(s<0&&(s=-s,i.x=-i.x,i.y=-i.y,i.z=-i.z,i.w=-i.w),1-s>1e-6){var o=Math.acos(s),c=Math.sin(o);r=Math.sin((1-n)*o)/c,a=Math.sin(n*o)/c}else r=1-n,a=n;return t.x=r*e.x+a*i.x,t.y=r*e.y+a*i.y,t.z=r*e.z+a*i.z,t.w=r*e.w+a*i.w,t},r.sqlerp=function(t,e,i,n,a,s){return r.slerp(p,e,a,s),r.slerp(m,i,n,s),r.slerp(t,p,m,2*s*(1-s)),t},r.invert=function(t,e){var i=e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w,n=i?1/i:0;return t.x=-e.x*n,t.y=-e.y*n,t.z=-e.z*n,t.w=e.w*n,t},r.conjugate=function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w)},r.lengthSqr=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},r.normalize=function(t,e){var i=e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w;return i>0&&(i=1/Math.sqrt(i),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=e.w*i),t},r.fromAxes=function(t,e,i,n){return s.default.set(g,e.x,e.y,e.z,i.x,i.y,i.z,n.x,n.y,n.z),r.normalize(t,r.fromMat3(t,g))},r.fromViewUp=function(t,e,i){return s.default.fromViewUp(g,e,i),r.normalize(t,r.fromMat3(t,g))},r.fromAxisAngle=function(t,e,i){i*=.5;var n=Math.sin(i);return t.x=n*e.x,t.y=n*e.y,t.z=n*e.z,t.w=Math.cos(i),t},r.fromAngleZ=function(t,e){return e*=y,t.x=t.y=0,t.z=Math.sin(e),t.w=Math.cos(e),t},r.fromMat3=function(t,e){var i=e.m,n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],c=i[5],l=i[6],h=i[7],u=i[8],f=n+o+u;if(f>0){var _=.5/Math.sqrt(f+1);t.w=.25/_,t.x=(c-h)*_,t.y=(l-a)*_,t.z=(r-s)*_}else if(n>o&&n>u){var d=2*Math.sqrt(1+n-o-u);t.w=(c-h)/d,t.x=.25*d,t.y=(s+r)/d,t.z=(l+a)/d}else if(o>u){var p=2*Math.sqrt(1+o-n-u);t.w=(l-a)/p,t.x=(s+r)/p,t.y=.25*p,t.z=(h+c)/p}else{var m=2*Math.sqrt(1+u-n-o);t.w=(r-s)/m,t.x=(l+a)/m,t.y=(h+c)/m,t.z=.25*m}return t},r.fromEuler=function(t,e,i,n){e*=y,i*=y,n*=y;var r=Math.sin(e),a=Math.cos(e),s=Math.sin(i),o=Math.cos(i),c=Math.sin(n),l=Math.cos(n);return t.x=r*o*l+a*s*c,t.y=a*s*l+r*o*c,t.z=a*o*c-r*s*l,t.w=a*o*l-r*s*c,t},r.toAxisX=function(t,e){var i=2*e.y,n=2*e.z;return t.x=1-i*e.y-n*e.z,t.y=i*e.x+n*e.w,t.z=n*e.x+i*e.w,t},r.toAxisY=function(t,e){var i=2*e.x,n=2*e.y,r=2*e.z;return t.x=n*e.x-r*e.w,t.y=1-i*e.x-r*e.z,t.z=r*e.y+i*e.w,t},r.toAxisZ=function(t,e){var i=2*e.x,n=2*e.y,r=2*e.z;return t.x=r*e.x-n*e.w,t.y=r*e.y-i*e.w,t.z=1-i*e.x-n*e.y,t},r.toEuler=function(t,e,i){var n=e.x,r=e.y,a=e.z,s=e.w,c=0,l=0,h=0,u=n*r+a*s;if(u>.499999)c=0,l=(0,o.toDegree)(2*Math.atan2(n,s)),h=90;else if(u<-.499999)c=0,l=-(0,o.toDegree)(2*Math.atan2(n,s)),h=-90;else{var f=n*n,_=r*r,d=a*a;c=(0,o.toDegree)(Math.atan2(2*n*s-2*r*a,1-2*f-2*d)),l=(0,o.toDegree)(Math.atan2(2*r*s-2*n*a,1-2*_-2*d)),h=(0,o.toDegree)(Math.asin(2*u)),i&&(c=-180*Math.sign(c+1e-6)+c,l=-180*Math.sign(l+1e-6)+l,h=180*Math.sign(h+1e-6)-h)}return t.x=c,t.y=l,t.z=h,t},r.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},r.equals=function(t,e,i){return void 0===i&&(i=o.EPSILON),Math.abs(t.x-e.x)<=i*Math.max(1,Math.abs(t.x),Math.abs(e.x))&&Math.abs(t.y-e.y)<=i*Math.max(1,Math.abs(t.y),Math.abs(e.y))&&Math.abs(t.z-e.z)<=i*Math.max(1,Math.abs(t.z),Math.abs(e.z))&&Math.abs(t.w-e.w)<=i*Math.max(1,Math.abs(t.w),Math.abs(e.w))},r.toArray=function(t,e,i){return void 0===i&&(i=0),t[i+0]=e.x,t[i+1]=e.y,t[i+2]=e.z,t[i+3]=e.w,t},r.fromArray=function(t,e,i){return void 0===i&&(i=0),t.x=e[i+0],t.y=e[i+1],t.z=e[i+2],t.w=e[i+3],t},n.clone=function(){return new r(this.x,this.y,this.z,this.w)},n.set=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},n.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},n.toEuler=function(t){return r.toEuler(t,this)},n.fromEuler=function(t){return r.fromEuler(this,t.x,t.y,t.z)},n.lerp=function(t,e,i){return i=i||new r,r.slerp(i,this,t,e),i},n.multiply=function(t){return r.multiply(this,this,t)},n.rotateAround=function(t,e,i,n){return n=n||new r,r.rotateAround(n,t,e,i)},r})(n.default);i.default=d,d.mul=d.multiply,d.scale=d.multiplyScalar,d.mag=d.len,d.IDENTITY=Object.freeze(new d);var p=new d,m=new d,v=new a.default,g=new s.default,y=.5*Math.PI/180;r.default.fastDefine("cc.Quat",d,{x:0,y:0,z:0,w:1}),cc.quat=function(t,e,i,n){return new d(t,e,i,n)},cc.Quat=d,e.exports=i.default}),{"../platform/CCClass":168,"./mat3":258,"./utils":264,"./value-type":265,"./vec3":267}],261:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=o(t("./value-type")),r=o(t("../platform/CCClass")),a=o(t("./vec2")),s=o(t("./size"));function o(t){return t&&t.__esModule?t:{default:t}}function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=l(n.key,"string"))?r:String(r)),n)}var r}function l(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var u=(function(t){var e,i;function n(e,i,n,r){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),(a=t.call(this)||this).x=void 0,a.y=void 0,a.width=void 0,a.height=void 0,e&&"object"==typeof e&&(i=e.y,n=e.width,r=e.height,e=e.x),a.x=e||0,a.y=i||0,a.width=n||0,a.height=r||0,a}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,h(e,i),n.fromMinMax=function(t,e){var i=Math.min(t.x,e.x),r=Math.min(t.y,e.y);return new n(i,r,Math.max(t.x,e.x)-i,Math.max(t.y,e.y)-r)};var r,o,l=n.prototype;return l.clone=function(){return new n(this.x,this.y,this.width,this.height)},l.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},l.lerp=function(t,e,i){i=i||new n;var r=this.x,a=this.y,s=this.width,o=this.height;return i.x=r+(t.x-r)*e,i.y=a+(t.y-a)*e,i.width=s+(t.width-s)*e,i.height=o+(t.height-o)*e,i},l.set=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},l.intersects=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,r=t.y+t.height;return!(e<t.x||n<this.x||i<t.y||r<this.y)},l.intersection=function(t,e){var i=this.x,n=this.y,r=this.x+this.width,a=this.y+this.height,s=e.x,o=e.y,c=e.x+e.width,l=e.y+e.height;return t.x=Math.max(i,s),t.y=Math.max(n,o),t.width=Math.min(r,c)-t.x,t.height=Math.min(a,l)-t.y,t},l.contains=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},l.containsRect=function(t){return this.x<=t.x&&this.x+this.width>=t.x+t.width&&this.y<=t.y&&this.y+this.height>=t.y+t.height},l.union=function(t,e){var i=this.x,n=this.y,r=this.width,a=this.height,s=e.x,o=e.y,c=e.width,l=e.height;return t.x=Math.min(i,s),t.y=Math.min(n,o),t.width=Math.max(i+r,s+c)-t.x,t.height=Math.max(n+a,o+l)-t.y,t},l.transformMat4=function(t,e){var i=this.x,n=this.y,r=i+this.width,a=n+this.height,s=e.m,o=s[0]*i+s[4]*n+s[12],c=s[1]*i+s[5]*n+s[13],l=s[0]*r+s[4]*n+s[12],h=s[1]*r+s[5]*n+s[13],u=s[0]*i+s[4]*a+s[12],f=s[1]*i+s[5]*a+s[13],_=s[0]*r+s[4]*a+s[12],d=s[1]*r+s[5]*a+s[13],p=Math.min(o,l,u,_),m=Math.max(o,l,u,_),v=Math.min(c,h,f,d),g=Math.max(c,h,f,d);return t.x=p,t.y=v,t.width=m-p,t.height=g-v,t},l.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.width.toFixed(2)+", "+this.height.toFixed(2)+")"},r=n,(o=[{key:"xMin",get:function(){return this.x},set:function(t){this.width+=this.x-t,this.x=t}},{key:"yMin",get:function(){return this.y},set:function(t){this.height+=this.y-t,this.y=t}},{key:"xMax",get:function(){return this.x+this.width},set:function(t){this.width=t-this.x}},{key:"yMax",get:function(){return this.y+this.height},set:function(t){this.height=t-this.y}},{key:"center",get:function(){return new a.default(this.x+.5*this.width,this.y+.5*this.height)},set:function(t){this.x=t.x-.5*this.width,this.y=t.y-.5*this.height}},{key:"origin",get:function(){return new a.default(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}},{key:"size",get:function(){return new s.default(this.width,this.height)},set:function(t){this.width=t.width,this.height=t.height}}])&&c(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),n})(n.default);i.default=u,r.default.fastDefine("cc.Rect",u,{x:0,y:0,width:0,height:0}),cc.Rect=u,cc.rect=function(t,e,i,n){return new u(t,e,i,n)},e.exports=i.default}),{"../platform/CCClass":168,"./size":262,"./value-type":265,"./vec2":266}],262:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("./value-type")),r=a(t("../platform/CCClass"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=o(n.key,"string"))?r:String(r)),n)}var r}function o(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function c(t,e){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var l=(function(t){var e,i;function n(e,i){var n;return void 0===e&&(e=0),void 0===i&&(i=0),(n=t.call(this)||this).width=void 0,n.height=void 0,e&&"object"==typeof e?(n.width=e.width,n.height=e.height):(n.width=e||0,n.height=i||0),n}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,c(e,i);var r,a,o=n.prototype;return o.clone=function(){return new n(this.width,this.height)},o.equals=function(t){return t&&this.width===t.width&&this.height===t.height},o.lerp=function(t,e,i){i=i||new n;var r=this.width,a=this.height;return i.width=r+(t.width-r)*e,i.height=a+(t.height-a)*e,i},o.set=function(t){return this.width=t.width,this.height=t.height,this},o.toString=function(){return"("+this.width.toFixed(2)+", "+this.height.toFixed(2)+")"},r=n,a=[{key:"ZERO",get:function(){return new n}}],null&&s(r.prototype,null),a&&s(r,a),Object.defineProperty(r,"prototype",{writable:!1}),n})(n.default);i.default=l,l.ZERO_R=l.ZERO,r.default.fastDefine("cc.Size",l,{width:0,height:0}),cc.size=function(t,e){return new l(t,e)},cc.Size=l,e.exports=i.default}),{"../platform/CCClass":168,"./value-type":265}],263:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./quat"))&&n.__esModule?n:{default:n},a=new r.default,s=(function(){function t(){}return t.toRotation=function(t,e){return t.x=e[3],t.y=e[4],t.z=e[5],t.w=e[6],t},t.fromRotation=function(t,e){return t[3]=e.x,t[4]=e.y,t[5]=e.z,t[6]=e.w,t},t.toEuler=function(e,i){return t.toRotation(a,i),r.default.toEuler(e,a),e},t.fromEuler=function(e,i){return r.default.fromEuler(a,i.x,i.y,i.z),t.fromRotation(e,a),e},t.fromEulerNumber=function(e,i,n,s){return r.default.fromEuler(a,i,n,s),t.fromRotation(e,a),e},t.toScale=function(t,e){return t.x=e[7],t.y=e[8],t.z=e[9],t},t.fromScale=function(t,e){return t[7]=e.x,t[8]=e.y,t[9]=e.z,t},t.toPosition=function(t,e){return t.x=e[0],t.y=e[1],t.z=e[2],t},t.fromPosition=function(t,e){return t[0]=e.x,t[1]=e.y,t[2]=e.z,t},t.fromAngleZ=function(e,i){return r.default.fromAngleZ(a,i),t.fromRotation(e,a),e},t.toMat4=function(t,e){var i=e[3],n=e[4],r=e[5],a=e[6],s=i+i,o=n+n,c=r+r,l=i*s,h=i*o,u=i*c,f=n*o,_=n*c,d=r*c,p=a*s,m=a*o,v=a*c,g=e[7],y=e[8],T=e[9],A=t.m;return A[0]=(1-(f+d))*g,A[1]=(h+v)*g,A[2]=(u-m)*g,A[3]=0,A[4]=(h-v)*y,A[5]=(1-(l+d))*y,A[6]=(_+p)*y,A[7]=0,A[8]=(u+m)*T,A[9]=(_-p)*T,A[10]=(1-(l+f))*T,A[11]=0,A[12]=e[0],A[13]=e[1],A[14]=e[2],A[15]=1,t},t})();i.default=s,cc.Trs=s,e.exports=i.default}),{"./quat":260}],264:[(function(t,e,i){"use strict";i.__esModule=!0,i.INT_MIN=i.INT_MAX=i.INT_BITS=i.FLOAT_BYTES=i.FLOAT_ARRAY_TYPE=i.EPSILON=void 0,i.approx=function(t,e,i){return i=i||a,Math.abs(t-e)<=i},i.clamp=function(t,e,i){return t<e?e:t>i?i:t},i.clamp01=function(t){return t<0?0:t>1?1:t},i.equals=function(t,e){return Math.abs(t-e)<=a*Math.max(1,Math.abs(t),Math.abs(e))},i.inverseLerp=function(t,e,i){return(i-t)/(e-t)},i.lerp=function(t,e,i){return t+(e-t)*i},i.nextPow2=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},i.pingPong=function(t,e){return t=u(t,2*e),e-Math.abs(t-e)},i.pseudoRandom=l,i.pseudoRandomRange=h,i.pseudoRandomRangeInt=function(t,e,i){return Math.floor(h(t,e,i))},i.random=void 0,i.randomRange=c,i.randomRangeInt=function(t,e){return Math.floor(c(t,e))},i.repeat=u,i.sign=function(t){return(t>0)-(t<0)},i.toDegree=function(t){return t*r},i.toRadian=function(t){return t*n};var n=Math.PI/180,r=180/Math.PI,a=1e-6;i.EPSILON=a,i.INT_BITS=32,i.INT_MAX=2147483647,i.INT_MIN=-1<<31;var s=Float64Array;i.FLOAT_ARRAY_TYPE=s,i.FLOAT_BYTES=8;var o=Math.random;function c(t,e){return Math.random()*(e-t)+t}function l(t){return(t=(9301*t+49297)%233280)/233280}function h(t,e,i){return l(t)*(i-e)+e}function u(t,e){return t-Math.floor(t/e)*e}i.random=o}),{}],265:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../platform/js"))&&n.__esModule?n:{default:n},a=(function(){function t(){}var e=t.prototype;return e.clone=function(){return cc.errorID("0100",r.default.getClassName(this)+".clone"),null},e.equals=function(){return cc.errorID("0100",r.default.getClassName(this)+".equals"),!1},e.lerp=function(){return cc.errorID("0100",r.default.getClassName(this)+".lerp"),this.clone()},e.set=function(){cc.errorID("0100",r.default.getClassName(this)+".set")},e.toString=function(){return""+{}},t})();i.default=a,r.default.setClassName("cc.ValueType",a),cc.ValueType=a,e.exports=i.default}),{"../platform/js":189}],266:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=o(t("./value-type")),r=o(t("../platform/CCClass")),a=o(t("../utils/misc")),s=t("./utils");function o(t){return t&&t.__esModule?t:{default:t}}function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=l(n.key,"string"))?r:String(r)),n)}var r}function l(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var u=0,f=0,_=(function(t){var e,i;i=t,(e=l).prototype=Object.create(i.prototype),e.prototype.constructor=e,h(e,i);var n,r,o=l.prototype;function l(e,i){var n;return void 0===e&&(e=0),void 0===i&&(i=0),(n=t.call(this)||this).mag=l.prototype.len,n.magSqr=l.prototype.lengthSqr,n.subSelf=l.prototype.subtract,n.mulSelf=l.prototype.multiplyScalar,n.divSelf=l.prototype.divide,n.scaleSelf=l.prototype.multiply,n.negSelf=l.prototype.negate,n.x=void 0,n.y=void 0,n.z=0,e&&"object"==typeof e?(n.x=e.x||0,n.y=e.y||0):(n.x=e||0,n.y=i||0),n}return o.sub=function(t,e){return l.subtract(e||new l,this,t)},o.mul=function(t,e){return l.multiplyScalar(e||new l,this,t)},o.div=function(t,e){return l.multiplyScalar(e||new l,this,1/t)},o.scale=function(t,e){return l.multiply(e||new l,this,t)},o.neg=function(t){return l.negate(t||new l,this)},l.clone=function(t){return new l(t.x,t.y)},l.copy=function(t,e){return t.x=e.x,t.y=e.y,t},l.set=function(t,e,i){return t.x=e,t.y=i,t},l.add=function(t,e,i){return t.x=e.x+i.x,t.y=e.y+i.y,t},l.subtract=function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t},l.multiply=function(t,e,i){return t.x=e.x*i.x,t.y=e.y*i.y,t},l.divide=function(t,e,i){return t.x=e.x/i.x,t.y=e.y/i.y,t},l.ceil=function(t,e){return t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t},l.floor=function(t,e){return t.x=Math.floor(e.x),t.y=Math.floor(e.y),t},l.min=function(t,e,i){return t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t},l.max=function(t,e,i){return t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t},l.round=function(t,e){return t.x=Math.round(e.x),t.y=Math.round(e.y),t},l.multiplyScalar=function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t},l.scaleAndAdd=function(t,e,i,n){return t.x=e.x+i.x*n,t.y=e.y+i.y*n,t},l.distance=function(t,e){return u=e.x-t.x,f=e.y-t.y,Math.sqrt(u*u+f*f)},l.squaredDistance=function(t,e){return u=e.x-t.x,f=e.y-t.y,u*u+f*f},l.len=function(t){return u=t.x,f=t.y,Math.sqrt(u*u+f*f)},l.lengthSqr=function(t){return u=t.x,f=t.y,u*u+f*f},l.negate=function(t,e){return t.x=-e.x,t.y=-e.y,t},l.inverse=function(t,e){return t.x=1/e.x,t.y=1/e.y,t},l.inverseSafe=function(t,e){return u=e.x,f=e.y,Math.abs(u)<s.EPSILON?t.x=0:t.x=1/u,Math.abs(f)<s.EPSILON?t.y=0:t.y=1/f,t},l.normalize=function(t,e){u=e.x,f=e.y;var i=u*u+f*f;return i>0&&(i=1/Math.sqrt(i),t.x=u*i,t.y=f*i),t},l.dot=function(t,e){return t.x*e.x+t.y*e.y},l.cross=function(t,e,i){return t.x=t.y=0,t.z=e.x*i.y-e.y*i.x,t},l.lerp=function(t,e,i,n){return u=e.x,f=e.y,t.x=u+n*(i.x-u),t.y=f+n*(i.y-f),t},l.random=function(t,e){e=e||1;var i=2*(0,s.random)()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t},l.transformMat3=function(t,e,i){u=e.x,f=e.y;var n=i.m;return t.x=n[0]*u+n[3]*f+n[6],t.y=n[1]*u+n[4]*f+n[7],t},l.transformMat4=function(t,e,i){u=e.x,f=e.y;var n=i.m;return t.x=n[0]*u+n[4]*f+n[12],t.y=n[1]*u+n[5]*f+n[13],t},l.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y},l.equals=function(t,e,i){return void 0===i&&(i=s.EPSILON),Math.abs(t.x-e.x)<=i*Math.max(1,Math.abs(t.x),Math.abs(e.x))&&Math.abs(t.y-e.y)<=i*Math.max(1,Math.abs(t.y),Math.abs(e.y))},l.angle=function(t,e){l.normalize(d,t),l.normalize(p,e);var i=l.dot(d,p);return i>1?0:i<-1?Math.PI:Math.acos(i)},l.toArray=function(t,e,i){return void 0===i&&(i=0),t[i+0]=e.x,t[i+1]=e.y,t},l.fromArray=function(t,e,i){return void 0===i&&(i=0),t.x=e[i+0],t.y=e[i+1],t},o.clone=function(){return new l(this.x,this.y)},o.set=function(t){return this.x=t.x,this.y=t.y,this},o.equals=function(t){return t&&this.x===t.x&&this.y===t.y},o.fuzzyEquals=function(t,e){return this.x-e<=t.x&&t.x<=this.x+e&&this.y-e<=t.y&&t.y<=this.y+e},o.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+")"},o.lerp=function(t,e,i){i=i||new l;var n=this.x,r=this.y;return i.x=n+(t.x-n)*e,i.y=r+(t.y-r)*e,i},o.clampf=function(t,e){return this.x=a.default.clampf(this.x,t.x,e.x),this.y=a.default.clampf(this.y,t.y,e.y),this},o.add=function(t,e){return(e=e||new l).x=this.x+t.x,e.y=this.y+t.y,e},o.addSelf=function(t){return this.x+=t.x,this.y+=t.y,this},o.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},o.multiplyScalar=function(t){return this.x*=t,this.y*=t,this},o.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},o.divide=function(t){return this.x/=t,this.y/=t,this},o.negate=function(){return this.x=-this.x,this.y=-this.y,this},o.dot=function(t){return this.x*t.x+this.y*t.y},o.cross=function(t){return this.x*t.y-this.y*t.x},o.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},o.lengthSqr=function(){return this.x*this.x+this.y*this.y},o.normalizeSelf=function(){var t=this.x*this.x+this.y*this.y;if(1===t)return this;if(0===t)return this;var e=1/Math.sqrt(t);return this.x*=e,this.y*=e,this},o.normalize=function(t){return(t=t||new l).x=this.x,t.y=this.y,t.normalizeSelf(),t},o.angle=function(t){var e=this.magSqr(),i=t.magSqr();if(0===e||0===i)return console.warn("Can't get angle between zero vector"),0;var n=this.dot(t)/Math.sqrt(e*i);return n=a.default.clampf(n,-1,1),Math.acos(n)},o.signAngle=function(t){var e=this.angle(t);return this.cross(t)<0?-e:e},o.rotate=function(t,e){return(e=e||new l).x=this.x,e.y=this.y,e.rotateSelf(t)},o.rotateSelf=function(t){var e=Math.sin(t),i=Math.cos(t),n=this.x;return this.x=i*n-e*this.y,this.y=e*n+i*this.y,this},o.project=function(t){return t.multiplyScalar(this.dot(t)/t.dot(t))},o.transformMat4=function(t,e){return e=e||new l,l.transformMat4(e,this,t),e},o.maxAxis=function(){return Math.max(this.x,this.y)},n=l,r=[{key:"ONE",get:function(){return new l(1,1)}},{key:"ZERO",get:function(){return new l(0,0)}},{key:"UP",get:function(){return new l(0,1)}},{key:"RIGHT",get:function(){return new l(1,0)}}],null&&c(n.prototype,null),r&&c(n,r),Object.defineProperty(n,"prototype",{writable:!1}),l})(n.default);i.default=_,_.sub=_.subtract,_.mul=_.multiply,_.scale=_.multiplyScalar,_.mag=_.len,_.squaredMagnitude=_.lengthSqr,_.div=_.divide,_.ONE_R=_.ONE,_.ZERO_R=_.ZERO,_.UP_R=_.UP,_.RIGHT_R=_.RIGHT;var d=new _,p=new _;r.default.fastDefine("cc.Vec2",_,{x:0,y:0}),cc.v2=function(t,e){return new _(t,e)},cc.Vec2=_,e.exports=i.default}),{"../platform/CCClass":168,"../utils/misc":242,"./utils":264,"./value-type":265}],267:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=c(t("./value-type")),r=c(t("../platform/CCClass")),a=c(t("../utils/misc")),s=c(t("./vec2")),o=t("./utils");function c(t){return t&&t.__esModule?t:{default:t}}function l(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=h(n.key,"string"))?r:String(r)),n)}var r}function h(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function u(t,e){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var f=0,_=0,d=0,p=(function(t){var e,i;i=t,(e=h).prototype=Object.create(i.prototype),e.prototype.constructor=e,u(e,i);var n,r,c=h.prototype;function h(e,i,n){var r;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),(r=t.call(this)||this).mag=h.prototype.len,r.magSqr=h.prototype.lengthSqr,r.subSelf=h.prototype.subtract,r.mulSelf=h.prototype.multiplyScalar,r.divSelf=h.prototype.divide,r.scaleSelf=h.prototype.multiply,r.negSelf=h.prototype.negate,r.x=void 0,r.y=void 0,r.z=void 0,r.angle=s.default.prototype.angle,r.project=s.default.prototype.project,e&&"object"==typeof e?(r.x=e.x,r.y=e.y,r.z=e.z):(r.x=e,r.y=i,r.z=n),r}return c.sub=function(t,e){return h.subtract(e||new h,this,t)},c.mul=function(t,e){return h.multiplyScalar(e||new h,this,t)},c.div=function(t,e){return h.multiplyScalar(e||new h,this,1/t)},c.scale=function(t,e){return h.multiply(e||new h,this,t)},c.neg=function(t){return h.negate(t||new h,this)},h.zero=function(t){return t.x=0,t.y=0,t.z=0,t},h.clone=function(t){return new h(t.x,t.y,t.z)},h.copy=function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t},h.set=function(t,e,i,n){return t.x=e,t.y=i,t.z=n,t},h.add=function(t,e,i){return t.x=e.x+i.x,t.y=e.y+i.y,t.z=e.z+i.z,t},h.subtract=function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t.z=e.z-i.z,t},h.multiply=function(t,e,i){return t.x=e.x*i.x,t.y=e.y*i.y,t.z=e.z*i.z,t},h.divide=function(t,e,i){return t.x=e.x/i.x,t.y=e.y/i.y,t.z=e.z/i.z,t},h.ceil=function(t,e){return t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t.z=Math.ceil(e.z),t},h.floor=function(t,e){return t.x=Math.floor(e.x),t.y=Math.floor(e.y),t.z=Math.floor(e.z),t},h.min=function(t,e,i){return t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t.z=Math.min(e.z,i.z),t},h.max=function(t,e,i){return t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t.z=Math.max(e.z,i.z),t},h.round=function(t,e){return t.x=Math.round(e.x),t.y=Math.round(e.y),t.z=Math.round(e.z),t},h.multiplyScalar=function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},h.scaleAndAdd=function(t,e,i,n){return t.x=e.x+i.x*n,t.y=e.y+i.y*n,t.z=e.z+i.z*n,t},h.distance=function(t,e){return f=e.x-t.x,_=e.y-t.y,d=e.z-t.z,Math.sqrt(f*f+_*_+d*d)},h.squaredDistance=function(t,e){return f=e.x-t.x,_=e.y-t.y,d=e.z-t.z,f*f+_*_+d*d},h.len=function(t){return f=t.x,_=t.y,d=t.z,Math.sqrt(f*f+_*_+d*d)},h.lengthSqr=function(t){return f=t.x,_=t.y,d=t.z,f*f+_*_+d*d},h.negate=function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},h.inverse=function(t,e){return t.x=1/e.x,t.y=1/e.y,t.z=1/e.z,t},h.inverseSafe=function(t,e){return f=e.x,_=e.y,d=e.z,Math.abs(f)<o.EPSILON?t.x=0:t.x=1/f,Math.abs(_)<o.EPSILON?t.y=0:t.y=1/_,Math.abs(d)<o.EPSILON?t.z=0:t.z=1/d,t},h.normalize=function(t,e){f=e.x,_=e.y,d=e.z;var i=f*f+_*_+d*d;return i>0&&(i=1/Math.sqrt(i),t.x=f*i,t.y=_*i,t.z=d*i),t},h.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},h.cross=function(t,e,i){var n=e.x,r=e.y,a=e.z,s=i.x,o=i.y,c=i.z;return t.x=r*c-a*o,t.y=a*s-n*c,t.z=n*o-r*s,t},h.lerp=function(t,e,i,n){return t.x=e.x+n*(i.x-e.x),t.y=e.y+n*(i.y-e.y),t.z=e.z+n*(i.z-e.z),t},h.random=function(t,e){e=e||1;var i=2*(0,o.random)()*Math.PI,n=2*(0,o.random)()-1,r=Math.sqrt(1-n*n);return t.x=r*Math.cos(i)*e,t.y=r*Math.sin(i)*e,t.z=n*e,t},h.transformMat4=function(t,e,i){f=e.x,_=e.y,d=e.z;var n=i.m,r=n[3]*f+n[7]*_+n[11]*d+n[15];return r=r?1/r:1,t.x=(n[0]*f+n[4]*_+n[8]*d+n[12])*r,t.y=(n[1]*f+n[5]*_+n[9]*d+n[13])*r,t.z=(n[2]*f+n[6]*_+n[10]*d+n[14])*r,t},h.transformMat4Normal=function(t,e,i){f=e.x,_=e.y,d=e.z;var n=i.m,r=n[3]*f+n[7]*_+n[11]*d;return r=r?1/r:1,t.x=(n[0]*f+n[4]*_+n[8]*d)*r,t.y=(n[1]*f+n[5]*_+n[9]*d)*r,t.z=(n[2]*f+n[6]*_+n[10]*d)*r,t},h.transformMat3=function(t,e,i){f=e.x,_=e.y,d=e.z;var n=i.m;return t.x=f*n[0]+_*n[3]+d*n[6],t.y=f*n[1]+_*n[4]+d*n[7],t.z=f*n[2]+_*n[5]+d*n[8],t},h.transformAffine=function(t,e,i){f=e.x,_=e.y,d=e.z;var n=i.m;return t.x=n[0]*f+n[1]*_+n[2]*d+n[3],t.y=n[4]*f+n[5]*_+n[6]*d+n[7],t.x=n[8]*f+n[9]*_+n[10]*d+n[11],t},h.transformQuat=function(t,e,i){var n=i.w*e.x+i.y*e.z-i.z*e.y,r=i.w*e.y+i.z*e.x-i.x*e.z,a=i.w*e.z+i.x*e.y-i.y*e.x,s=-i.x*e.x-i.y*e.y-i.z*e.z;return t.x=n*i.w+s*-i.x+r*-i.z-a*-i.y,t.y=r*i.w+s*-i.y+a*-i.x-n*-i.z,t.z=a*i.w+s*-i.z+n*-i.y-r*-i.x,t},h.transformRTS=function(t,e,i,n,r){var a=e.x*r.x,s=e.y*r.y,o=e.z*r.z,c=i.w*a+i.y*o-i.z*s,l=i.w*s+i.z*a-i.x*o,h=i.w*o+i.x*s-i.y*a,u=-i.x*a-i.y*s-i.z*o;return t.x=c*i.w+u*-i.x+l*-i.z-h*-i.y+n.x,t.y=l*i.w+u*-i.y+h*-i.x-c*-i.z+n.y,t.z=h*i.w+u*-i.z+c*-i.y-l*-i.x+n.z,t},h.transformInverseRTS=function(t,e,i,n,r){var a=e.x-n.x,s=e.y-n.y,o=e.z-n.z,c=i.w*a-i.y*o+i.z*s,l=i.w*s-i.z*a+i.x*o,h=i.w*o-i.x*s+i.y*a,u=i.x*a+i.y*s+i.z*o;return t.x=(c*i.w+u*i.x+l*i.z-h*i.y)/r.x,t.y=(l*i.w+u*i.y+h*i.x-c*i.z)/r.y,t.z=(h*i.w+u*i.z+c*i.y-l*i.x)/r.z,t},h.rotateX=function(t,e,i,n){f=e.x-i.x,_=e.y-i.y,d=e.z-i.z;var r=Math.cos(n),a=Math.sin(n),s=f,o=_*r-d*a,c=_*a+d*r;return t.x=s+i.x,t.y=o+i.y,t.z=c+i.z,t},h.rotateY=function(t,e,i,n){f=e.x-i.x,_=e.y-i.y,d=e.z-i.z;var r=Math.cos(n),a=Math.sin(n),s=d*a+f*r,o=_,c=d*r-f*a;return t.x=s+i.x,t.y=o+i.y,t.z=c+i.z,t},h.rotateZ=function(t,e,i,n){f=e.x-i.x,_=e.y-i.y,d=e.z-i.z;var r=Math.cos(n),a=Math.sin(n),s=f*r-_*a,o=f*a+_*r,c=d;return t.x=s+i.x,t.y=o+i.y,t.z=c+i.z,t},h.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z},h.equals=function(t,e,i){void 0===i&&(i=o.EPSILON);var n=t.x,r=t.y,a=t.z,s=e.x,c=e.y,l=e.z;return Math.abs(n-s)<=i*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-c)<=i*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(a-l)<=i*Math.max(1,Math.abs(a),Math.abs(l))},h.angle=function(t,e){h.normalize(m,t),h.normalize(v,e);var i=h.dot(m,v);return i>1?0:i<-1?Math.PI:Math.acos(i)},h.projectOnPlane=function(t,e,i){return h.subtract(t,e,h.project(t,e,i))},h.project=function(t,e,i){var n=h.lengthSqr(i);return n<1e-6?h.set(t,0,0,0):h.multiplyScalar(t,i,h.dot(e,i)/n)},h.toArray=function(t,e,i){return void 0===i&&(i=0),t[i+0]=e.x,t[i+1]=e.y,t[i+2]=e.z,t},h.fromArray=function(t,e,i){return void 0===i&&(i=0),t.x=e[i+0],t.y=e[i+1],t.z=e[i+2],t},c.clone=function(){return new h(this.x,this.y,this.z)},c.set=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},c.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z},c.fuzzyEquals=function(t,e){return this.x-e<=t.x&&t.x<=this.x+e&&this.y-e<=t.y&&t.y<=this.y+e&&this.z-e<=t.z&&t.z<=this.z+e},c.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.z.toFixed(2)+")"},c.lerp=function(t,e,i){return i=i||new h,h.lerp(i,this,t,e),i},c.clampf=function(t,e){return this.x=a.default.clampf(this.x,t.x,e.x),this.y=a.default.clampf(this.y,t.y,e.y),this.z=a.default.clampf(this.z,t.z,e.z),this},c.addSelf=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},c.add=function(t,e){return(e=e||new h).x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e},c.subtract=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},c.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},c.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},c.divide=function(t){return this.x/=t,this.y/=t,this.z/=t,this},c.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},c.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},c.cross=function(t,e){return e=e||new h,h.cross(e,this,t),e},c.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},c.lengthSqr=function(){return this.x*this.x+this.y*this.y+this.z*this.z},c.normalizeSelf=function(){return h.normalize(this,this),this},c.normalize=function(t){return t=t||new h,h.normalize(t,this),t},c.transformMat4=function(t,e){return e=e||new h,h.transformMat4(e,this,t),e},c.maxAxis=function(){return Math.max(this.x,this.y,this.z)},c.signAngle=function(t){cc.warnID(1408,"vec3.signAngle","v2.1","cc.v2(selfVector).signAngle(vector)");var e=new s.default(this.x,this.y),i=new s.default(t.x,t.y);return e.signAngle(i)},c.rotate=function(t,e){return cc.warnID(1408,"vec3.rotate","v2.1","cc.v2(selfVector).rotate(radians, out)"),s.default.prototype.rotate.call(this,t,e)},c.rotateSelf=function(t){return cc.warnID(1408,"vec3.rotateSelf","v2.1","cc.v2(selfVector).rotateSelf(radians)"),s.default.prototype.rotateSelf.call(this,t)},n=h,r=[{key:"ONE",get:function(){return new h(1,1,1)}},{key:"ZERO",get:function(){return new h}},{key:"UP",get:function(){return new h(0,1,0)}},{key:"RIGHT",get:function(){return new h(1,0,0)}},{key:"FORWARD",get:function(){return new h(0,0,1)}}],null&&l(n.prototype,null),r&&l(n,r),Object.defineProperty(n,"prototype",{writable:!1}),h})(n.default);i.default=p,p.sub=p.subtract,p.mul=p.multiply,p.scale=p.multiplyScalar,p.mag=p.len,p.squaredMagnitude=p.lengthSqr,p.div=p.divide,p.ONE_R=p.ONE,p.ZERO_R=p.ZERO,p.UP_R=p.UP,p.RIGHT_R=p.RIGHT,p.FRONT_R=p.FORWARD;var m=new p,v=new p;r.default.fastDefine("cc.Vec3",p,{x:0,y:0,z:0}),cc.v3=function(t,e,i){return new p(t,e,i)},cc.Vec3=p,e.exports=i.default}),{"../platform/CCClass":168,"../utils/misc":242,"./utils":264,"./value-type":265,"./vec2":266}],268:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0,i.v4=p;var n=s(t("../platform/CCClass")),r=s(t("./value-type")),a=t("./utils");function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=c(n.key,"string"))?r:String(r)),n)}var r}function c(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var h=0,u=0,f=0,_=0,d=(function(t){var e,i;i=t,(e=c).prototype=Object.create(i.prototype),e.prototype.constructor=e,l(e,i);var n,r,s=c.prototype;function c(e,i,n,r){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),(a=t.call(this)||this).mag=c.prototype.len,a.magSqr=c.prototype.lengthSqr,a.subSelf=c.prototype.subtract,a.mulSelf=c.prototype.multiplyScalar,a.divSelf=c.prototype.divide,a.scaleSelf=c.prototype.multiply,a.negSelf=c.prototype.negate,a.x=void 0,a.y=void 0,a.z=void 0,a.w=void 0,e&&"object"==typeof e?(a.x=e.x,a.y=e.y,a.z=e.z,a.w=e.w):(a.x=e,a.y=i,a.z=n,a.w=r),a}return s.sub=function(t,e){return c.subtract(e||new c,this,t)},s.mul=function(t,e){return c.multiplyScalar(e||new c,this,t)},s.div=function(t,e){return c.multiplyScalar(e||new c,this,1/t)},s.scale=function(t,e){return c.multiply(e||new c,this,t)},s.neg=function(t){return c.negate(t||new c,this)},c.clone=function(t){return new c(t.x,t.y,t.z,t.w)},c.copy=function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t},c.set=function(t,e,i,n,r){return t.x=e,t.y=i,t.z=n,t.w=r,t},c.add=function(t,e,i){return t.x=e.x+i.x,t.y=e.y+i.y,t.z=e.z+i.z,t.w=e.w+i.w,t},c.subtract=function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t.z=e.z-i.z,t.w=e.w-i.w,t},c.multiply=function(t,e,i){return t.x=e.x*i.x,t.y=e.y*i.y,t.z=e.z*i.z,t.w=e.w*i.w,t},c.divide=function(t,e,i){return t.x=e.x/i.x,t.y=e.y/i.y,t.z=e.z/i.z,t.w=e.w/i.w,t},c.ceil=function(t,e){return t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t.z=Math.ceil(e.z),t.w=Math.ceil(e.w),t},c.floor=function(t,e){return t.x=Math.floor(e.x),t.y=Math.floor(e.y),t.z=Math.floor(e.z),t.w=Math.floor(e.w),t},c.min=function(t,e,i){return t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t.z=Math.min(e.z,i.z),t.w=Math.min(e.w,i.w),t},c.max=function(t,e,i){return t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t.z=Math.max(e.z,i.z),t.w=Math.max(e.w,i.w),t},c.round=function(t,e){return t.x=Math.round(e.x),t.y=Math.round(e.y),t.z=Math.round(e.z),t.w=Math.round(e.w),t},c.multiplyScalar=function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=e.w*i,t},c.scaleAndAdd=function(t,e,i,n){return t.x=e.x+i.x*n,t.y=e.y+i.y*n,t.z=e.z+i.z*n,t.w=e.w+i.w*n,t},c.distance=function(t,e){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,a=e.w-t.w;return Math.sqrt(i*i+n*n+r*r+a*a)},c.squaredDistance=function(t,e){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,a=e.w-t.w;return i*i+n*n+r*r+a*a},c.len=function(t){return h=t.x,u=t.y,f=t.z,_=t.w,Math.sqrt(h*h+u*u+f*f+_*_)},c.lengthSqr=function(t){return h=t.x,u=t.y,f=t.z,_=t.w,h*h+u*u+f*f+_*_},c.negate=function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.inverse=function(t,e){return t.x=1/e.x,t.y=1/e.y,t.z=1/e.z,t.w=1/e.w,t},c.inverseSafe=function(t,e){return h=e.x,u=e.y,f=e.z,_=e.w,Math.abs(h)<a.EPSILON?t.x=0:t.x=1/h,Math.abs(u)<a.EPSILON?t.y=0:t.y=1/u,Math.abs(f)<a.EPSILON?t.z=0:t.z=1/f,Math.abs(_)<a.EPSILON?t.w=0:t.w=1/_,t},c.normalize=function(t,e){h=e.x,u=e.y,f=e.z,_=e.w;var i=h*h+u*u+f*f+_*_;return i>0&&(i=1/Math.sqrt(i),t.x=h*i,t.y=u*i,t.z=f*i,t.w=_*i),t},c.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},c.lerp=function(t,e,i,n){return t.x=e.x+n*(i.x-e.x),t.y=e.y+n*(i.y-e.y),t.z=e.z+n*(i.z-e.z),t.w=e.w+n*(i.w-e.w),t},c.random=function(t,e){e=e||1;var i=2*(0,a.random)()*Math.PI,n=2*(0,a.random)()-1,r=Math.sqrt(1-n*n);return t.x=r*Math.cos(i)*e,t.y=r*Math.sin(i)*e,t.z=n*e,t.w=0,t},c.transformMat4=function(t,e,i){h=e.x,u=e.y,f=e.z,_=e.w;var n=i.m;return t.x=n[0]*h+n[4]*u+n[8]*f+n[12]*_,t.y=n[1]*h+n[5]*u+n[9]*f+n[13]*_,t.z=n[2]*h+n[6]*u+n[10]*f+n[14]*_,t.w=n[3]*h+n[7]*u+n[11]*f+n[15]*_,t},c.transformAffine=function(t,e,i){h=e.x,u=e.y,f=e.z,_=e.w;var n=i.m;return t.x=n[0]*h+n[1]*u+n[2]*f+n[3]*_,t.y=n[4]*h+n[5]*u+n[6]*f+n[7]*_,t.x=n[8]*h+n[9]*u+n[10]*f+n[11]*_,t.w=e.w,t},c.transformQuat=function(t,e,i){var n=e.x,r=e.y,a=e.z;h=i.x,u=i.y,f=i.z;var s=(_=i.w)*n+u*a-f*r,o=_*r+f*n-h*a,c=_*a+h*r-u*n,l=-h*n-u*r-f*a;return t.x=s*_+l*-h+o*-f-c*-u,t.y=o*_+l*-u+c*-h-s*-f,t.z=c*_+l*-f+s*-u-o*-h,t.w=e.w,t},c.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},c.equals=function(t,e,i){return void 0===i&&(i=a.EPSILON),Math.abs(t.x-e.x)<=i*Math.max(1,Math.abs(t.x),Math.abs(e.x))&&Math.abs(t.y-e.y)<=i*Math.max(1,Math.abs(t.y),Math.abs(e.y))&&Math.abs(t.z-e.z)<=i*Math.max(1,Math.abs(t.z),Math.abs(e.z))&&Math.abs(t.w-e.w)<=i*Math.max(1,Math.abs(t.w),Math.abs(e.w))},c.toArray=function(t,e,i){return void 0===i&&(i=0),t[i+0]=e.x,t[i+1]=e.y,t[i+2]=e.z,t[i+3]=e.w,t},c.fromArray=function(t,e,i){return void 0===i&&(i=0),t.x=e[i+0],t.y=e[i+1],t.z=e[i+2],t.w=e[i+3],t},s.clone=function(){return new c(this.x,this.y,this.z,this.w)},s.set=function(t,e,i,n){return t&&"object"==typeof t?(this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},s.equals=function(t,e){return void 0===e&&(e=a.EPSILON),Math.abs(this.x-t.x)<=e*Math.max(1,Math.abs(this.x),Math.abs(t.x))&&Math.abs(this.y-t.y)<=e*Math.max(1,Math.abs(this.y),Math.abs(t.y))&&Math.abs(this.z-t.z)<=e*Math.max(1,Math.abs(this.z),Math.abs(t.z))&&Math.abs(this.w-t.w)<=e*Math.max(1,Math.abs(this.w),Math.abs(t.w))},s.equals4f=function(t,e,i,n,r){return void 0===r&&(r=a.EPSILON),Math.abs(this.x-t)<=r*Math.max(1,Math.abs(this.x),Math.abs(t))&&Math.abs(this.y-e)<=r*Math.max(1,Math.abs(this.y),Math.abs(e))&&Math.abs(this.z-i)<=r*Math.max(1,Math.abs(this.z),Math.abs(i))&&Math.abs(this.w-n)<=r*Math.max(1,Math.abs(this.w),Math.abs(n))},s.strictEquals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},s.strictEquals4f=function(t,e,i,n){return this.x===t&&this.y===e&&this.z===i&&this.w===n},s.lerp=function(t,e){return h=this.x,u=this.y,f=this.z,_=this.w,this.x=h+e*(t.x-h),this.y=u+e*(t.y-u),this.z=f+e*(t.z-f),this.w=_+e*(t.w-_),this},s.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.z.toFixed(2)+", "+this.w.toFixed(2)+")"},s.clampf=function(t,e){return this.x=(0,a.clamp)(this.x,t.x,e.x),this.y=(0,a.clamp)(this.y,t.y,e.y),this.z=(0,a.clamp)(this.z,t.z,e.z),this.w=(0,a.clamp)(this.w,t.w,e.w),this},s.addSelf=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},s.add=function(t,e){return(e=e||new c).x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e.w=this.w+t.w,e},s.subtract=function(t,e){return(e=e||new c).x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e.w=this.w-t.w,e},s.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},s.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},s.divide=function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},s.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},s.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},s.cross=function(t,e){e=e||new c;var i=this.x,n=this.y,r=this.z,a=t.x,s=t.y,o=t.z;return e.x=n*o-r*s,e.y=r*a-i*o,e.z=i*s-n*a,e},s.len=function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},s.lengthSqr=function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},s.normalizeSelf=function(){return this.normalize(this),this},s.normalize=function(t){t=t||new c,h=this.x,u=this.y,f=this.z,_=this.w;var e=h*h+u*u+f*f+_*_;return e>0&&(e=1/Math.sqrt(e),t.x=h*e,t.y=u*e,t.z=f*e,t.w=_*e),t},s.transformMat4=function(t,e){e=e||new c,h=this.x,u=this.y,f=this.z,_=this.w;var i=t.m;return e.x=i[0]*h+i[4]*u+i[8]*f+i[12]*_,e.y=i[1]*h+i[5]*u+i[9]*f+i[13]*_,e.z=i[2]*h+i[6]*u+i[10]*f+i[14]*_,e.w=i[3]*h+i[7]*u+i[11]*f+i[15]*_,e},s.maxAxis=function(){return Math.max(this.x,this.y,this.z,this.w)},n=c,r=[{key:"ZERO",get:function(){return new c(0,0,0,0)}},{key:"ONE",get:function(){return new c(1,1,1,1)}},{key:"NEG_ONE",get:function(){return new c(-1,-1,-1,-1)}}],null&&o(n.prototype,null),r&&o(n,r),Object.defineProperty(n,"prototype",{writable:!1}),c})(r.default);function p(t,e,i,n){return new d(t,e,i,n)}i.default=d,d.sub=d.subtract,d.mul=d.multiply,d.div=d.divide,d.scale=d.multiplyScalar,d.mag=d.len,d.squaredMagnitude=d.lengthSqr,d.ZERO_R=d.ZERO,d.ONE_R=d.ONE,d.NEG_ONE_R=d.NEG_ONE,n.default.fastDefine("cc.Vec4",d,{x:0,y:0,z:0,w:0}),cc.v4=p,cc.Vec4=d}),{"../platform/CCClass":168,"./utils":264,"./value-type":265}],269:[(function(){"use strict";cc.js}),{}],270:[(function(t){"use strict";t("./core/CCGame"),t("./actions")}),{"./actions":7,"./core/CCGame":28}],271:[(function(t,e){"use strict";var i=t("../compression/zlib.min"),n=t("../core/CCDebug"),r=function(t){var e,i,r,a,s,o,c,l,h,u,f,_,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(e=this.readUInt32(),l=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},a=this.readUInt16(),r=this.readUInt16()||100,s.delay=1e3*a/r,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===l&&(this.pos+=4,e-=4),t=(null!=s?s.data:void 0)||this.imgData,f=0;0<=e?f<e:f>e;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(e),(h=255-this.transparency.indexed.length)>0)for(_=0;0<=h?_<h:_>h;0<=h?++_:--_)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":o=(u=this.read(e)).indexOf(0),c=String.fromCharCode.apply(String,u.slice(0,o)),this.text[c]=String.fromCharCode.apply(String,u.slice(o+1));break;case"IEND":return s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,i=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*i,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(Uint8Array!=Array&&(this.imgData=new Uint8Array(this.imgData)));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error(n.getError(6017))}};r.prototype={constructor:r,read:function(t){var e,i;for(i=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)i.push(this.data[this.pos++]);return i},readUInt32:function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},readUInt16:function(){return this.data[this.pos++]<<8|this.data[this.pos++]},decodePixels:function(t){var e,r,a,s,o,c,l,h,u,f,_,d,p,m,v,g,y,T,A,b,E,C,x;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);for(t=new i.Inflate(t,{index:0,verify:!1}).decompress(),g=(d=this.pixelBitlength/8)*this.width,p=new Uint8Array(g*this.height),c=t.length,v=0,m=0,r=0;m<c;){switch(t[m++]){case 0:for(s=A=0;A<g;s=A+=1)p[r++]=t[m++];break;case 1:for(s=b=0;b<g;s=b+=1)e=t[m++],o=s<d?0:p[r-d],p[r++]=(e+o)%256;break;case 2:for(s=E=0;E<g;s=E+=1)e=t[m++],a=(s-s%d)/d,y=v&&p[(v-1)*g+a*d+s%d],p[r++]=(y+e)%256;break;case 3:for(s=C=0;C<g;s=C+=1)e=t[m++],a=(s-s%d)/d,o=s<d?0:p[r-d],y=v&&p[(v-1)*g+a*d+s%d],p[r++]=(e+Math.floor((o+y)/2))%256;break;case 4:for(s=x=0;x<g;s=x+=1)e=t[m++],a=(s-s%d)/d,o=s<d?0:p[r-d],0===v?y=T=0:(y=p[(v-1)*g+a*d+s%d],T=a&&p[(v-1)*g+(a-1)*d+s%d]),l=o+y-T,h=Math.abs(l-o),f=Math.abs(l-y),_=Math.abs(l-T),u=h<=f&&h<=_?o:f<=_?y:T,p[r++]=(e+u)%256;break;default:throw new Error(n.getError(6018,t[m-1]))}v++}return p},copyToImageData:function(t,e){var i,n,r,a,s,o,c,l,h,u,f;if(n=this.colors,h=null,i=this.hasAlphaChannel,this.palette.length&&(h=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(),n=4,i=!0),l=(r=t.data||t).length,s=h||e,a=o=0,1===n)for(;a<l;)c=h?4*e[a/4]:o,u=s[c++],r[a++]=u,r[a++]=u,r[a++]=u,r[a++]=i?s[c++]:255,o=c;else for(;a<l;)c=h?4*e[a/4]:o,r[a++]=s[c++],r[a++]=s[c++],r[a++]=s[c++],r[a++]=i?s[c++]:255,o=c},decodePalette:function(){var t,e,i,n,r,a,s,o,c;for(i=this.palette,a=this.transparency.indexed||[],r=new Uint8Array((a.length||0)+i.length),n=0,t=0,e=s=0,o=i.length;s<o;e=s+=3)r[n++]=i[e],r[n++]=i[e+1],r[n++]=i[e+2],r[n++]=null!=(c=a[t++])?c:255;return r},render:function(t){var e,i;return t.width=this.width,t.height=this.height,i=(e=t.getContext("2d")).createImageData(this.width,this.height),this.copyToImageData(i,this.decodePixels()),e.putImageData(i,0,0)}},e.exports=r}),{"../compression/zlib.min":25,"../core/CCDebug":26}],272:[(function(t,e){"use strict";var i=t("../core/assets/CCAsset"),n=t("../core/assets/CCSpriteFrame"),r=cc.Class({name:"cc.ParticleAsset",extends:i,properties:{spriteFrame:{default:null,type:n}}});cc.ParticleAsset=e.exports=r}),{"../core/assets/CCAsset":62,"../core/assets/CCSpriteFrame":74}],273:[(function(t,e){"use strict";var i=t("../core/platform/CCMacro"),n=t("./CCParticleAsset"),r=t("../core/components/CCRenderComponent"),a=t("../compression/ZipUtils"),s=t("./CCPNGReader"),o=t("./CCTIFFReader"),c=t("../core/utils/texture-util"),l=(t("../core/renderer/render-flow"),t("./particle-simulator")),h=(t("../core/assets/material/CCMaterial"),t("../core/utils/blend-func")),u=cc.Enum({GRAVITY:0,RADIUS:1}),f=cc.Enum({FREE:0,RELATIVE:1,GROUPED:2}),_={preview:{default:!0,editorOnly:!0,notify:!1,animatable:!1,tooltip:!1},_custom:!1,custom:{get:function(){return this._custom},set:function(t){this._custom!==t&&(this._custom=t,this._applyFile())},animatable:!1,tooltip:!1},_file:{default:null,type:n},file:{get:function(){return this._file},set:function(t){this._file!==t&&(this._file=t,t?this._applyFile():this.custom=!0)},animatable:!1,type:n,tooltip:!1},_spriteFrame:{default:null,type:cc.SpriteFrame},spriteFrame:{get:function(){return this._spriteFrame},set:function(t){var e=this._renderSpriteFrame;e!==t&&(this._renderSpriteFrame=t,t&&!t._uuid||(this._spriteFrame=t),this._applySpriteFrame(e))},type:cc.SpriteFrame,tooltip:!1},_texture:{default:null,type:cc.Texture2D,editorOnly:!0},texture:{get:function(){return this._getTexture()},set:function(t){t&&cc.warnID(6017)},type:cc.Texture2D,tooltip:!1,readonly:!0,visible:!1,animatable:!1},particleCount:{visible:!1,get:function(){return this._simulator.particles.length},readonly:!0},_stopped:!0,stopped:{get:function(){return this._stopped},animatable:!1,visible:!1},playOnLoad:!0,autoRemoveOnFinish:{default:!1,animatable:!1,tooltip:!1},active:{get:function(){return this._simulator.active},visible:!1},totalParticles:150,duration:-1,emissionRate:10,life:1,lifeVar:0,_startColor:null,startColor:{type:cc.Color,get:function(){return this._startColor},set:function(t){this._startColor.r=t.r,this._startColor.g=t.g,this._startColor.b=t.b,this._startColor.a=t.a}},_startColorVar:null,startColorVar:{type:cc.Color,get:function(){return this._startColorVar},set:function(t){this._startColorVar.r=t.r,this._startColorVar.g=t.g,this._startColorVar.b=t.b,this._startColorVar.a=t.a}},_endColor:null,endColor:{type:cc.Color,get:function(){return this._endColor},set:function(t){this._endColor.r=t.r,this._endColor.g=t.g,this._endColor.b=t.b,this._endColor.a=t.a}},_endColorVar:null,endColorVar:{type:cc.Color,get:function(){return this._endColorVar},set:function(t){this._endColorVar.r=t.r,this._endColorVar.g=t.g,this._endColorVar.b=t.b,this._endColorVar.a=t.a}},angle:90,angleVar:20,startSize:50,startSizeVar:0,endSize:0,endSizeVar:0,startSpin:0,startSpinVar:0,endSpin:0,endSpinVar:0,sourcePos:cc.Vec2.ZERO,posVar:cc.Vec2.ZERO,_positionType:{default:f.FREE,formerlySerializedAs:"positionType"},positionType:{type:f,get:function(){return this._positionType},set:function(t){this._positionType=t,this._updateMaterial()}},emitterMode:{default:u.GRAVITY,type:u},gravity:cc.Vec2.ZERO,speed:180,speedVar:50,tangentialAccel:80,tangentialAccelVar:0,radialAccel:0,radialAccelVar:0,rotationIsDir:!1,startRadius:0,startRadiusVar:0,endRadius:0,endRadiusVar:0,rotatePerS:0,rotatePerSVar:0},d=cc.Class({name:"cc.ParticleSystem",extends:r,mixins:[h],editor:!1,ctor:function(){this.initProperties()},initProperties:function(){this._previewTimer=null,this._focused=!1,this._aspectRatio=1,this._simulator=new l(this),this._startColor=cc.color(255,255,255,255),this._startColorVar=cc.color(0,0,0,0),this._endColor=cc.color(255,255,255,0),this._endColorVar=cc.color(0,0,0,0),this._renderSpriteFrame=null},properties:_,statics:{DURATION_INFINITY:-1,START_SIZE_EQUAL_TO_END_SIZE:-1,START_RADIUS_EQUAL_TO_END_RADIUS:-1,EmitterMode:u,PositionType:f,_PNGReader:s,_TIFFReader:o},onFocusInEditor:!1,onLostFocusInEditor:!1,onRestore:!1,_startPreview:!1,_stopPreview:!1,_convertTextureToSpriteFrame:!1,__preload:function(){this._super(),this._custom&&this.spriteFrame&&!this._renderSpriteFrame?this._applySpriteFrame(this.spriteFrame):this._file&&(this._custom?!this._getTexture()&&this._applyFile():this._applyFile()),this.playOnLoad&&this.resetSystem()},onDestroy:function(){this.autoRemoveOnFinish&&(this.autoRemoveOnFinish=!1),this._buffer&&(this._buffer.destroy(),this._buffer=null),this._simulator._uvFilled=0,this._super()},lateUpdate:function(t){this._simulator.finished||this._simulator.step(t)},addParticle:function(){},stopSystem:function(){this._stopped=!0,this._simulator.stop()},resetSystem:function(){this._stopped=!1,this._simulator.reset(),this.markForRender(!0)},isFull:function(){return this.particleCount>=this.totalParticles},setTextureWithRect:function(t,e){t instanceof cc.Texture2D&&(this.spriteFrame=new cc.SpriteFrame(t,e))},_applyFile:function(){var t=this._file;if(t){var e=this;cc.assetManager.postLoadNative(t,(function(i){!i&&t._nativeAsset?e.isValid&&(e._plistFile=t.nativeUrl,e._custom||(e._spriteFrame!==t.spriteFrame&&(e.spriteFrame=t.spriteFrame),e._initWithDictionary(t._nativeAsset)),e._spriteFrame?!e._renderSpriteFrame&&e._spriteFrame&&e._applySpriteFrame(e.spriteFrame):t.spriteFrame?e.spriteFrame=t.spriteFrame:e._custom&&e._initTextureWithDictionary(t._nativeAsset)):cc.errorID(6029)}))}},_initTextureWithDictionary:function(t){var e,n=cc.path.changeBasename(this._plistFile,t.textureFileName||"");if(t.textureFileName)c.loadImage(n,(function(e,i){e?(t.textureFileName=void 0,this._initTextureWithDictionary(t)):(cc.assetManager.assets.add(n,i),this.spriteFrame=new cc.SpriteFrame(i))}),this);else if(t.textureImageData){var r=t.textureImageData;if(!(r&&r.length>0))return!1;var l=cc.assetManager.assets.get(n);if(!l){var h=a.unzipBase64AsArray(r,1);if(!h)return cc.warnID(6030,this._file.name),!1;var u=(e=h).length>8&&137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]&&13===e[4]&&10===e[5]&&26===e[6]&&10===e[7]?i.ImageFormat.PNG:e.length>2&&(73===e[0]&&73===e[1]||77===e[0]&&77===e[1]||255===e[0]&&216===e[1])?i.ImageFormat.TIFF:i.ImageFormat.UNKNOWN;if(u!==i.ImageFormat.TIFF&&u!==i.ImageFormat.PNG)return cc.warnID(6031,this._file.name),!1;var f=document.createElement("canvas");u===i.ImageFormat.PNG?new s(h).render(f):o.parseTIFF(h,f),l=c.cacheImage(n,f)}l||cc.warnID(6032,this._file.name),this.spriteFrame=new cc.SpriteFrame(l)}return!0},_initWithDictionary:function(t){this.totalParticles=parseInt(t.maxParticles||0),this.life=parseFloat(t.particleLifespan||0),this.lifeVar=parseFloat(t.particleLifespanVariance||0);var e=t.emissionRate;this.emissionRate=e||Math.min(this.totalParticles/this.life,Number.MAX_VALUE),this.duration=parseFloat(t.duration||0),this.srcBlendFactor=parseInt(t.blendFuncSource||i.SRC_ALPHA),this.dstBlendFactor=parseInt(t.blendFuncDestination||i.ONE_MINUS_SRC_ALPHA);var n=this._startColor;n.r=255*parseFloat(t.startColorRed||0),n.g=255*parseFloat(t.startColorGreen||0),n.b=255*parseFloat(t.startColorBlue||0),n.a=255*parseFloat(t.startColorAlpha||0);var r=this._startColorVar;r.r=255*parseFloat(t.startColorVarianceRed||0),r.g=255*parseFloat(t.startColorVarianceGreen||0),r.b=255*parseFloat(t.startColorVarianceBlue||0),r.a=255*parseFloat(t.startColorVarianceAlpha||0);var a=this._endColor;a.r=255*parseFloat(t.finishColorRed||0),a.g=255*parseFloat(t.finishColorGreen||0),a.b=255*parseFloat(t.finishColorBlue||0),a.a=255*parseFloat(t.finishColorAlpha||0);var s=this._endColorVar;if(s.r=255*parseFloat(t.finishColorVarianceRed||0),s.g=255*parseFloat(t.finishColorVarianceGreen||0),s.b=255*parseFloat(t.finishColorVarianceBlue||0),s.a=255*parseFloat(t.finishColorVarianceAlpha||0),this.startSize=parseFloat(t.startParticleSize||0),this.startSizeVar=parseFloat(t.startParticleSizeVariance||0),this.endSize=parseFloat(t.finishParticleSize||0),this.endSizeVar=parseFloat(t.finishParticleSizeVariance||0),this.positionType=parseFloat(void 0!==t.positionType?t.positionType:f.RELATIVE),this.sourcePos.x=0,this.sourcePos.y=0,this.posVar.x=parseFloat(t.sourcePositionVariancex||0),this.posVar.y=parseFloat(t.sourcePositionVariancey||0),this.angle=parseFloat(t.angle||0),this.angleVar=parseFloat(t.angleVariance||0),this.startSpin=parseFloat(t.rotationStart||0),this.startSpinVar=parseFloat(t.rotationStartVariance||0),this.endSpin=parseFloat(t.rotationEnd||0),this.endSpinVar=parseFloat(t.rotationEndVariance||0),this.emitterMode=parseInt(t.emitterType||u.GRAVITY),this.emitterMode===u.GRAVITY){this.gravity.x=parseFloat(t.gravityx||0),this.gravity.y=parseFloat(t.gravityy||0),this.speed=parseFloat(t.speed||0),this.speedVar=parseFloat(t.speedVariance||0),this.radialAccel=parseFloat(t.radialAcceleration||0),this.radialAccelVar=parseFloat(t.radialAccelVariance||0),this.tangentialAccel=parseFloat(t.tangentialAcceleration||0),this.tangentialAccelVar=parseFloat(t.tangentialAccelVariance||0);var o=t.rotationIsDir||"";null!==o?(o=o.toString().toLowerCase(),this.rotationIsDir="true"===o||"1"===o):this.rotationIsDir=!1}else{if(this.emitterMode!==u.RADIUS)return cc.warnID(6009),!1;this.startRadius=parseFloat(t.maxRadius||0),this.startRadiusVar=parseFloat(t.maxRadiusVariance||0),this.endRadius=parseFloat(t.minRadius||0),this.endRadiusVar=parseFloat(t.minRadiusVariance||0),this.rotatePerS=parseFloat(t.rotatePerSecond||0),this.rotatePerSVar=parseFloat(t.rotatePerSecondVariance||0)}return this._initTextureWithDictionary(t),!0},_validateRender:function(){var t=this._getTexture();t&&t.loaded?this._super():this.disableRender()},_onTextureLoaded:function(){this._simulator.updateUVs(!0),this._syncAspect(),this._updateMaterial(),this.markForRender(!0)},_syncAspect:function(){var t=this._renderSpriteFrame._rect;this._aspectRatio=t.width/t.height},_applySpriteFrame:function(){this._renderSpriteFrame=this._renderSpriteFrame||this._spriteFrame,this._renderSpriteFrame&&(this._renderSpriteFrame.textureLoaded()?this._onTextureLoaded():this._renderSpriteFrame.onTextureLoaded(this._onTextureLoaded,this))},_getTexture:function(){return this._renderSpriteFrame&&this._renderSpriteFrame.getTexture()||this._texture},_updateMaterial:function(){var t=this.getMaterial(0);t&&(t.define("CC_USE_MODEL",this._positionType!==f.FREE),t.setProperty("texture",this._getTexture()),h.prototype._updateMaterial.call(this))},_finishedSimulation:function(){this.resetSystem(),this.stopSystem(),this.disableRender(),this.autoRemoveOnFinish&&this._stopped&&this.node.destroy()}});cc.ParticleSystem=e.exports=d}),{"../compression/ZipUtils":22,"../core/assets/material/CCMaterial":81,"../core/components/CCRenderComponent":115,"../core/platform/CCMacro":173,"../core/renderer/render-flow":200,"../core/utils/blend-func":237,"../core/utils/texture-util":250,"./CCPNGReader":271,"./CCParticleAsset":272,"./CCTIFFReader":274,"./particle-simulator":276,"fire-url":void 0}],274:[(function(t,e){"use strict";var i=t("../core/CCDebug"),n={_littleEndian:!1,_tiffData:null,_fileDirectories:[],getUint8:function(t){return this._tiffData[t]},getUint16:function(t){return this._littleEndian?this._tiffData[t+1]<<8|this._tiffData[t]:this._tiffData[t]<<8|this._tiffData[t+1]},getUint32:function(t){var e=this._tiffData;return this._littleEndian?e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]:e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},checkLittleEndian:function(){var t=this.getUint16(0);if(18761===t)this.littleEndian=!0;else{if(19789!==t)throw console.log(t),TypeError(i.getError(6019));this.littleEndian=!1}return this.littleEndian},hasTowel:function(){if(42!==this.getUint16(2))throw RangeError(i.getError(6020));return!0},getFieldTypeName:function(t){var e=this.fieldTypeNames;return t in e?e[t]:null},getFieldTagName:function(t){var e=this.fieldTagNames;return t in e?e[t]:(cc.logID(6021,t),"Tag"+t)},getFieldTypeLength:function(t){return-1!==["BYTE","ASCII","SBYTE","UNDEFINED"].indexOf(t)?1:-1!==["SHORT","SSHORT"].indexOf(t)?2:-1!==["LONG","SLONG","FLOAT"].indexOf(t)?4:-1!==["RATIONAL","SRATIONAL","DOUBLE"].indexOf(t)?8:null},getFieldValues:function(t,e,i,n){var r=[],a=this.getFieldTypeLength(e);if(a*i<=4)!1===this.littleEndian?r.push(n>>>8*(4-a)):r.push(n);else for(var s=0;s<i;s++){var o=a*s;a>=8?-1!==["RATIONAL","SRATIONAL"].indexOf(e)?(r.push(this.getUint32(n+o)),r.push(this.getUint32(n+o+4))):cc.logID(8e3):r.push(this.getBytes(a,n+o))}return"ASCII"===e&&r.forEach((function(t,e,i){i[e]=String.fromCharCode(t)})),r},getBytes:function(t,e){if(t<=0)cc.logID(8001);else{if(t<=1)return this.getUint8(e);if(t<=2)return this.getUint16(e);if(t<=3)return this.getUint32(e)>>>8;if(t<=4)return this.getUint32(e);cc.logID(8002)}},getBits:function(t,e,i){i=i||0;var n,r,a=e+Math.floor(i/8),s=i+t,o=32-t;return s<=0?cc.logID(6023):s<=8?(n=24+i,r=this.getUint8(a)):s<=16?(n=16+i,r=this.getUint16(a)):s<=32?(n=i,r=this.getUint32(a)):cc.logID(6022),{bits:r<<n>>>o,byteOffset:a+Math.floor(s/8),bitOffset:s%8}},parseFileDirectory:function(t){for(var e=this.getUint16(t),i=[],n=t+2,r=0;r<e;n+=12,r++){var a=this.getUint16(n),s=this.getUint16(n+2),o=this.getUint32(n+4),c=this.getUint32(n+8),l=this.getFieldTagName(a),h=this.getFieldTypeName(s),u=this.getFieldValues(l,h,o,c);i[l]={type:h,values:u}}this._fileDirectories.push(i);var f=this.getUint32(n);0!==f&&this.parseFileDirectory(f)},clampColorSample:function(t,e){var i=Math.pow(2,8-e);return Math.floor(t*i+(i-1))},parseTIFF:function(t,e){if(e=e||document.createElement("canvas"),this._tiffData=t,this.canvas=e,this.checkLittleEndian(),this.hasTowel()){var n=this.getUint32(4);this._fileDirectories.length=0,this.parseFileDirectory(n);var r=this._fileDirectories[0],a=r.ImageWidth.values[0],s=r.ImageLength.values[0];this.canvas.width=a,this.canvas.height=s;var o=[],c=r.Compression?r.Compression.values[0]:1,l=r.SamplesPerPixel.values[0],h=[],u=0,f=!1;if(r.BitsPerSample.values.forEach((function(t,e){h[e]={bitsPerSample:t,hasBytesPerSample:!1,bytesPerSample:void 0},t%8==0&&(h[e].hasBytesPerSample=!0,h[e].bytesPerSample=t/8),u+=t}),this),u%8==0){f=!0;var _=u/8}var d=r.StripOffsets.values,p=d.length;if(r.StripByteCounts)var m=r.StripByteCounts.values;else{if(cc.logID(8003),1!==p)throw Error(i.getError(6024));m=[Math.ceil(a*s*u/8)]}for(var v=0;v<p;v++){var g=d[v];o[v]=[];for(var y=m[v],T=0,A=0,b=1,E=!0,C=[],x=0,S=0,w=0;T<y;T+=b)switch(c){case 1:var D=0;for(C=[];D<l;D++){if(!h[D].hasBytesPerSample){var M=this.getBits(h[D].bitsPerSample,g+T,A);throw C.push(M.bits),T=M.byteOffset-g,A=M.bitOffset,RangeError(i.getError(6025))}var R=h[D].bytesPerSample*D;C.push(this.getBytes(h[D].bytesPerSample,g+T+R))}if(o[v].push(C),!f)throw b=0,RangeError(i.getError(6026));b=_;break;case 2:case 3:case 4:case 5:case 6:case 7:break;case 32773:if(E){E=!1;var I=1,O=1,P=this.getInt8(g+T);P>=0&&P<=127?I=P+1:P>=-127&&P<=-1?O=1-P:E=!0}else{var N=this.getUint8(g+T);for(D=0;D<O;D++){if(!h[S].hasBytesPerSample)throw RangeError(i.getError(6025));w=w<<8*x|N,++x===h[S].bytesPerSample&&(C.push(w),w=x=0,S++),S===l&&(o[v].push(C),C=[],S=0)}0==--I&&(E=!0)}b=1}}if(e.getContext){var F=this.canvas.getContext("2d");F.fillStyle="rgba(255, 255, 255, 0)";var L=r.RowsPerStrip?r.RowsPerStrip.values[0]:s,B=o.length,k=s%L,V=0===k?L:k,U=L,z=0,G=r.PhotometricInterpretation.values[0],H=[],W=0;if(r.ExtraSamples&&(W=(H=r.ExtraSamples.values).length),r.ColorMap)var j=r.ColorMap.values,Y=Math.pow(2,h[0].bitsPerSample);for(v=0;v<B;v++){v+1===B&&(U=V);for(var X=o[v].length,q=z*v,Z=0,K=0;K<X;Z++)for(var J=0;J<a;J++,K++){var Q=o[v][K],$=0,tt=0,et=0,it=1;if(W>0)for(var nt=0;nt<W;nt++)if(1===H[nt]||2===H[nt]){it=Q[3+nt]/256;break}switch(G){case 0:if(h[0].hasBytesPerSample)var rt=Math.pow(16,2*h[0].bytesPerSample);Q.forEach((function(t,e,i){i[e]=rt-t}));case 1:$=tt=et=this.clampColorSample(Q[0],h[0].bitsPerSample);break;case 2:$=this.clampColorSample(Q[0],h[0].bitsPerSample),tt=this.clampColorSample(Q[1],h[1].bitsPerSample),et=this.clampColorSample(Q[2],h[2].bitsPerSample);break;case 3:if(void 0===j)throw Error(i.getError(6027));var at=Q[0];$=this.clampColorSample(j[at],16),tt=this.clampColorSample(j[Y+at],16),et=this.clampColorSample(j[2*Y+at],16);break;default:throw RangeError(i.getError(6028,G))}F.fillStyle="rgba("+$+", "+tt+", "+et+", "+it+")",F.fillRect(J,q+Z,1,1)}z=U}}return this.canvas}},fieldTagNames:{315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop"},fieldTypeNames:{1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE"}};e.exports=n}),{"../core/CCDebug":26}],275:[(function(t){"use strict";t("./CCParticleAsset"),t("./CCParticleSystem"),t("./particle-simulator"),t("./particle-system-assembler")}),{"./CCParticleAsset":272,"./CCParticleSystem":273,"./particle-simulator":276,"./particle-system-assembler":277}],276:[(function(t,e){"use strict";var i=t("../core/platform/js"),n=t("../core/utils/misc"),r=cc.v2(0,0),a=cc.v2(),s=cc.v2(),o=cc.v2(),c=cc.v2(),l=function(){this.pos=cc.v2(0,0),this.startPos=cc.v2(0,0),this.color=cc.color(0,0,0,255),this.deltaColor={r:0,g:0,b:0,a:255},this.preciseColor={r:0,g:0,b:0,a:255},this.size=0,this.deltaSize=0,this.rotation=0,this.deltaRotation=0,this.timeToLive=0,this.drawPos=cc.v2(0,0),this.aspectRatio=1,this.dir=cc.v2(0,0),this.radialAccel=0,this.tangentialAccel=0,this.angle=0,this.degreesPerSecond=0,this.radius=0,this.deltaRadius=0},h=new i.Pool(function(t){t.pos.set(r),t.startPos.set(r),t.color._val=4278190080,t.deltaColor.r=t.deltaColor.g=t.deltaColor.b=0,t.deltaColor.a=255,t.size=0,t.deltaSize=0,t.rotation=0,t.deltaRotation=0,t.timeToLive=0,t.drawPos.set(r),t.aspectRatio=1,t.dir.set(r),t.radialAccel=0,t.tangentialAccel=0,t.angle=0,t.degreesPerSecond=0,t.radius=0,t.deltaRadius=0},1024);h.get=function(){return this._get()||new l};var u=function(t){this.sys=t,this.particles=[],this.active=!1,this.readyToPlay=!0,this.finished=!1,this.elapsed=0,this.emitCounter=0,this._uvFilled=0,this._worldRotation=0};function f(t){for(var e=0,i=t;i;)e+=i.angle,i=i.parent;return e}u.prototype.stop=function(){this.active=!1,this.readyToPlay=!1,this.elapsed=this.sys.duration,this.emitCounter=0},u.prototype.reset=function(){this.active=!0,this.readyToPlay=!0,this.elapsed=0,this.emitCounter=0,this.finished=!1;for(var t=this.particles,e=0;e<t.length;++e)h.put(t[e]);t.length=0;var i=this.sys._assembler;i&&i._ia&&(i._ia._count=0)},u.prototype.emitParticle=function(t){var e=this.sys,i=n.clampf,r=h.get();this.particles.push(r),r.timeToLive=e.life+e.lifeVar*(Math.random()-.5)*2;var a,s,o,c,l=r.timeToLive=Math.max(0,r.timeToLive);r.pos.x=e.sourcePos.x+e.posVar.x*(Math.random()-.5)*2,r.pos.y=e.sourcePos.y+e.posVar.y*(Math.random()-.5)*2;var u=e._startColor,f=e._startColorVar,_=e._endColor,d=e._endColorVar;r.color.r=a=i(u.r+f.r*(Math.random()-.5)*2,0,255),r.color.g=s=i(u.g+f.g*(Math.random()-.5)*2,0,255),r.color.b=o=i(u.b+f.b*(Math.random()-.5)*2,0,255),r.color.a=c=i(u.a+f.a*(Math.random()-.5)*2,0,255);var p=r.color,m=r.preciseColor;m.r=p.r,m.g=p.g,m.b=p.b,m.a=p.a,r.deltaColor.r=(i(_.r+d.r*(Math.random()-.5)*2,0,255)-a)/l,r.deltaColor.g=(i(_.g+d.g*(Math.random()-.5)*2,0,255)-s)/l,r.deltaColor.b=(i(_.b+d.b*(Math.random()-.5)*2,0,255)-o)/l,r.deltaColor.a=(i(_.a+d.a*(Math.random()-.5)*2,0,255)-c)/l;var v=e.startSize+e.startSizeVar*(Math.random()-.5)*2;if(v=Math.max(0,v),r.size=v,e.endSize===cc.ParticleSystem.START_SIZE_EQUAL_TO_END_SIZE)r.deltaSize=0;else{var g=e.endSize+e.endSizeVar*(Math.random()-.5)*2;g=Math.max(0,g),r.deltaSize=(g-v)/l}var y=e.startSpin+e.startSpinVar*(Math.random()-.5)*2,T=e.endSpin+e.endSpinVar*(Math.random()-.5)*2;r.rotation=y,r.deltaRotation=(T-y)/l,r.startPos.x=t.x,r.startPos.y=t.y,r.aspectRatio=e._aspectRatio||1;var A=n.degreesToRadians(e.angle+this._worldRotation+e.angleVar*(Math.random()-.5)*2);if(e.emitterMode===cc.ParticleSystem.EmitterMode.GRAVITY){var b=e.speed+e.speedVar*(Math.random()-.5)*2;r.dir.x=Math.cos(A),r.dir.y=Math.sin(A),r.dir.mulSelf(b),r.radialAccel=e.radialAccel+e.radialAccelVar*(Math.random()-.5)*2,r.tangentialAccel=e.tangentialAccel+e.tangentialAccelVar*(Math.random()-.5)*2,e.rotationIsDir&&(r.rotation=-n.radiansToDegrees(Math.atan2(r.dir.y,r.dir.x)))}else{var E=e.startRadius+e.startRadiusVar*(Math.random()-.5)*2,C=e.endRadius+e.endRadiusVar*(Math.random()-.5)*2;r.radius=E,r.deltaRadius=e.endRadius===cc.ParticleSystem.START_RADIUS_EQUAL_TO_END_RADIUS?0:(C-E)/l,r.angle=A,r.degreesPerSecond=n.degreesToRadians(e.rotatePerS+e.rotatePerSVar*(Math.random()-.5)*2)}},u.prototype.updateUVs=function(t){var e=this.sys._assembler;if(e){var i=e.getBuffer();if(i&&this.sys._renderSpriteFrame){for(var n=4*e._vfmt._bytes/4,r=i._vData,a=this.sys._renderSpriteFrame.uv,s=t?0:this._uvFilled,o=this.particles.length,c=s;c<o;c++){var l=c*n;r[l+2]=a[0],r[l+3]=a[1],r[l+7]=a[2],r[l+8]=a[3],r[l+12]=a[4],r[l+13]=a[5],r[l+17]=a[6],r[l+18]=a[7]}this._uvFilled=o}}},u.prototype.updateParticleBuffer=function(t,e,i,r){var a=i._vData,s=i._uintVData,o=e.x,c=e.y,l=t.size,h=l,u=t.aspectRatio;u>1?h=l/u:l=h*u;var f=l/2,_=h/2;if(t.rotation){var d=-f,p=-_,m=f,v=_,g=-n.degreesToRadians(t.rotation),y=Math.cos(g),T=Math.sin(g);a[r]=d*y-p*T+o,a[r+1]=d*T+p*y+c,a[r+5]=m*y-p*T+o,a[r+6]=m*T+p*y+c,a[r+10]=d*y-v*T+o,a[r+11]=d*T+v*y+c,a[r+15]=m*y-v*T+o,a[r+16]=m*T+v*y+c}else a[r]=o-f,a[r+1]=c-_,a[r+5]=o+f,a[r+6]=c-_,a[r+10]=o-f,a[r+11]=c+_,a[r+15]=o+f,a[r+16]=c+_;s[r+4]=t.color._val,s[r+9]=t.color._val,s[r+14]=t.color._val,s[r+19]=t.color._val},u.prototype.step=function(t){t=t>cc.director._maxParticleDeltaTime?cc.director._maxParticleDeltaTime:t;var e=this.sys,i=e.node,n=this.particles,r=4*this.sys._assembler._vfmt._bytes/4,l=cc.ParticleSystem.PositionType;if(i._updateWorldMatrix(),e.positionType===l.FREE){this._worldRotation=f(i);var u=i._worldMatrix.m;a.x=u[12],a.y=u[13]}else e.positionType===l.RELATIVE?(this._worldRotation=i.angle,a.x=i.x,a.y=i.y):this._worldRotation=0;if(this.active&&e.emissionRate){var _=1/e.emissionRate;for(n.length<e.totalParticles&&(this.emitCounter+=t);n.length<e.totalParticles&&this.emitCounter>_;)this.emitParticle(a),this.emitCounter-=_;this.elapsed+=t,-1!==e.duration&&e.duration<this.elapsed&&e.stopSystem()}var d=e._assembler.getBuffer(),p=n.length;d.reset(),d.request(4*p,6*p),p>this._uvFilled&&this.updateUVs();for(var m=0;m<n.length;){s.x=s.y=o.x=o.y=c.x=c.y=0;var v=n[m];if(v.timeToLive-=t,v.timeToLive>0){if(e.emitterMode===cc.ParticleSystem.EmitterMode.GRAVITY){var g=c,y=s,T=o;(v.pos.x||v.pos.y)&&(y.set(v.pos),y.normalizeSelf()),T.set(y),y.mulSelf(v.radialAccel);var A=T.x;T.x=-T.y,T.y=A,T.mulSelf(v.tangentialAccel),g.set(y),g.addSelf(T),g.addSelf(e.gravity),g.mulSelf(t),v.dir.addSelf(g),g.set(v.dir),g.mulSelf(t),v.pos.addSelf(g)}else v.angle+=v.degreesPerSecond*t,v.radius+=v.deltaRadius*t,v.pos.x=-Math.cos(v.angle)*v.radius,v.pos.y=-Math.sin(v.angle)*v.radius;var b=v.preciseColor,E=v.deltaColor;b.r+=E.r*t,b.g+=E.g*t,b.b+=E.b*t,b.a+=E.a*t;var C=v.color;C.r=b.r,C.g=b.g,C.b=b.b,C.a=b.a,v.size+=v.deltaSize*t,v.size<0&&(v.size=0),v.rotation+=v.deltaRotation*t;var x=s;x.set(v.pos),e.positionType!==l.GROUPED&&x.addSelf(v.startPos);var S=r*m;this.updateParticleBuffer(v,x,d,S),++m}else{var w=n[m];m!==n.length-1&&(n[m]=n[n.length-1]),h.put(w),n.length--}}e._assembler._ia._count=6*n.length,n.length>0?d.uploadData():this.active||this.readyToPlay||(this.finished=!0,e._finishedSimulation())},e.exports=u}),{"../core/platform/js":189,"../core/utils/misc":242}],277:[(function(t,e){"use strict";var i=r(t("../core/renderer/assembler")),n=r(t("../renderer/core/input-assembler"));function r(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=t("./CCParticleSystem"),o=t("../core/renderer/"),c=t("../core/renderer/webgl/quad-buffer"),l=t("../core/renderer/webgl/vertex-format").vfmtPosUvColor,h=(function(t){var e,i;function r(e){var i;return(i=t.call(this,e)||this)._buffer=null,i._ia=null,i._vfmt=l,i}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var s=r.prototype;return s.getBuffer=function(){return this._buffer||(this._buffer=new c(o._handle,l),this._ia=new n.default,this._ia._vertexBuffer=this._buffer._vb,this._ia._indexBuffer=this._buffer._ib,this._ia._start=0,this._ia._count=0),this._buffer},s.fillBuffers=function(t,e){if(this._ia){var i=cc.ParticleSystem.PositionType;t.positionType===i.RELATIVE?e.node=t.node.parent:e.node=t.node,e.material=t._materials[0],e._flushIA(this._ia)}},r})(i.default);i.default.register(s,h),e.exports=h}),{"../core/renderer/":199,"../core/renderer/assembler":196,"../core/renderer/webgl/quad-buffer":229,"../core/renderer/webgl/vertex-format":232,"../renderer/core/input-assembler":280,"./CCParticleSystem":273}],278:[(function(t,e){"use strict";var i,n,r,a,s,o,c,l,h,u,f,_,d,p,m,v,g,y,T,A,b,E,C,x,S,w,D,M,R,I,O,P,N,F,L,B,k,V,U,z,G,H;(function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL"})(i||(i={})),(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.BUFFER=1]="BUFFER",t[t.TEXTURE=2]="TEXTURE",t[t.TEXTURE_VIEW=3]="TEXTURE_VIEW",t[t.RENDER_PASS=4]="RENDER_PASS",t[t.FRAMEBUFFER=5]="FRAMEBUFFER",t[t.SAMPLER=6]="SAMPLER",t[t.SHADER=7]="SHADER",t[t.PIPELINE_LAYOUT=8]="PIPELINE_LAYOUT",t[t.PIPELINE_STATE=9]="PIPELINE_STATE",t[t.BINDING_LAYOUT=10]="BINDING_LAYOUT",t[t.INPUT_ASSEMBLER=11]="INPUT_ASSEMBLER",t[t.COMMAND_ALLOCATOR=12]="COMMAND_ALLOCATOR",t[t.COMMAND_BUFFER=13]="COMMAND_BUFFER",t[t.QUEUE=14]="QUEUE",t[t.WINDOW=15]="WINDOW"})(n||(n={})),(function(t){t[t.UNREADY=0]="UNREADY",t[t.FAILED=1]="FAILED",t[t.SUCCESS=2]="SUCCESS"})(r||(r={})),(function(){function t(t){this._gfxType=n.UNKNOWN,this._status=r.UNREADY,this._gfxType=t}Object.defineProperty(t.prototype,"gfxType",{get:function(){return this._gfxType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0})})(),(function(t){t.ATTR_POSITION="a_position",t.ATTR_NORMAL="a_normal",t.ATTR_TANGENT="a_tangent",t.ATTR_BITANGENT="a_bitangent",t.ATTR_WEIGHTS="a_weights",t.ATTR_JOINTS="a_joints",t.ATTR_COLOR="a_color",t.ATTR_COLOR1="a_color1",t.ATTR_COLOR2="a_color2",t.ATTR_TEX_COORD="a_texCoord",t.ATTR_TEX_COORD1="a_texCoord1",t.ATTR_TEX_COORD2="a_texCoord2",t.ATTR_TEX_COORD3="a_texCoord3",t.ATTR_TEX_COORD4="a_texCoord4",t.ATTR_TEX_COORD5="a_texCoord5",t.ATTR_TEX_COORD6="a_texCoord6",t.ATTR_TEX_COORD7="a_texCoord7",t.ATTR_TEX_COORD8="a_texCoord8"})(a||(a={})),(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.BOOL=1]="BOOL",t[t.BOOL2=2]="BOOL2",t[t.BOOL3=3]="BOOL3",t[t.BOOL4=4]="BOOL4",t[t.INT=5]="INT",t[t.INT2=6]="INT2",t[t.INT3=7]="INT3",t[t.INT4=8]="INT4",t[t.UINT=9]="UINT",t[t.UINT2=10]="UINT2",t[t.UINT3=11]="UINT3",t[t.UINT4=12]="UINT4",t[t.FLOAT=13]="FLOAT",t[t.FLOAT2=14]="FLOAT2",t[t.FLOAT3=15]="FLOAT3",t[t.FLOAT4=16]="FLOAT4",t[t.COLOR4=17]="COLOR4",t[t.MAT2=18]="MAT2",t[t.MAT2X3=19]="MAT2X3",t[t.MAT2X4=20]="MAT2X4",t[t.MAT3X2=21]="MAT3X2",t[t.MAT3=22]="MAT3",t[t.MAT3X4=23]="MAT3X4",t[t.MAT4X2=24]="MAT4X2",t[t.MAT4X3=25]="MAT4X3",t[t.MAT4=26]="MAT4",t[t.SAMPLER1D=27]="SAMPLER1D",t[t.SAMPLER1D_ARRAY=28]="SAMPLER1D_ARRAY",t[t.SAMPLER2D=29]="SAMPLER2D",t[t.SAMPLER2D_ARRAY=30]="SAMPLER2D_ARRAY",t[t.SAMPLER3D=31]="SAMPLER3D",t[t.SAMPLER_CUBE=32]="SAMPLER_CUBE",t[t.COUNT=33]="COUNT"})(s||(s={})),(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A8=1]="A8",t[t.L8=2]="L8",t[t.LA8=3]="LA8",t[t.R8=4]="R8",t[t.R8SN=5]="R8SN",t[t.R8UI=6]="R8UI",t[t.R8I=7]="R8I",t[t.R16F=8]="R16F",t[t.R16UI=9]="R16UI",t[t.R16I=10]="R16I",t[t.R32F=11]="R32F",t[t.R32UI=12]="R32UI",t[t.R32I=13]="R32I",t[t.RG8=14]="RG8",t[t.RG8SN=15]="RG8SN",t[t.RG8UI=16]="RG8UI",t[t.RG8I=17]="RG8I",t[t.RG16F=18]="RG16F",t[t.RG16UI=19]="RG16UI",t[t.RG16I=20]="RG16I",t[t.RG32F=21]="RG32F",t[t.RG32UI=22]="RG32UI",t[t.RG32I=23]="RG32I",t[t.RGB8=24]="RGB8",t[t.SRGB8=25]="SRGB8",t[t.RGB8SN=26]="RGB8SN",t[t.RGB8UI=27]="RGB8UI",t[t.RGB8I=28]="RGB8I",t[t.RGB16F=29]="RGB16F",t[t.RGB16UI=30]="RGB16UI",t[t.RGB16I=31]="RGB16I",t[t.RGB32F=32]="RGB32F",t[t.RGB32UI=33]="RGB32UI",t[t.RGB32I=34]="RGB32I",t[t.RGBA8=35]="RGBA8",t[t.SRGB8_A8=36]="SRGB8_A8",t[t.RGBA8SN=37]="RGBA8SN",t[t.RGBA8UI=38]="RGBA8UI",t[t.RGBA8I=39]="RGBA8I",t[t.RGBA16F=40]="RGBA16F",t[t.RGBA16UI=41]="RGBA16UI",t[t.RGBA16I=42]="RGBA16I",t[t.RGBA32F=43]="RGBA32F",t[t.RGBA32UI=44]="RGBA32UI",t[t.RGBA32I=45]="RGBA32I",t[t.R5G6B5=46]="R5G6B5",t[t.R11G11B10F=47]="R11G11B10F",t[t.RGB5A1=48]="RGB5A1",t[t.RGBA4=49]="RGBA4",t[t.RGB10A2=50]="RGB10A2",t[t.RGB10A2UI=51]="RGB10A2UI",t[t.RGB9E5=52]="RGB9E5",t[t.D16=53]="D16",t[t.D16S8=54]="D16S8",t[t.D24=55]="D24",t[t.D24S8=56]="D24S8",t[t.D32F=57]="D32F",t[t.D32F_S8=58]="D32F_S8",t[t.BC1=59]="BC1",t[t.BC1_ALPHA=60]="BC1_ALPHA",t[t.BC1_SRGB=61]="BC1_SRGB",t[t.BC1_SRGB_ALPHA=62]="BC1_SRGB_ALPHA",t[t.BC2=63]="BC2",t[t.BC2_SRGB=64]="BC2_SRGB",t[t.BC3=65]="BC3",t[t.BC3_SRGB=66]="BC3_SRGB",t[t.BC4=67]="BC4",t[t.BC4_SNORM=68]="BC4_SNORM",t[t.BC5=69]="BC5",t[t.BC5_SNORM=70]="BC5_SNORM",t[t.BC6H_UF16=71]="BC6H_UF16",t[t.BC6H_SF16=72]="BC6H_SF16",t[t.BC7=73]="BC7",t[t.BC7_SRGB=74]="BC7_SRGB",t[t.ETC_RGB8=75]="ETC_RGB8",t[t.ETC2_RGB8=76]="ETC2_RGB8",t[t.ETC2_SRGB8=77]="ETC2_SRGB8",t[t.ETC2_RGB8_A1=78]="ETC2_RGB8_A1",t[t.ETC2_SRGB8_A1=79]="ETC2_SRGB8_A1",t[t.ETC2_RGBA8=80]="ETC2_RGBA8",t[t.ETC2_SRGB8_A8=81]="ETC2_SRGB8_A8",t[t.EAC_R11=82]="EAC_R11",t[t.EAC_R11SN=83]="EAC_R11SN",t[t.EAC_RG11=84]="EAC_RG11",t[t.EAC_RG11SN=85]="EAC_RG11SN",t[t.PVRTC_RGB2=86]="PVRTC_RGB2",t[t.PVRTC_RGBA2=87]="PVRTC_RGBA2",t[t.PVRTC_RGB4=88]="PVRTC_RGB4",t[t.PVRTC_RGBA4=89]="PVRTC_RGBA4",t[t.PVRTC2_2BPP=90]="PVRTC2_2BPP",t[t.PVRTC2_4BPP=91]="PVRTC2_4BPP",t[t.ASTC_RGBA_4x4=92]="ASTC_RGBA_4x4",t[t.ASTC_RGBA_5x4=92]="ASTC_RGBA_5x4",t[t.ASTC_RGBA_5x5=92]="ASTC_RGBA_5x5",t[t.ASTC_RGBA_6x5=92]="ASTC_RGBA_6x5",t[t.ASTC_RGBA_6x6=92]="ASTC_RGBA_6x6",t[t.ASTC_RGBA_8x5=92]="ASTC_RGBA_8x5",t[t.ASTC_RGBA_8x6=92]="ASTC_RGBA_8x6",t[t.ASTC_RGBA_8x8=92]="ASTC_RGBA_8x8",t[t.ASTC_RGBA_10x5=92]="ASTC_RGBA_10x5",t[t.ASTC_RGBA_10x6=92]="ASTC_RGBA_10x6",t[t.ASTC_RGBA_10x8=92]="ASTC_RGBA_10x8",t[t.ASTC_RGBA_10x10=92]="ASTC_RGBA_10x10",t[t.ASTC_RGBA_12x10=92]="ASTC_RGBA_12x10",t[t.ASTC_RGBA_12x12=92]="ASTC_RGBA_12x12",t[t.ASTC_SRGBA_4x4=92]="ASTC_SRGBA_4x4",t[t.ASTC_SRGBA_5x4=92]="ASTC_SRGBA_5x4",t[t.ASTC_SRGBA_5x5=92]="ASTC_SRGBA_5x5",t[t.ASTC_SRGBA_6x5=92]="ASTC_SRGBA_6x5",t[t.ASTC_SRGBA_6x6=92]="ASTC_SRGBA_6x6",t[t.ASTC_SRGBA_8x5=92]="ASTC_SRGBA_8x5",t[t.ASTC_SRGBA_8x6=92]="ASTC_SRGBA_8x6",t[t.ASTC_SRGBA_8x8=92]="ASTC_SRGBA_8x8",t[t.ASTC_SRGBA_10x5=92]="ASTC_SRGBA_10x5",t[t.ASTC_SRGBA_10x6=92]="ASTC_SRGBA_10x6",t[t.ASTC_SRGBA_10x8=92]="ASTC_SRGBA_10x8",t[t.ASTC_SRGBA_10x10=92]="ASTC_SRGBA_10x10",t[t.ASTC_SRGBA_12x10=92]="ASTC_SRGBA_12x10",t[t.ASTC_SRGBA_12x12=92]="ASTC_SRGBA_12x12"})(o||(o={})),(function(t){t[t.NONE=0]="NONE",t[t.TRANSFER_SRC=1]="TRANSFER_SRC",t[t.TRANSFER_DST=2]="TRANSFER_DST",t[t.INDEX=4]="INDEX",t[t.VERTEX=8]="VERTEX",t[t.UNIFORM=16]="UNIFORM",t[t.STORAGE=32]="STORAGE",t[t.INDIRECT=64]="INDIRECT"})(c||(c={})),(function(t){t[t.NONE=0]="NONE",t[t.DEVICE=1]="DEVICE",t[t.HOST=2]="HOST"})(l||(l={})),(function(t){t[t.NONE=0]="NONE",t[t.READ=1]="READ",t[t.WRITE=2]="WRITE"})(h||(h={})),(function(t){t[t.POINT_LIST=0]="POINT_LIST",t[t.LINE_LIST=1]="LINE_LIST",t[t.LINE_STRIP=2]="LINE_STRIP",t[t.LINE_LOOP=3]="LINE_LOOP",t[t.LINE_LIST_ADJACENCY=4]="LINE_LIST_ADJACENCY",t[t.LINE_STRIP_ADJACENCY=5]="LINE_STRIP_ADJACENCY",t[t.ISO_LINE_LIST=6]="ISO_LINE_LIST",t[t.TRIANGLE_LIST=7]="TRIANGLE_LIST",t[t.TRIANGLE_STRIP=8]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=9]="TRIANGLE_FAN",t[t.TRIANGLE_LIST_ADJACENCY=10]="TRIANGLE_LIST_ADJACENCY",t[t.TRIANGLE_STRIP_ADJACENCY=11]="TRIANGLE_STRIP_ADJACENCY",t[t.TRIANGLE_PATCH_ADJACENCY=12]="TRIANGLE_PATCH_ADJACENCY",t[t.QUAD_PATCH_LIST=13]="QUAD_PATCH_LIST"})(u||(u={})),(function(t){t[t.FILL=0]="FILL",t[t.POINT=1]="POINT",t[t.LINE=2]="LINE"})(f||(f={})),(function(t){t[t.GOURAND=0]="GOURAND",t[t.FLAT=1]="FLAT"})(_||(_={})),(function(t){t[t.NONE=0]="NONE",t[t.FRONT=1]="FRONT",t[t.BACK=2]="BACK"})(d||(d={})),(function(t){t[t.NEVER=0]="NEVER",t[t.LESS=1]="LESS",t[t.EQUAL=2]="EQUAL",t[t.LESS_EQUAL=3]="LESS_EQUAL",t[t.GREATER=4]="GREATER",t[t.NOT_EQUAL=5]="NOT_EQUAL",t[t.GREATER_EQUAL=6]="GREATER_EQUAL",t[t.ALWAYS=7]="ALWAYS"})(p||(p={})),(function(t){t[t.ZERO=0]="ZERO",t[t.KEEP=1]="KEEP",t[t.REPLACE=2]="REPLACE",t[t.INCR=3]="INCR",t[t.DECR=4]="DECR",t[t.INVERT=5]="INVERT",t[t.INCR_WRAP=6]="INCR_WRAP",t[t.DECR_WRAP=7]="DECR_WRAP"})(m||(m={})),(function(t){t[t.ADD=0]="ADD",t[t.SUB=1]="SUB",t[t.REV_SUB=2]="REV_SUB",t[t.MIN=3]="MIN",t[t.MAX=4]="MAX"})(v||(v={})),(function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_ALPHA=2]="SRC_ALPHA",t[t.DST_ALPHA=3]="DST_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=4]="ONE_MINUS_SRC_ALPHA",t[t.ONE_MINUS_DST_ALPHA=5]="ONE_MINUS_DST_ALPHA",t[t.SRC_COLOR=6]="SRC_COLOR",t[t.DST_COLOR=7]="DST_COLOR",t[t.ONE_MINUS_SRC_COLOR=8]="ONE_MINUS_SRC_COLOR",t[t.ONE_MINUS_DST_COLOR=9]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=10]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=11]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=12]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=13]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=14]="ONE_MINUS_CONSTANT_ALPHA"})(g||(g={})),(function(t){t[t.NONE=0]="NONE",t[t.R=1]="R",t[t.G=2]="G",t[t.B=4]="B",t[t.A=8]="A",t[t.ALL=15]="ALL"})(y||(y={})),(function(t){t[t.NONE=0]="NONE",t[t.POINT=1]="POINT",t[t.LINEAR=2]="LINEAR",t[t.ANISOTROPIC=3]="ANISOTROPIC"})(T||(T={})),(function(t){t[t.WRAP=0]="WRAP",t[t.MIRROR=1]="MIRROR",t[t.CLAMP=2]="CLAMP",t[t.BORDER=3]="BORDER"})(A||(A={})),(function(t){t[t.TEX1D=0]="TEX1D",t[t.TEX2D=1]="TEX2D",t[t.TEX3D=2]="TEX3D"})(b||(b={})),(function(t){t[t.NONE=0]="NONE",t[t.TRANSFER_SRC=1]="TRANSFER_SRC",t[t.TRANSFER_DST=2]="TRANSFER_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.COLOR_ATTACHMENT=16]="COLOR_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=32]="DEPTH_STENCIL_ATTACHMENT",t[t.TRANSIENT_ATTACHMENT=64]="TRANSIENT_ATTACHMENT",t[t.INPUT_ATTACHMENT=128]="INPUT_ATTACHMENT"})(E||(E={})),(function(t){t[t.X1=0]="X1",t[t.X2=1]="X2",t[t.X4=2]="X4",t[t.X8=3]="X8",t[t.X16=4]="X16",t[t.X32=5]="X32",t[t.X64=6]="X64"})(C||(C={})),(function(t){t[t.NONE=0]="NONE",t[t.GEN_MIPMAP=1]="GEN_MIPMAP",t[t.CUBEMAP=2]="CUBEMAP",t[t.BAKUP_BUFFER=4]="BAKUP_BUFFER"})(x||(x={})),(function(t){t[t.TV1D=0]="TV1D",t[t.TV2D=1]="TV2D",t[t.TV3D=2]="TV3D",t[t.CUBE=3]="CUBE",t[t.TV1D_ARRAY=4]="TV1D_ARRAY",t[t.TV2D_ARRAY=5]="TV2D_ARRAY"})(S||(S={})),(function(t){t[t.VERTEX=0]="VERTEX",t[t.HULL=1]="HULL",t[t.DOMAIN=2]="DOMAIN",t[t.GEOMETRY=3]="GEOMETRY",t[t.FRAGMENT=4]="FRAGMENT",t[t.COMPUTE=5]="COMPUTE",t[t.COUNT=6]="COUNT"})(w||(w={})),(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.UNIFORM_BUFFER=1]="UNIFORM_BUFFER",t[t.SAMPLER=2]="SAMPLER",t[t.STORAGE_BUFFER=3]="STORAGE_BUFFER"})(D||(D={})),(function(t){t[t.PRIMARY=0]="PRIMARY",t[t.SECONDARY=1]="SECONDARY"})(M||(M={})),(function(t){t[t.LOAD=0]="LOAD",t[t.CLEAR=1]="CLEAR",t[t.DISCARD=2]="DISCARD"})(R||(R={})),(function(t){t[t.STORE=0]="STORE",t[t.DISCARD=1]="DISCARD"})(I||(I={})),(function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.GENERAL=1]="GENERAL",t[t.COLOR_ATTACHMENT_OPTIMAL=2]="COLOR_ATTACHMENT_OPTIMAL",t[t.DEPTH_STENCIL_ATTACHMENT_OPTIMAL=3]="DEPTH_STENCIL_ATTACHMENT_OPTIMAL",t[t.DEPTH_STENCIL_READONLY_OPTIMAL=4]="DEPTH_STENCIL_READONLY_OPTIMAL",t[t.SHADER_READONLY_OPTIMAL=5]="SHADER_READONLY_OPTIMAL",t[t.TRANSFER_SRC_OPTIMAL=6]="TRANSFER_SRC_OPTIMAL",t[t.TRANSFER_DST_OPTIMAL=7]="TRANSFER_DST_OPTIMAL",t[t.PREINITIALIZED=8]="PREINITIALIZED",t[t.PRESENT_SRC=9]="PRESENT_SRC"})(O||(O={})),(function(t){t[t.GRAPHICS=0]="GRAPHICS",t[t.COMPUTE=1]="COMPUTE",t[t.RAY_TRACING=2]="RAY_TRACING"})(P||(P={})),(function(t){t[t.VIEWPORT=0]="VIEWPORT",t[t.SCISSOR=1]="SCISSOR",t[t.LINE_WIDTH=2]="LINE_WIDTH",t[t.DEPTH_BIAS=3]="DEPTH_BIAS",t[t.BLEND_CONSTANTS=4]="BLEND_CONSTANTS",t[t.DEPTH_BOUNDS=5]="DEPTH_BOUNDS",t[t.STENCIL_WRITE_MASK=6]="STENCIL_WRITE_MASK",t[t.STENCIL_COMPARE_MASK=7]="STENCIL_COMPARE_MASK"})(N||(N={})),(function(t){t[t.FRONT=0]="FRONT",t[t.BACK=1]="BACK",t[t.ALL=2]="ALL"})(F||(F={})),(function(t){t[t.GRAPHICS=0]="GRAPHICS",t[t.COMPUTE=1]="COMPUTE",t[t.TRANSFER=2]="TRANSFER"})(L||(L={})),(function(t){t[t.NONE=0]="NONE",t[t.COLOR=1]="COLOR",t[t.DEPTH=2]="DEPTH",t[t.STENCIL=4]="STENCIL",t[t.DEPTH_STENCIL=6]="DEPTH_STENCIL",t[t.ALL=7]="ALL"})(B||(B={})),(function(t){t[t.DEFAULT=100]="DEFAULT"})(k||(k={})),(function(t){t[t.MIN=0]="MIN",t[t.MAX=255]="MAX",t[t.DEFAULT=128]="DEFAULT"})(V||(V={})),(function(t){t[t.UBO_GLOBAL=23]="UBO_GLOBAL",t[t.UBO_SHADOW=22]="UBO_SHADOW",t[t.UBO_LOCAL=21]="UBO_LOCAL",t[t.UBO_FORWARD_LIGHTS=20]="UBO_FORWARD_LIGHTS",t[t.UBO_SKINNING=19]="UBO_SKINNING",t[t.UBO_SKINNING_TEXTURE=18]="UBO_SKINNING_TEXTURE",t[t.UBO_UI=17]="UBO_UI",t[t.SAMPLER_JOINTS=25]="SAMPLER_JOINTS",t[t.SAMPLER_ENVIRONMENT=26]="SAMPLER_ENVIRONMENT",t[t.CUSTUM_UBO_BINDING_END_POINT=17]="CUSTUM_UBO_BINDING_END_POINT",t[t.CUSTOM_SAMPLER_BINDING_START_POINT=30]="CUSTOM_SAMPLER_BINDING_START_POINT"})(U||(U={})),(function(t){t[t.minFilter=0]="minFilter",t[t.magFilter=1]="magFilter",t[t.mipFilter=2]="mipFilter",t[t.addressU=3]="addressU",t[t.addressV=4]="addressV",t[t.addressW=5]="addressW",t[t.maxAnisotropy=6]="maxAnisotropy",t[t.cmpFunc=7]="cmpFunc",t[t.minLOD=8]="minLOD",t[t.maxLOD=9]="maxLOD",t[t.mipLODBias=10]="mipLODBias",t[t.borderColor=11]="borderColor",t[t.total=15]="total"})(H||(H={}));var W={};W[W.bool=s.BOOL]="bool",W[W.int=s.INT]="int",W[W.ivec2=s.INT2]="ivec2invTypeParams",W[W.ivec3=s.INT3]="ivec3",W[W.ivec4=s.INT4]="ivec4",W[W.float=s.FLOAT]="float",W[W.vec2=s.FLOAT2]="vec2",W[W.vec3=s.FLOAT3]="vec3",W[W.vec4=s.FLOAT4]="vec4",W[W.mat2=s.MAT2]="mat2",W[W.mat3=s.MAT3]="mat3",W[W.mat4=s.MAT4]="mat4",W[W.sampler2D=s.SAMPLER2D]="sampler2D",W[W.samplerCube=s.SAMPLER_CUBE]="samplerCube";var j=((z={})[s.BOOL]=4,z[s.INT]=4,z[s.INT2]=8,z[s.INT3]=12,z[s.INT4]=16,z[s.FLOAT]=4,z[s.FLOAT2]=8,z[s.FLOAT3]=12,z[s.FLOAT4]=16,z[s.MAT2]=16,z[s.MAT3]=36,z[s.MAT4]=64,z[s.SAMPLER2D]=4,z[s.SAMPLER_CUBE]=4,z),Y=((G={})[s.BOOL]=o.R32I,G[s.INT]=o.R32I,G[s.INT2]=o.RG32I,G[s.INT3]=o.RGB32I,G[s.INT4]=o.RGBA32I,G[s.FLOAT]=o.R32F,G[s.FLOAT2]=o.RG32F,G[s.FLOAT3]=o.RGB32F,G[s.FLOAT4]=o.RGBA32F,G),X={BACK:1029,FRONT:1028,NONE:0,ADD:32774,SUB:32778,REV_SUB:32779,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,SRC_ALPHA_SATURATE:776,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,INCR_WRAP:34055,DECR:7683,DECR_WRAP:34056,INVERT:5386};Object.assign(X,k);var q={murmurhash2_32_gc:function(t,e){for(var i,n=t.length,r=e^n,a=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:r^=(255&t.charCodeAt(a+2))<<16;case 2:r^=(255&t.charCodeAt(a+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(a)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0},SamplerInfoIndex:H,effectStructure:{$techniques:[{$passes:[{depthStencilState:{},rasterizerState:{},blendState:{targets:[{}]},properties:{any:{sampler:{},inspector:{}}}}]}]},typeMap:W,sizeMap:j,formatMap:Y,passParams:X,RenderQueue:{OPAQUE:0,TRANSPARENT:1,OVERLAY:2},RenderPriority:V,GFXGetTypeSize:function(t){switch(t){case s.BOOL:case s.INT:case s.UINT:case s.FLOAT:return 4;case s.BOOL2:case s.INT2:case s.UINT2:case s.FLOAT2:return 8;case s.BOOL3:case s.INT3:case s.UINT3:case s.FLOAT3:return 12;case s.BOOL4:case s.INT4:case s.UINT4:case s.FLOAT4:case s.MAT2:return 16;case s.MAT2X3:return 24;case s.MAT2X4:return 32;case s.MAT3X2:return 24;case s.MAT3:return 36;case s.MAT3X4:return 48;case s.MAT4X2:case s.MAT4X2:return 32;case s.MAT4:return 64;case s.SAMPLER1D:case s.SAMPLER1D_ARRAY:case s.SAMPLER2D:case s.SAMPLER2D_ARRAY:case s.SAMPLER3D:case s.SAMPLER_CUBE:return 4;default:return 0}},UniformBinding:U};e.exports=q}),{}],279:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../memop"),r=l(t("../enums")),a=t("../../core/value-types"),s=l(t("./program-lib")),o=l(t("./view")),c=l(t("../gfx"));function l(t){return t&&t.__esModule?t:{default:t}}var h=new a.Mat4,u=new n.RecyclePool(function(){return{stage:null,items:null}},8),f=new n.RecyclePool(function(){return new Float32Array(2)},8),_=new n.RecyclePool(function(){return new Float32Array(3)},8),d=new n.RecyclePool(function(){return new Float32Array(4)},8),p=new n.RecyclePool(function(){return new Float32Array(9)},8),m=new n.RecyclePool(function(){return new Float32Array(16)},8),v=new n.RecyclePool(function(){return new Float32Array(64)},8),g=new n.RecyclePool(function(){return new Int32Array(2)},8),y=new n.RecyclePool(function(){return new Int32Array(3)},8),T=new n.RecyclePool(function(){return new Int32Array(4)},8),A=new n.RecyclePool(function(){return new Int32Array(64)},8),b=(function(){function t(t,e){var i;this._device=t,this._programLib=new s.default(t),this._opts=e,this._type2defaultValue=((i={})[r.default.PARAM_INT]=0,i[r.default.PARAM_INT2]=new a.Vec2(0,0),i[r.default.PARAM_INT3]=new a.Vec3(0,0,0),i[r.default.PARAM_INT4]=new a.Vec4(0,0,0,0),i[r.default.PARAM_FLOAT]=0,i[r.default.PARAM_FLOAT2]=new a.Vec2(0,0),i[r.default.PARAM_FLOAT3]=new a.Vec3(0,0,0),i[r.default.PARAM_FLOAT4]=new a.Vec4(0,0,0,0),i[r.default.PARAM_COLOR4]=new a.Color(0,0,0,1),i[r.default.PARAM_MAT3]=new a.Mat3,i[r.default.PARAM_MAT4]=new a.Mat4,i[r.default.PARAM_TEXTURE_2D]=e.defaultTexture,i[r.default.PARAM_TEXTURE_CUBE]=e.defaultTextureCube,i),this._stage2fn={},this._usedTextureUnits=0,this._viewPools=new n.RecyclePool(function(){return new o.default},8),this._drawItemsPools=new n.RecyclePool(function(){return{model:null,node:null,ia:null,effect:null,defines:null,uniforms:null}},100),this._stageItemsPools=new n.RecyclePool(function(){return new n.RecyclePool(function(){return{model:null,node:null,ia:null,effect:null,defines:null,passes:[],sortKey:-1,uniforms:null}},100)},16),this._definesChanged=!1}var e=t.prototype;return e._resetTextuerUnit=function(){this._usedTextureUnits=0},e._allocTextureUnit=function(){var t=this._device,e=this._usedTextureUnits;return e>=t._caps.maxTextureUnits&&console.warn("Trying to use "+e+" texture units while this GPU supports only "+t._caps.maxTextureUnits),this._usedTextureUnits+=1,e},e._registerStage=function(t,e){this._stage2fn[t]=e},e.clear=function(){this._programLib.clear(),this.reset()},e.reset=function(){this._viewPools.reset(),this._stageItemsPools.reset(),this._definesChanged=!1},e._requestView=function(){return this._viewPools.add()},e._render=function(t,e){var i=this._device;i.setFrameBuffer(t._framebuffer),i.setViewport(t._rect.x,t._rect.y,t._rect.w,t._rect.h);var n={};t._clearFlags&r.default.CLEAR_COLOR&&(n.color=a.Vec4.toArray([],t._color)),t._clearFlags&r.default.CLEAR_DEPTH&&(n.depth=t._depth),t._clearFlags&r.default.CLEAR_STENCIL&&(n.stencil=t._stencil),i.clear(n),this._drawItemsPools.reset();for(var s=0;s<e._models.length;++s){var o=e._models.data[s];if(0!=(o._cullingMask&t._cullingMask)){var c=this._drawItemsPools.add();o.extractDrawItem(c)}}u.reset();for(var l=0;l<t._stages.length;++l){var h=t._stages[l],f=this._stageItemsPools.add();f.reset();for(var _=0;_<this._drawItemsPools.length;++_){var d=this._drawItemsPools.data[_],p=d.effect.stagePasses[h];if(p&&0!==p.length){var m=f.add();m.passes=p,m.model=d.model,m.node=d.node,m.ia=d.ia,m.effect=d.effect,m.defines=d.defines,m.sortKey=-1,m.uniforms=d.uniforms}}var v=u.add();v.stage=h,v.items=f}for(var g=0;g<u.length;++g){var y=u.data[g];(0,this._stage2fn[y.stage])(t,y.items)}},e._setProperty=function(t){var e=this._device,i=t.value;if(void 0===i&&(i=t.val),void 0===i&&(i=this._type2defaultValue[t.type]),void 0!==i)if(t.type===r.default.PARAM_TEXTURE_2D||t.type===r.default.PARAM_TEXTURE_CUBE)if(Array.isArray(i)){if(i.length>t.count)return void console.error("Failed to set property ["+t.name+"] : The length of texture array ["+i.length+"] is bigger than ["+t.count+"].");for(var n=A.add(),a=0;a<i.length;++a)n[a]=this._allocTextureUnit();e.setTextureArray(t.name,i,n)}else e.setTexture(t.name,i,this._allocTextureUnit());else t.directly?e.setUniformDirectly(t.name,i):e.setUniform(t.name,i);else console.warn("Failed to set technique property "+t.name+", value not found.")},e._draw=function(t){var e=this._device,i=this._programLib,n=t.node,r=t.ia,s=t.passes,o=t.effect;f.reset(),_.reset(),d.reset(),p.reset(),m.reset(),v.reset(),g.reset(),y.reset(),T.reset(),A.reset(),n.getWorldMatrix(h),e.setUniform("cc_matWorld",a.Mat4.toArray(m.add(),h)),a.Mat4.invert(h,h),a.Mat4.transpose(h,h),e.setUniform("cc_matWorldIT",a.Mat4.toArray(m.add(),h));for(var l=this._defines,u=0;u<s.length;++u){var b=s[u];this._definesChanged&&(b._programKey=null);var E=r.count;r._vertexBuffer&&e.setVertexBuffer(0,r._vertexBuffer),r._indexBuffer&&e.setIndexBuffer(r._indexBuffer),e.setPrimitiveType(r._primitiveType),Object.setPrototypeOf(l,b._defines);var C=i.getProgram(b,l,o.name);e.setProgram(C);for(var x=C._uniforms,S=b._properties,w=0;w<x.length;w++){var D=S[x[w].name];void 0!==D&&this._setProperty(D)}e.setCullMode(b._cullMode),b._blend&&(e.enableBlend(),e.setBlendFuncSep(b._blendSrc,b._blendDst,b._blendSrcAlpha,b._blendDstAlpha),e.setBlendEqSep(b._blendEq,b._blendAlphaEq),e.setBlendColor32(b._blendColor)),b._depthTest&&(e.enableDepthTest(),e.setDepthFunc(b._depthFunc)),b._depthWrite&&e.enableDepthWrite(),e.setStencilTest(b._stencilTest),b._stencilTest===c.default.STENCIL_ENABLE&&(e.setStencilFuncFront(b._stencilFuncFront,b._stencilRefFront,b._stencilMaskFront),e.setStencilOpFront(b._stencilFailOpFront,b._stencilZFailOpFront,b._stencilZPassOpFront,b._stencilWriteMaskFront),e.setStencilFuncBack(b._stencilFuncBack,b._stencilRefBack,b._stencilMaskBack),e.setStencilOpBack(b._stencilFailOpBack,b._stencilZFailOpBack,b._stencilZPassOpBack,b._stencilWriteMaskBack)),e.draw(r._start,E),this._resetTextuerUnit()}},t})();i.default=b,e.exports=i.default}),{"../../core/value-types":257,"../enums":285,"../gfx":290,"../memop":302,"./program-lib":282,"./view":284}],280:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../gfx"))&&n.__esModule?n:{default:n};function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=s(n.key,"string"))?r:String(r)),n)}var r}function s(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var o=(function(){function t(t,e,i){void 0===i&&(i=r.default.PT_TRIANGLES),this._vertexBuffer=t,this._indexBuffer=e,this._primitiveType=i,this._start=0,this._count=-1}var e,i;return e=t,(i=[{key:"count",get:function(){return-1!==this._count?this._count:this._indexBuffer?this._indexBuffer.count:this._vertexBuffer?this._vertexBuffer.count:0}}])&&a(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=o,e.exports=i.default}),{"../gfx":290}],281:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../gfx")),r=s(t("../enums")),a=s(t("../../core/value-types/value-type"));function s(t){return t&&t.__esModule?t:{default:t}}var o=(function(){function t(t,e,i,r,a,s){void 0===a&&(a={}),void 0===s&&(s={}),this._name=t,this._detailName=e,this._programName=i,this._programKey=null,this._stage=r,this._properties=a,this._defines=s,this._propertyNames=Object.keys(a),this._defineNames=Object.keys(s),this._cullMode=n.default.CULL_BACK,this._blend=!1,this._blendEq=n.default.BLEND_FUNC_ADD,this._blendAlphaEq=n.default.BLEND_FUNC_ADD,this._blendSrc=n.default.BLEND_SRC_ALPHA,this._blendDst=n.default.BLEND_ONE_MINUS_SRC_ALPHA,this._blendSrcAlpha=n.default.BLEND_SRC_ALPHA,this._blendDstAlpha=n.default.BLEND_ONE_MINUS_SRC_ALPHA,this._blendColor=4294967295,this._depthTest=!1,this._depthWrite=!1,this._depthFunc=n.default.DS_FUNC_LESS,this._stencilTest=n.default.STENCIL_INHERIT,this._stencilFuncFront=n.default.DS_FUNC_ALWAYS,this._stencilRefFront=0,this._stencilMaskFront=255,this._stencilFailOpFront=n.default.STENCIL_OP_KEEP,this._stencilZFailOpFront=n.default.STENCIL_OP_KEEP,this._stencilZPassOpFront=n.default.STENCIL_OP_KEEP,this._stencilWriteMaskFront=255,this._stencilFuncBack=n.default.DS_FUNC_ALWAYS,this._stencilRefBack=0,this._stencilMaskBack=255,this._stencilFailOpBack=n.default.STENCIL_OP_KEEP,this._stencilZFailOpBack=n.default.STENCIL_OP_KEEP,this._stencilZPassOpBack=n.default.STENCIL_OP_KEEP,this._stencilWriteMaskBack=255}var e=t.prototype;return e.setCullMode=function(t){void 0===t&&(t=n.default.CULL_BACK),this._cullMode=t},e.setBlend=function(t,e,i,r,a,s,o,c){void 0===t&&(t=!1),void 0===e&&(e=n.default.BLEND_FUNC_ADD),void 0===i&&(i=n.default.BLEND_SRC_ALPHA),void 0===r&&(r=n.default.BLEND_ONE_MINUS_SRC_ALPHA),void 0===a&&(a=n.default.BLEND_FUNC_ADD),void 0===s&&(s=n.default.BLEND_SRC_ALPHA),void 0===o&&(o=n.default.BLEND_ONE_MINUS_SRC_ALPHA),void 0===c&&(c=4294967295),this._blend=t,this._blendEq=e,this._blendSrc=i,this._blendDst=r,this._blendAlphaEq=a,this._blendSrcAlpha=s,this._blendDstAlpha=o,this._blendColor=c},e.setDepth=function(t,e,i){void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===i&&(i=n.default.DS_FUNC_LESS),this._depthTest=t,this._depthWrite=e,this._depthFunc=i},e.setStencilFront=function(t,e,i,r,a,s,o,c){void 0===t&&(t=n.default.STENCIL_INHERIT),void 0===e&&(e=n.default.DS_FUNC_ALWAYS),void 0===i&&(i=0),void 0===r&&(r=255),void 0===a&&(a=n.default.STENCIL_OP_KEEP),void 0===s&&(s=n.default.STENCIL_OP_KEEP),void 0===o&&(o=n.default.STENCIL_OP_KEEP),void 0===c&&(c=255),this._stencilTest=t,this._stencilFuncFront=e,this._stencilRefFront=i,this._stencilMaskFront=r,this._stencilFailOpFront=a,this._stencilZFailOpFront=s,this._stencilZPassOpFront=o,this._stencilWriteMaskFront=c},e.setStencilEnabled=function(t){void 0===t&&(t=n.default.STENCIL_INHERIT),this._stencilTest=t},e.setStencilBack=function(t,e,i,r,a,s,o,c){void 0===t&&(t=n.default.STENCIL_INHERIT),void 0===e&&(e=n.default.DS_FUNC_ALWAYS),void 0===i&&(i=0),void 0===r&&(r=255),void 0===a&&(a=n.default.STENCIL_OP_KEEP),void 0===s&&(s=n.default.STENCIL_OP_KEEP),void 0===o&&(o=n.default.STENCIL_OP_KEEP),void 0===c&&(c=255),this._stencilTest=t,this._stencilFuncBack=e,this._stencilRefBack=i,this._stencilMaskBack=r,this._stencilFailOpBack=a,this._stencilZFailOpBack=s,this._stencilZPassOpBack=o,this._stencilWriteMaskBack=c},e.setStage=function(t){this._stage=t},e.setProperties=function(t){this._properties=t},e.getProperty=function(t){if(this._properties[t])return this._properties[t].value},e.setProperty=function(t,e,i){var n=this._properties[t];if(!n)return!1;if(n.directly=i,Array.isArray(e)){var s=n.value;if(s.length!==e.length)return void cc.warnID(9105,this._name,t);for(var o=0;o<e.length;o++)s[o]=e[o]}else e&&!ArrayBuffer.isView(e)?n.type===r.default.PARAM_TEXTURE_2D?n.value=e.getImpl():e instanceof a.default?e.constructor.toArray(n.value,e):("object"==typeof e&&cc.warnID(9106,this._name,t),n.value=e):n.value=e;return!0},e.getDefine=function(t){return this._defines[t]},e.define=function(t,e,i){var n=this._defines[t];return!(!i&&void 0===n||(n!==e&&(this._defines[t]=e,this._programKey=null),0))},e.clone=function(){var e=new t(this._programName);Object.assign(e,this);var i={},n=this._properties;for(var r in n){var a=n[r],s=i[r]={},o=a.value;for(var c in Array.isArray(o)?s.value=o.concat():ArrayBuffer.isView(o)?s.value=new o.__proto__.constructor(o):s.value=o,a)"value"!==c&&(s[c]=a[c])}return e._properties=i,e._defines=Object.assign({},this._defines),e._propertyNames=this._propertyNames,e._defineNames=this._defineNames,e},t})();i.default=o,e.exports=i.default}),{"../../core/value-types/value-type":265,"../enums":285,"../gfx":290}],282:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../gfx"))&&n.__esModule?n:{default:n},a=0;function s(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n].name,a=e[r];"number"!=typeof a&&(a=a?1:0),i.push("#define "+r+" "+a)}return i.join("\n")+"\n"}function o(t,e,i){for(var n=t,r=0;r<e.length;r++){var a=e[r].name,s=i[a];if(Number.isInteger(s)){var o=new RegExp(a,"g");n=n.replace(o,s)}}return n}function c(t){return t.replace(/#pragma for (\w+) in range\(\s*(\d+)\s*,\s*(\d+)\s*\)([\s\S]+?)#pragma endFor/g,(function(t,e,i,n,r){var a="",s=parseInt(i),o=parseInt(n);(s.isNaN||o.isNaN)&&console.error("Unroll For Loops Error: begin and end of range must be an int num.");for(var c=s;c<o;++c)a+=r.replace(new RegExp("{"+e+"}","g"),c);return a}))}function l(t){return t.replace(/\bhighp\b/g,"mediump")}var h=(function(){function t(t){this._device=t,this._templates={},this._cache={},this._checkPrecision()}var e=t.prototype;return e.clear=function(){this._templates={},this._cache={}},e.define=function(t){var e=t.name,i=t.defines,n=t.glsl1||t,r=n.vert,s=n.frag;if(!this._templates[e]){for(var o=++a,c=0,l=0;l<i.length;++l){var h=i[l],u=1;if("number"===h.type){var f=h.range||[];h.min=f[0]||0,h.max=f[1]||4,u=Math.ceil(Math.log2(h.max-h.min)),h._map=function(t){return t-this.min<<this._offset}.bind(h)}else h._map=function(t){return t?1<<this._offset:0}.bind(h);h._offset=c,c+=u}var _=t.uniforms||[];if(t.samplers)for(var d=0;d<t.samplers.length;d++)_.push(t.samplers[d]);if(t.blocks)for(var p=0;p<t.blocks.length;p++)for(var m=t.blocks[p].defines,v=t.blocks[p].members,g=0;g<v.length;g++)_.push({defines:m,name:v[g].name,type:v[g].type});this._templates[e]={id:o,name:e,vert:r,frag:s,defines:i,attributes:t.attributes,uniforms:_,extensions:t.extensions}}},e.getTemplate=function(t){return this._templates[t]},e.hasProgram=function(t){return void 0!==this._templates[t]},e.getKey=function(t,e){for(var i=this._templates[t],n=0,r=0;r<i.defines.length;++r){var a=i.defines[r],s=e[a.name];void 0!==s&&(n|=a._map(s))}return i.id+":"+n},e.getProgram=function(t,e,i){var n=t._programKey=t._programKey||this.getKey(t._programName,e),a=this._cache[n];if(a)return a;var h=this._templates[t._programName],u=s(h.defines,e),f=o(h.vert,h.defines,e);f=u+c(f),this._highpSupported||(f=l(f));var _=o(h.frag,h.defines,e);_=u+c(_),this._highpSupported||(_=l(_));var d=(a=new r.default.Program(this._device,{vert:f,frag:_})).link();if(d){var p=f.split("\n"),m=_.split("\n"),v=h.defines.length;d.forEach((function(t){var e=t.line-1,n=t.line-v,r=("vs"===t.type?p:m)[e],a=t.info||"Failed to compile "+t.type+" "+t.fileID+" (ln "+n+"): \n "+t.message+": \n "+r;cc.error(i+" : "+a)}))}return this._cache[n]=a,a},e._checkPrecision=function(){var t=this._device._gl,e=!1;if(t.getShaderPrecisionFormat){var i=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT),n=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e=i&&i.precision>0&&n&&n.precision>0}e||cc.warnID(9102),this._highpSupported=e},t})();i.default=h,e.exports=i.default}),{"../gfx":290}],283:[(function(t,e,i){"use strict";function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(a=r(n.key,"string"))?a:String(a)),n)}var a}function r(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}i.__esModule=!0,i.default=void 0;var a=(function(){function t(t,e){this._name=t,this._passes=e}var e,i;return t.prototype.clone=function(){for(var e=[],i=0;i<this._passes.length;i++)e.push(this._passes[i].clone());return new t(this._name,e)},e=t,(i=[{key:"name",get:function(){return this._name}},{key:"passes",get:function(){return this._passes}}])&&n(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=a,e.exports=i.default}),{}],284:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../../core/value-types"),a=(n=t("../enums"))&&n.__esModule?n:{default:n},s=new r.Mat4,o=0,c=(function(){function t(){this._id=o++,this._priority=0,this._rect={x:0,y:0,w:1,h:1},this._color=new r.Vec4(.3,.3,.3,1),this._depth=1,this._stencil=0,this._clearFlags=a.default.CLEAR_COLOR|a.default.CLEAR_DEPTH,this._clearModel=null,this._matView=cc.mat4(),this._matViewInv=cc.mat4(),this._matProj=cc.mat4(),this._matViewProj=cc.mat4(),this._matInvViewProj=cc.mat4(),this._stages=[],this._cullingByID=!1,this._framebuffer=null,this._shadowLight=null,this._cullingMask=4294967295}var e=t.prototype;return e.getForward=function(t){var e=this._matView.m;return r.Vec3.set(t,-e[2],-e[6],-e[10])},e.getPosition=function(t){return r.Mat4.invert(s,this._matView),r.Mat4.getTranslation(t,s)},t})();i.default=c,e.exports=i.default}),{"../../core/value-types":257,"../enums":285}],285:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("./build/mappings"),r={PROJ_PERSPECTIVE:0,PROJ_ORTHO:1,LIGHT_DIRECTIONAL:0,LIGHT_POINT:1,LIGHT_SPOT:2,LIGHT_AMBIENT:3,SHADOW_NONE:0,SHADOW_HARD:1,SHADOW_SOFT:2,PARAM_INT:n.typeMap.int,PARAM_INT2:n.typeMap.ivec2,PARAM_INT3:n.typeMap.ivec3,PARAM_INT4:n.typeMap.ivec4,PARAM_FLOAT:n.typeMap.float,PARAM_FLOAT2:n.typeMap.vec2,PARAM_FLOAT3:n.typeMap.vec3,PARAM_FLOAT4:n.typeMap.vec4,PARAM_MAT2:n.typeMap.mat2,PARAM_MAT3:n.typeMap.mat3,PARAM_MAT4:n.typeMap.mat4,PARAM_TEXTURE_2D:n.typeMap.sampler2D,PARAM_TEXTURE_CUBE:n.typeMap.samplerCube,CLEAR_COLOR:1,CLEAR_DEPTH:2,CLEAR_STENCIL:4,CLEAR_SKYBOX:8,BUFFER_VIEW_INT8:0,BUFFER_VIEW_UINT8:1,BUFFER_VIEW_INT16:2,BUFFER_VIEW_UINT16:3,BUFFER_VIEW_INT32:4,BUFFER_VIEW_UINT32:5,BUFFER_VIEW_FLOAT32:6};i.default=r,e.exports=i.default}),{"./build/mappings":278}],286:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r,a=l(t("./state")),s=t("./enums"),o=l(t("./texture-2d")),c=l(t("./texture-cube"));function l(t){return t&&t.__esModule?t:{default:t}}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=u(n.key,"string"))?r:String(r)),n)}var r}function u(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=((n={})[5124]=function(t,e,i){t.uniform1i(e,i)},n[5126]=function(t,e,i){t.uniform1f(e,i)},n[35664]=function(t,e,i){t.uniform2fv(e,i)},n[35665]=function(t,e,i){t.uniform3fv(e,i)},n[35666]=function(t,e,i){t.uniform4fv(e,i)},n[35667]=function(t,e,i){t.uniform2iv(e,i)},n[35668]=function(t,e,i){t.uniform3iv(e,i)},n[35669]=function(t,e,i){t.uniform4iv(e,i)},n[35670]=function(t,e,i){t.uniform1i(e,i)},n[35671]=function(t,e,i){t.uniform2iv(e,i)},n[35672]=function(t,e,i){t.uniform3iv(e,i)},n[35673]=function(t,e,i){t.uniform4iv(e,i)},n[35674]=function(t,e,i){t.uniformMatrix2fv(e,!1,i)},n[35675]=function(t,e,i){t.uniformMatrix3fv(e,!1,i)},n[35676]=function(t,e,i){t.uniformMatrix4fv(e,!1,i)},n[35678]=function(t,e,i){t.uniform1i(e,i)},n[35680]=function(t,e,i){t.uniform1i(e,i)},n),_=((r={})[5124]=function(t,e,i){t.uniform1iv(e,i)},r[5126]=function(t,e,i){t.uniform1fv(e,i)},r[35664]=function(t,e,i){t.uniform2fv(e,i)},r[35665]=function(t,e,i){t.uniform3fv(e,i)},r[35666]=function(t,e,i){t.uniform4fv(e,i)},r[35667]=function(t,e,i){t.uniform2iv(e,i)},r[35668]=function(t,e,i){t.uniform3iv(e,i)},r[35669]=function(t,e,i){t.uniform4iv(e,i)},r[35670]=function(t,e,i){t.uniform1iv(e,i)},r[35671]=function(t,e,i){t.uniform2iv(e,i)},r[35672]=function(t,e,i){t.uniform3iv(e,i)},r[35673]=function(t,e,i){t.uniform4iv(e,i)},r[35674]=function(t,e,i){t.uniformMatrix2fv(e,!1,i)},r[35675]=function(t,e,i){t.uniformMatrix3fv(e,!1,i)},r[35676]=function(t,e,i){t.uniformMatrix4fv(e,!1,i)},r[35678]=function(t,e,i){t.uniform1iv(e,i)},r[35680]=function(t,e,i){t.uniform1iv(e,i)},r);function d(t,e,i){if(e.blend!==i.blend)return i.blend?(t.enable(t.BLEND),i.blendSrc!==s.enums.BLEND_CONSTANT_COLOR&&i.blendSrc!==s.enums.BLEND_ONE_MINUS_CONSTANT_COLOR&&i.blendDst!==s.enums.BLEND_CONSTANT_COLOR&&i.blendDst!==s.enums.BLEND_ONE_MINUS_CONSTANT_COLOR||t.blendColor((i.blendColor>>24)/255,(i.blendColor>>16&255)/255,(i.blendColor>>8&255)/255,(255&i.blendColor)/255),void(i.blendSep?(t.blendFuncSeparate(i.blendSrc,i.blendDst,i.blendSrcAlpha,i.blendDstAlpha),t.blendEquationSeparate(i.blendEq,i.blendAlphaEq)):(t.blendFunc(i.blendSrc,i.blendDst),t.blendEquation(i.blendEq)))):void t.disable(t.BLEND);!1!==i.blend&&(e.blendColor!==i.blendColor&&t.blendColor((i.blendColor>>24)/255,(i.blendColor>>16&255)/255,(i.blendColor>>8&255)/255,(255&i.blendColor)/255),e.blendSep===i.blendSep?i.blendSep?(e.blendSrc===i.blendSrc&&e.blendDst===i.blendDst&&e.blendSrcAlpha===i.blendSrcAlpha&&e.blendDstAlpha===i.blendDstAlpha||t.blendFuncSeparate(i.blendSrc,i.blendDst,i.blendSrcAlpha,i.blendDstAlpha),e.blendEq===i.blendEq&&e.blendAlphaEq===i.blendAlphaEq||t.blendEquationSeparate(i.blendEq,i.blendAlphaEq)):(e.blendSrc===i.blendSrc&&e.blendDst===i.blendDst||t.blendFunc(i.blendSrc,i.blendDst),e.blendEq!==i.blendEq&&t.blendEquation(i.blendEq)):i.blendSep?(t.blendFuncSeparate(i.blendSrc,i.blendDst,i.blendSrcAlpha,i.blendDstAlpha),t.blendEquationSeparate(i.blendEq,i.blendAlphaEq)):(t.blendFunc(i.blendSrc,i.blendDst),t.blendEquation(i.blendEq)))}function p(t,e,i){if(e.depthTest!==i.depthTest)return i.depthTest?(t.enable(t.DEPTH_TEST),t.depthFunc(i.depthFunc),void t.depthMask(i.depthWrite)):void t.disable(t.DEPTH_TEST);e.depthWrite!==i.depthWrite&&t.depthMask(i.depthWrite),!1!==i.depthTest?e.depthFunc!==i.depthFunc&&t.depthFunc(i.depthFunc):i.depthWrite&&(i.depthTest=!0,i.depthFunc=s.enums.DS_FUNC_ALWAYS,t.enable(t.DEPTH_TEST),t.depthFunc(i.depthFunc))}function m(t,e,i){if(i.stencilTest!==s.enums.STENCIL_INHERIT)return i.stencilTest!==e.stencilTest?i.stencilTest===s.enums.STENCIL_DISABLE?void t.disable(t.STENCIL_TEST):(t.enable(t.STENCIL_TEST),void(i.stencilSep?(t.stencilFuncSeparate(t.FRONT,i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),t.stencilMaskSeparate(t.FRONT,i.stencilWriteMaskFront),t.stencilOpSeparate(t.FRONT,i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront),t.stencilFuncSeparate(t.BACK,i.stencilFuncBack,i.stencilRefBack,i.stencilMaskBack),t.stencilMaskSeparate(t.BACK,i.stencilWriteMaskBack),t.stencilOpSeparate(t.BACK,i.stencilFailOpBack,i.stencilZFailOpBack,i.stencilZPassOpBack)):(t.stencilFunc(i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),t.stencilMask(i.stencilWriteMaskFront),t.stencilOp(i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront)))):void(i.stencilTest!==s.enums.STENCIL_DISABLE&&(e.stencilSep===i.stencilSep?i.stencilSep?(e.stencilFuncFront===i.stencilFuncFront&&e.stencilRefFront===i.stencilRefFront&&e.stencilMaskFront===i.stencilMaskFront||t.stencilFuncSeparate(t.FRONT,i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),e.stencilWriteMaskFront!==i.stencilWriteMaskFront&&t.stencilMaskSeparate(t.FRONT,i.stencilWriteMaskFront),e.stencilFailOpFront===i.stencilFailOpFront&&e.stencilZFailOpFront===i.stencilZFailOpFront&&e.stencilZPassOpFront===i.stencilZPassOpFront||t.stencilOpSeparate(t.FRONT,i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront),e.stencilFuncBack===i.stencilFuncBack&&e.stencilRefBack===i.stencilRefBack&&e.stencilMaskBack===i.stencilMaskBack||t.stencilFuncSeparate(t.BACK,i.stencilFuncBack,i.stencilRefBack,i.stencilMaskBack),e.stencilWriteMaskBack!==i.stencilWriteMaskBack&&t.stencilMaskSeparate(t.BACK,i.stencilWriteMaskBack),e.stencilFailOpBack===i.stencilFailOpBack&&e.stencilZFailOpBack===i.stencilZFailOpBack&&e.stencilZPassOpBack===i.stencilZPassOpBack||t.stencilOpSeparate(t.BACK,i.stencilFailOpBack,i.stencilZFailOpBack,i.stencilZPassOpBack)):(e.stencilFuncFront===i.stencilFuncFront&&e.stencilRefFront===i.stencilRefFront&&e.stencilMaskFront===i.stencilMaskFront||t.stencilFunc(i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),e.stencilWriteMaskFront!==i.stencilWriteMaskFront&&t.stencilMask(i.stencilWriteMaskFront),e.stencilFailOpFront===i.stencilFailOpFront&&e.stencilZFailOpFront===i.stencilZFailOpFront&&e.stencilZPassOpFront===i.stencilZPassOpFront||t.stencilOp(i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront)):i.stencilSep?(t.stencilFuncSeparate(t.FRONT,i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),t.stencilMaskSeparate(t.FRONT,i.stencilWriteMaskFront),t.stencilOpSeparate(t.FRONT,i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront),t.stencilFuncSeparate(t.BACK,i.stencilFuncBack,i.stencilRefBack,i.stencilMaskBack),t.stencilMaskSeparate(t.BACK,i.stencilWriteMaskBack),t.stencilOpSeparate(t.BACK,i.stencilFailOpBack,i.stencilZFailOpBack,i.stencilZPassOpBack)):(t.stencilFunc(i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),t.stencilMask(i.stencilWriteMaskFront),t.stencilOp(i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront))))}function v(t,e,i){e.cullMode!==i.cullMode&&(i.cullMode!==s.enums.CULL_NONE?(t.enable(t.CULL_FACE),t.cullFace(i.cullMode)):t.disable(t.CULL_FACE))}function g(t,e,i,n){var r=!1;if(-1!==n.maxStream){if(i.maxStream!==n.maxStream)r=!0;else if(i.program!==n.program)r=!0;else for(var a=0;a<n.maxStream+1;++a)if(i.vertexBuffers[a]!==n.vertexBuffers[a]||i.vertexBufferOffsets[a]!==n.vertexBufferOffsets[a]){r=!0;break}if(r){for(var s=0;s<t._caps.maxVertexAttribs;++s)t._newAttributes[s]=0;for(var o=0;o<n.maxStream+1;++o){var c=n.vertexBuffers[o],l=n.vertexBufferOffsets[o];if(c&&-1!==c._glID){e.bindBuffer(e.ARRAY_BUFFER,c._glID);for(var h=0;h<n.program._attributes.length;++h){var u=n.program._attributes[h],f=c._format.element(u.name);f?(0===t._enabledAttributes[u.location]&&(e.enableVertexAttribArray(u.location),t._enabledAttributes[u.location]=1),t._newAttributes[u.location]=1,e.vertexAttribPointer(u.location,f.num,f.type,f.normalize,f.stride,f.offset+l*f.stride)):console.warn("Can not find vertex attribute: "+u.name)}}}for(var _=0;_<t._caps.maxVertexAttribs;++_)t._enabledAttributes[_]!==t._newAttributes[_]&&(e.disableVertexAttribArray(_),t._enabledAttributes[_]=0)}}}function y(t,e,i){for(var n=0;n<i.maxTextureSlot+1;++n)if(e.textureUnits[n]!==i.textureUnits[n]){var r=i.textureUnits[n];r&&-1!==r._glID&&(t.activeTexture(t.TEXTURE0+n),t.bindTexture(r._target,r._glID))}}function T(t,e,i,n){void 0===n&&(n=0),i instanceof o.default?t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_2D,i._glID,0):i instanceof c.default?t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,i._glID,0):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,i._glID)}var A=(function(){function t(t,e){var i;void 0===(e=e||{}).alpha&&(e.alpha=!1),void 0===e.stencil&&(e.stencil=!0),void 0===e.depth&&(e.depth=!0),void 0===e.antialias&&(e.antialias=!1),void 0===e.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!1);try{i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)||t.getContext("webkit-3d",e)||t.getContext("moz-webgl",e)}catch(r){return void console.error(r)}i||console.error("This device does not support webgl"),this._gl=i,this._extensions={},this._caps={},this._stats={texture:0,vb:0,ib:0,drawcalls:0},this._initExtensions(["EXT_texture_filter_anisotropic","EXT_shader_texture_lod","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","WEBGL_draw_buffers"]),this._initCaps(),this._initStates(),a.default.initDefault(this),this._current=new a.default(this),this._next=new a.default(this),this._uniforms={},this._vx=this._vy=this._vw=this._vh=0,this._sx=this._sy=this._sw=this._sh=0,this._framebuffer=null,this._enabledAttributes=new Array(this._caps.maxVertexAttribs),this._newAttributes=new Array(this._caps.maxVertexAttribs);for(var n=0;n<this._caps.maxVertexAttribs;++n)this._enabledAttributes[n]=0,this._newAttributes[n]=0}var e,i,n=t.prototype;return n._initExtensions=function(t){for(var e=this._gl,i=0;i<t.length;++i)for(var n=t[i],r=["","WEBKIT_","MOZ_"],a=0;a<r.length;a++)try{var s=e.getExtension(r[a]+n);if(s){this._extensions[n]=s;break}}catch(o){console.error(o)}},n._initCaps=function(){var t=this._gl,e=this.ext("WEBGL_draw_buffers");this._caps.maxVertexStreams=4,this._caps.maxVertexTextures=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._caps.maxFragUniforms=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),this._caps.maxTextureUnits=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this._caps.maxVertexAttribs=t.getParameter(t.MAX_VERTEX_ATTRIBS),this._caps.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this._caps.maxDrawBuffers=e?t.getParameter(e.MAX_DRAW_BUFFERS_WEBGL):1,this._caps.maxColorAttachments=e?t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL):1},n._initStates=function(){var t=this._gl;t.disable(t.BLEND),t.blendFunc(t.ONE,t.ZERO),t.blendEquation(t.FUNC_ADD),t.blendColor(1,1,1,1),t.colorMask(!0,!0,!0,!0),t.enable(t.CULL_FACE),t.cullFace(t.BACK),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.disable(t.POLYGON_OFFSET_FILL),t.depthRange(0,1),t.disable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,0,255),t.stencilMask(255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearDepth(1),t.clearColor(0,0,0,0),t.clearStencil(0),t.disable(t.SCISSOR_TEST)},n._restoreTexture=function(t){var e=this._gl,i=this._current.textureUnits[t];i&&-1!==i._glID?e.bindTexture(i._target,i._glID):e.bindTexture(e.TEXTURE_2D,null)},n._restoreIndexBuffer=function(){var t=this._gl,e=this._current.indexBuffer;e&&-1!==e._glID?t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e._glID):t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)},n.ext=function(t){return this._extensions[t]},n.allowFloatTexture=function(){return null!=this.ext("OES_texture_float")},n.setFrameBuffer=function(t){if(this._framebuffer!==t){this._framebuffer=t;var e=this._gl;if(t){e.bindFramebuffer(e.FRAMEBUFFER,t._glID);for(var i=t._colors.length,n=0;n<i;++n){var r=t._colors[n];T(e,e.COLOR_ATTACHMENT0+n,r)}for(var a=i;a<this._caps.maxColorAttachments;++a)e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+a,e.TEXTURE_2D,null,0);t._depth&&T(e,e.DEPTH_ATTACHMENT,t._depth),t._stencil&&T(e,e.STENCIL_ATTACHMENT,t._stencil),t._depthStencil&&T(e,e.DEPTH_STENCIL_ATTACHMENT,t._depthStencil)}else e.bindFramebuffer(e.FRAMEBUFFER,null)}},n.setViewport=function(t,e,i,n){this._vx===t&&this._vy===e&&this._vw===i&&this._vh===n||(this._gl.viewport(t,e,i,n),this._vx=t,this._vy=e,this._vw=i,this._vh=n)},n.setScissor=function(t,e,i,n){this._sx===t&&this._sy===e&&this._sw===i&&this._sh===n||(this._gl.scissor(t,e,i,n),this._sx=t,this._sy=e,this._sw=i,this._sh=n)},n.clear=function(t){if(void 0!==t.color||void 0!==t.depth||void 0!==t.stencil){var e=this._gl,i=0;void 0!==t.color&&(i|=e.COLOR_BUFFER_BIT,e.clearColor(t.color[0],t.color[1],t.color[2],t.color[3])),void 0!==t.depth&&(i|=e.DEPTH_BUFFER_BIT,e.clearDepth(t.depth),e.enable(e.DEPTH_TEST),e.depthMask(!0),e.depthFunc(e.ALWAYS)),void 0!==t.stencil&&(i|=e.STENCIL_BUFFER_BIT,e.clearStencil(t.stencil)),e.clear(i),void 0!==t.depth&&(!1===this._current.depthTest?e.disable(e.DEPTH_TEST):(!1===this._current.depthWrite&&e.depthMask(!1),this._current.depthFunc!==s.enums.DS_FUNC_ALWAYS&&e.depthFunc(this._current.depthFunc)))}},n.enableBlend=function(){this._next.blend=!0},n.enableDepthTest=function(){this._next.depthTest=!0},n.enableDepthWrite=function(){this._next.depthWrite=!0},n.setStencilTest=function(t){this._next.stencilTest=t},n.setStencilFunc=function(t,e,i){this._next.stencilSep=!1,this._next.stencilFuncFront=this._next.stencilFuncBack=t,this._next.stencilRefFront=this._next.stencilRefBack=e,this._next.stencilMaskFront=this._next.stencilMaskBack=i},n.setStencilFuncFront=function(t,e,i){this._next.stencilSep=!0,this._next.stencilFuncFront=t,this._next.stencilRefFront=e,this._next.stencilMaskFront=i},n.setStencilFuncBack=function(t,e,i){this._next.stencilSep=!0,this._next.stencilFuncBack=t,this._next.stencilRefBack=e,this._next.stencilMaskBack=i},n.setStencilOp=function(t,e,i,n){this._next.stencilFailOpFront=this._next.stencilFailOpBack=t,this._next.stencilZFailOpFront=this._next.stencilZFailOpBack=e,this._next.stencilZPassOpFront=this._next.stencilZPassOpBack=i,this._next.stencilWriteMaskFront=this._next.stencilWriteMaskBack=n},n.setStencilOpFront=function(t,e,i,n){this._next.stencilSep=!0,this._next.stencilFailOpFront=t,this._next.stencilZFailOpFront=e,this._next.stencilZPassOpFront=i,this._next.stencilWriteMaskFront=n},n.setStencilOpBack=function(t,e,i,n){this._next.stencilSep=!0,this._next.stencilFailOpBack=t,this._next.stencilZFailOpBack=e,this._next.stencilZPassOpBack=i,this._next.stencilWriteMaskBack=n},n.setDepthFunc=function(t){this._next.depthFunc=t},n.setBlendColor32=function(t){this._next.blendColor=t},n.setBlendColor=function(t,e,i,n){this._next.blendColor=(255*t<<24|255*e<<16|255*i<<8|255*n)>>>0},n.setBlendFunc=function(t,e){this._next.blendSep=!1,this._next.blendSrc=t,this._next.blendDst=e},n.setBlendFuncSep=function(t,e,i,n){this._next.blendSep=!0,this._next.blendSrc=t,this._next.blendDst=e,this._next.blendSrcAlpha=i,this._next.blendDstAlpha=n},n.setBlendEq=function(t){this._next.blendSep=!1,this._next.blendEq=t},n.setBlendEqSep=function(t,e){this._next.blendSep=!0,this._next.blendEq=t,this._next.blendAlphaEq=e},n.setCullMode=function(t){this._next.cullMode=t},n.setVertexBuffer=function(t,e,i){void 0===i&&(i=0),this._next.vertexBuffers[t]=e,this._next.vertexBufferOffsets[t]=i,this._next.maxStream<t&&(this._next.maxStream=t)},n.setIndexBuffer=function(t){this._next.indexBuffer=t},n.setProgram=function(t){this._next.program=t},n.setTexture=function(t,e,i){i>=this._caps.maxTextureUnits?console.warn("Can not set texture "+t+" at stage "+i+", max texture exceed: "+this._caps.maxTextureUnits):(this._next.textureUnits[i]=e,this.setUniform(t,i),this._next.maxTextureSlot<i&&(this._next.maxTextureSlot=i))},n.setTextureArray=function(t,e,i){var n=e.length;if(n>=this._caps.maxTextureUnits)console.warn("Can not set "+n+" textures for "+t+", max texture exceed: "+this._caps.maxTextureUnits);else{for(var r=0;r<n;++r){var a=i[r];this._next.textureUnits[a]=e[r],this._next.maxTextureSlot<a&&(this._next.maxTextureSlot=a)}this.setUniform(t,i)}},n.setUniform=function(t,e){var i=this._uniforms[t],n=!1,r=!1,a=!1,s=!1;do{if(!i)break;if(a=Array.isArray(e)||e instanceof Float32Array,s=e instanceof Int32Array,r=a||s,i.isArray!==r)break;if(i.isArray&&i.value.length!==e.length)break;n=!0}while(0);if(n){var o=i.value,c=!1;if(i.isArray)for(var l=0,h=o.length;l<h;l++)o[l]!==e[l]&&(c=!0,o[l]=e[l]);else o!==e&&(c=!0,i.value=e);c&&(i.dirty=!0)}else{var u=e;a?u=new Float32Array(e):s&&(u=new Int32Array(e)),i={dirty:!0,value:u,isArray:r}}this._uniforms[t]=i},n.setUniformDirectly=function(t,e){var i=this._uniforms[t];i||(this._uniforms[t]=i={}),i.dirty=!0,i.value=e},n.setPrimitiveType=function(t){this._next.primitiveType=t},n.resetDrawCalls=function(){this._stats.drawcalls=0},n.getDrawCalls=function(){return this._stats.drawcalls},n.draw=function(t,e){var i=this._gl,n=this._current,r=this._next;d(i,n,r),p(i,n,r),m(i,n,r),v(i,n,r),g(this,i,n,r),n.indexBuffer!==r.indexBuffer&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.indexBuffer&&-1!==r.indexBuffer._glID?r.indexBuffer._glID:null);var a=!1;n.program!==r.program&&(r.program._linked?i.useProgram(r.program._glID):console.warn("Failed to use program: has not linked yet."),a=!0),y(i,n,r);for(var s=0;s<r.program._uniforms.length;++s){var o=r.program._uniforms[s],c=this._uniforms[o.name];if(c&&(a||c.dirty)){c.dirty=!1;var l=void 0===o.size?f[o.type]:_[o.type];l?l(i,o.location,c.value):console.warn("Can not find commit function for uniform "+o.name)}}e&&(r.indexBuffer?i.drawElements(this._next.primitiveType,e,r.indexBuffer._format,t*r.indexBuffer._bytesPerIndex):i.drawArrays(this._next.primitiveType,t,e),this._stats.drawcalls++),n.set(r),r.reset()},e=t,(i=[{key:"caps",get:function(){return this._caps}}])&&h(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=A,e.exports=i.default}),{"./enums":287,"./state":294,"./texture-2d":295,"./texture-cube":296}],287:[(function(t,e,i){"use strict";i.__esModule=!0,i.attrTypeBytes=function(t){return t===a.ATTR_TYPE_INT8?1:t===a.ATTR_TYPE_UINT8?1:t===a.ATTR_TYPE_INT16?2:t===a.ATTR_TYPE_UINT16?2:t===a.ATTR_TYPE_INT32?4:t===a.ATTR_TYPE_UINT32?4:t===a.ATTR_TYPE_FLOAT32?4:(console.warn("Unknown ATTR_TYPE: "+t),0)},i.enums=void 0,i.glFilter=function(t,e,i){void 0===i&&(i=-1);var r=n[e][i+1];return void 0===r?(console.warn("Unknown FILTER: "+e),-1===i?t.LINEAR:t.LINEAR_MIPMAP_LINEAR):r},i.glTextureFmt=function(t){var e=r[t];return void 0===e?(console.warn("Unknown TEXTURE_FMT: "+t),r[a.TEXTURE_FMT_RGBA8]):e};var n=[[9728,9984,9986],[9729,9985,9987]],r=[{format:6407,internalFormat:33776,pixelType:null},{format:6408,internalFormat:33777,pixelType:null},{format:6408,internalFormat:33778,pixelType:null},{format:6408,internalFormat:33779,pixelType:null},{format:6407,internalFormat:36196,pixelType:null},{format:6407,internalFormat:35841,pixelType:null},{format:6408,internalFormat:35843,pixelType:null},{format:6407,internalFormat:35840,pixelType:null},{format:6408,internalFormat:35842,pixelType:null},{format:6406,internalFormat:6406,pixelType:5121},{format:6409,internalFormat:6409,pixelType:5121},{format:6410,internalFormat:6410,pixelType:5121},{format:6407,internalFormat:6407,pixelType:33635},{format:6408,internalFormat:6408,pixelType:32820},{format:6408,internalFormat:6408,pixelType:32819},{format:6407,internalFormat:6407,pixelType:5121},{format:6408,internalFormat:6408,pixelType:5121},{format:6407,internalFormat:6407,pixelType:36193},{format:6408,internalFormat:6408,pixelType:36193},{format:6407,internalFormat:6407,pixelType:5126},{format:6408,internalFormat:6408,pixelType:5126},{format:null,internalFormat:null,pixelType:null},{format:null,internalFormat:null,pixelType:null},{format:null,internalFormat:null,pixelType:null},{format:null,internalFormat:null,pixelType:null},{format:6402,internalFormat:6402,pixelType:5123},{format:6402,internalFormat:6402,pixelType:5125},{format:6402,internalFormat:6402,pixelType:5125},{format:6407,internalFormat:37492,pixelType:null},{format:6408,internalFormat:37496,pixelType:null},{format:6408,internalFormat:37808,pixelType:null},{format:6408,internalFormat:37809,pixelType:null},{format:6408,internalFormat:37810,pixelType:null},{format:6408,internalFormat:37811,pixelType:null},{format:6408,internalFormat:37812,pixelType:null},{format:6408,internalFormat:37813,pixelType:null},{format:6408,internalFormat:37814,pixelType:null},{format:6408,internalFormat:37815,pixelType:null},{format:6408,internalFormat:37816,pixelType:null},{format:6408,internalFormat:37817,pixelType:null},{format:6408,internalFormat:37818,pixelType:null},{format:6408,internalFormat:37819,pixelType:null},{format:6408,internalFormat:37820,pixelType:null},{format:6408,internalFormat:37821,pixelType:null},{format:6408,internalFormat:37840,pixelType:null},{format:6408,internalFormat:37841,pixelType:null},{format:6408,internalFormat:37842,pixelType:null},{format:6408,internalFormat:37843,pixelType:null},{format:6408,internalFormat:37844,pixelType:null},{format:6408,internalFormat:37845,pixelType:null},{format:6408,internalFormat:37846,pixelType:null},{format:6408,internalFormat:37847,pixelType:null},{format:6408,internalFormat:37848,pixelType:null},{format:6408,internalFormat:37849,pixelType:null},{format:6408,internalFormat:37850,pixelType:null},{format:6408,internalFormat:37851,pixelType:null},{format:6408,internalFormat:37852,pixelType:null},{format:6408,internalFormat:37853,pixelType:null}],a={USAGE_STATIC:35044,USAGE_DYNAMIC:35048,USAGE_STREAM:35040,INDEX_FMT_UINT8:5121,INDEX_FMT_UINT16:5123,INDEX_FMT_UINT32:5125,ATTR_POSITION:"a_position",ATTR_NORMAL:"a_normal",ATTR_TANGENT:"a_tangent",ATTR_BITANGENT:"a_bitangent",ATTR_WEIGHTS:"a_weights",ATTR_JOINTS:"a_joints",ATTR_COLOR:"a_color",ATTR_COLOR0:"a_color0",ATTR_COLOR1:"a_color1",ATTR_UV:"a_uv",ATTR_UV0:"a_uv0",ATTR_UV1:"a_uv1",ATTR_UV2:"a_uv2",ATTR_UV3:"a_uv3",ATTR_UV4:"a_uv4",ATTR_UV5:"a_uv5",ATTR_UV6:"a_uv6",ATTR_UV7:"a_uv7",ATTR_TEX_COORD:"a_texCoord",ATTR_TEX_COORD1:"a_texCoord1",ATTR_TEX_COORD2:"a_texCoord2",ATTR_TEX_COORD3:"a_texCoord3",ATTR_TEX_COORD4:"a_texCoord4",ATTR_TEX_COORD5:"a_texCoord5",ATTR_TEX_COORD6:"a_texCoord6",ATTR_TEX_COORD7:"a_texCoord7",ATTR_TEX_COORD8:"a_texCoord8",ATTR_TYPE_INT8:5120,ATTR_TYPE_UINT8:5121,ATTR_TYPE_INT16:5122,ATTR_TYPE_UINT16:5123,ATTR_TYPE_INT32:5124,ATTR_TYPE_UINT32:5125,ATTR_TYPE_FLOAT32:5126,FILTER_NEAREST:0,FILTER_LINEAR:1,WRAP_REPEAT:10497,WRAP_CLAMP:33071,WRAP_MIRROR:33648,TEXTURE_FMT_RGB_DXT1:0,TEXTURE_FMT_RGBA_DXT1:1,TEXTURE_FMT_RGBA_DXT3:2,TEXTURE_FMT_RGBA_DXT5:3,TEXTURE_FMT_RGB_ETC1:4,TEXTURE_FMT_RGB_PVRTC_2BPPV1:5,TEXTURE_FMT_RGBA_PVRTC_2BPPV1:6,TEXTURE_FMT_RGB_PVRTC_4BPPV1:7,TEXTURE_FMT_RGBA_PVRTC_4BPPV1:8,TEXTURE_FMT_A8:9,TEXTURE_FMT_L8:10,TEXTURE_FMT_L8_A8:11,TEXTURE_FMT_R5_G6_B5:12,TEXTURE_FMT_R5_G5_B5_A1:13,TEXTURE_FMT_R4_G4_B4_A4:14,TEXTURE_FMT_RGB8:15,TEXTURE_FMT_RGBA8:16,TEXTURE_FMT_RGB16F:17,TEXTURE_FMT_RGBA16F:18,TEXTURE_FMT_RGB32F:19,TEXTURE_FMT_RGBA32F:20,TEXTURE_FMT_R32F:21,TEXTURE_FMT_111110F:22,TEXTURE_FMT_SRGB:23,TEXTURE_FMT_SRGBA:24,TEXTURE_FMT_D16:25,TEXTURE_FMT_D32:26,TEXTURE_FMT_D24S8:27,TEXTURE_FMT_RGB_ETC2:28,TEXTURE_FMT_RGBA_ETC2:29,TEXTURE_FMT_RGBA_ASTC_4X4:30,TEXTURE_FMT_RGBA_ASTC_5X4:31,TEXTURE_FMT_RGBA_ASTC_5X5:32,TEXTURE_FMT_RGBA_ASTC_6X5:33,TEXTURE_FMT_RGBA_ASTC_6X6:34,TEXTURE_FMT_RGBA_ASTC_8X5:35,TEXTURE_FMT_RGBA_ASTC_8X6:36,TEXTURE_FMT_RGBA_ASTC_8X8:37,TEXTURE_FMT_RGBA_ASTC_10X5:38,TEXTURE_FMT_RGBA_ASTC_10X6:39,TEXTURE_FMT_RGBA_ASTC_10X8:40,TEXTURE_FMT_RGBA_ASTC_10X10:41,TEXTURE_FMT_RGBA_ASTC_12X10:42,TEXTURE_FMT_RGBA_ASTC_12X12:43,TEXTURE_FMT_SRGBA_ASTC_4X4:44,TEXTURE_FMT_SRGBA_ASTC_5X4:45,TEXTURE_FMT_SRGBA_ASTC_5X5:46,TEXTURE_FMT_SRGBA_ASTC_6X5:47,TEXTURE_FMT_SRGBA_ASTC_6X6:48,TEXTURE_FMT_SRGBA_ASTC_8X5:49,TEXTURE_FMT_SRGBA_ASTC_8X6:50,TEXTURE_FMT_SRGBA_ASTC_8X8:51,TEXTURE_FMT_SRGBA_ASTC_10X5:52,TEXTURE_FMT_SRGBA_ASTC_10X6:53,TEXTURE_FMT_SRGBA_ASTC_10X8:54,TEXTURE_FMT_SRGBA_ASTC_10X10:55,TEXTURE_FMT_SRGBA_ASTC_12X10:56,TEXTURE_FMT_SRGBA_ASTC_12X12:57,DS_FUNC_NEVER:512,DS_FUNC_LESS:513,DS_FUNC_EQUAL:514,DS_FUNC_LEQUAL:515,DS_FUNC_GREATER:516,DS_FUNC_NOTEQUAL:517,DS_FUNC_GEQUAL:518,DS_FUNC_ALWAYS:519,RB_FMT_RGBA4:32854,RB_FMT_RGB5_A1:32855,RB_FMT_RGB565:36194,RB_FMT_D16:33189,RB_FMT_S8:36168,RB_FMT_D24S8:34041,BLEND_FUNC_ADD:32774,BLEND_FUNC_SUBTRACT:32778,BLEND_FUNC_REVERSE_SUBTRACT:32779,BLEND_ZERO:0,BLEND_ONE:1,BLEND_SRC_COLOR:768,BLEND_ONE_MINUS_SRC_COLOR:769,BLEND_DST_COLOR:774,BLEND_ONE_MINUS_DST_COLOR:775,BLEND_SRC_ALPHA:770,BLEND_ONE_MINUS_SRC_ALPHA:771,BLEND_DST_ALPHA:772,BLEND_ONE_MINUS_DST_ALPHA:773,BLEND_CONSTANT_COLOR:32769,BLEND_ONE_MINUS_CONSTANT_COLOR:32770,BLEND_CONSTANT_ALPHA:32771,BLEND_ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_SRC_ALPHA_SATURATE:776,STENCIL_DISABLE:0,STENCIL_ENABLE:1,STENCIL_INHERIT:2,STENCIL_OP_KEEP:7680,STENCIL_OP_ZERO:0,STENCIL_OP_REPLACE:7681,STENCIL_OP_INCR:7682,STENCIL_OP_INCR_WRAP:34055,STENCIL_OP_DECR:7683,STENCIL_OP_DECR_WRAP:34056,STENCIL_OP_INVERT:5386,CULL_NONE:0,CULL_FRONT:1028,CULL_BACK:1029,CULL_FRONT_AND_BACK:1032,PT_POINTS:0,PT_LINES:1,PT_LINE_LOOP:2,PT_LINE_STRIP:3,PT_TRIANGLES:4,PT_TRIANGLE_STRIP:5,PT_TRIANGLE_FAN:6};i.enums=a}),{}],288:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(t,e,i,n){this._device=t,this._width=e,this._height=i,this._colors=n.colors||[],this._depth=n.depth||null,this._stencil=n.stencil||null,this._depthStencil=n.depthStencil||null,this._glID=t._gl.createFramebuffer()}var e=t.prototype;return e.destroy=function(){null!==this._glID?(this._device._gl.deleteFramebuffer(this._glID),this._glID=null):console.error("The frame-buffer already destroyed")},e.getHandle=function(){return this._glID},t})();i.default=n,e.exports=i.default}),{}],289:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./enums");function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=s(n.key,"string"))?r:String(r)),n)}var r}function s(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var o=((n={})[r.enums.INDEX_FMT_UINT8]=1,n[r.enums.INDEX_FMT_UINT16]=2,n[r.enums.INDEX_FMT_UINT32]=4,n),c=(function(){function t(t,e,i,n){this._device=t,this._format=e,this._usage=i,this._bytesPerIndex=o[e],this._bytes=n.byteLength,this._numIndices=this._bytes/this._bytesPerIndex,this._needExpandDataStore=!0,this._glID=t._gl.createBuffer(),this.update(0,n),t._stats.ib+=this._bytes}var e,i,n=t.prototype;return n.destroy=function(){-1!==this._glID?(this._device._gl.deleteBuffer(this._glID),this._device._stats.ib-=this.bytes,this._glID=-1):console.error("The buffer already destroyed")},n.update=function(t,e){if(-1!==this._glID){if(0!==e.byteLength){if(t+e.byteLength>this._bytes){if(t)return void console.error("Failed to update data, bytes exceed.");this._needExpandDataStore=!0,this._bytes=t+e.byteLength,this._numIndices=this._bytes/this._bytesPerIndex}var i=this._device._gl,n=this._usage;i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this._glID),this._needExpandDataStore?(i.bufferData(i.ELEMENT_ARRAY_BUFFER,e,n),this._needExpandDataStore=!1):i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,t,e),this._device._restoreIndexBuffer()}}else console.error("The buffer is destroyed")},n.setUsage=function(t){this._usage=t},e=t,(i=[{key:"count",get:function(){return this._numIndices}}])&&a(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();c.BYTES_PER_INDEX=o;var l=c;i.default=l,e.exports=i.default}),{"./enums":287}],290:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./enums");n={VertexFormat:t("./vertex-format"),IndexBuffer:t("./index-buffer"),VertexBuffer:t("./vertex-buffer"),Program:t("./program"),Texture:t("./texture"),Texture2D:t("./texture-2d"),TextureCube:t("./texture-cube"),RenderBuffer:t("./render-buffer"),FrameBuffer:t("./frame-buffer"),Device:t("./device"),attrTypeBytes:r.attrTypeBytes,glFilter:r.glFilter,glTextureFmt:r.glTextureFmt},Object.assign(n,r.enums);var a=n;i.default=a,cc.gfx=n,e.exports=i.default}),{"./device":286,"./enums":287,"./frame-buffer":288,"./index-buffer":289,"./program":292,"./render-buffer":293,"./texture":297,"./texture-2d":295,"./texture-cube":296,"./vertex-buffer":298,"./vertex-format":299}],291:[(function(t,e,i){"use strict";i.__esModule=!0,i.isPow2=function(t){return!(t&t-1||!t)}}),{}],292:[(function(t,e,i){"use strict";function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(a=r(n.key,"string"))?a:String(a)),n)}var a}function r(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}i.__esModule=!0,i.default=void 0;var a=0;function s(t,e,i){i&&i.split("\n").forEach((function(i){if(!(i.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(i);n?t.push({type:e,fileID:0|n[1],line:0|n[2],message:n[3].trim()}):i.length>0&&t.push({type:e,fileID:-1,line:0,message:i})}}))}var o=(function(){function t(t,e){this._device=t,this._attributes=[],this._uniforms=[],this._samplers=[],this._errors=[],this._linked=!1,this._vertSource=e.vert,this._fragSource=e.frag,this._glID=null,this._id=a++}var e,i,r=t.prototype;return r.link=function(){if(!this._linked){var t=this._device._gl,e=c(t,t.VERTEX_SHADER,this._vertSource),i=c(t,t.FRAGMENT_SHADER,this._fragSource),n=t.createProgram();t.attachShader(n,e),t.attachShader(n,i),t.linkProgram(n);var r=!1,a=this._errors;if(t.getShaderParameter(e,t.COMPILE_STATUS)||(s(a,"vs",t.getShaderInfoLog(e)),r=!0),t.getShaderParameter(i,t.COMPILE_STATUS)||(s(a,"fs",t.getShaderInfoLog(i)),r=!0),t.deleteShader(e),t.deleteShader(i),r)return a;if(!t.getProgramParameter(n,t.LINK_STATUS))return a.push({info:"Failed to link shader program: "+t.getProgramInfoLog(n)}),a;this._glID=n;for(var o=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),l=0;l<o;++l){var h=t.getActiveAttrib(n,l),u=t.getAttribLocation(n,h.name);this._attributes.push({name:h.name,location:u,type:h.type})}for(var f=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),_=0;_<f;++_){var d=t.getActiveUniform(n,_),p=d.name,m=t.getUniformLocation(n,p),v="[0]"===p.substr(p.length-3);v&&(p=p.substr(0,p.length-3));var g={name:p,location:m,type:d.type,size:v?d.size:void 0};this._uniforms.push(g)}this._linked=!0}},r.destroy=function(){this._device._gl.deleteProgram(this._glID),this._linked=!1,this._glID=null,this._attributes=[],this._uniforms=[],this._samplers=[]},e=t,(i=[{key:"id",get:function(){return this._id}}])&&n(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();function c(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}i.default=o,e.exports=i.default}),{}],293:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(t,e,i,n){this._device=t,this._format=e,this._glID=t._gl.createRenderbuffer(),this.update(i,n)}var e=t.prototype;return e.update=function(t,e){this._width=t,this._height=e;var i=this._device._gl;i.bindRenderbuffer(i.RENDERBUFFER,this._glID),i.renderbufferStorage(i.RENDERBUFFER,this._format,t,e),i.bindRenderbuffer(i.RENDERBUFFER,null)},e.destroy=function(){if(null!==this._glID){var t=this._device._gl;t.bindRenderbuffer(t.RENDERBUFFER,null),t.deleteRenderbuffer(this._glID),this._glID=null}else console.error("The render-buffer already destroyed")},t})();i.default=n,e.exports=i.default}),{}],294:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("./enums"),r={blend:!1,blendSep:!1,blendColor:4294967295,blendEq:n.enums.BLEND_FUNC_ADD,blendAlphaEq:n.enums.BLEND_FUNC_ADD,blendSrc:n.enums.BLEND_ONE,blendDst:n.enums.BLEND_ZERO,blendSrcAlpha:n.enums.BLEND_ONE,blendDstAlpha:n.enums.BLEND_ZERO,depthTest:!1,depthWrite:!1,depthFunc:n.enums.DS_FUNC_LESS,stencilTest:!1,stencilSep:!1,stencilFuncFront:n.enums.DS_FUNC_ALWAYS,stencilRefFront:0,stencilMaskFront:255,stencilFailOpFront:n.enums.STENCIL_OP_KEEP,stencilZFailOpFront:n.enums.STENCIL_OP_KEEP,stencilZPassOpFront:n.enums.STENCIL_OP_KEEP,stencilWriteMaskFront:255,stencilFuncBack:n.enums.DS_FUNC_ALWAYS,stencilRefBack:0,stencilMaskBack:255,stencilFailOpBack:n.enums.STENCIL_OP_KEEP,stencilZFailOpBack:n.enums.STENCIL_OP_KEEP,stencilZPassOpBack:n.enums.STENCIL_OP_KEEP,stencilWriteMaskBack:255,cullMode:n.enums.CULL_BACK,primitiveType:n.enums.PT_TRIANGLES,maxStream:-1,vertexBuffers:[],vertexBufferOffsets:[],indexBuffer:null,maxTextureSlot:-1,textureUnits:[],program:null},a=(function(){function t(t){this.vertexBuffers=new Array(t._caps.maxVertexStreams),this.vertexBufferOffsets=new Array(t._caps.maxVertexStreams),this.textureUnits=new Array(t._caps.maxTextureUnits),this.set(r)}t.initDefault=function(t){r.vertexBuffers=new Array(t._caps.maxVertexStreams),r.vertexBufferOffsets=new Array(t._caps.maxVertexStreams),r.textureUnits=new Array(t._caps.maxTextureUnits)};var e=t.prototype;return e.reset=function(){this.set(r)},e.set=function(t){this.blend=t.blend,this.blendSep=t.blendSep,this.blendColor=t.blendColor,this.blendEq=t.blendEq,this.blendAlphaEq=t.blendAlphaEq,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.depthFunc=t.depthFunc,this.stencilTest=t.stencilTest,this.stencilSep=t.stencilSep,this.stencilFuncFront=t.stencilFuncFront,this.stencilRefFront=t.stencilRefFront,this.stencilMaskFront=t.stencilMaskFront,this.stencilFailOpFront=t.stencilFailOpFront,this.stencilZFailOpFront=t.stencilZFailOpFront,this.stencilZPassOpFront=t.stencilZPassOpFront,this.stencilWriteMaskFront=t.stencilWriteMaskFront,this.stencilFuncBack=t.stencilFuncBack,this.stencilRefBack=t.stencilRefBack,this.stencilMaskBack=t.stencilMaskBack,this.stencilFailOpBack=t.stencilFailOpBack,this.stencilZFailOpBack=t.stencilZFailOpBack,this.stencilZPassOpBack=t.stencilZPassOpBack,this.stencilWriteMaskBack=t.stencilWriteMaskBack,this.cullMode=t.cullMode,this.primitiveType=t.primitiveType,this.maxStream=t.maxStream;for(var e=0;e<t.vertexBuffers.length;++e)this.vertexBuffers[e]=t.vertexBuffers[e];for(var i=0;i<t.vertexBufferOffsets.length;++i)this.vertexBufferOffsets[i]=t.vertexBufferOffsets[i];this.indexBuffer=t.indexBuffer,this.maxTextureSlot=t.maxTextureSlot;for(var n=0;n<t.textureUnits.length;++n)this.textureUnits[n]=t.textureUnits[n];this.program=t.program},t})();i.default=a,e.exports=i.default}),{"./enums":287}],295:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./texture"))&&n.__esModule?n:{default:n},a=t("./enums"),s=t("./misc");function o(t,e){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var c=(function(t){var e,i;function n(e,i){var n,r=(n=t.call(this,e)||this)._device._gl;return n._target=r.TEXTURE_2D,n._glID=r.createTexture(),i.images=i.images||[null],n.update(i),n}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,o(e,i);var r=n.prototype;return r.update=function(t){var e=this._device._gl,i=this._genMipmap;if(t){void 0!==t.width&&(this._width=t.width),void 0!==t.height&&(this._height=t.height),void 0!==t.anisotropy&&(this._anisotropy=t.anisotropy),void 0!==t.minFilter&&(this._minFilter=t.minFilter),void 0!==t.magFilter&&(this._magFilter=t.magFilter),void 0!==t.mipFilter&&(this._mipFilter=t.mipFilter),void 0!==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!==t.format&&(this._format=t.format,this._compressed=this._format>=a.enums.TEXTURE_FMT_RGB_DXT1&&this._format<=a.enums.TEXTURE_FMT_RGBA_PVRTC_4BPPV1||this._format>=a.enums.TEXTURE_FMT_RGB_ETC2&&this._format<=a.enums.TEXTURE_FMT_RGBA_ETC2||this._format>=a.enums.TEXTURE_FMT_RGBA_ASTC_4X4&&this._format<=a.enums.TEXTURE_FMT_SRGBA_ASTC_12X12),void 0!==t.genMipmaps&&(this._genMipmap=t.genMipmaps,i=t.genMipmaps);var n=this._device.caps.maxTextureSize||Number.MAX_VALUE,r=Math.max(t.width||0,t.height||0);n<r&&console.warn("The current texture size "+r+" exceeds the maximum size ["+n+"] supported on the device."),void 0!==t.images&&t.images.length>1&&(i=!1,(t.width>t.height?t.width:t.height)>>t.images.length-1!=1&&console.error("texture-2d mipmap is invalid, should have a 1x1 mipmap."))}(0,s.isPow2)(this._width)&&(0,s.isPow2)(this._height)||(i=!1),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._glID),void 0!==t.images&&t.images.length>0&&(this._setMipmap(t.images,t.flipY,t.premultiplyAlpha),t.images.length>1&&(this._genMipmap=!0)),i&&(e.hint(e.GENERATE_MIPMAP_HINT,e.NICEST),e.generateMipmap(e.TEXTURE_2D),this._genMipmap=!0),this._setTexInfo(),this._device._restoreTexture(0)},r.updateSubImage=function(t){var e=this._device._gl,i=(0,a.glTextureFmt)(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._glID),this._setSubImage(i,t),this._device._restoreTexture(0)},r.updateImage=function(t){var e=this._device._gl,i=(0,a.glTextureFmt)(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._glID),this._setImage(i,t),this._device._restoreTexture(0)},r._setSubImage=function(t,e){var i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,a=e.image;!a||ArrayBuffer.isView(a)||a instanceof ArrayBuffer?(void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),this._compressed?i.compressedTexSubImage2D(i.TEXTURE_2D,e.level,e.x,e.y,e.width,e.height,t.format,a):i.texSubImage2D(i.TEXTURE_2D,e.level,e.x,e.y,e.width,e.height,t.format,t.pixelType,a)):(void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),i.texSubImage2D(i.TEXTURE_2D,e.level,e.x,e.y,t.format,t.pixelType,a))},r._setImage=function(t,e){var i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,a=e.image;!a||ArrayBuffer.isView(a)||a instanceof ArrayBuffer?(void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),this._compressed?i.compressedTexImage2D(i.TEXTURE_2D,e.level,t.internalFormat,e.width,e.height,0,a):i.texImage2D(i.TEXTURE_2D,e.level,t.internalFormat,e.width,e.height,0,t.format,t.pixelType,a)):(void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),i.texImage2D(i.TEXTURE_2D,e.level,t.internalFormat,t.format,t.pixelType,a))},r._setMipmap=function(t,e,i){for(var n=(0,a.glTextureFmt)(this._format),r={width:this._width,height:this._height,flipY:e,premultiplyAlpha:i,level:0,image:null},s=0;s<t.length;++s)r.level=s,r.width=this._width>>s,r.height=this._height>>s,r.image=t[s],this._setImage(n,r)},r._setTexInfo=function(){var t=this._device._gl,e=(0,s.isPow2)(this._width)&&(0,s.isPow2)(this._height);e||this._wrapS===a.enums.WRAP_CLAMP&&this._wrapT===a.enums.WRAP_CLAMP||(console.warn("WebGL1 doesn't support all wrap modes with NPOT textures"),this._wrapS=a.enums.WRAP_CLAMP,this._wrapT=a.enums.WRAP_CLAMP);var i=this._genMipmap?this._mipFilter:-1;e||-1===i||(console.warn("NPOT textures do not support mipmap filter"),i=-1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,(0,a.glFilter)(t,this._minFilter,i)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,(0,a.glFilter)(t,this._magFilter,-1)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this._wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this._wrapT);var n=this._device.ext("EXT_texture_filter_anisotropic");n&&t.texParameteri(t.TEXTURE_2D,n.TEXTURE_MAX_ANISOTROPY_EXT,this._anisotropy)},n})(r.default);i.default=c,e.exports=i.default}),{"./enums":287,"./misc":291,"./texture":297}],296:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./texture"))&&n.__esModule?n:{default:n},a=t("./enums"),s=t("./misc");function o(t,e){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var c=(function(t){var e,i;function n(e,i){var n,r=(n=t.call(this,e)||this)._device._gl;return n._target=r.TEXTURE_CUBE_MAP,n._glID=r.createTexture(),n.update(i),n}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,o(e,i);var r=n.prototype;return r.update=function(t){var e=this._device._gl,i=this._genMipmaps;t&&(void 0!==t.width&&(this._width=t.width),void 0!==t.height&&(this._height=t.height),void 0!==t.anisotropy&&(this._anisotropy=t.anisotropy),void 0!==t.minFilter&&(this._minFilter=t.minFilter),void 0!==t.magFilter&&(this._magFilter=t.magFilter),void 0!==t.mipFilter&&(this._mipFilter=t.mipFilter),void 0!==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!==t.format&&(this._format=t.format,this._compressed=this._format>=a.enums.TEXTURE_FMT_RGB_DXT1&&this._format<=a.enums.TEXTURE_FMT_RGBA_PVRTC_4BPPV1||this._format>=a.enums.TEXTURE_FMT_RGB_ETC2&&this._format<=a.enums.TEXTURE_FMT_RGBA_ETC2||this._format>=a.enums.TEXTURE_FMT_RGBA_ASTC_4X4&&this._format<=a.enums.TEXTURE_FMT_SRGBA_ASTC_12X12),void 0!==t.genMipmaps&&(this._genMipmaps=t.genMipmaps,i=t.genMipmaps),void 0!==t.images&&t.images.length>1&&(i=!1,t.width!==t.height&&console.warn("texture-cube width and height should be identical."),t.width>>t.images.length-1!=1&&console.error("texture-cube mipmap is invalid. please set mipmap as 1x1, 2x2, 4x4 ... nxn"))),(0,s.isPow2)(this._width)&&(0,s.isPow2)(this._height)||(i=!1),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this._glID),void 0!==t.images&&t.images.length>0&&(this._setMipmap(t.images,t.flipY,t.premultiplyAlpha),t.images.length>1&&(this._genMipmaps=!0)),i&&(e.hint(e.GENERATE_MIPMAP_HINT,e.NICEST),e.generateMipmap(e.TEXTURE_CUBE_MAP),this._genMipmaps=!0),this._setTexInfo(),this._device._restoreTexture(0)},r.updateSubImage=function(t){var e=this._device._gl,i=(0,a.glTextureFmt)(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this._glID),this._setSubImage(i,t),this._device._restoreTexture(0)},r.updateImage=function(t){var e=this._device._gl,i=(0,a.glTextureFmt)(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this._glID),this._setImage(i,t),this._device._restoreTexture(0)},r._setSubImage=function(t,e){var i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,a=e.faceIndex,s=e.image;void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),!s||ArrayBuffer.isView(s)||s instanceof ArrayBuffer?this._compressed?i.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+a,e.level,e.x,e.y,e.width,e.height,t.format,s):i.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+a,e.level,e.x,e.y,e.width,e.height,t.format,t.pixelType,s):i.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+a,e.level,e.x,e.y,t.format,t.pixelType,s)},r._setImage=function(t,e){var i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,a=e.faceIndex,s=e.image;void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),!s||ArrayBuffer.isView(s)||s instanceof ArrayBuffer?this._compressed?i.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+a,e.level,t.internalFormat,e.width,e.height,0,s):i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+a,e.level,t.internalFormat,e.width,e.height,0,t.format,t.pixelType,s):i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+a,e.level,t.internalFormat,t.format,t.pixelType,s)},r._setMipmap=function(t,e,i){for(var n=(0,a.glTextureFmt)(this._format),r={width:this._width,height:this._height,faceIndex:0,flipY:e,premultiplyAlpha:i,level:0,image:null},s=0;s<t.length;++s){var o=t[s];r.level=s,r.width=this._width>>s,r.height=this._height>>s;for(var c=0;c<6;++c)r.faceIndex=c,r.image=o[c],this._setImage(n,r)}},r._setTexInfo=function(){var t=this._device._gl,e=(0,s.isPow2)(this._width)&&(0,s.isPow2)(this._height);e||this._wrapS===a.enums.WRAP_CLAMP&&this._wrapT===a.enums.WRAP_CLAMP||(console.warn("WebGL1 doesn't support all wrap modes with NPOT textures"),this._wrapS=a.enums.WRAP_CLAMP,this._wrapT=a.enums.WRAP_CLAMP);var i=this._genMipmaps?this._mipFilter:-1;e||-1===i||(console.warn("NPOT textures do not support mipmap filter"),i=-1),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,(0,a.glFilter)(t,this._minFilter,i)),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,(0,a.glFilter)(t,this._magFilter,-1)),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this._wrapS),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this._wrapT);var n=this._device.ext("EXT_texture_filter_anisotropic");n&&t.texParameteri(t.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this._anisotropy)},n})(r.default);i.default=c,e.exports=i.default}),{"./enums":287,"./misc":291,"./texture":297}],297:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("./enums"),r=0,a=(function(){function t(t){this._device=t,this._width=4,this._height=4,this._genMipmaps=!1,this._compressed=!1,this._anisotropy=1,this._minFilter=n.enums.FILTER_LINEAR,this._magFilter=n.enums.FILTER_LINEAR,this._mipFilter=n.enums.FILTER_LINEAR,this._wrapS=n.enums.WRAP_REPEAT,this._wrapT=n.enums.WRAP_REPEAT,this._format=n.enums.TEXTURE_FMT_RGBA8,this._target=-1,this._id=r++}return t.prototype.destroy=function(){null!==this._glID?(this._device._gl.deleteTexture(this._glID),this._device._stats.tex-=this.bytes,this._glID=null):console.error("The texture already destroyed")},t})();i.default=a,e.exports=i.default}),{"./enums":287}],298:[(function(t,e,i){"use strict";function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(a=r(n.key,"string"))?a:String(a)),n)}var a}function r(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}i.__esModule=!0,i.default=void 0,t("./enums");var a=(function(){function t(t,e,i,n){this._device=t,this._format=e,this._usage=i,this._bytesPerVertex=this._format._bytes,this._bytes=n.byteLength,this._numVertices=this._bytes/this._bytesPerVertex,this._needExpandDataStore=!0,this._glID=t._gl.createBuffer(),this.update(0,n),t._stats.vb+=this._bytes}var e,i,r=t.prototype;return r.destroy=function(){-1!==this._glID?(this._device._gl.deleteBuffer(this._glID),this._device._stats.vb-=this.bytes,this._glID=-1):console.error("The buffer already destroyed")},r.update=function(t,e){if(-1!==this._glID){if(0!==e.byteLength){if(t+e.byteLength>this._bytes){if(t)return void console.error("Failed to update data, bytes exceed.");this._needExpandDataStore=!0,this._bytes=t+e.byteLength,this._numVertices=this._bytes/this._bytesPerVertex}var i=this._device._gl,n=this._usage;i.bindBuffer(i.ARRAY_BUFFER,this._glID),this._needExpandDataStore?(i.bufferData(i.ARRAY_BUFFER,e,n),this._needExpandDataStore=!1):i.bufferSubData(i.ARRAY_BUFFER,t,e),i.bindBuffer(i.ARRAY_BUFFER,null)}}else console.error("The buffer is destroyed")},r.getFormat=function(t){return this._format.element(t)},r.setUsage=function(t){this._usage=t},e=t,(i=[{key:"count",get:function(){return this._numVertices}}])&&n(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=a,e.exports=i.default}),{"./enums":287}],299:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./enums"),a=(n=t("../murmurhash2_gc"))&&n.__esModule?n:{default:n},s=(function(){function t(t){this._attr2el={},this._elements=[],this._bytes=0;for(var e="",i=0,n=t.length;i<n;++i){var s=t[i],o={name:s.name,offset:this._bytes,stride:0,stream:-1,type:s.type,num:s.num,normalize:void 0!==s.normalize&&s.normalize,bytes:s.num*(0,r.attrTypeBytes)(s.type)};this._attr2el[o.name]=o,this._elements.push(o),this._bytes+=o.bytes,e+=o.name+":"+o.num+":"+o.type+":"+o.normalize}for(var c=0,l=this._elements.length;c<l;++c)this._elements[c].stride=this._bytes;this._hash=(0,a.default)(e,666)}var e=t.prototype;return e.element=function(t){return this._attr2el[t]},e.getHash=function(){return this._hash},t})();i.default=s,e.exports=i.default}),{"../murmurhash2_gc":308,"./enums":287}],300:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(t,e){this._cursor=0,this._data=new Array(e);for(var i=0;i<e;++i)this._data[i]=t()}return t.prototype.request=function(){var t=this._data[this._cursor];return this._cursor=(this._cursor+1)%this._data.length,t},t})();i.default=n,e.exports=i.default}),{}],301:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./timsort"))&&n.__esModule?n:{default:n};function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=s(n.key,"string"))?r:String(r)),n)}var r}function s(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var o=(function(){function t(t){this._count=0,this._data=new Array(t)}var e,i,n=t.prototype;return n._resize=function(t){if(t>this._data.length)for(var e=this._data.length;e<t;++e)this._data[e]=void 0},n.reset=function(){for(var t=0;t<this._count;++t)this._data[t]=void 0;this._count=0},n.push=function(t){this._count>=this._data.length&&this._resize(2*this._data.length),this._data[this._count]=t,++this._count},n.pop=function(){--this._count,this._count<0&&(this._count=0);var t=this._data[this._count];return this._data[this._count]=void 0,t},n.fastRemove=function(t){if(!(t>=this._count||t<0)){var e=this._count-1;this._data[t]=this._data[e],this._data[e]=void 0,this._count-=1}},n.indexOf=function(t){return this._data.indexOf(t)},n.sort=function(t){return(0,r.default)(this._data,0,this._count,t)},e=t,(i=[{key:"length",get:function(){return this._count}},{key:"data",get:function(){return this._data}}])&&a(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=o,e.exports=i.default}),{"./timsort":306}],302:[(function(t,e,i){"use strict";i.__esModule=!0,i.TypedArrayPool=i.RecyclePool=i.Pool=i.LinkedArray=i.FixedArray=i.CircularPool=void 0;var n=l(t("./circular-pool"));i.CircularPool=n.default;var r=l(t("./fixed-array"));i.FixedArray=r.default;var a=l(t("./linked-array"));i.LinkedArray=a.default;var s=l(t("./pool"));i.Pool=s.default;var o=l(t("./recycle-pool"));i.RecyclePool=o.default;var c=l(t("./typed-array-pool"));function l(t){return t&&t.__esModule?t:{default:t}}i.TypedArrayPool=c.default}),{"./circular-pool":300,"./fixed-array":301,"./linked-array":303,"./pool":304,"./recycle-pool":305,"./typed-array-pool":307}],303:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./pool"))&&n.__esModule?n:{default:n};function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=s(n.key,"string"))?r:String(r)),n)}var r}function s(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var o=(function(){function t(t,e){this._fn=t,this._count=0,this._head=null,this._tail=null,this._pool=new r.default(t,e)}var e,i,n=t.prototype;return n.add=function(){var t=this._pool.alloc();return this._tail?(this._tail._next=t,t._prev=this._tail):this._head=t,this._tail=t,this._count+=1,t},n.remove=function(t){t._prev?t._prev._next=t._next:this._head=t._next,t._next?t._next._prev=t._prev:this._tail=t._prev,t._next=null,t._prev=null,this._pool.free(t),this._count-=1},n.forEach=function(t,e){var i=this._head;if(i){e&&(t=t.bind(e));for(var n=0,r=i;i;)r=i._next,t(i,n,this),i=r,++n}},e=t,(i=[{key:"head",get:function(){return this._head}},{key:"tail",get:function(){return this._tail}},{key:"length",get:function(){return this._count}}])&&a(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=o,e.exports=i.default}),{"./pool":304}],304:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(t,e){this._fn=t,this._idx=e-1,this._frees=new Array(e);for(var i=0;i<e;++i)this._frees[i]=t()}var e=t.prototype;return e._expand=function(t){var e=this._frees;this._frees=new Array(t);for(var i=t-e.length,n=0;n<i;++n)this._frees[n]=this._fn();for(var r=i,a=0;r<t;++r,++a)this._frees[r]=e[a];this._idx+=i},e.alloc=function(){this._idx<0&&this._expand(Math.round(1.2*this._frees.length)+1);var t=this._frees[this._idx];return this._frees[this._idx]=null,--this._idx,t},e.free=function(t){++this._idx,this._frees[this._idx]=t},e.clear=function(t){for(var e=0;e<=this._idx;e++)t&&t(this._frees[e]);this._frees.length=0,this._idx=-1},t})();i.default=n,e.exports=i.default}),{}],305:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./timsort"))&&n.__esModule?n:{default:n};function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=s(n.key,"string"))?r:String(r)),n)}var r}function s(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var o=(function(){function t(t,e){this._fn=t,this._count=0,this._data=new Array(e);for(var i=0;i<e;++i)this._data[i]=t()}var e,i,n=t.prototype;return n.reset=function(){this._count=0},n.resize=function(t){if(t>this._data.length)for(var e=this._data.length;e<t;++e)this._data[e]=this._fn()},n.add=function(){return this._count>=this._data.length&&this.resize(2*this._data.length),this._data[this._count++]},n.remove=function(t){if(!(t>=this._count)){var e=this._count-1,i=this._data[t];this._data[t]=this._data[e],this._data[e]=i,this._count-=1}},n.sort=function(t){return(0,r.default)(this._data,0,this._count,t)},e=t,(i=[{key:"length",get:function(){return this._count}},{key:"data",get:function(){return this._data}}])&&a(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=o,cc.RecyclePool=o,e.exports=i.default}),{"./timsort":306}],306:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=function(t,e,i,r){if(!Array.isArray(t))throw new TypeError("Can only sort arrays");void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=c);var a=i-e;if(!(a<2)){var s=0;if(a<n)return void f(t,e,i,e+(s=h(t,e,i,r)),r);var o=new p(t,r),u=l(a);do{if((s=h(t,e,i,r))<u){var _=a;_>u&&(_=u),f(t,e,e+_,e+s,r),s=_}o.pushRun(e,s),o.mergeRuns(),a-=s,e+=s}while(0!==a);o.forceMergeRuns()}};var n=32,r=7,a=256,s=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function o(t){return t<1e5?t<100?t<10?0:1:t<1e4?t<1e3?2:3:4:t<1e7?t<1e6?5:6:t<1e9?t<1e8?7:8:9}function c(t,e){if(t===e)return 0;if(~~t===t&&~~e===e){if(0===t||0===e)return t<e?-1:1;if(t<0||e<0){if(e>=0)return-1;if(t>=0)return 1;t=-t,e=-e}var i=o(t),n=o(e),r=0;return i<n?(t*=s[n-i-1],e/=10,r=-1):i>n&&(e*=s[i-n-1],t/=10,r=1),t===e?r:t<e?-1:1}var a=String(t),c=String(e);return a===c?0:a<c?-1:1}function l(t){for(var e=0;t>=n;)e|=1&t,t>>=1;return t+e}function h(t,e,i,n){var r=e+1;if(r===i)return 1;if(n(t[r++],t[e])<0){for(;r<i&&n(t[r],t[r-1])<0;)r++;u(t,e,r)}else for(;r<i&&n(t[r],t[r-1])>=0;)r++;return r-e}function u(t,e,i){for(i--;e<i;){var n=t[e];t[e++]=t[i],t[i--]=n}}function f(t,e,i,n,r){for(n===e&&n++;n<i;n++){for(var a=t[n],s=e,o=n;s<o;){var c=s+o>>>1;r(a,t[c])<0?o=c:s=c+1}var l=n-s;switch(l){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;l>0;)t[s+l]=t[s+l-1],l--}t[s]=a}}function _(t,e,i,n,r,a){var s=0,o=0,c=1;if(a(t,e[i+r])>0){for(o=n-r;c<o&&a(t,e[i+r+c])>0;)s=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o),s+=r,c+=r}else{for(o=r+1;c<o&&a(t,e[i+r-c])<=0;)s=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o);var l=s;s=r-c,c=r-l}for(s++;s<c;){var h=s+(c-s>>>1);a(t,e[i+h])>0?s=h+1:c=h}return c}function d(t,e,i,n,r,a){var s=0,o=0,c=1;if(a(t,e[i+r])<0){for(o=r+1;c<o&&a(t,e[i+r-c])<0;)s=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o);var l=s;s=r-c,c=r-l}else{for(o=n-r;c<o&&a(t,e[i+r+c])>=0;)s=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o),s+=r,c+=r}for(s++;s<c;){var h=s+(c-s>>>1);a(t,e[i+h])<0?c=h:s=h+1}return c}var p=(function(){function t(t,e){this.array=t,this.compare=e,this.minGallop=r,this.length=t.length,this.tmpStorageLength=a,this.length<2*a&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength),this.stackSize=0}var e=t.prototype;return e.pushRun=function(t,e){this.runStart[this.stackSize]=t,this.runLength[this.stackSize]=e,this.stackSize+=1},e.mergeRuns=function(){for(;this.stackSize>1;){var t=this.stackSize-2;if(t>=1&&this.runLength[t-1]<=this.runLength[t]+this.runLength[t+1]||t>=2&&this.runLength[t-2]<=this.runLength[t]+this.runLength[t-1])this.runLength[t-1]<this.runLength[t+1]&&t--;else if(this.runLength[t]>this.runLength[t+1])break;this.mergeAt(t)}},e.forceMergeRuns=function(){for(;this.stackSize>1;){var t=this.stackSize-2;t>0&&this.runLength[t-1]<this.runLength[t+1]&&t--,this.mergeAt(t)}},e.mergeAt=function(t){var e=this.compare,i=this.array,n=this.runStart[t],r=this.runLength[t],a=this.runStart[t+1],s=this.runLength[t+1];this.runLength[t]=r+s,t===this.stackSize-3&&(this.runStart[t+1]=this.runStart[t+2],this.runLength[t+1]=this.runLength[t+2]),this.stackSize--;var o=d(i[a],i,n,r,0,e);n+=o,0!=(r-=o)&&0!==(s=_(i[n+r-1],i,a,s,s-1,e))&&(r<=s?this.mergeLow(n,r,a,s):this.mergeHigh(n,r,a,s))},e.mergeLow=function(t,e,i,n){var a=this.compare,s=this.array,o=this.tmp,c=0;for(c=0;c<e;c++)o[c]=s[t+c];var l=0,h=i,u=t;if(s[u++]=s[h++],0!=--n)if(1!==e){for(var f=this.minGallop;;){var p=0,m=0,v=!1;do{if(a(s[h],o[l])<0){if(s[u++]=s[h++],m++,p=0,0==--n){v=!0;break}}else if(s[u++]=o[l++],p++,m=0,1==--e){v=!0;break}}while((p|m)<f);if(v)break;do{if(0!==(p=d(s[h],o,l,e,0,a))){for(c=0;c<p;c++)s[u+c]=o[l+c];if(u+=p,l+=p,(e-=p)<=1){v=!0;break}}if(s[u++]=s[h++],0==--n){v=!0;break}if(0!==(m=_(o[l],s,h,n,0,a))){for(c=0;c<m;c++)s[u+c]=s[h+c];if(u+=m,h+=m,0==(n-=m)){v=!0;break}}if(s[u++]=o[l++],1==--e){v=!0;break}f--}while(p>=r||m>=r);if(v)break;f<0&&(f=0),f+=2}if(this.minGallop=f,f<1&&(this.minGallop=1),1===e){for(c=0;c<n;c++)s[u+c]=s[h+c];s[u+n]=o[l]}else{if(0===e)throw new Error("mergeLow preconditions were not respected");for(c=0;c<e;c++)s[u+c]=o[l+c]}}else{for(c=0;c<n;c++)s[u+c]=s[h+c];s[u+n]=o[l]}else for(c=0;c<e;c++)s[u+c]=o[l+c]},e.mergeHigh=function(t,e,i,n){var a=this.compare,s=this.array,o=this.tmp,c=0;for(c=0;c<n;c++)o[c]=s[i+c];var l=t+e-1,h=n-1,u=i+n-1,f=0,p=0;if(s[u--]=s[l--],0!=--e)if(1!==n){for(var m=this.minGallop;;){var v=0,g=0,y=!1;do{if(a(o[h],s[l])<0){if(s[u--]=s[l--],v++,g=0,0==--e){y=!0;break}}else if(s[u--]=o[h--],g++,v=0,1==--n){y=!0;break}}while((v|g)<m);if(y)break;do{if(0!=(v=e-d(o[h],s,t,e,e-1,a))){for(e-=v,p=1+(u-=v),f=1+(l-=v),c=v-1;c>=0;c--)s[p+c]=s[f+c];if(0===e){y=!0;break}}if(s[u--]=o[h--],1==--n){y=!0;break}if(0!=(g=n-_(s[l],o,0,n,n-1,a))){for(n-=g,p=1+(u-=g),f=1+(h-=g),c=0;c<g;c++)s[p+c]=o[f+c];if(n<=1){y=!0;break}}if(s[u--]=s[l--],0==--e){y=!0;break}m--}while(v>=r||g>=r);if(y)break;m<0&&(m=0),m+=2}if(this.minGallop=m,m<1&&(this.minGallop=1),1===n){for(p=1+(u-=e),f=1+(l-=e),c=e-1;c>=0;c--)s[p+c]=s[f+c];s[u]=o[h]}else{if(0===n)throw new Error("mergeHigh preconditions were not respected");for(f=u-(n-1),c=0;c<n;c++)s[f+c]=o[c]}}else{for(p=1+(u-=e),f=1+(l-=e),c=e-1;c>=0;c--)s[p+c]=s[f+c];s[u]=o[h]}else for(f=u-(n-1),c=0;c<n;c++)s[f+c]=o[c]},t})();e.exports=i.default}),{}],307:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;for(var n=Array(8),r=0;r<8;++r)n[r]=[];function a(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}function s(t){var e,i;return e=(t>65535)<<4,e|=i=((t>>>=e)>255)<<3,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}function o(t){var e=a(t),i=n[s(e)>>2];return i.length>0?i.pop():new ArrayBuffer(e)}var c={alloc_int8:function(t){var e=new Int8Array(o(t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_uint8:function(t){var e=new Uint8Array(o(t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_int16:function(t){var e=new Int16Array(o(2*t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_uint16:function(t){var e=new Uint16Array(o(2*t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_int32:function(t){var e=new Int32Array(o(4*t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_uint32:function(t){var e=new Uint32Array(o(4*t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_float32:function(t){var e=new Float32Array(o(4*t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_float64:function(t){var e=new Float64Array(o(8*t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_dataview:function(t){var e=new DataView(o(t),0,t);return e.length!==t?e.subarray(0,t):e},free:function(t){var e;e=t.buffer,n[s(e.byteLength)>>2].push(e)},reset:function(){for(var t=Array(8),e=0;e<8;++e)t[e]=[]}};i.default=c,e.exports=i.default}),{}],308:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=function(t,e){for(var i,n=t.length,r=e^n,a=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:r^=(255&t.charCodeAt(a+2))<<16;case 2:r^=(255&t.charCodeAt(a+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(a)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0},e.exports=i.default}),{}],309:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../../core/value-types"),r=o(t("../core/base-renderer")),a=o(t("../enums")),s=t("../memop");function o(t){return t&&t.__esModule?t:{default:t}}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var h=new Float32Array(16),u=new Float32Array(16),f=new Float32Array(16),_=new Float32Array(16),d=new Float32Array(4),p=new Float32Array(64),m=[],v=new Float32Array(4),g=new n.Vec4(0,0,0,0),y=new n.Vec3(0,0,0),T=new n.Vec3(0,0,0),A=new s.RecyclePool(function(){return new Float32Array(16)},8);function b(t,e){return t._priority-e._priority}var E=(function(t){var e,i;function r(e,i){var n;return(n=t.call(this,e,i)||this)._time=new Float32Array(4),n._lights=[],n._shadowLights=[],n._numLights=0,n._defines={},n._registerStage("shadowcast",n._shadowStage.bind(c(n))),n._registerStage("opaque",n._opaqueStage.bind(c(n))),n._registerStage("transparent",n._transparentStage.bind(c(n))),n}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,l(e,i);var s=r.prototype;return s.reset=function(){A.reset(),t.prototype.reset.call(this)},s.render=function(t,e){this.reset(),e&&(this._time[0]+=e,this._time[1]=e,this._time[2]++),this._device.setUniform("cc_time",this._time),this._updateLights(t);for(var i=this._device._gl.canvas,n=0;n<t._cameras.length;++n){var r=this._requestView(),a=i.width,s=i.height;t._cameras.data[n].extractView(r,a,s)}this._viewPools.sort(b);for(var o=0;o<this._viewPools.length;++o){var c=this._viewPools.data[o];this._render(c,t)}},s.renderCamera=function(t,e){this.reset(),this._updateLights(e);var i=this._device._gl.canvas,n=i.width,r=i.height,a=this._requestView();t.extractView(a,n,r),this._viewPools.sort(b);for(var s=0;s<this._viewPools.length;++s){var o=this._viewPools.data[s];this._render(o,e)}},s._updateLights=function(t){this._lights.length=0,this._shadowLights.length=0;for(var e=t._lights,i=0;i<e.length;++i){var n=e.data[i];if(n.update(this._device),n.shadowType!==a.default.SHADOW_NONE){this._shadowLights.length<2&&this._shadowLights.unshift(n);var r=this._requestView();n.extractView(r,["shadowcast"]),this._lights.splice(0,0,n)}else this._lights.push(n)}this._updateLightDefines(),this._numLights=e._count},s._updateLightDefines=function(){for(var t=this._defines,e=0;e<this._lights.length;++e){var i=this._lights[e],n="CC_LIGHT_"+e+"_TYPE",r="CC_SHADOW_"+e+"_TYPE";t[n]!==i._type&&(t[n]=i._type,this._definesChanged=!0),t[r]!==i._shadowType&&(t[r]=i._shadowType,this._definesChanged=!0)}var a=Math.min(4,this._lights.length);t.CC_NUM_LIGHTS!==a&&(t.CC_NUM_LIGHTS=a,this._definesChanged=!0),a=Math.min(4,this._shadowLights.length),t.CC_NUM_SHADOW_LIGHTS!==a&&(t.CC_NUM_SHADOW_LIGHTS=a,this._definesChanged=!0)},s._submitLightsUniforms=function(){var t=this._device;if(this._lights.length>0){for(var e=A.add(),i=A.add(),n=A.add(),r=Math.min(4,this._lights.length),s=0;s<r;++s){var o=this._lights[s],c=4*s;n.set(o._colorUniform,c),i.set(o._directionUniform,c),e.set(o._positionUniform,c),e[c+3]=o._range,o._type===a.default.LIGHT_SPOT?(i[c+3]=o._spotUniform[0],n[c+3]=o._spotUniform[1]):(i[c+3]=0,n[c+3]=0)}t.setUniform("cc_lightDirection",i),t.setUniform("cc_lightColor",n),t.setUniform("cc_lightPositionAndRange",e)}},s._submitShadowStageUniforms=function(t){var e=t._shadowLight,i=v;i[0]=e.shadowMinDepth,i[1]=e.shadowMaxDepth,i[2]=e.shadowDepthScale,i[3]=e.shadowDarkness,this._device.setUniform("cc_shadow_map_lightViewProjMatrix",n.Mat4.toArray(_,t._matViewProj)),this._device.setUniform("cc_shadow_map_info",i),this._device.setUniform("cc_shadow_map_bias",e.shadowBias),this._defines.CC_SHADOW_TYPE=e._shadowType},s._submitOtherStagesUniforms=function(){for(var t=A.add(),e=0;e<this._shadowLights.length;++e){var i=this._shadowLights[e],r=m[e];r||(r=m[e]=new Float32Array(p.buffer,64*e,16)),n.Mat4.toArray(r,i.viewProjMatrix);var a=4*e;t[a]=i.shadowMinDepth,t[a+1]=i.shadowMaxDepth,t[a+2]=i._shadowResolution,t[a+3]=i.shadowDarkness}this._device.setUniform("cc_shadow_lightViewProjMatrix",p),this._device.setUniform("cc_shadow_info",t)},s._sortItems=function(t){t.sort((function(t,e){return t.passes.length!==e.passes.length?t.passes.length-e.passes.length:t.sortKey-e.sortKey}))},s._shadowStage=function(t,e){this._submitShadowStageUniforms(t);for(var i=0;i<e.length;++i){var n=e.data[i];n.effect.getDefine("CC_CASTING_SHADOW")&&this._draw(n)}},s._drawItems=function(t,e){var i=this._shadowLights;if(0===i.length&&0===this._numLights)for(var n=0;n<e.length;++n){var r=e.data[n];this._draw(r)}else for(var a=0;a<e.length;++a){for(var s=e.data[a],o=0;o<i.length;++o)this._device.setTexture("cc_shadow_map_"+o,i[o].shadowMap,this._allocTextureUnit());this._draw(s)}},s._opaqueStage=function(t,e){t.getPosition(g),this._device.setUniform("cc_matView",n.Mat4.toArray(h,t._matView)),this._device.setUniform("cc_matViewInv",n.Mat4.toArray(u,t._matViewInv)),this._device.setUniform("cc_matProj",n.Mat4.toArray(f,t._matProj)),this._device.setUniform("cc_matViewProj",n.Mat4.toArray(_,t._matViewProj)),this._device.setUniform("cc_cameraPos",n.Vec4.toArray(d,g)),this._submitLightsUniforms(),this._submitOtherStagesUniforms(),this._drawItems(t,e)},s._transparentStage=function(t,e){t.getPosition(g),t.getForward(y),this._device.setUniform("cc_matView",n.Mat4.toArray(h,t._matView)),this._device.setUniform("cc_matViewInv",n.Mat4.toArray(u,t._matViewInv)),this._device.setUniform("cc_matProj",n.Mat4.toArray(f,t._matProj)),this._device.setUniform("cc_matViewProj",n.Mat4.toArray(_,t._matViewProj)),this._device.setUniform("cc_cameraPos",n.Vec4.toArray(d,g)),this._submitLightsUniforms(),this._submitOtherStagesUniforms();for(var i=0;i<e.length;++i){var r=e.data[i];r.node.getWorldPosition(T),n.Vec3.sub(T,T,g),r.sortKey=-n.Vec3.dot(T,y)}this._sortItems(e),this._drawItems(t,e)},r})(r.default);i.default=E,e.exports=i.default}),{"../../core/value-types":257,"../core/base-renderer":279,"../enums":285,"../memop":302}],310:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../../core/value-types"),a=t("../../core/geom-utils"),s=(n=t("../enums"))&&n.__esModule?n:{default:n};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(r=c(n.key,"string"))?r:String(r)),n)}var r}function c(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var l=new r.Mat4,h=new r.Mat4,u=new r.Mat4,f=new r.Mat4,_=new r.Mat4,d=new r.Mat4,p=new r.Vec3,m=new r.Vec3,v=(function(){function t(){this._poolID=-1,this._node=null,this._projection=s.default.PROJ_PERSPECTIVE,this._priority=0,this._color=new r.Vec4(.2,.3,.47,1),this._depth=1,this._stencil=0,this._clearFlags=s.default.CLEAR_COLOR|s.default.CLEAR_DEPTH,this._clearModel=null,this._stages=[],this._framebuffer=null,this._near=.01,this._far=1e3,this._fov=Math.PI/4,this._rect={x:0,y:0,w:1,h:1},this._orthoHeight=10,this._cullingMask=4294967295}var e,i,n=t.prototype;return n.setCullingMask=function(t){this._cullingMask=t},n.getNode=function(){return this._node},n.setNode=function(t){this._node=t},n.getType=function(){return this._projection},n.setType=function(t){this._projection=t},n.getPriority=function(){return this._priority},n.setPriority=function(t){this._priority=t},n.getOrthoHeight=function(){return this._orthoHeight},n.setOrthoHeight=function(t){this._orthoHeight=t},n.getFov=function(){return this._fov},n.setFov=function(t){this._fov=t},n.getNear=function(){return this._near},n.setNear=function(t){this._near=t},n.getFar=function(){return this._far},n.setFar=function(t){this._far=t},n.getColor=function(t){return r.Vec4.copy(t,this._color)},n.setColor=function(t,e,i,n){r.Vec4.set(this._color,t,e,i,n)},n.getDepth=function(){return this._depth},n.setDepth=function(t){this._depth=t},n.getStencil=function(){return this._stencil},n.setStencil=function(t){this._stencil=t},n.getClearFlags=function(){return this._clearFlags},n.setClearFlags=function(t){this._clearFlags=t},n.getRect=function(t){return t.x=this._rect.x,t.y=this._rect.y,t.w=this._rect.w,t.h=this._rect.h,t},n.setRect=function(t,e,i,n){this._rect.x=t,this._rect.y=e,this._rect.w=i,this._rect.h=n},n.getStages=function(){return this._stages},n.setStages=function(t){this._stages=t},n.getFramebuffer=function(){return this._framebuffer},n.setFrameBuffer=function(t){this._framebuffer=t},n._calcMatrices=function(t,e){this._node.getWorldRT(u),r.Mat4.invert(h,u);var i=t/e;if(this._projection===s.default.PROJ_PERSPECTIVE)r.Mat4.perspective(f,this._fov,i,this._near,this._far);else{var n=this._orthoHeight*i,a=this._orthoHeight;r.Mat4.ortho(f,-n,n,-a,a,this._near,this._far)}r.Mat4.mul(_,f,h),r.Mat4.invert(d,_)},n.extractView=function(t,e,i){this._framebuffer&&(e=this._framebuffer._width,i=this._framebuffer._height),t._priority=this._priority,t._rect.x=this._rect.x*e,t._rect.y=this._rect.y*i,t._rect.w=this._rect.w*e,t._rect.h=this._rect.h*i,this.getColor(t._color),t._depth=this._depth,t._stencil=this._stencil,t._clearFlags=this._clearFlags,t._clearModel=this._clearModel,t._stages=this._stages,t._framebuffer=this._framebuffer,this._calcMatrices(e,i),r.Mat4.copy(t._matView,h),r.Mat4.copy(t._matViewInv,u),r.Mat4.copy(t._matProj,f),r.Mat4.copy(t._matViewProj,_),r.Mat4.copy(t._matInvViewProj,d),t._cullingMask=this._cullingMask},n.screenPointToRay=function(t,e,i,n,o){if(!cc.geomUtils)return o;o=o||new a.Ray,this._calcMatrices(i,n);var c=this._rect.x*i,l=this._rect.y*n,h=this._rect.w*i,u=this._rect.h*n;return r.Vec3.set(m,(t-c)/h*2-1,(e-l)/u*2-1,1),r.Vec3.transformMat4(m,m,d),this._projection===s.default.PROJ_PERSPECTIVE?this._node.getWorldPosition(p):(r.Vec3.set(p,(t-c)/h*2-1,(e-l)/u*2-1,-1),r.Vec3.transformMat4(p,p,d)),a.Ray.fromPoints(o,p,m)},n.screenToWorld=function(t,e,i,n){this._calcMatrices(i,n);var a=this._rect.x*i,o=this._rect.y*n,c=this._rect.w*i,l=this._rect.h*n;return this._projection===s.default.PROJ_PERSPECTIVE?(r.Vec3.set(t,(e.x-a)/c*2-1,(e.y-o)/l*2-1,.9999),r.Vec3.transformMat4(t,t,d),this._node.getWorldPosition(p),r.Vec3.lerp(t,p,t,(0,r.lerp)(this._near/this._far,1,e.z))):(r.Vec3.set(t,(e.x-a)/c*2-1,(e.y-o)/l*2-1,2*e.z-1),r.Vec3.transformMat4(t,t,d)),t},n.worldToScreen=function(t,e,i,n){this._calcMatrices(i,n);var a=this._rect.x*i,s=this._rect.y*n,o=this._rect.w*i,c=this._rect.h*n;return r.Vec3.transformMat4(t,e,_),t.x=a+.5*(t.x+1)*o,t.y=s+.5*(t.y+1)*c,t.z=.5*t.z+.5,t},n.worldMatrixToScreen=function(t,e,i,n){this._calcMatrices(i,n),r.Mat4.mul(t,_,e);var a=i/2,s=n/2;return r.Mat4.identity(l),r.Mat4.transform(l,l,r.Vec3.set(p,a,s,0)),r.Mat4.scale(l,l,r.Vec3.set(p,a,s,1)),r.Mat4.mul(t,l,t),t},e=t,(i=[{key:"cullingMask",get:function(){return this._cullingMask},set:function(t){this._cullingMask=t}}])&&o(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t})();i.default=v,e.exports=i.default}),{"../../core/geom-utils":149,"../../core/value-types":257,"../enums":285}],311:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=(function(){function t(){this._type="default",this._poolID=-1,this._node=null,this._inputAssembler=null,this._effect=null,this._viewID=-1,this._cameraID=-1,this._userKey=-1,this._castShadow=!1,this._boundingShape=null}var e=t.prototype;return e.setNode=function(t){this._node=t},e.setInputAssembler=function(t){this._inputAssembler=t},e.setEffect=function(t){this._effect=t},e.setUserKey=function(t){this._userKey=t},e.extractDrawItem=function(t){t.model=this,t.node=this._node,t.ia=this._inputAssembler,t.effect=this._effect},t})();i.default=n,e.exports=i.default}),{}],312:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../memop"),r=(function(){function t(t){this._lights=new n.FixedArray(16),this._models=new n.FixedArray(16),this._cameras=new n.FixedArray(16),this._debugCamera=null,this._app=t,this._views=[]}var e=t.prototype;return e._add=function(t,e){-1===e._poolID&&(t.push(e),e._poolID=t.length-1)},e._remove=function(t,e){-1!==e._poolID&&(t.data[t.length-1]._poolID=e._poolID,t.fastRemove(e._poolID),e._poolID=-1)},e.reset=function(){for(var t=0;t<this._models.length;++t)this._models.data[t]._viewID=-1},e.setDebugCamera=function(t){this._debugCamera=t},e.getCameraCount=function(){return this._cameras.length},e.getCamera=function(t){return this._cameras.data[t]},e.addCamera=function(t){this._add(this._cameras,t)},e.removeCamera=function(t){this._remove(this._cameras,t)},e.getModelCount=function(){return this._models.length},e.getModel=function(t){return this._models.data[t]},e.addModel=function(t){this._add(this._models,t)},e.removeModel=function(t){this._remove(this._models,t)},e.getLightCount=function(){return this._lights.length},e.getLight=function(t){return this._lights.data[t]},e.addLight=function(t){this._add(this._lights,t)},e.removeLight=function(t){this._remove(this._lights,t)},e.addView=function(t){-1===this._views.indexOf(t)&&this._views.push(t)},e.removeView=function(t){var e=this._views.indexOf(t);-1!==e&&this._views.splice(e,1)},t})();i.default=r,e.exports=i.default}),{"../memop":302}],313:[(function(t,e,i){"use strict";i.__esModule=!0,i.getClassName=i.enums2default=i.ctor2enums=void 0,i.getInspectorProps=function(t){var e={type:t.type};Object.assign(e,t.editor||t.inspector),e.defines=t.defines,e.value=g(e.type)(t.value),t.range&&(e.range=t.range);var i=y(e.type);return e.typeName=T[i]||i,e.valueCtor=d[e.type],"cc.Texture2D"==e.typeName&&(e.typeName="cc.Asset",e.assetType="cc.Texture2D"),e},i.getInstanceType=i.getInstanceCtor=void 0;var n,r,a,s,o=h(t("./enums")),c=t("../core/value-types"),l=h(t("../core/assets/CCTexture2D"));function h(t){return t&&t.__esModule?t:{default:t}}var u;u=t("./gfx/texture-2d");var f=cc.Object,_=((n={})[Boolean]=function(t){return t||!1},n[Number]=function(t){return t?ArrayBuffer.isView(t)?t[0]:t:0},n[c.Vec2]=function(t){return t?cc.v2(t[0],t[1]):cc.v2()},n[c.Vec3]=function(t){return t?cc.v3(t[0],t[1],t[2]):cc.v3()},n[c.Vec4]=function(t){return t?cc.v4(t[0],t[1],t[2],t[3]):cc.v4()},n[c.Color]=function(t){return t?cc.color(255*t[0],255*t[1],255*t[2],255*(t[3]||1)):cc.color()},n[c.Mat4]=function(t){return t?cc.mat4(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]):cc.mat4()},n[l.default]=function(){return null},n[f]=function(){return null},n),d=((r={})[o.default.PARAM_INT]=Number,r[o.default.PARAM_INT2]=c.Vec2,r[o.default.PARAM_INT3]=c.Vec3,r[o.default.PARAM_INT4]=c.Vec4,r[o.default.PARAM_FLOAT]=Number,r[o.default.PARAM_FLOAT2]=c.Vec2,r[o.default.PARAM_FLOAT3]=c.Vec3,r[o.default.PARAM_FLOAT4]=c.Vec4,r[o.default.PARAM_MAT4]=c.Mat4,r[o.default.PARAM_TEXTURE_2D]=l.default,r.color=c.Color,r.number=Number,r.boolean=Boolean,r.default=f,r),p=((a={})[Number]=o.default.PARAM_FLOAT,a[c.Vec2]=o.default.PARAM_FLOAT2,a[c.Vec3]=o.default.PARAM_FLOAT3,a[c.Vec4]=o.default.PARAM_FLOAT4,a[c.Color]=o.default.PARAM_COLOR3,a[c.Color]=o.default.PARAM_COLOR4,a[c.Mat4]=o.default.PARAM_MAT4,a[l.default]=o.default.PARAM_TEXTURE_2D,a[u]=o.default.PARAM_TEXTURE_2D,a);i.ctor2enums=p;var m=((s={})[o.default.PARAM_INT]=new Uint32Array([0]),s[o.default.PARAM_INT2]=new Uint32Array([0,0]),s[o.default.PARAM_INT3]=new Uint32Array([0,0,0]),s[o.default.PARAM_INT4]=new Uint32Array([0,0,0,0]),s[o.default.PARAM_FLOAT]=new Float32Array([0]),s[o.default.PARAM_FLOAT2]=new Float32Array([0,0]),s[o.default.PARAM_FLOAT3]=new Float32Array([0,0,0]),s[o.default.PARAM_FLOAT4]=new Float32Array([0,0,0,0]),s[o.default.PARAM_MAT4]=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),s[o.default.PARAM_TEXTURE_2D]=null,s.number=0,s.boolean=!1,s);i.enums2default=m;var v=function(t){return d[t]||d.default};i.getInstanceType=v;var g=function(t){return _[v(t)]};i.getInstanceCtor=g;var y=function(t){return cc.js.getClassName(v(t))};i.getClassName=y;var T={Number:"number",Boolean:"boolean"}}),{"../core/assets/CCTexture2D":77,"../core/value-types":257,"./enums":285,"./gfx/texture-2d":295}],314:[(function(t,e){"use strict";var i=cc.Class({name:"cc.TiledMapAsset",extends:cc.Asset,properties:{tmxXmlStr:"",textures:{default:[],type:[cc.Texture2D]},textureNames:[cc.String],textureSizes:{default:[],type:[cc.Size]},imageLayerTextures:{default:[],type:[cc.Texture2D]},imageLayerTextureNames:[cc.String],tsxFiles:[cc.TextAsset],tsxFileNames:[cc.String]},statics:{preventDeferredLoadDependents:!0},createNode:!1});cc.TiledMapAsset=i,e.exports=i}),{}],315:[(function(t,e){"use strict";var i=t("./webview-impl"),n=i.EventType;function r(){}var a=cc.Class({name:"cc.WebView",extends:cc.Component,editor:!1,properties:{_url:"",url:{type:cc.String,tooltip:!1,get:function(){return this._url},set:function(t){this._url=t;var e=this._impl;e&&e.loadURL(t)}},webviewEvents:{default:[],type:cc.Component.EventHandler}},statics:{EventType:n,Impl:i},ctor:function(){this._impl=new a.Impl},onRestore:function(){this._impl||(this._impl=new a.Impl)},onEnable:function(){var t=this._impl;t.createDomElementIfNeeded(this.node.width,this.node.height),t.setEventListener(n.LOADED,this._onWebViewLoaded.bind(this)),t.setEventListener(n.LOADING,this._onWebViewLoading.bind(this)),t.setEventListener(n.ERROR,this._onWebViewLoadError.bind(this)),t.loadURL(this._url),t.setVisible(!0)},onDisable:function(){var t=this._impl;t.setVisible(!1),t.setEventListener(n.LOADED,r),t.setEventListener(n.LOADING,r),t.setEventListener(n.ERROR,r)},onDestroy:function(){this._impl&&(this._impl.destroy(),this._impl=null)},update:function(){this._impl&&this._impl.updateMatrix(this.node)},_onWebViewLoaded:function(){cc.Component.EventHandler.emitEvents(this.webviewEvents,this,n.LOADED),this.node.emit("loaded",this)},_onWebViewLoading:function(){return cc.Component.EventHandler.emitEvents(this.webviewEvents,this,n.LOADING),this.node.emit("loading",this),!0},_onWebViewLoadError:function(){cc.Component.EventHandler.emitEvents(this.webviewEvents,this,n.ERROR),this.node.emit("error",this)},setJavascriptInterfaceScheme:function(t){this._impl&&this._impl.setJavascriptInterfaceScheme(t)},setOnJSCallback:function(t){this._impl&&this._impl.setOnJSCallback(t)},evaluateJS:function(t){this._impl&&this._impl.evaluateJS(t)}});cc.WebView=e.exports=a}),{"./webview-impl":316}],316:[(function(t,e){"use strict";var i=t("../core/platform/utils"),n=t("../core/platform/CCSys"),r=cc.mat4(),a=cc.Class({name:"WebViewImpl",ctor:function(){this._EventList={},this._visible=!1,this._parent=null,this._div=null,this._iframe=null,this._listener=null,this._forceUpdate=!1,this._m00=0,this._m01=0,this._m04=0,this._m05=0,this._m12=0,this._m13=0,this._w=0,this._h=0,this.__eventListeners={}},_updateVisibility:function(){if(this._div){var t=this._div;this._visible?t.style.visibility="visible":t.style.visibility="hidden"}},_updateSize:function(t,e){var i=this._div;i&&(i.style.width=t+"px",i.style.height=e+"px")},_initEvent:function(){var t=this._iframe;if(t){var e=this.__eventListeners,i=this;e.load=function(){i._forceUpdate=!0,i._dispatchEvent(a.EventType.LOADED)},e.error=function(){i._dispatchEvent(a.EventType.ERROR)},t.addEventListener("load",e.load),t.addEventListener("error",e.error)}},_initStyle:function(){if(this._div){var t=this._div;t.style.position="absolute",t.style.bottom="0px",t.style.left="0px"}},_setOpacity:function(t){var e=this._iframe;e&&e.style&&(e.style.opacity=t/255)},_createDom:function(t,e){a._polyfill.enableDiv?(this._div=document.createElement("div"),this._div.style["-webkit-overflow"]="auto",this._div.style["-webkit-overflow-scrolling"]="touch",this._iframe=document.createElement("iframe"),this._div.appendChild(this._iframe),this._iframe.style.width="100%",this._iframe.style.height="100%"):this._div=this._iframe=document.createElement("iframe"),a._polyfill.enableBG&&(this._div.style.background="#FFF"),this._div.style.height=e+"px",this._div.style.width=t+"px",this._div.style.overflow="scroll",this._iframe.style.border="none",cc.game.container.appendChild(this._div),this._updateVisibility()},_createNativeControl:function(t,e){this._createDom(t,e),this._initStyle(),this._initEvent()},createDomElementIfNeeded:function(t,e){this._div?this._updateSize(t,e):this._createNativeControl(t,e)},removeDom:function(){var t=this._div;t&&(i.contains(cc.game.container,t)&&cc.game.container.removeChild(t),this._div=null);var e=this._iframe;if(e){var n=this.__eventListeners;e.removeEventListener("load",n.load),e.removeEventListener("error",n.error),n.load=null,n.error=null,this._iframe=null}},setOnJSCallback:function(){},setJavascriptInterfaceScheme:function(){},loadData:function(){},loadHTMLString:function(){},loadURL:function(t){var e=this._iframe;if(e){e.src=t;var i=this;e.addEventListener("load",(function t(){i._loaded=!0,i._updateVisibility(),e.removeEventListener("load",t)})),this._dispatchEvent(a.EventType.LOADING)}},stopLoading:function(){cc.logID(7800)},reload:function(){var t=this._iframe;if(t){var e=t.contentWindow;e&&e.location&&e.location.reload()}},canGoBack:function(){return cc.logID(7801),!0},canGoForward:function(){return cc.logID(7802),!0},goBack:function(){try{if(a._polyfill.closeHistory)return cc.logID(7803);var t=this._iframe;if(t){var e=t.contentWindow;e&&e.location&&e.history.back.call(e)}}catch(i){cc.log(i)}},goForward:function(){try{if(a._polyfill.closeHistory)return cc.logID(7804);var t=this._iframe;if(t){var e=t.contentWindow;e&&e.location&&e.history.forward.call(e)}}catch(i){cc.log(i)}},evaluateJS:function(t){var e=this._iframe;if(e){var i=e.contentWindow;try{i.eval(t),this._dispatchEvent(a.EventType.JS_EVALUATED)}catch(n){console.error(n)}}},setScalesPageToFit:function(){cc.logID(7805)},setEventListener:function(t,e){this._EventList[t]=e},removeEventListener:function(t){this._EventList[t]=null},_dispatchEvent:function(t){var e=this._EventList[t];e&&e.call(this,this,this._iframe.src)},_createRenderCmd:function(){return new a.RenderCmd(this)},destroy:function(){this.removeDom()},setVisible:function(t){this._visible!==t&&(this._visible=!!t,this._updateVisibility())},updateMatrix:function(t){if(this._div&&this._visible){t.getWorldMatrix(r);var e=cc.Camera._findRendererCamera(t);e&&e.worldMatrixToScreen(r,r,cc.game.canvas.width,cc.game.canvas.height);var i=r.m;if(this._forceUpdate||this._m00!==i[0]||this._m01!==i[1]||this._m04!==i[4]||this._m05!==i[5]||this._m12!==i[12]||this._m13!==i[13]||this._w!==t._contentSize.width||this._h!==t._contentSize.height){this._m00=i[0],this._m01=i[1],this._m04=i[4],this._m05=i[5],this._m12=i[12],this._m13=i[13],this._w=t._contentSize.width,this._h=t._contentSize.height;var n=cc.view._devicePixelRatio,a=1/n,s=1/n,o=cc.game.container,c=i[0]*a,l=i[1],h=i[4],u=i[5]*s,f=o&&o.style.paddingLeft?parseInt(o.style.paddingLeft):0,_=o&&o.style.paddingBottom?parseInt(o.style.paddingBottom):0;this._updateSize(this._w,this._h);var d=this._w*a,p=this._h*s,m=d*i[0]*t._anchorPoint.x,v=p*i[5]*t._anchorPoint.y,g="matrix("+c+","+-l+","+-h+","+u+","+(i[12]*a-m+f)+","+-(i[13]*s-v+_)+")";this._div.style.transform=g,this._div.style["-webkit-transform"]=g,this._div.style["transform-origin"]="0px 100% 0px",this._div.style["-webkit-transform-origin"]="0px 100% 0px",this._setOpacity(t.opacity),this._forceUpdate=!1}}}});a.EventType={LOADING:0,LOADED:1,ERROR:2,JS_EVALUATED:3};var s=a._polyfill={devicePixelRatio:!1,enableDiv:!1};n.os===n.OS_IOS&&(s.enableDiv=!0),n.isMobile?n.browserType===n.BROWSER_TYPE_FIREFOX&&(s.enableBG=!0):n.browserType===n.BROWSER_TYPE_IE&&(s.closeHistory=!0),e.exports=a}),{"../core/platform/CCSys":177,"../core/platform/utils":192}],317:[(function(t){"use strict";t("./cocos2d/core"),t("./cocos2d/animation"),t("./cocos2d/particle"),t("./cocos2d/tilemap"),t("./cocos2d/videoplayer/CCVideoPlayer"),t("./cocos2d/webview/CCWebView"),t("./cocos2d/core/components/CCStudioComponent"),t("./extensions/ccpool/CCNodePool"),t("./cocos2d/actions"),t("./extensions/spine"),t("./extensions/dragonbones"),t("./cocos2d/deprecated")}),{"./cocos2d/actions":7,"./cocos2d/animation":16,"./cocos2d/core":161,"./cocos2d/core/components/CCStudioComponent":121,"./cocos2d/deprecated":269,"./cocos2d/particle":275,"./cocos2d/particle/CCParticleAsset":272,"./cocos2d/tilemap":void 0,"./cocos2d/tilemap/CCTiledMapAsset":314,"./cocos2d/videoplayer/CCVideoPlayer":void 0,"./cocos2d/webview/CCWebView":315,"./extensions/ccpool/CCNodePool":void 0,"./extensions/dragonbones":327,"./extensions/spine":332}],318:[(function(t,e){"use strict";var i,n,r=[],a=[],s=0,o=0,c=0,l=null,h=null,u=0,f=0,_=0,d=0,p=null,m=cc.Class({ctor:function(){this._privateMode=!1,this._inited=!1,this._invalid=!0,this._enableCacheAttachedInfo=!1,this.frames=[],this.totalTime=0,this.isCompleted=!1,this._frameIdx=-1,this._armatureInfo=null,this._animationName=null,this._tempSegments=null,this._tempColors=null,this._tempBoneInfos=null},init:function(t,e){this._inited=!0,this._armatureInfo=t,this._animationName=e},clear:function(){this._inited=!1;for(var t=0,e=this.frames.length;t<e;t++)this.frames[t].segments.length=0;this.invalidAllFrame()},begin:function(){if(this._invalid){var t=this._armatureInfo,e=t.curAnimationCache;e&&e!=this&&(this._privateMode?e.invalidAllFrame():e.updateToFrame()),t.armature.animation.play(this._animationName,1),t.curAnimationCache=this,this._invalid=!1,this._frameIdx=-1,this.totalTime=0,this.isCompleted=!1}},end:function(){this._needToUpdate()||(this._armatureInfo.curAnimationCache=null,this.frames.length=this._frameIdx+1,this.isCompleted=!0)},_needToUpdate:function(t){return!this._armatureInfo.armature.animation.isCompleted&&this.totalTime<30&&(null==t||this._frameIdx<t)},updateToFrame:function(t){if(this._inited&&(this.begin(),this._needToUpdate(t))){var e=this._armatureInfo.armature;do{e.advanceTime(1/60),this._frameIdx++,this._updateFrame(e,this._frameIdx),this.totalTime+=1/60}while(this._needToUpdate(t));this.end()}},isInited:function(){return this._inited},isInvalid:function(){return this._invalid},invalidAllFrame:function(){this.isCompleted=!1,this._invalid=!0},updateAllFrame:function(){this.invalidAllFrame(),this.updateToFrame()},enableCacheAttachedInfo:function(){this._enableCacheAttachedInfo||(this._enableCacheAttachedInfo=!0,this.invalidAllFrame())},_updateFrame:function(t,e){c=0,s=0,o=0,l=null,h=null,u=0,f=0,_=0,d=0,p=null,this.frames[e]=this.frames[e]||{segments:[],colors:[],boneInfos:[],vertices:null,uintVert:null,indices:null};var i=this.frames[e],n=this._tempSegments=i.segments,m=this._tempColors=i.colors,v=this._tempBoneInfos=i.boneInfos;this._traverseArmature(t,1),d>0&&(m[d-1].vfOffset=c),m.length=d,v.length=s;var g=_-1;if(g>=0)if(f>0){var y=n[g];y.indexCount=f,y.vfCount=5*u,y.vertexCount=u,n.length=_}else n.length=_-1;if(0!==n.length){var T=i.vertices,A=i.uintVert;(!T||T.length<c)&&(T=i.vertices=new Float32Array(c),A=i.uintVert=new Uint32Array(T.buffer));for(var b=0,E=0;b<c;)T[b++]=r[E++],T[b++]=r[E++],T[b++]=r[E++],T[b++]=r[E++],A[b++]=r[E++];var C=i.indices;(!C||C.length<o)&&(C=i.indices=new Uint16Array(o));for(var x=0;x<o;x++)C[x]=a[x];i.vertices=T,i.uintVert=A,i.indices=C}},_traverseArmature:function(t,e){var m,v,g,y,T,A,b,E,C,x=this._tempColors,S=this._tempSegments,w=this._tempBoneInfos,D=r,M=a,R=t._slots,I=t._bones;if(this._enableCacheAttachedInfo)for(var O=0,P=I.length;O<P;O++,s++){var N=I[O],F=w[s];F||(F=w[s]={globalTransformMatrix:new dragonBones.Matrix});var L=N.globalTransformMatrix;F.globalTransformMatrix.copyFrom(L)}for(var B=0,k=R.length;B<k;B++)if((g=R[B])._visible&&g._displayData)if(g.updateWorldMatrix(),T=g._color,g.childArmature)this._traverseArmature(g.childArmature,e*T.a/255);else if(b=g.getTexture()){l===b.nativeUrl&&h===g._blendMode||(l=b.nativeUrl,h=g._blendMode,(E=_-1)>=0&&(f>0?((C=S[E]).indexCount=f,C.vertexCount=u,C.vfCount=5*u):_--),S[_]={tex:b,blendMode:g._blendMode,indexCount:0,vertexCount:0,vfCount:0},_++,f=0,u=0),A=(T.a*e<<24>>>0)+(T.b<<16)+(T.g<<8)+T.r,p!==A&&(p=A,d>0&&(x[d-1].vfOffset=c),x[d++]={r:T.r,g:T.g,b:T.b,a:T.a*e,vfOffset:0}),m=g._localVertices,v=g._indices,y=g._worldMatrix.m;for(var V=0,U=m.length;V<U;)i=m[V++],n=m[V++],D[c++]=i*y[0]+n*y[4]+y[12],D[c++]=i*y[1]+n*y[5]+y[13],D[c++]=m[V++],D[c++]=m[V++],D[c++]=A;for(var z=0,G=v.length;z<G;z++)M[o++]=u+v[z];f+=v.length,u+=m.length/4}}}),v=cc.Class({ctor:function(){this._privateMode=!1,this._animationPool={},this._armatureCache={}},enablePrivateMode:function(){this._privateMode=!0},dispose:function(){for(var t in this._armatureCache){var e=this._armatureCache[t];if(e){var i=e.armature;i&&i.dispose()}}this._armatureCache=null,this._animationPool=null},_removeArmature:function(t){var e=this._armatureCache[t],i=e.animationsCache;for(var n in i){var r=i[n];r&&(this._animationPool[t+"#"+n]=r,r.clear())}var a=e.armature;a&&a.dispose(),delete this._armatureCache[t]},resetArmature:function(t){for(var e in this._armatureCache)-1!=e.indexOf(t)&&this._removeArmature(e)},getArmatureCache:function(t,e,i){var n,r=this._armatureCache[e];if(r)n=r.armature;else{var a=dragonBones.CCFactory.getInstance().buildArmatureDisplay(t,e,"",i);if(!a||!a._armature)return;if(n=a._armature,!v.canCache(n))return void n.dispose();this._armatureCache[e]={armature:n,animationsCache:{},curAnimationCache:null}}return n},getAnimationCache:function(t,e){var i=this._armatureCache[t];return i?i.animationsCache[e]:null},initAnimationCache:function(t,e){if(!e)return null;var i=this._armatureCache[t],n=i&&i.armature;if(!n)return null;if(!n.animation.hasAnimation(e))return null;var r=i.animationsCache,a=r[e];if(!a){var s=t+"#"+e;(a=this._animationPool[s])?delete this._animationPool[s]:(a=new m)._privateMode=this._privateMode,a.init(i,e),r[e]=a}return a},invalidAnimationCache:function(t){var e=this._armatureCache[t];if(!e||!e.armature)return null;var i=e.animationsCache;for(var n in i)i[n].invalidAllFrame()},updateAnimationCache:function(t,e){if(e){var i=this.initAnimationCache(t,e);if(!i)return;i.updateAllFrame()}else{var n=this._armatureCache[t];if(!n||!n.armature)return null;var r=n.animationsCache;for(var a in r)r[a].updateAllFrame()}}});v.FrameTime=1/60,v.sharedCache=new v,v.canCache=function(t){for(var e=t._slots,i=0,n=e.length;i<n;i++)if(e[i].childArmature)return!1;return!0},e.exports=v}),{}],319:[(function(t,e){"use strict";var i=t("../../cocos2d/core/components/CCRenderComponent"),n=t("../../cocos2d/core/event/event-target"),r=t("../../cocos2d/core/graphics/graphics"),a=t("../../cocos2d/core/renderer/render-flow").FLAG_POST_RENDER,s=t("./ArmatureCache"),o=t("./AttachUtil"),c=cc.Enum({default:-1}),l=cc.Enum({"<None>":0}),h=(cc.Enum({REALTIME:0}),cc.Enum({REALTIME:0,SHARED_CACHE:1,PRIVATE_CACHE:2})),u=cc.Class({name:"dragonBones.ArmatureDisplay",extends:i,editor:!1,statics:{AnimationCacheMode:h},properties:{_factory:{default:null,type:dragonBones.CCFactory,serializable:!1},dragonAsset:{default:null,type:dragonBones.DragonBonesAsset,notify:function(){this._refresh()},tooltip:!1},dragonAtlasAsset:{default:null,type:dragonBones.DragonBonesAtlasAsset,notify:function(){this._parseDragonAtlasAsset(),this._refresh()},tooltip:!1},_armatureName:"",armatureName:{get:function(){return this._armatureName},set:function(t){this._armatureName=t;var e=this.getAnimationNames(this._armatureName);(!this.animationName||e.indexOf(this.animationName)<0)&&(this.animationName=""),this._armature&&!this.isAnimationCached()&&this._factory._dragonBones.clock.remove(this._armature),this._refresh(),this._armature&&!this.isAnimationCached()&&this._factory._dragonBones.clock.add(this._armature)},visible:!1},_animationName:"",animationName:{get:function(){return this._animationName},set:function(t){this._animationName=t},visible:!1},_defaultArmatureIndex:{default:0,notify:function(){var t="";if(this.dragonAsset){var e;if(this.dragonAsset&&(e=this.dragonAsset.getArmatureEnum()),!e)return cc.errorID(7400,this.name);t=e[this._defaultArmatureIndex]}void 0!==t?this.armatureName=t:cc.errorID(7401,this.name)},type:c,visible:!0,editorOnly:!0,animatable:!1,displayName:"Armature",tooltip:!1},_animationIndex:{default:0,notify:function(){var t;if(0!==this._animationIndex){if(this.dragonAsset&&(t=this.dragonAsset.getAnimsEnum(this.armatureName)),t){var e=t[this._animationIndex];void 0!==e?this.playAnimation(e,this.playTimes):cc.errorID(7402,this.name)}}else this.animationName=""},type:l,visible:!0,editorOnly:!0,animatable:!1,displayName:"Animation",tooltip:!1},_preCacheMode:-1,_cacheMode:h.REALTIME,_defaultCacheMode:{default:0,type:h,notify:function(){if(this._defaultCacheMode!==h.REALTIME&&this._armature&&!s.canCache(this._armature))return this._defaultCacheMode=h.REALTIME,void cc.warn("Animation cache mode doesn't support skeletal nesting");this.setAnimationCacheMode(this._defaultCacheMode)},editorOnly:!0,visible:!0,animatable:!1,displayName:"Animation Cache Mode",tooltip:!1},timeScale:{default:1,notify:function(){this._armature&&!this.isAnimationCached()&&(this._armature.animation.timeScale=this.timeScale)},tooltip:!1},playTimes:{default:-1,tooltip:!1},premultipliedAlpha:{default:!1,tooltip:!1},debugBones:{default:!1,notify:function(){this._updateDebugDraw()},tooltip:!1},enableBatch:{default:!1,notify:function(){this._updateBatch()},tooltip:!1},_armatureKey:"",_accTime:0,_playCount:0,_frameCache:null,_curFrame:null,_playing:!1,_armatureCache:null},ctor:function(){this._eventTarget=new n,this._materialCache={},this._inited=!1,this.attachUtil=new o,this._factory=dragonBones.CCFactory.getInstance()},onLoad:function(){for(var t=this.node.children,e=0,i=t.length;e<i;e++){var n=t[e];0===(n._name&&n._name.search("CHILD_ARMATURE-"))&&n.destroy()}},_updateBatch:function(){var t=this.getMaterial(0);t&&t.define("CC_USE_MODEL",!this.enableBatch),this._materialCache={}},_updateMaterial:function(){var t=this.getMaterial(0);if(t){t.define("CC_USE_MODEL",!this.enableBatch),t.define("USE_TEXTURE",!0);var e=this.premultipliedAlpha?cc.gfx.BLEND_ONE:cc.gfx.BLEND_SRC_ALPHA,i=cc.gfx.BLEND_ONE_MINUS_SRC_ALPHA;t.setBlend(!0,cc.gfx.BLEND_FUNC_ADD,e,e,cc.gfx.BLEND_FUNC_ADD,i,i)}this._materialCache={}},disableRender:function(){this._super(),this.node._renderFlag&=~a},markForRender:function(t){this._super(t),t?this.node._renderFlag|=a:this.node._renderFlag&=~a},_validateRender:function(){var t=this.dragonAtlasAsset&&this.dragonAtlasAsset.texture;t&&t.loaded?this._super():this.disableRender()},__preload:function(){this._init()},_init:function(){if(!this._inited){this._inited=!0,this._resetAssembler(),this._activateMaterial(),this._parseDragonAtlasAsset(),this._refresh();for(var t=this.node.children,e=0,i=t.length;e<i;e++){var n=t[e];n&&"DEBUG_DRAW_NODE"===n._name&&n.destroy()}this._updateDebugDraw()}},getArmatureKey:function(){return this._armatureKey},setAnimationCacheMode:function(t){this._preCacheMode!==t&&(this._cacheMode=t,this._buildArmature(),this._armature&&!this.isAnimationCached()&&this._factory._dragonBones.clock.add(this._armature))},isAnimationCached:function(){return this._cacheMode!==h.REALTIME},onEnable:function(){this._super(),this._armature&&!this.isAnimationCached()&&this._factory._dragonBones.clock.add(this._armature)},onDisable:function(){this._super(),this._armature&&!this.isAnimationCached()&&this._factory._dragonBones.clock.remove(this._armature)},_emitCacheCompleteEvent:function(){this._eventTarget.emit(dragonBones.EventObject.LOOP_COMPLETE),this._eventTarget.emit(dragonBones.EventObject.COMPLETE)},update:function(t){if(this.isAnimationCached()&&this._frameCache){var e=this._frameCache;if(e.isInited()){var i=e.frames;if(this._playing){var n=s.FrameTime;0==this._accTime&&0==this._playCount&&this._eventTarget.emit(dragonBones.EventObject.START);var r=dragonBones.timeScale;this._accTime+=t*this.timeScale*r;var a=Math.floor(this._accTime/n);if(e.isCompleted||e.updateToFrame(a),e.isCompleted&&a>=i.length){if(this._playCount++,this.playTimes>0&&this._playCount>=this.playTimes)return this._curFrame=i[i.length-1],this._accTime=0,this._playing=!1,this._playCount=0,void this._emitCacheCompleteEvent();this._accTime=0,a=0,this._emitCacheCompleteEvent()}this._curFrame=i[a]}else e.isInvalid()&&(e.updateToFrame(),this._curFrame=i[i.length-1])}}},onDestroy:function(){this._super(),this._inited=!1,this._cacheMode===h.PRIVATE_CACHE?(this._armatureCache.dispose(),this._armatureCache=null,this._armature=null):this._cacheMode===h.SHARED_CACHE?(this._armatureCache=null,this._armature=null):this._armature&&(this._armature.dispose(),this._armature=null)},_updateDebugDraw:function(){if(this.debugBones){if(!this._debugDraw){var t=new cc.PrivateNode;t.name="DEBUG_DRAW_NODE";var e=t.addComponent(r);e.lineWidth=1,e.strokeColor=cc.color(255,0,0,255),this._debugDraw=e}this._debugDraw.node.parent=this.node}else this._debugDraw&&(this._debugDraw.node.parent=null)},_buildArmature:function(){if(this.dragonAsset&&this.dragonAtlasAsset&&this.armatureName){this._armature&&(this._preCacheMode===h.PRIVATE_CACHE?this._armatureCache.dispose():this._preCacheMode===h.REALTIME&&this._armature.dispose(),this._armatureCache=null,this._armature=null,this._displayProxy=null,this._frameCache=null,this._curFrame=null,this._playing=!1,this._preCacheMode=null),this._cacheMode===h.SHARED_CACHE?this._armatureCache=s.sharedCache:this._cacheMode===h.PRIVATE_CACHE&&(this._armatureCache=new s,this._armatureCache.enablePrivateMode());var t=this.dragonAtlasAsset._uuid;if(this._armatureKey=this.dragonAsset.init(this._factory,t),this.isAnimationCached()&&(this._armature=this._armatureCache.getArmatureCache(this.armatureName,this._armatureKey,t),this._armature||(this._cacheMode=h.REALTIME)),this._preCacheMode=this._cacheMode,this._cacheMode===h.REALTIME){if(this._displayProxy=this._factory.buildArmatureDisplay(this.armatureName,this._armatureKey,"",t),!this._displayProxy)return;this._displayProxy._ccNode=this.node,this._displayProxy.setEventTarget(this._eventTarget),this._armature=this._displayProxy._armature,this._armature.animation.timeScale=this.timeScale}if(this._cacheMode!==h.REALTIME&&this.debugBones&&cc.warn("Debug bones is invalid in cached mode"),this._armature){var e=this._armature.armatureData.aabb;this.node.setContentSize(e.width,e.height)}this._updateBatch(),this.attachUtil.init(this),this.attachUtil._associateAttachedNode(),this.animationName&&this.playAnimation(this.animationName,this.playTimes),this.markForRender(!0)}},_parseDragonAtlasAsset:function(){this.dragonAtlasAsset&&this.dragonAtlasAsset.init(this._factory)},_refresh:function(){this._buildArmature()},_updateCacheModeEnum:!1,_updateAnimEnum:!1,_updateArmatureEnum:!1,playAnimation:function(t,e){if(this.playTimes=void 0===e?-1:e,this.animationName=t,this.isAnimationCached()){var i=this._armatureCache.getAnimationCache(this._armatureKey,t);i||(i=this._armatureCache.initAnimationCache(this._armatureKey,t)),i&&(this._accTime=0,this._playCount=0,this._frameCache=i,this.attachUtil._hasAttachedNode()&&this._frameCache.enableCacheAttachedInfo(),this._frameCache.updateToFrame(0),this._playing=!0,this._curFrame=this._frameCache.frames[0])}else if(this._armature)return this._armature.animation.play(t,this.playTimes)},updateAnimationCache:function(t){this.isAnimationCached()&&this._armatureCache.updateAnimationCache(this._armatureKey,t)},invalidAnimationCache:function(){this.isAnimationCached()&&this._armatureCache.invalidAnimationCache(this._armatureKey)},getArmatureNames:function(){var t=this._factory.getDragonBonesData(this._armatureKey);return t&&t.armatureNames||[]},getAnimationNames:function(t){var e=[],i=this._factory.getDragonBonesData(this._armatureKey);if(i){var n=i.getArmature(t);if(n)for(var r in n.animations)n.animations.hasOwnProperty(r)&&e.push(r)}return e},on:function(t,e,i){this.addEventListener(t,e,i)},off:function(t,e,i){this.removeEventListener(t,e,i)},once:function(t,e,i){this._eventTarget.once(t,e,i)},addEventListener:function(t,e,i){this._eventTarget.on(t,e,i)},removeEventListener:function(t,e,i){this._eventTarget.off(t,e,i)},buildArmature:function(t,e){return this._factory.createArmatureNode(this,t,e)},armature:function(){return this._armature}});e.exports=dragonBones.ArmatureDisplay=u}),{"../../cocos2d/core/components/CCRenderComponent":115,"../../cocos2d/core/event/event-target":141,"../../cocos2d/core/graphics/graphics":157,"../../cocos2d/core/renderer/render-flow":200,"./ArmatureCache":318,"./AttachUtil":320}],320:[(function(t,e){"use strict";var i,n=(i=t("../../cocos2d/core/value-types/mat4"))&&i.__esModule?i:{default:i},r=t("../../cocos2d/core/renderer/render-flow").FLAG_TRANSFORM,a=function(){},s=function(t){Object.defineProperty(t,"_worldMatDirty",{get:function(){return!0},set:function(){}}),t._calculWorldMatrix=a,t._mulMat=a},o=new n.default,c=cc.Class({name:"dragonBones.AttachUtil",ctor:function(){this._inited=!1,this._armature=null,this._armatureNode=null,this._armatureDisplay=null,this._attachedRootNode=null,this._attachedNodeArray=[],this._boneIndexToNode={}},init:function(t){this._inited=!0,this._armature=t._armature,this._armatureNode=t.node,this._armatureDisplay=t},reset:function(){this._inited=!1,this._armature=null,this._armatureNode=null,this._armatureDisplay=null},_prepareAttachNode:function(){if(this._armature){var t=this._armatureNode.getChildByName("ATTACHED_NODE_TREE");return t&&t.isValid||(t=new cc.Node("ATTACHED_NODE_TREE"),s(t),this._armatureNode.addChild(t)),this._armatureDisplay.isAnimationCached()&&this._armatureDisplay._frameCache&&this._armatureDisplay._frameCache.enableCacheAttachedInfo(),this._attachedRootNode=t,t}},_buildBoneAttachedNode:function(t,e){var i="ATTACHED_NODE:"+t.name,n=new cc.Node(i);return this._buildBoneRelation(n,t,e),n},_buildBoneRelation:function(t,e,i){s(t),t._bone=e,t._boneIndex=i,this._attachedNodeArray.push(t),this._boneIndexToNode[i]=t},getAttachedRootNode:function(){return this._attachedRootNode},getAttachedNodes:function(t){var e=this._attachedNodeArray,i=[];if(!this._inited)return i;for(var n=0,r=e.length;n<r;n++){var a=e[n];a&&a.isValid&&a.name==="ATTACHED_NODE:"+t&&i.push(a)}return i},_rebuildNodeArray:function(){for(var t=this._boneIndexToNode={},e=this._attachedNodeArray,i=this._attachedNodeArray=[],n=0,r=e.length;n<r;n++){var a=e[n];a&&a.isValid&&!a._toRemove&&(i.push(a),t[a._boneIndex]=a)}},_sortNodeArray:function(){this._attachedNodeArray.sort((function(t,e){return t._boneIndex<e._boneIndex?-1:1}))},_getNodeByBoneIndex:function(t){var e=this._boneIndexToNode[t];return e&&e.isValid?e:null},destroyAttachedNodes:function(t){if(this._inited){for(var e=this._attachedNodeArray,i=function t(e){for(var i=e.children,n=0,r=i.length;n<r;n++){var a=i[n];a&&t(a)}e._toRemove=!0},n=0,r=e.length;n<r;n++){var a=e[n];a&&a.isValid&&a.name.split("ATTACHED_NODE:")[1]===t&&(i(a),a.removeFromParent(!0),a.destroy(),e[n]=null)}this._rebuildNodeArray()}},generateAttachedNodes:function(t){var e=[];if(!this._inited)return e;var i=this._prepareAttachNode();if(!i)return e;var n=0,r=[],a=function(e){if(e){for(var i,s=e.getBones(),o=0,c=s.length;o<c;o++)(i=s[o])._boneIndex=n++,t===i.name&&r.push(i);for(var l,h=e.getSlots(),u=0,f=h.length;u<f;u++)(l=h[u]).childArmature&&a(l.childArmature)}}.bind(this);a(this._armature);for(var s=function(t){if(t){var e=this._getNodeByBoneIndex(t._boneIndex);if(e)return e;e=this._buildBoneAttachedNode(t,t._boneIndex);var n=null;t.armature.parent&&(n=t.armature.parent.parent);var r=s(t.parent||n)||i;return e.parent=r,t.parent?e._rootNode=r._rootNode:e._rootNode=r,e}}.bind(this),o=0,c=r.length;o<c;o++){var l=s(r[o]);l&&e.push(l)}return this._sortNodeArray(),e},destroyAllAttachedNodes:function(){if(this._attachedRootNode=null,this._attachedNodeArray.length=0,this._boneIndexToNode={},this._inited){var t=this._armatureNode.getChildByName("ATTACHED_NODE_TREE");t&&(t.removeFromParent(!0),t.destroy(),t=null)}},generateAllAttachedNodes:function(){if(this._inited){this._boneIndexToNode={},this._attachedNodeArray.length=0;var t=this._prepareAttachNode();if(t){var e=0,i=function(n){if(n){var r=t;n.parent&&(r=n.parent.parent._attachedNode);for(var a,s=n.getBones(),o=0,c=s.length;o<c;o++){var l=e++;(a=s[o])._attachedNode=null;var h=null;if(h=a.parent?a.parent._attachedNode:r){var u=h.getChildByName("ATTACHED_NODE:"+a.name);u&&u.isValid?this._buildBoneRelation(u,a,l):(u=this._buildBoneAttachedNode(a,l),h.addChild(u)),u._rootNode=r,a._attachedNode=u}}for(var f,_=n.getSlots(),d=0,p=_.length;d<p;d++)(f=_[d]).childArmature&&i(f.childArmature)}}.bind(this);return i(this._armature),t}}},_hasAttachedNode:function(){return!!this._inited&&!!this._armatureNode.getChildByName("ATTACHED_NODE_TREE")},_associateAttachedNode:function(){if(this._inited){var t=this._armatureNode.getChildByName("ATTACHED_NODE_TREE");if(t&&t.isValid){this._attachedRootNode=t,this._boneIndexToNode={},this._attachedNodeArray.length=0;var e=this._armature;if(e){s(t),this._armatureDisplay.isAnimationCached()&&this._armatureDisplay._frameCache&&this._armatureDisplay._frameCache.enableCacheAttachedInfo();var i=0,n=function(e){if(e){var r=t;e.parent&&(r=e.parent.parent._attachedNode);for(var a,s=e.getBones(),o=0,c=s.length;o<c;o++){var l=i++;(a=s[o])._attachedNode=null;var h=null;if(h=a.parent?a.parent._attachedNode:r){var u=h.getChildByName("ATTACHED_NODE:"+a.name);u&&u.isValid&&(this._buildBoneRelation(u,a,l),u._rootNode=r,a._attachedNode=u)}}for(var f,_=e.getSlots(),d=0,p=_.length;d<p;d++)(f=_[d]).childArmature&&n(f.childArmature)}}.bind(this);n(e)}}}},_syncAttachedNode:function(){if(this._inited){var t=this._attachedRootNode,e=this._attachedNodeArray;if(!t||!t.isValid)return this._attachedRootNode=null,void(e.length=0);var i=this._armatureNode._worldMatrix;n.default.copy(t._worldMatrix,i),t._renderFlag&=~r;var a=null,s=this._armatureDisplay.isAnimationCached();if(!s||(a=this._armatureDisplay._curFrame&&this._armatureDisplay._curFrame.boneInfos)){for(var c,l,h,u,f=this._armatureNode._mulMat,_=!1,d=0,p=e.length;d<p;d++){var m=e[d];if(m&&m.isValid){var v=s?a[m._boneIndex]:m._bone;v&&!v._isInPool?(c=m._worldMatrix,l=m._rootNode._worldMatrix,h=v.globalTransformMatrix,u=void 0,(u=o.m)[0]=h.a,u[1]=h.b,u[4]=-h.c,u[5]=-h.d,u[12]=h.tx,u[13]=h.ty,f(c,l,o),m._renderFlag&=~r):(m.removeFromParent(!0),m.destroy(),e[d]=null,_=!0)}else e[d]=null,_=!0}_&&this._rebuildNodeArray()}}}});e.exports=dragonBones.AttachUtil=c}),{"../../cocos2d/core/renderer/render-flow":200,"../../cocos2d/core/value-types/mat4":259}],321:[(function(t){"use strict";var e=t("../../cocos2d/core/event/event-target");dragonBones.CCArmatureDisplay=cc.Class({name:"dragonBones.CCArmatureDisplay",properties:{node:{get:function(){return this}}},ctor:function(){this._eventTarget=new e},setEventTarget:function(t){this._eventTarget=t},getRootDisplay:function(){var t,e=this._armature._parent;if(!e)return this;for(;e;)t=e,e=e._armature._parent;return t._armature.getDisplay()},convertToRootSpace:function(t){var e=this._armature._parent;if(!e)return t;e.updateWorldMatrix();var i=e._worldMatrix.m,n=cc.v2(0,0);return n.x=t.x*i[0]+t.y*i[4]+i[12],n.y=t.x*i[1]+t.y*i[5]+i[13],n},convertToWorldSpace:function(t){var e=this.convertToRootSpace(t);return this.getRootNode().convertToWorldSpaceAR(e)},getRootNode:function(){var t=this.getRootDisplay();return t&&t._ccNode},dbInit:function(t){this._armature=t},dbClear:function(){this._armature=null},dbUpdate:function(){},advanceTimeBySelf:function(t){this.shouldAdvanced=!!t},hasDBEventListener:function(t){return this._eventTarget.hasEventListener(t)},addDBEventListener:function(t,e,i){this._eventTarget.on(t,e,i)},removeDBEventListener:function(t,e,i){this._eventTarget.off(t,e,i)},dispatchDBEvent:function(t,e){this._eventTarget.emit(t,e)}})}),{"../../cocos2d/core/event/event-target":141}],322:[(function(){"use strict";var t=dragonBones.BaseObject,e=dragonBones.BaseFactory,i=dragonBones.CCFactory=cc.Class({name:"dragonBones.CCFactory",extends:e,statics:{_factory:null,getInstance:function(){return i._factory||(i._factory=new i),i._factory}},ctor:function(){var t=new dragonBones.CCArmatureDisplay;this._dragonBones=new dragonBones.DragonBones(t),cc.director._scheduler&&(cc.game.on(cc.game.EVENT_RESTART,this.initUpdate,this),this.initUpdate())},initUpdate:function(){cc.director._scheduler.enableForTarget(this),cc.director._scheduler.scheduleUpdate(this,cc.Scheduler.PRIORITY_SYSTEM,!1)},update:function(t){this._dragonBones.advanceTime(t)},getDragonBonesDataByRawData:function(t){return(t instanceof ArrayBuffer?e._binaryParser:this._dataParser).parseDragonBonesData(t,1)},buildArmatureDisplay:function(t,e,i,n){var r=this.buildArmature(t,e,i,n);return r&&r._display},createArmatureNode:function(t,e,i){var n=(i=i||new cc.Node).getComponent(dragonBones.ArmatureDisplay);return n||(n=i.addComponent(dragonBones.ArmatureDisplay)),i.name=e,n._armatureName=e,n._N$dragonAsset=t.dragonAsset,n._N$dragonAtlasAsset=t.dragonAtlasAsset,n._init(),n},_buildTextureAtlasData:function(e,i){return e?e.renderTexture=i:e=t.borrowObject(dragonBones.CCTextureAtlasData),e},_sortSlots:function(){for(var t=this._slots,e=[],i=0,n=t.length;i<n;i++){for(var r=t[i],a=r._zOrder,s=!1,o=e.length-1;o>=0;o--)if(a>=e[o]._zOrder){e.splice(o+1,0,r),s=!0;break}s||e.unshift(r)}this._slots=e},_buildArmature:function(e){var i=t.borrowObject(dragonBones.Armature);i._skinData=e.skin,i._animation=t.borrowObject(dragonBones.Animation),i._animation._armature=i,i._animation.animations=e.armature.animations,i._isChildArmature=!1;var n=new dragonBones.CCArmatureDisplay;return i.init(e.armature,n,n,this._dragonBones),i},_buildSlot:function(e,i,n){var r=t.borrowObject(dragonBones.CCSlot),a=r;return r.init(i,n,a,a),r},getDragonBonesDataByUUID:function(t){for(var e in this._dragonBonesDataMap)if(-1!=e.indexOf(t))return this._dragonBonesDataMap[e];return null},removeDragonBonesDataByUUID:function(t,e){for(var i in void 0===e&&(e=!0),this._dragonBonesDataMap)-1!==i.indexOf(t)&&(e&&this._dragonBones.bufferObject(this._dragonBonesDataMap[i]),delete this._dragonBonesDataMap[i])}})}),{}],323:[(function(t){"use strict";var e,i=(e=t("../../cocos2d/core/value-types/mat4"))&&e.__esModule?e:{default:e},n=dragonBones.BinaryOffset,r=dragonBones.BoneType;dragonBones.CCSlot=cc.Class({name:"dragonBones.CCSlot",extends:dragonBones.Slot,ctor:function(){this._localVertices=[],this._indices=[],this._matrix=cc.mat4(),this._worldMatrix=cc.mat4(),this._worldMatrixDirty=!0,this._visible=!1,this._color=cc.color()},_onClear:function(){this._super(),this._localVertices.length=0,this._indices.length=0,i.default.identity(this._matrix),i.default.identity(this._worldMatrix),this._worldMatrixDirty=!0,this._color=cc.color(),this._visible=!1},statics:{toString:function(){return"[class dragonBones.CCSlot]"}},_onUpdateDisplay:function(){},_initDisplay:function(){},_addDisplay:function(){this._visible=!0},_replaceDisplay:function(){},_removeDisplay:function(){this._visible=!1},_disposeDisplay:function(){},_updateVisible:function(){this._visible=this.parent._visible},_updateZOrder:function(){},_updateBlendMode:function(){if(this._childArmature)for(var t=this._childArmature.getSlots(),e=0,i=t.length;e<i;e++){var n=t[e];n._blendMode=this._blendMode,n._updateBlendMode()}},_updateColor:function(){var t=this._color;t.r=255*this._colorTransform.redMultiplier,t.g=255*this._colorTransform.greenMultiplier,t.b=255*this._colorTransform.blueMultiplier,t.a=255*this._colorTransform.alphaMultiplier},getTexture:function(){return this._textureData&&this._textureData.spriteFrame&&this._textureData.spriteFrame.getTexture()},_updateFrame:function(){this._indices.length=0;var t=this._indices,e=this._localVertices,i=0,r=0,a=this._textureData;if(this._display&&!(this._displayIndex<0)&&a&&a.spriteFrame){var s=a.spriteFrame.getTexture(),o=s.width,c=s.height,l=a.region,h=null!==this._deformVertices&&this._display===this._meshDisplay?this._deformVertices.verticesData:null;if(h){var u=h.data,f=u.intArray,_=u.floatArray,d=f[h.offset+n.MeshVertexCount],p=f[h.offset+n.MeshTriangleCount],m=f[h.offset+n.MeshFloatOffset];m<0&&(m+=65536);for(var v=m+2*d,g=this._armature._armatureData.scale,y=0,T=2*d;y<T;y+=2)e[r++]=_[m+y]*g,e[r++]=-_[m+y+1]*g,h.rotated?(e[r++]=(l.x+(1-_[v+y])*l.width)/o,e[r++]=(l.y+_[v+y+1]*l.height)/c):(e[r++]=(l.x+_[v+y]*l.width)/o,e[r++]=(l.y+_[v+y+1]*l.height)/c);for(var A=0;A<3*p;++A)t[i++]=f[h.offset+n.MeshVertexIndices+A];e.length=r,t.length=i,h.weight&&this._identityTransform()}else{var b=l.x/o,E=(l.y+l.height)/c,C=(l.x+l.width)/o,x=l.y/c;e[r++]=0,e[r++]=0,e[r++]=b,e[r++]=E,e[r++]=l.width,e[r++]=0,e[r++]=C,e[r++]=E,e[r++]=0,e[r++]=l.height,e[r++]=b,e[r++]=x,e[r++]=l.width,e[r++]=l.height,e[r++]=C,e[r++]=x,t[0]=0,t[1]=1,t[2]=2,t[3]=1,t[4]=3,t[5]=2,e.length=r,t.length=6}this._visibleDirty=!0,this._blendModeDirty=!0,this._colorDirty=!0}},_updateMesh:function(){var t=this._armature._armatureData.scale,e=this._deformVertices.vertices,i=this._deformVertices.bones,a=this._deformVertices.verticesData,s=a.weight,o=e.length>0&&a.inheritDeform,c=this._localVertices;if(s){var l=a.data,h=l.intArray,u=l.floatArray,f=h[a.offset+n.MeshVertexCount],_=h[s.offset+n.WeigthFloatOffset];_<0&&(_+=65536);for(var d=0,p=s.offset+n.WeigthBoneIndices+i.length,m=_,v=0,g=0;d<f;d++,g+=4){for(var y=h[p++],T=0,A=0,b=0;b<y;++b){var E=i[h[p++]];if(null!==E){var C=E.globalTransformMatrix,x=u[m++],S=u[m++]*t,w=u[m++]*t;o&&(S+=e[v++],w+=e[v++]),T+=(C.a*S+C.c*w+C.tx)*x,A+=(C.b*S+C.d*w+C.ty)*x}}c[g]=T,c[g+1]=-A}}else if(o){var D=this._parent._boneData.type!==r.Bone,M=a.data,R=M.intArray,I=M.floatArray,O=R[a.offset+n.MeshVertexCount],P=R[a.offset+n.MeshFloatOffset];P<0&&(P+=65536);for(var N=0,F=O,L=0;N<F;N++,L+=4){var B=I[P+2*N]*t+e[2*N],k=I[P+2*N+1]*t+e[2*N+1];if(D){var V=this._parent._getGlobalTransformMatrix(B,k);c[L]=V.a*B+V.c*k+V.tx,c[L+1]=-V.b*B+V.d*k+V.ty}else c[L]=B,c[L+1]=-k}}s&&this._identityTransform()},_identityTransform:function(){var t=this._matrix.m;t[0]=1,t[1]=0,t[4]=-0,t[5]=-1,t[12]=0,t[13]=0,this._worldMatrixDirty=!0},_updateTransform:function(){var t=this._matrix.m;t[0]=this.globalTransformMatrix.a,t[1]=this.globalTransformMatrix.b,t[4]=-this.globalTransformMatrix.c,t[5]=-this.globalTransformMatrix.d,this._childArmature?(t[12]=this.globalTransformMatrix.tx,t[13]=this.globalTransformMatrix.ty):(t[12]=this.globalTransformMatrix.tx-(this.globalTransformMatrix.a*this._pivotX-this.globalTransformMatrix.c*this._pivotY),t[13]=this.globalTransformMatrix.ty-(this.globalTransformMatrix.b*this._pivotX-this.globalTransformMatrix.d*this._pivotY)),this._worldMatrixDirty=!0},updateWorldMatrix:function(){if(this._armature){var t=this._armature._parent;if(t&&t.updateWorldMatrix(),this._worldMatrixDirty){this.calculWorldMatrix();var e=this.childArmature;if(!e)return;for(var i=e.getSlots(),n=0,r=i.length;n<r;n++){var a=i[n];a&&(a._worldMatrixDirty=!0)}}}},_mulMat:function(t,e,i){var n=e.m,r=i.m,a=t.m,s=n[0],o=n[1],c=n[4],l=n[5],h=n[12],u=n[13],f=r[0],_=r[1],d=r[4],p=r[5],m=r[12],v=r[13];0!==o||0!==c?(a[0]=f*s+_*c,a[1]=f*o+_*l,a[4]=d*s+p*c,a[5]=d*o+p*l,a[12]=s*m+c*v+h,a[13]=o*m+l*v+u):(a[0]=f*s,a[1]=_*l,a[4]=d*s,a[5]=p*l,a[12]=s*m+h,a[13]=l*v+u)},calculWorldMatrix:function(){var t=this._armature._parent;t?this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):i.default.copy(this._worldMatrix,this._matrix),this._worldMatrixDirty=!1}})}),{"../../cocos2d/core/value-types/mat4":259}],324:[(function(){"use strict";dragonBones.CCTextureAtlasData=cc.Class({extends:dragonBones.TextureAtlasData,name:"dragonBones.CCTextureAtlasData",properties:{_renderTexture:{default:null,serializable:!1},renderTexture:{get:function(){return this._renderTexture},set:function(t){if(this._renderTexture=t,t)for(var e in this.textures){var i=this.textures[e];if(!i.spriteFrame){var n;n=i.rotated?cc.rect(i.region.x,i.region.y,i.region.height,i.region.width):cc.rect(i.region.x,i.region.y,i.region.width,i.region.height);var r=cc.v2(0,0),a=cc.size(n.width,n.height);i.spriteFrame=new cc.SpriteFrame,i.spriteFrame.setTexture(t,n,!1,r,a)}}else for(var s in this.textures)this.textures[s].spriteFrame=null}}},statics:{toString:function(){return"[class dragonBones.CCTextureAtlasData]"}},_onClear:function(){dragonBones.TextureAtlasData.prototype._onClear.call(this),this.renderTexture=null},createTexture:function(){return dragonBones.BaseObject.borrowObject(dragonBones.CCTextureData)}}),dragonBones.CCTextureData=cc.Class({extends:dragonBones.TextureData,name:"dragonBones.CCTextureData",properties:{spriteFrame:{default:null,serializable:!1}},statics:{toString:function(){return"[class dragonBones.CCTextureData]"}},_onClear:function(){dragonBones.TextureData.prototype._onClear.call(this),this.spriteFrame=null}})}),{}],325:[(function(t,e){"use strict";var i=t("./ArmatureCache").sharedCache,n=cc.Class({name:"dragonBones.DragonBonesAsset",extends:cc.Asset,ctor:function(){this.reset()},properties:{_dragonBonesJson:"",dragonBonesJson:{get:function(){return this._dragonBonesJson},set:function(t){this._dragonBonesJson=t,this._dragonBonesJsonData=JSON.parse(t),this.reset()}},_nativeAsset:{get:function(){return this._buffer},set:function(t){this._buffer=t.buffer||t,this.reset()},override:!0}},statics:{preventDeferredLoadDependents:!0},createNode:!1,reset:function(){this._clear()},init:function(t,e){this._factory=t,!this._dragonBonesJsonData&&this.dragonBonesJson&&(this._dragonBonesJsonData=JSON.parse(this.dragonBonesJson));var i;if(i=this._dragonBonesJsonData?this._dragonBonesJsonData:this._nativeAsset,!this._uuid){var n=this._factory.getDragonBonesDataByRawData(i);n?this._uuid=n.name:cc.warn("dragonbones name is empty")}var r=this._uuid+"#"+e;return this._factory.getDragonBonesData(r)?r:(this._factory.parseDragonBonesData(i,r),r)},getArmatureEnum:!1,getAnimsEnum:!1,_clear:function(){this._factory&&(i.resetArmature(this._uuid),this._factory.removeDragonBonesDataByUUID(this._uuid,!0))},destroy:function(){this._clear(),this._super()}});dragonBones.DragonBonesAsset=e.exports=n}),{"./ArmatureCache":318}],326:[(function(t,e){"use strict";var i=t("./ArmatureCache").sharedCache,n=cc.Class({name:"dragonBones.DragonBonesAtlasAsset",extends:cc.Asset,ctor:function(){this._clear()},properties:{_atlasJson:"",atlasJson:{get:function(){return this._atlasJson},set:function(t){this._atlasJson=t,this._atlasJsonData=JSON.parse(this.atlasJson),this._clear()}},_texture:{default:null,type:cc.Texture2D,formerlySerializedAs:"texture"},texture:{get:function(){return this._texture},set:function(t){this._texture=t,this._clear()}},_textureAtlasData:null},statics:{preventDeferredLoadDependents:!0},createNode:!1,init:function(t){this._factory=t,this._atlasJsonData||(this._atlasJsonData=JSON.parse(this.atlasJson));var e=this._atlasJsonData;this._uuid=this._uuid||e.name,this._textureAtlasData?t.addTextureAtlasData(this._textureAtlasData,this._uuid):this._textureAtlasData=t.parseTextureAtlasData(e,this.texture,this._uuid)},_clear:function(){this._factory&&(i.resetArmature(this._uuid),this._factory.removeTextureAtlasData(this._uuid,!0),this._factory.removeDragonBonesDataByUUID(this._uuid,!0)),this._textureAtlasData=null},destroy:function(){this._clear(),this._super()}});dragonBones.DragonBonesAtlasAsset=e.exports=n}),{"./ArmatureCache":318}],327:[(function(t){"use strict";var e="undefined"==typeof window?global:window;e.dragonBones=t("./lib/dragonBones"),cc.sys.platform!==cc.sys.TAOBAO&&cc.sys.platform!==cc.sys.TAOBAO_MINIGAME||(dragonBones=e.dragonBones),void 0!==e.dragonBones&&(dragonBones._timeScale=1,Object.defineProperty(dragonBones,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale=t,this.CCFactory.getInstance()._dragonBones.clock.timeScale=t},configurable:!0}),dragonBones.DisplayType={Image:0,Armature:1,Mesh:2},dragonBones.ArmatureType={Armature:0,MovieClip:1,Stage:2},dragonBones.ExtensionType={FFD:0,AdjustColor:10,BevelFilter:11,BlurFilter:12,DropShadowFilter:13,GlowFilter:14,GradientBevelFilter:15,GradientGlowFilter:16},dragonBones.EventType={Frame:0,Sound:1},dragonBones.ActionType={Play:0,Stop:1,GotoAndPlay:2,GotoAndStop:3,FadeIn:4,FadeOut:5},dragonBones.AnimationFadeOutMode={None:0,SameLayer:1,SameGroup:2,SameLayerAndGroup:3,All:4},dragonBones.BinaryOffset={WeigthBoneCount:0,WeigthFloatOffset:1,WeigthBoneIndices:2,MeshVertexCount:0,MeshTriangleCount:1,MeshFloatOffset:2,MeshWeightOffset:3,MeshVertexIndices:4,TimelineScale:0,TimelineOffset:1,TimelineKeyFrameCount:2,TimelineFrameValueCount:3,TimelineFrameValueOffset:4,TimelineFrameOffset:5,FramePosition:0,FrameTweenType:1,FrameTweenEasingOrCurveSampleCount:2,FrameCurveSamples:3,DeformMeshOffset:0,DeformCount:1,DeformValueCount:2,DeformValueOffset:3,DeformFloatOffset:4},dragonBones.BoneType={Bone:0,Surface:1},t("./CCFactory"),t("./CCSlot"),t("./CCTextureData"),t("./CCArmatureDisplay"),t("./ArmatureCache"),t("./DragonBonesAsset"),t("./DragonBonesAtlasAsset"),t("./ArmatureDisplay"),t("./webgl-assembler"))}),{"./ArmatureCache":318,"./ArmatureDisplay":319,"./CCArmatureDisplay":321,"./CCFactory":322,"./CCSlot":323,"./CCTextureData":324,"./DragonBonesAsset":325,"./DragonBonesAtlasAsset":326,"./lib/dragonBones":328,"./webgl-assembler":329}],328:[(function(t,e){"use strict";var i,n,r,a=Object.setPrototypeOf||Array;r||(r={}),(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://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}return e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var i=0,n=this._objects;i<n.length;i++)n[i].returnToPool();this._objects.length=0}if(this._clock.advanceTime(e),this._events.length>0){for(var r=0;r<this._events.length;++r){var a=this._events[r],s=a.armature;null!==s._armatureData&&(s.eventDispatcher.dispatchDBEvent(a.type,a),a.type===t.EventObject.SOUND_EVENT&&this._eventManager.dispatchDBEvent(a.type,a)),this.bufferObject(a)}this._events.length=0}},e.prototype.bufferEvent=function(t){this._events.indexOf(t)<0&&this._events.push(t)},e.prototype.bufferObject=function(t){this._objects.indexOf(t)<0&&this._objects.push(t)},Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventManager",{get:function(){return this._eventManager},enumerable:!0,configurable:!0}),e.VERSION="5.6.300",e.yDown=!1,e.debug=!1,e.debugDraw=!1,e.webAssembly=!1,e})();t.DragonBones=e})(r||(r={})),console.warn||(console.warn=function(){}),console.assert||(console.assert=function(){}),Date.now||(Date.now=function(){return(new Date).getTime()}),a=function(t,e){function i(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);i.prototype=e.prototype,t.prototype=new i},(function(t){var e=(function(){function t(){this.hashCode=t._hashCode++,this._isInPool=!1}return t._returnObject=function(e){var i=String(e.constructor),n=i in t._maxCountMap?t._maxCountMap[i]:t._defaultMaxCount,r=t._poolsMap[i]=t._poolsMap[i]||[];r.length<n&&(e._isInPool?console.warn("The object is already in the pool."):(e._isInPool=!0,r.push(e)))},t.toString=function(){throw new Error},t.setMaxCount=function(e,i){if((i<0||i!=i)&&(i=0),null!==e)null!==(r=(n=String(e))in t._poolsMap?t._poolsMap[n]:null)&&r.length>i&&(r.length=i),t._maxCountMap[n]=i;else for(var n in t._defaultMaxCount=i,t._poolsMap){var r;(r=t._poolsMap[n]).length>i&&(r.length=i),n in t._maxCountMap&&(t._maxCountMap[n]=i)}},t.clearPool=function(e){if(void 0===e&&(e=null),null!==e){var i=String(e);null!==(r=i in t._poolsMap?t._poolsMap[i]:null)&&r.length>0&&(r.length=0)}else for(var n in t._poolsMap){var r;(r=t._poolsMap[n]).length=0}},t.borrowObject=function(e){var i=String(e),n=i in t._poolsMap?t._poolsMap[i]:null;if(null!==n&&n.length>0){var r=n.pop();return r._isInPool=!1,r}var a=new e;return a._onClear(),a},t.prototype.returnToPool=function(){this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=3e3,t._maxCountMap={},t._poolsMap={},t})();t.BaseObject=e})(r||(r={})),(function(t){var e=(function(){function t(t,e,i,n,r,a){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===a&&(a=0),this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=a}return 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){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.copyFromArray=function(t,e){return void 0===e&&(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],this},t.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this},t.prototype.concat=function(t){var e=this.a*t.a,i=0,n=0,r=this.d*t.d,a=this.tx*t.a+t.tx,s=this.ty*t.d+t.ty;return 0===this.b&&0===this.c||(e+=this.b*t.c,i+=this.b*t.d,n+=this.c*t.a,r+=this.c*t.b),0===t.b&&0===t.c||(i+=this.a*t.b,n+=this.d*t.c,a+=this.ty*t.c,s+=this.tx*t.b),this.a=e,this.b=i,this.c=n,this.d=r,this.tx=a,this.ty=s,this},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,a=this.ty;if(0===e&&0===i)return this.b=this.c=0,0===t||0===n?this.a=this.b=this.tx=this.ty=0:(t=this.a=1/t,n=this.d=1/n,this.tx=-t*r,this.ty=-n*a),this;var s=t*n-e*i;if(0===s)return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this;s=1/s;var o=this.a=n*s;return e=this.b=-e*s,i=this.c=-i*s,n=this.d=t*s,this.tx=-(o*r+i*a),this.ty=-(e*r+n*a),this},t.prototype.transformPoint=function(t,e,i,n){void 0===n&&(n=!1),i.x=this.a*t+this.c*e,i.y=this.b*t+this.d*e,n||(i.x+=this.tx,i.y+=this.ty)},t.prototype.transformRectangle=function(t,e){void 0===e&&(e=!1);var i=this.a,n=this.b,r=this.c,a=this.d,s=e?0:this.tx,o=e?0:this.ty,c=t.x,l=t.y,h=c+t.width,u=l+t.height,f=i*c+r*l+s,_=n*c+a*l+o,d=i*h+r*l+s,p=n*h+a*l+o,m=i*h+r*u+s,v=n*h+a*u+o,g=i*c+r*u+s,y=n*c+a*u+o,T=0;f>d&&(T=f,f=d,d=T),m>g&&(T=m,m=g,g=T),t.x=Math.floor(f<m?f:m),t.width=Math.ceil((d>g?d:g)-t.x),_>p&&(T=_,_=p,p=T),v>y&&(T=v,v=y,y=T),t.y=Math.floor(_<v?_:v),t.height=Math.ceil((p>y?p:y)-t.y)},t})();t.Matrix=e})(r||(r={})),(function(t){var e=(function(){function t(t,e,i,n,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===a&&(a=1),this.x=t,this.y=e,this.skew=i,this.rotation=n,this.scaleX=r,this.scaleY=a}return t.normalizeRadian=function(t){return(t=(t+Math.PI)%(2*Math.PI))+(t>0?-Math.PI:Math.PI)},t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+180*this.skew/Math.PI+" skewY:"+180*this.rotation/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.skew=t.skew,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this},t.prototype.identity=function(){return this.x=this.y=0,this.skew=this.rotation=0,this.scaleX=this.scaleY=1,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.skew+=t.skew,this.rotation+=t.rotation,this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this},t.prototype.minus=function(t){return this.x-=t.x,this.y-=t.y,this.skew-=t.skew,this.rotation-=t.rotation,this.scaleX/=t.scaleX,this.scaleY/=t.scaleY,this},t.prototype.fromMatrix=function(e){var i=this.scaleX,n=this.scaleY,r=t.PI_Q;this.x=e.tx,this.y=e.ty,this.rotation=Math.atan(e.b/e.a);var a=Math.atan(-e.c/e.d);return this.scaleX=this.rotation>-r&&this.rotation<r?e.a/Math.cos(this.rotation):e.b/Math.sin(this.rotation),this.scaleY=a>-r&&a<r?e.d/Math.cos(a):-e.c/Math.sin(a),i>=0&&this.scaleX<0&&(this.scaleX=-this.scaleX,this.rotation=this.rotation-Math.PI),n>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,a-=Math.PI),this.skew=a-this.rotation,this},t.prototype.toMatrix=function(t){return 0===this.rotation?(t.a=1,t.b=0):(t.a=Math.cos(this.rotation),t.b=Math.sin(this.rotation)),0===this.skew?(t.c=-t.b,t.d=t.a):(t.c=-Math.sin(this.skew+this.rotation),t.d=Math.cos(this.skew+this.rotation)),1!==this.scaleX&&(t.a*=this.scaleX,t.b*=this.scaleX),1!==this.scaleY&&(t.c*=this.scaleY,t.d*=this.scaleY),t.tx=this.x,t.ty=this.y,this},t.PI=Math.PI,t.PI_D=2*Math.PI,t.PI_H=Math.PI/2,t.PI_Q=Math.PI/4,t.RAD_DEG=180/Math.PI,t.DEG_RAD=Math.PI/180,t})();t.Transform=e})(r||(r={})),(function(t){var e=(function(){function t(t,e,i,n,r,a,s,o){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===o&&(o=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=i,this.blueMultiplier=n,this.alphaOffset=r,this.redOffset=a,this.greenOffset=s,this.blueOffset=o}return 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},t})();t.ColorTransform=e})(r||(r={})),(function(t){var e=(function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clear=function(){this.x=this.y=0},t})();t.Point=e})(r||(r={})),(function(t){var e=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n}return 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},t})();t.Rectangle=e})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ints=[],e.floats=[],e.strings=[],e}return a(e,t),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){return void 0===t&&(t=0),t>=0&&t<this.ints.length?this.ints[t]:0},e.prototype.getFloat=function(t){return void 0===t&&(t=0),t>=0&&t<this.floats.length?this.floats[t]:0},e.prototype.getString=function(t){return void 0===t&&(t=0),t>=0&&t<this.strings.length?this.strings[t]:""},e})(t.BaseObject);t.UserData=e;var i=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data=null,e}return a(e,t),e.toString=function(){return"[class dragonBones.ActionData]"},e.prototype._onClear=function(){null!==this.data&&this.data.returnToPool(),this.type=0,this.name="",this.bone=null,this.slot=null,this.data=null},e})(t.BaseObject);t.ActionData=i})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameIndices=[],e.cachedFrames=[],e.armatureNames=[],e.armatures={},e.userData=null,e}return a(e,t),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];null!==this.userData&&this.userData.returnToPool(),this.autoSearch=!1,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){t.name in this.armatures?console.warn("Same armature: "+t.name):(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("\u5df2\u5e9f\u5f03"),this.returnToPool()},e})(t.BaseObject);t.DragonBonesData=e})(r||(r={})),(function(t){var e=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return 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,i}return a(i,e),i.toString=function(){return"[class dragonBones.ArmatureData]"},i.prototype._onClear=function(){for(var t=0,e=this.defaultActions;t<e.length;t++)e[t].returnToPool();for(var i=0,n=this.actions;i<n.length;i++)n[i].returnToPool();for(var r in this.bones)this.bones[r].returnToPool(),delete this.bones[r];for(var r in this.slots)this.slots[r].returnToPool(),delete this.slots[r];for(var r in this.constraints)this.constraints[r].returnToPool(),delete this.constraints[r];for(var r in this.skins)this.skins[r].returnToPool(),delete this.skins[r];for(var r in this.animations)this.animations[r].returnToPool(),delete this.animations[r];null!==this.canvas&&this.canvas.returnToPool(),null!==this.userData&&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)){var e=this.sortedBones.concat(),i=0,n=0;for(this.sortedBones.length=0;n<t;){var r=e[i++];if(i>=t&&(i=0),!(this.sortedBones.indexOf(r)>=0)){var a=!1;for(var s in this.constraints){var o=this.constraints[s];if(o.root===r&&this.sortedBones.indexOf(o.target)<0){a=!0;break}}a||null!==r.parent&&this.sortedBones.indexOf(r.parent)<0||(this.sortedBones.push(r),n++)}}}},i.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0))for(var e in this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFrameRate)},i.prototype.setCacheFrame=function(t,e){var i=this.parent.cachedFrames,n=i.length;return i.length+=10,i[n]=t.a,i[n+1]=t.b,i[n+2]=t.c,i[n+3]=t.d,i[n+4]=t.tx,i[n+5]=t.ty,i[n+6]=e.rotation,i[n+7]=e.skew,i[n+8]=e.scaleX,i[n+9]=e.scaleY,n},i.prototype.getCacheFrame=function(t,e,i){var n=this.parent.cachedFrames;t.a=n[i],t.b=n[i+1],t.c=n[i+2],t.d=n[i+3],t.tx=n[i+4],t.ty=n[i+5],e.rotation=n[i+6],e.skew=n[i+7],e.scaleX=n[i+8],e.scaleY=n[i+9],e.x=t.tx,e.y=t.ty},i.prototype.addBone=function(t){t.name in this.bones?console.warn("Same bone: "+t.name):(this.bones[t.name]=t,this.sortedBones.push(t))},i.prototype.addSlot=function(t){t.name in this.slots?console.warn("Same slot: "+t.name):(this.slots[t.name]=t,this.sortedSlots.push(t))},i.prototype.addConstraint=function(t){t.name in this.constraints?console.warn("Same constraint: "+t.name):this.constraints[t.name]=t},i.prototype.addSkin=function(t){t.name in this.skins?console.warn("Same skin: "+t.name):(t.parent=this,this.skins[t.name]=t,null===this.defaultSkin&&(this.defaultSkin=t),"default"===t.name&&(this.defaultSkin=t))},i.prototype.addAnimation=function(t){t.name in this.animations?console.warn("Same animation: "+t.name):(t.parent=this,this.animations[t.name]=t,this.animationNames.push(t.name),null===this.defaultAnimation&&(this.defaultAnimation=t))},i.prototype.addAction=function(t,e){e?this.defaultActions.push(t):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.getMesh=function(t,e,i){var n=this.getSkin(t);return null===n?null:n.getDisplay(e,i)},i.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null},i})(t.BaseObject);t.ArmatureData=e;var i=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.transform=new t.Transform,i.userData=null,i}return a(i,e),i.toString=function(){return"[class dragonBones.BoneData]"},i.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.inheritTranslation=!1,this.inheritRotation=!1,this.inheritScale=!1,this.inheritReflection=!1,this.type=0,this.length=0,this.name="",this.transform.identity(),this.userData=null,this.parent=null},i})(t.BaseObject);t.BoneData=i;var n=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.SurfaceData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=1,this.segmentX=0,this.segmentY=0,this.vertices.length=0},e})(i);t.SurfaceData=n;var r=(function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.color=null,t.userData=null,t}return a(i,e),i.createColor=function(){return new t.ColorTransform},i.toString=function(){return"[class dragonBones.SlotData]"},i.prototype._onClear=function(){null!==this.userData&&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,i})(t.BaseObject);t.SlotData=r})(r||(r={})),(function(t){var e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype._onClear=function(){this.order=0,this.name="",this.type=0,this.target=null,this.root=null,this.bone=null},e})(t.BaseObject);t.ConstraintData=e;var i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.IKConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.scaleEnabled=!1,this.bendPositive=!1,this.weight=1},e})(e);t.IKConstraintData=i;var n=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return a(e,t),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)},e})(e);t.PathConstraintData=n})(r||(r={})),(function(t){var e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.CanvasData]"},e.prototype._onClear=function(){this.hasBackground=!1,this.color=0,this.x=0,this.y=0,this.width=0,this.height=0},e})(t.BaseObject);t.CanvasData=e})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displays={},e}return a(e,t),e.toString=function(){return"[class dragonBones.SkinData]"},e.prototype._onClear=function(){for(var t in this.displays){for(var e=0,i=this.displays[t];e<i.length;e++){var n=i[e];null!==n&&n.returnToPool()}delete this.displays[t]}this.name="",this.parent=null},e.prototype.addDisplay=function(t,e){t in this.displays||(this.displays[t]=[]),null!==e&&(e.parent=this),this.displays[t].push(e)},e.prototype.getDisplay=function(t,e){var i=this.getDisplays(t);if(null!==i)for(var n=0,r=i;n<r.length;n++){var a=r[n];if(null!==a&&a.name===e)return a}return null},e.prototype.getDisplays=function(t){return t in this.displays?this.displays[t]:null},e})(t.BaseObject);t.SkinData=e})(r||(r={})),(function(t){var e=(function(){function t(){this.weight=null}return t.prototype.clear=function(){this.isShared||null===this.weight||this.weight.returnToPool(),this.isShared=!1,this.inheritDeform=!1,this.offset=0,this.data=null,this.weight=null},t.prototype.shareFrom=function(t){this.isShared=!0,this.offset=t.offset,this.weight=t.weight},t})();t.VerticesData=e;var i=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.transform=new t.Transform,i}return a(i,e),i.prototype._onClear=function(){this.name="",this.path="",this.transform.identity(),this.parent=null},i})(t.BaseObject);t.DisplayData=i;var n=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.pivot=new t.Point,i}return a(i,e),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},i})(i);t.ImageDisplayData=n;var r=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.actions=[],e}return a(e,t),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++)i[e].returnToPool();this.type=1,this.inheritAnimation=!1,this.actions.length=0,this.armature=null},e.prototype.addAction=function(t){this.actions.push(t)},e})(i);t.ArmatureDisplayData=r;var s=(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.vertices=new e,i}return a(i,t),i.toString=function(){return"[class dragonBones.MeshDisplayData]"},i.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.vertices.clear(),this.texture=null},i})(i);t.MeshDisplayData=s;var o=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boundingBox=null,e}return a(e,t),e.toString=function(){return"[class dragonBones.BoundingBoxDisplayData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),null!==this.boundingBox&&this.boundingBox.returnToPool(),this.type=3,this.boundingBox=null},e})(i);t.BoundingBoxDisplayData=o;var c=(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.vertices=new e,i.curveLengths=[],i}return a(i,t),i.toString=function(){return"[class dragonBones.PathDisplayData]"},i.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=4,this.closed=!1,this.constantSpeed=!1,this.vertices.clear(),this.curveLengths.length=0},i})(i);t.PathDisplayData=c;var l=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return a(e,t),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)},e})(t.BaseObject);t.WeightData=l})(r||(r={})),(function(t){var e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype._onClear=function(){this.color=0,this.width=0,this.height=0},e})(t.BaseObject);t.BoundingBoxData=e;var i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.RectangleBoundingBoxData]"},e._computeOutCode=function(t,e,i,n,r,a){var s=0;return t<i?s|=1:t>r&&(s|=2),e<n?s|=4:e>a&&(s|=8),s},e.rectangleIntersectsSegment=function(t,i,n,r,a,s,o,c,l,h,u){void 0===l&&(l=null),void 0===h&&(h=null),void 0===u&&(u=null);var f=t>a&&t<o&&i>s&&i<c,_=n>a&&n<o&&r>s&&r<c;if(f&&_)return-1;for(var d=0,p=e._computeOutCode(t,i,a,s,o,c),m=e._computeOutCode(n,r,a,s,o,c);;){if(0==(p|m)){d=2;break}if(0!=(p&m))break;var v=0,g=0,y=0,T=0!==p?p:m;0!=(4&T)?(v=t+(n-t)*(s-i)/(r-i),g=s,null!==u&&(y=.5*-Math.PI)):0!=(8&T)?(v=t+(n-t)*(c-i)/(r-i),g=c,null!==u&&(y=.5*Math.PI)):0!=(2&T)?(g=i+(r-i)*(o-t)/(n-t),v=o,null!==u&&(y=0)):0!=(1&T)&&(g=i+(r-i)*(a-t)/(n-t),v=a,null!==u&&(y=Math.PI)),T===p?(t=v,i=g,p=e._computeOutCode(t,i,a,s,o,c),null!==u&&(u.x=y)):(n=v,r=g,m=e._computeOutCode(n,r,a,s,o,c),null!==u&&(u.y=y))}return d&&(f?(d=2,null!==l&&(l.x=n,l.y=r),null!==h&&(h.x=n,h.y=n),null!==u&&(u.x=u.y+Math.PI)):_?(d=1,null!==l&&(l.x=t,l.y=i),null!==h&&(h.x=t,h.y=i),null!==u&&(u.y=u.x+Math.PI)):(d=3,null!==l&&(l.x=t,l.y=i),null!==h&&(h.x=n,h.y=r))),d},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=0},e.prototype.containsPoint=function(t,e){var i=.5*this.width;if(t>=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return!0}return!1},e.prototype.intersectsSegment=function(t,i,n,r,a,s,o){void 0===a&&(a=null),void 0===s&&(s=null),void 0===o&&(o=null);var c=.5*this.width,l=.5*this.height;return e.rectangleIntersectsSegment(t,i,n,r,-c,-l,c,l,a,s,o)},e})(e);t.RectangleBoundingBoxData=i;var n=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.EllipseData]"},e.ellipseIntersectsSegment=function(t,e,i,n,r,a,s,o,c,l,h){void 0===c&&(c=null),void 0===l&&(l=null),void 0===h&&(h=null);var u=s/o,f=u*u,_=i-t,d=(n*=u)-(e*=u),p=Math.sqrt(_*_+d*d),m=_/p,v=d/p,g=(r-t)*m+(a-e)*v,y=s*s,T=y-(t*t+e*e)+g*g,A=0;if(T>=0){var b=Math.sqrt(T),E=g-b,C=g+b,x=E<0?-1:E<=p?0:1,S=C<0?-1:C<=p?0:1,w=x*S;if(w<0)return-1;0===w&&(-1===x?(A=2,i=t+C*m,n=(e+C*v)/u,null!==c&&(c.x=i,c.y=n),null!==l&&(l.x=i,l.y=n),null!==h&&(h.x=Math.atan2(n/y*f,i/y),h.y=h.x+Math.PI)):1===S?(A=1,t+=E*m,e=(e+E*v)/u,null!==c&&(c.x=t,c.y=e),null!==l&&(l.x=t,l.y=e),null!==h&&(h.x=Math.atan2(e/y*f,t/y),h.y=h.x+Math.PI)):(A=3,null!==c&&(c.x=t+E*m,c.y=(e+E*v)/u,null!==h&&(h.x=Math.atan2(c.y/y*f,c.x/y))),null!==l&&(l.x=t+C*m,l.y=(e+C*v)/u,null!==h&&(h.y=Math.atan2(l.y/y*f,l.x/y)))))}return A},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=1},e.prototype.containsPoint=function(t,e){var i=.5*this.width;if(t>=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return e*=i/n,Math.sqrt(t*t+e*e)<=i}return!1},e.prototype.intersectsSegment=function(t,i,n,r,a,s,o){return void 0===a&&(a=null),void 0===s&&(s=null),void 0===o&&(o=null),e.ellipseIntersectsSegment(t,i,n,r,0,0,.5*this.width,.5*this.height,a,s,o)},e})(e);t.EllipseBoundingBoxData=n;var r=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"},e.polygonIntersectsSegment=function(t,e,i,n,r,a,s,o){void 0===a&&(a=null),void 0===s&&(s=null),void 0===o&&(o=null),t===i&&(t=i+1e-6),e===n&&(e=n+1e-6);for(var c=r.length,l=t-i,h=e-n,u=t*n-e*i,f=0,_=r[c-2],d=r[c-1],p=0,m=0,v=0,g=0,y=0,T=0,A=0;A<c;A+=2){var b=r[A],E=r[A+1];_===b&&(_=b+1e-4),d===E&&(d=E+1e-4);var C=_-b,x=d-E,S=_*E-d*b,w=l*x-h*C,D=(u*C-l*S)/w;if((D>=_&&D<=b||D>=b&&D<=_)&&(0===l||D>=t&&D<=i||D>=i&&D<=t)){var M=(u*x-h*S)/w;if((M>=d&&M<=E||M>=E&&M<=d)&&(0===h||M>=e&&M<=n||M>=n&&M<=e)){if(null===s){v=D,g=M,y=D,T=M,f++,null!==o&&(o.x=Math.atan2(E-d,b-_)-.5*Math.PI,o.y=o.x);break}var R=D-t;R<0&&(R=-R),0===f?(p=R,m=R,v=D,g=M,y=D,T=M,null!==o&&(o.x=Math.atan2(E-d,b-_)-.5*Math.PI,o.y=o.x)):(R<p&&(p=R,v=D,g=M,null!==o&&(o.x=Math.atan2(E-d,b-_)-.5*Math.PI)),R>m&&(m=R,y=D,T=M,null!==o&&(o.y=Math.atan2(E-d,b-_)-.5*Math.PI))),f++}}_=b,d=E}return 1===f?(null!==a&&(a.x=v,a.y=g),null!==s&&(s.x=v,s.y=g),null!==o&&(o.y=o.x+Math.PI)):f>1&&(f++,null!==a&&(a.x=v,a.y=g),null!==s&&(s.x=y,s.y=T)),f},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 i=!1;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var n=0,r=this.vertices.length,a=r-2;n<r;n+=2){var s=this.vertices[a+1],o=this.vertices[n+1];if(o<e&&s>=e||s<e&&o>=e){var c=this.vertices[a],l=this.vertices[n];(e-o)*(c-l)/(s-o)+l<t&&(i=!i)}a=n}return i},e.prototype.intersectsSegment=function(t,n,r,a,s,o,c){void 0===s&&(s=null),void 0===o&&(o=null),void 0===c&&(c=null);var l=0;return 0!==i.rectangleIntersectsSegment(t,n,r,a,this.x,this.y,this.x+this.width,this.y+this.height,null,null,null)&&(l=e.polygonIntersectsSegment(t,n,r,a,this.vertices,s,o,c)),l},e})(e);t.PolygonBoundingBoxData=r})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cachedFrames=[],e.boneTimelines={},e.surfaceTimelines={},e.slotTimelines={},e.constraintTimelines={},e.animationTimelines={},e.boneCachedFrameIndices={},e.slotCachedFrameIndices={},e.actionTimeline=null,e.zOrderTimeline=null,e}return a(e,t),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++)i[e].returnToPool();delete this.boneTimelines[t]}for(var t in this.surfaceTimelines){for(var n=0,r=this.surfaceTimelines[t];n<r.length;n++)r[n].returnToPool();delete this.surfaceTimelines[t]}for(var t in this.slotTimelines){for(var a=0,s=this.slotTimelines[t];a<s.length;a++)s[a].returnToPool();delete this.slotTimelines[t]}for(var t in this.constraintTimelines){for(var o=0,c=this.constraintTimelines[t];o<c.length;o++)c[o].returnToPool();delete this.constraintTimelines[t]}for(var t in this.animationTimelines){for(var l=0,h=this.animationTimelines[t];l<h.length;l++)h[l].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];null!==this.actionTimeline&&this.actionTimeline.returnToPool(),null!==this.zOrderTimeline&&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)){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,n=this.cacheFrames.length;i<n;++i)this.cachedFrames[i]=!1;for(var r=0,a=this.parent.sortedBones;r<a.length;r++){var s=a[r];for(i=0,n=(l=new Array(e)).length;i<n;++i)l[i]=-1;this.boneCachedFrameIndices[s.name]=l}for(var o=0,c=this.parent.sortedSlots;o<c.length;o++){var l,h=c[o];for(i=0,n=(l=new Array(e)).length;i<n;++i)l[i]=-1;this.slotCachedFrameIndices[h.name]=l}}},e.prototype.addBoneTimeline=function(t,e){var i=t.name in this.boneTimelines?this.boneTimelines[t.name]:this.boneTimelines[t.name]=[];i.indexOf(e)<0&&i.push(e)},e.prototype.addSurfaceTimeline=function(t,e){var i=t.name in this.surfaceTimelines?this.surfaceTimelines[t.name]:this.surfaceTimelines[t.name]=[];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]=[];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]=[];i.indexOf(e)<0&&i.push(e)},e.prototype.addAnimationTimeline=function(t,e){var i=t in this.animationTimelines?this.animationTimelines[t]:this.animationTimelines[t]=[];i.indexOf(e)<0&&i.push(e)},e.prototype.getBoneTimelines=function(t){return t in this.boneTimelines?this.boneTimelines[t]:null},e.prototype.getSurfaceTimelines=function(t){return t in this.surfaceTimelines?this.surfaceTimelines[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},e})(t.BaseObject);t.AnimationData=e;var i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.TimelineData]"},e.prototype._onClear=function(){this.type=10,this.offset=0,this.frameIndicesOffset=-1},e})(t.BaseObject);t.TimelineData=i})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boneMask=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.AnimationConfig]"},e.prototype._onClear=function(){this.pauseFadeOut=!0,this.fadeOutMode=4,this.fadeOutTweenType=1,this.fadeOutTime=-1,this.actionEnabled=!0,this.additiveBlending=!1,this.displayControl=!0,this.pauseFadeIn=!0,this.resetToPose=!0,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 0===this.boneMask.length||this.boneMask.indexOf(t)>=0},e.prototype.addBoneMask=function(t,e,i){void 0===i&&(i=!0);var n=t.getBone(e);if(null!==n&&(this.boneMask.indexOf(e)<0&&this.boneMask.push(e),i))for(var r=0,a=t.getBones();r<a.length;r++){var s=a[r];this.boneMask.indexOf(s.name)<0&&n.contains(s)&&this.boneMask.push(s.name)}},e.prototype.removeBoneMask=function(t,e,i){void 0===i&&(i=!0);var n=this.boneMask.indexOf(e);if(n>=0&&this.boneMask.splice(n,1),i){var r=t.getBone(e);if(null!==r)if(this.boneMask.length>0)for(var a=0,s=t.getBones();a<s.length;a++){var o=s[a],c=this.boneMask.indexOf(o.name);c>=0&&r.contains(o)&&this.boneMask.splice(c,1)}else for(var l=0,h=t.getBones();l<h.length;l++)(o=h[l])!==r&&(r.contains(o)||this.boneMask.push(o.name))}},e})(t.BaseObject);t.AnimationConfig=e})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.textures={},e}return a(e,t),e.prototype._onClear=function(){for(var t in this.textures)this.textures[t].returnToPool(),delete this.textures[t];this.autoSearch=!1,this.width=0,this.height=0,this.scale=1,this.name="",this.imagePath=""},e.prototype.copyFrom=function(t){for(var e in this.autoSearch=t.autoSearch,this.scale=t.scale,this.width=t.width,this.height=t.height,this.name=t.name,this.imagePath=t.imagePath,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){t.name in this.textures?console.warn("Same texture: "+t.name):(t.parent=this,this.textures[t.name]=t)},e.prototype.getTexture=function(t){return t in this.textures?this.textures[t]:null},e})(t.BaseObject);t.TextureAtlasData=e;var i=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.region=new t.Rectangle,i.frame=null,i}return a(i,e),i.createRectangle=function(){return new t.Rectangle},i.prototype._onClear=function(){this.rotated=!1,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,null===this.frame&&null!==t.frame?this.frame=i.createRectangle():null!==this.frame&&null===t.frame&&(this.frame=null),null!==this.frame&&null!==t.frame&&this.frame.copyFrom(t.frame)},i})(t.BaseObject);t.TextureData=i})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e.bones=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.DeformVertices]"},e.prototype._onClear=function(){this.verticesDirty=!1,this.vertices.length=0,this.bones.length=0,this.verticesData=null},e.prototype.init=function(t,e){if(this.verticesData=t,null!==this.verticesData){var i;i=null!==this.verticesData.weight?2*this.verticesData.weight.count:2*this.verticesData.data.intArray[this.verticesData.offset+0],this.verticesDirty=!0,this.vertices.length=i,this.bones.length=0;for(var n=0,r=this.vertices.length;n<r;++n)this.vertices[n]=0;if(null!==this.verticesData.weight)for(n=0,r=this.verticesData.weight.bones.length;n<r;++n){var a=e.getBone(this.verticesData.weight.bones[n].name);this.bones.push(a)}}else this.verticesDirty=!1,this.vertices.length=0,this.bones.length=0,this.verticesData=null},e.prototype.isBonesUpdate=function(){for(var t=0,e=this.bones;t<e.length;t++){var i=e[t];if(null!==i&&i._childrenTransformDirty)return!0}return!1},e})(t.BaseObject);t.DeformVertices=e})(r||(r={})),n=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._bones=[],e._slots=[],e._constraints=[],e._actions=[],e._animation=null,e._proxy=null,e._replaceTextureAtlasData=null,e._clock=null,e}return a(e,t),e.toString=function(){return"[class dragonBones.Armature]"},e._onSortSlots=function(t,e){return t._zOrder>e._zOrder?1:-1},e.prototype._onClear=function(){null!==this._clock&&this._clock.remove(this);for(var t=0,e=this._bones;t<e.length;t++)e[t].returnToPool();for(var i=0,n=this._slots;i<n.length;i++)n[i].returnToPool();for(var r=0,a=this._constraints;r<a.length;r++)a[r].returnToPool();for(var s=0,o=this._actions;s<o.length;s++)o[s].returnToPool();null!==this._animation&&this._animation.returnToPool(),null!==this._proxy&&this._proxy.dbClear(),null!==this._replaceTextureAtlasData&&this._replaceTextureAtlasData.returnToPool(),this.inheritAnimation=!0,this.userData=null,this._lockUpdate=!1,this._slotsDirty=!0,this._zOrderDirty=!1,this._flipX=!1,this._flipY=!1,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},e.prototype._sortZOrder=function(t,e){var i=this._armatureData.sortedSlots,n=null===t;if(this._zOrderDirty||!n){for(var r=0,a=i.length;r<a;++r){var s=n?r:t[e+r];if(!(s<0||s>=a)){var o=i[s],c=this.getSlot(o.name);null!==c&&c._setZorder(r)}}this._slotsDirty=!0,this._zOrderDirty=!n}},e.prototype._addBone=function(t){this._bones.indexOf(t)<0&&this._bones.push(t)},e.prototype._addSlot=function(t){this._slots.indexOf(t)<0&&this._slots.push(t)},e.prototype._addConstraint=function(t){this._constraints.indexOf(t)<0&&this._constraints.push(t)},e.prototype._bufferAction=function(t,e){this._actions.indexOf(t)<0&&(e?this._actions.push(t):this._actions.unshift(t))},e.prototype.dispose=function(){null!==this._armatureData&&(this._lockUpdate=!0,this._dragonBones.bufferObject(this))},e.prototype.init=function(t,e,n,r){null===this._armatureData&&(this._armatureData=t,this._animation=i.BaseObject.borrowObject(i.Animation),this._proxy=e,this._display=n,this._dragonBones=r,this._proxy.dbInit(this),this._animation.init(this),this._animation.animations=this._armatureData.animations)},e.prototype.advanceTime=function(t){if(!this._lockUpdate)if(null!==this._armatureData)if(null!==this._armatureData.parent){var i=this._cacheFrameIndex;if(this._animation.advanceTime(t),this._slotsDirty&&(this._slotsDirty=!1,this._slots.sort(e._onSortSlots)),this._cacheFrameIndex<0||this._cacheFrameIndex!==i){var n=0,r=0;for(n=0,r=this._bones.length;n<r;++n)this._bones[n].update(this._cacheFrameIndex);for(n=0,r=this._slots.length;n<r;++n)this._slots[n].update(this._cacheFrameIndex)}if(this._actions.length>0){this._lockUpdate=!0;for(var a=0,s=this._actions;a<s.length;a++){var o=s[a],c=o.actionData;if(null!==c&&0===c.type)if(null!==o.slot)null!==(u=o.slot.childArmature)&&u.animation.fadeIn(c.name);else if(null!==o.bone)for(var l=0,h=this.getSlots();l<h.length;l++){var u,f=h[l];f.parent===o.bone&&null!==(u=f.childArmature)&&u.animation.fadeIn(c.name)}else this._animation.fadeIn(c.name);o.returnToPool()}this._actions.length=0,this._lockUpdate=!1}this._proxy.dbUpdate()}else console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");else console.warn("The armature has been disposed.")},e.prototype.invalidUpdate=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=!1),null!==t&&t.length>0){if(null!==(s=this.getBone(t))&&(s.invalidUpdate(),e))for(var i=0,n=this._slots;i<n.length;i++)(l=n[i]).parent===s&&l.invalidUpdate()}else{for(var r=0,a=this._bones;r<a.length;r++){var s;(s=a[r]).invalidUpdate()}if(e)for(var o=0,c=this._slots;o<c.length;o++){var l;(l=c[o]).invalidUpdate()}}},e.prototype.containsPoint=function(t,e){for(var i=0,n=this._slots;i<n.length;i++){var r=n[i];if(r.containsPoint(t,e))return r}return null},e.prototype.intersectsSegment=function(t,e,i,n,r,a,s){void 0===r&&(r=null),void 0===a&&(a=null),void 0===s&&(s=null);for(var o=t===i,c=0,l=0,h=0,u=0,f=0,_=0,d=0,p=0,m=null,v=null,g=0,y=this._slots;g<y.length;g++){var T=y[g];if(T.intersectsSegment(t,e,i,n,r,a,s)>0){if(null===r&&null===a){m=T;break}var A;null!==r&&((A=o?r.y-e:r.x-t)<0&&(A=-A),(null===m||A<c)&&(c=A,h=r.x,u=r.y,m=T,s&&(d=s.x))),null!==a&&((A=a.x-t)<0&&(A=-A),(null===v||A>l)&&(l=A,f=a.x,_=a.y,v=T,null!==s&&(p=s.y)))}}return null!==m&&null!==r&&(r.x=h,r.y=u,null!==s&&(s.x=d)),null!==v&&null!==a&&(a.x=f,a.y=_,null!==s&&(s.y=p)),m},e.prototype.getBone=function(t){for(var e=0,i=this._bones;e<i.length;e++){var n=i[e];if(n.name===t)return n}return null},e.prototype.getBoneByDisplay=function(t){var e=this.getSlotByDisplay(t);return null!==e?e.parent:null},e.prototype.getSlot=function(t){for(var e=0,i=this._slots;e<i.length;e++){var n=i[e];if(n.name===t)return n}return null},e.prototype.getSlotByDisplay=function(t){if(null!==t)for(var e=0,i=this._slots;e<i.length;e++){var n=i[e];if(n.display===t)return n}return null},e.prototype.getBones=function(){return this._bones},e.prototype.getSlots=function(){return this._slots},Object.defineProperty(e.prototype,"flipX",{get:function(){return this._flipX},set:function(t){this._flipX!==t&&(this._flipX=t,this.invalidUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flipY",{get:function(){return this._flipY},set:function(t){this._flipY!==t&&(this._flipY=t,this.invalidUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.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 n=i[e].childArmature;null!==n&&(n.cacheFrameRate=t)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._armatureData.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"armatureData",{get:function(){return this._armatureData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"proxy",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventDispatcher",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"display",{get:function(){return this._display},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"replacedTexture",{get:function(){return this._replacedTexture},set:function(t){if(this._replacedTexture!==t){null!==this._replaceTextureAtlasData&&(this._replaceTextureAtlasData.returnToPool(),this._replaceTextureAtlasData=null),this._replacedTexture=t;for(var e=0,i=this._slots;e<i.length;e++){var n=i[e];n.invalidUpdate(),n.update(-1)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock!==t){null!==this._clock&&this._clock.remove(this),this._clock=t,this._clock&&this._clock.add(this);for(var e=0,i=this._slots;e<i.length;e++){var n=i[e].childArmature;null!==n&&(n.clock=this._clock)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),e.prototype.replaceTexture=function(t){this.replacedTexture=t},e.prototype.hasEventListener=function(t){return this._proxy.hasDBEventListener(t)},e.prototype.addEventListener=function(t,e,i){this._proxy.addDBEventListener(t,e,i)},e.prototype.removeEventListener=function(t,e,i){this._proxy.removeDBEventListener(t,e,i)},e.prototype.enableAnimationCache=function(t){console.warn("Deprecated."),this.cacheFrameRate=t},e.prototype.getDisplay=function(){return this._display},e})((i=r||(r={})).BaseObject),i.Armature=n,(function(t){var e=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.globalTransformMatrix=new t.Matrix,i.global=new t.Transform,i.offset=new t.Transform,i}return a(i,e),i.prototype._onClear=function(){this.globalTransformMatrix.identity(),this.global.identity(),this.offset.identity(),this.origin=null,this.userData=null,this._globalDirty=!1,this._armature=null},i.prototype.updateGlobalTransform=function(){this._globalDirty&&(this._globalDirty=!1,this.global.fromMatrix(this.globalTransformMatrix))},Object.defineProperty(i.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),i._helpMatrix=new t.Matrix,i._helpTransform=new t.Transform,i._helpPoint=new t.Point,i})(t.BaseObject);t.TransformObject=e})(r||(r={})),(function(t){var e=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.animationPose=new t.Transform,i._blendState=new t.BlendState,i}return a(i,e),i.toString=function(){return"[class dragonBones.Bone]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.offsetMode=1,this.animationPose.identity(),this._transformDirty=!1,this._childrenTransformDirty=!1,this._localDirty=!0,this._hasConstraint=!1,this._visible=!0,this._cachedFrameIndex=-1,this._blendState.clear(),this._boneData=null,this._parent=null,this._cachedFrameIndices=null},i.prototype._updateGlobalTransformMatrix=function(e){var i=this._boneData,n=this.global,r=this.globalTransformMatrix,a=this.origin,s=this.offset,o=this.animationPose,c=this._parent,l=this._armature.flipX,h=this._armature.flipY===t.DragonBones.yDown,u=null!==c,f=0;if(1===this.offsetMode?null!==a?(n.x=a.x+s.x+o.x,n.scaleX=a.scaleX*s.scaleX*o.scaleX,n.scaleY=a.scaleY*s.scaleY*o.scaleY,t.DragonBones.yDown?(n.y=a.y+s.y+o.y,n.skew=a.skew+s.skew+o.skew,n.rotation=a.rotation+s.rotation+o.rotation):(n.y=a.y-s.y+o.y,n.skew=a.skew-s.skew+o.skew,n.rotation=a.rotation-s.rotation+o.rotation)):(n.copyFrom(s),t.DragonBones.yDown||(n.y=-n.y,n.skew=-n.skew,n.rotation=-n.rotation),n.add(o)):0===this.offsetMode?null!==a?n.copyFrom(a).add(o):n.copyFrom(o):(u=!1,n.copyFrom(s),t.DragonBones.yDown||(n.y=-n.y,n.skew=-n.skew,n.rotation=-n.rotation)),u){var _=0===c._boneData.type?c.globalTransformMatrix:c._getGlobalTransformMatrix(n.x,n.y);if(i.inheritScale)i.inheritRotation||(c.updateGlobalTransform(),f=l&&h?n.rotation-(c.global.rotation+Math.PI):l?n.rotation+c.global.rotation+Math.PI:h?n.rotation+c.global.rotation:n.rotation-c.global.rotation,n.rotation=f),n.toMatrix(r),r.concat(_),i.inheritTranslation?(n.x=r.tx,n.y=r.ty):(r.tx=n.x,r.ty=n.y),e?n.fromMatrix(r):this._globalDirty=!0;else{if(i.inheritTranslation){var d=n.x,p=n.y;n.x=_.a*d+_.c*p+_.tx,n.y=_.b*d+_.d*p+_.ty}else l&&(n.x=-n.x),h&&(n.y=-n.y);i.inheritRotation?(c.updateGlobalTransform(),f=c.global.scaleX<0?n.rotation+c.global.rotation+Math.PI:n.rotation+c.global.rotation,_.a*_.d-_.b*_.c<0&&(f-=2*n.rotation,(l!==h||i.inheritReflection)&&(n.skew+=Math.PI),t.DragonBones.yDown||(n.skew=-n.skew)),n.rotation=f):(l||h)&&(l&&h?f=n.rotation+Math.PI:(f=l?Math.PI-n.rotation:-n.rotation,n.skew+=Math.PI),n.rotation=f),n.toMatrix(r)}}else(l||h)&&(l&&(n.x=-n.x),h&&(n.y=-n.y),l&&h?f=n.rotation+Math.PI:(f=l?Math.PI-n.rotation:-n.rotation,n.skew+=Math.PI),n.rotation=f),n.toMatrix(r)},i.prototype.init=function(t,e){null===this._boneData&&(this._boneData=t,this._armature=e,null!==this._boneData.parent&&(this._parent=this._armature.getBone(this._boneData.parent.name)),this._armature._addBone(this),this.origin=this._boneData.transform)},i.prototype.update=function(t){if(this._blendState.dirty=!1,t>=0&&null!==this._cachedFrameIndices){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e)this._transformDirty=!1;else if(e>=0)this._transformDirty=!0,this._cachedFrameIndex=e;else{if(this._hasConstraint)for(var i=0,n=this._armature._constraints;i<n.length;i++)(s=n[i])._root===this&&s.update();this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var r=0,a=this._armature._constraints;r<a.length;r++){var s;(s=a[r])._root===this&&s.update()}(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1)}if(this._transformDirty)if(this._transformDirty=!1,this._childrenTransformDirty=!0,this._cachedFrameIndex<0){var o=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(o),o&&null!==this._cachedFrameIndices&&(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 this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},i.prototype.updateByConstraint=function(){this._localDirty&&(this._localDirty=!1,(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&this._updateGlobalTransformMatrix(!0),this._transformDirty=!0)},i.prototype.invalidUpdate=function(){this._transformDirty=!0},i.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.parent;return e===this},Object.defineProperty(i.prototype,"boneData",{get:function(){return this._boneData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible!==t){this._visible=t;for(var e=0,i=this._armature.getSlots();e<i.length;e++){var n=i[e];n.parent===this&&n._updateVisible()}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this._boneData.name},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),i.prototype.getBones=function(){console.warn("Deprecated.");for(var t=new Array,e=0,i=this._armature.getBones();e<i.length;e++){var n=i[e];n.parent===this&&t.push(n)}return t},i.prototype.getSlots=function(){console.warn("Deprecated.");for(var t=new Array,e=0,i=this._armature.getSlots();e<i.length;e++){var n=i[e];n.parent===this&&t.push(n)}return t},Object.defineProperty(i.prototype,"slot",{get:function(){console.warn("Deprecated.");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:!0,configurable:!0}),i})(t.TransformObject);t.Bone=e})(r||(r={})),(function(t){var e=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._vertices=[],e._deformVertices=[],e._hullCache=[],e._matrixCahce=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.Surface]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._dX=0,this._dY=0,this._k=0,this._kX=0,this._kY=0,this._vertices.length=0,this._deformVertices.length=0,this._matrixCahce.length=0,this._hullCache.length=0},e.prototype._getAffineTransform=function(t,e,i,n,r,a,s,o,c,l,h,u,f){var _=s-r,d=o-a,p=c-r,m=l-a;h.rotation=Math.atan2(d,_),h.skew=Math.atan2(m,p)-.5*Math.PI-h.rotation,f&&(h.rotation+=Math.PI),h.scaleX=Math.sqrt(_*_+d*d)/i,h.scaleY=Math.sqrt(p*p+m*m)/n,h.toMatrix(u),h.x=u.tx=r-(u.a*t+u.c*e),h.y=u.ty=a-(u.b*t+u.d*e)},e.prototype._updateVertices=function(){var t=this._boneData.vertices,e=this._vertices,i=this._deformVertices;if(null!==this._parent)if(1===this._parent._boneData.type)for(var n=0,r=t.length;n<r;n+=2){var a=t[n]+i[n],s=t[n+1]+i[n],o=this._parent._getGlobalTransformMatrix(a,s);e[n]=o.a*a+o.c*s+o.tx,e[n+1]=o.b*a+o.d*s+o.ty}else{var c=this._parent.globalTransformMatrix;for(n=0,r=t.length;n<r;n+=2)a=t[n]+i[n],s=t[n+1]+i[n+1],e[n]=c.a*a+c.c*s+c.tx,e[n+1]=c.b*a+c.d*s+c.ty}else for(n=0,r=t.length;n<r;n+=2)e[n]=t[n]+i[n],e[n+1]=t[n+1]+i[n+1]},e.prototype._updateGlobalTransformMatrix=function(){var t=2*this._boneData.segmentX,e=this._vertices.length-2,i=this._vertices[0],n=this._vertices[1],r=this._vertices[t],a=this._vertices[t+1],s=this._vertices[e],o=this._vertices[e+1],c=this._vertices[e-t],l=this._vertices[e-t+1],h=i+.5*(s-i),u=n+.5*(o-n),f=h+.5*(r+.5*(c-r)-h),_=u+.5*(a+.5*(l-a)-u),d=r+.5*(s-r),p=a+.5*(o-a),m=c+.5*(s-c),v=l+.5*(o-l);this._globalDirty=!1,this._getAffineTransform(0,0,200,200,f,_,d,p,m,v,this.global,this.globalTransformMatrix,!1)},e.prototype._getGlobalTransformMatrix=function(t,i){var n=1e3;if(t<-n||n<t||i<-n||n<i)return this.globalTransformMatrix;var r=!1,a=200,s=this._boneData,o=s.segmentX,c=s.segmentY,l=2*s.segmentX,h=this._dX,u=this._dY,f=Math.floor((t+a)/h),_=Math.floor((i+a)/u),d=0,p=f*h-a,m=_*u-a,v=this._matrixCahce,g=e._helpMatrix;if(t<-a){if(i<-a||i>=a)return this.globalTransformMatrix;if(d=7*(2*(o*(c+1)+2*o+c+_)+((r=i>this._kX*(t+a)+m)?1:0)),this._matrixCahce[d]>0)g.copyFromArray(v,d+1);else{var y=_*(l+2),T=this._hullCache[4],A=this._hullCache[5],b=this._hullCache[2]-(c-_)*T,E=this._hullCache[3]-(c-_)*A,C=this._vertices;r?this._getAffineTransform(-a,m+u,800,u,C[y+l+2],C[y+l+3],b+T,E+A,C[y],C[y+1],e._helpTransform,g,!0):this._getAffineTransform(-n,m,800,u,b,E,C[y],C[y+1],b+T,E+A,e._helpTransform,g,!1),v[d]=1,v[d+1]=g.a,v[d+2]=g.b,v[d+3]=g.c,v[d+4]=g.d,v[d+5]=g.tx,v[d+6]=g.ty}}else if(t>=a){if(i<-a||i>=a)return this.globalTransformMatrix;d=7*(2*(o*(c+1)+o+_)+((r=i>this._kX*(t-n)+m)?1:0)),this._matrixCahce[d]>0?g.copyFromArray(v,d+1):(y=(_+1)*(l+2)-2,T=this._hullCache[4],A=this._hullCache[5],b=this._hullCache[0]+_*T,E=this._hullCache[1]+_*A,C=this._vertices,r?this._getAffineTransform(n,m+u,800,u,b+T,E+A,C[y+l+2],C[y+l+3],b,E,e._helpTransform,g,!0):this._getAffineTransform(a,m,800,u,C[y],C[y+1],b,E,C[y+l+2],C[y+l+3],e._helpTransform,g,!1),v[d]=1,v[d+1]=g.a,v[d+2]=g.b,v[d+3]=g.c,v[d+4]=g.d,v[d+5]=g.tx,v[d+6]=g.ty)}else if(i<-a){if(t<-a||t>=a)return this.globalTransformMatrix;d=7*(o*(c+1)+2*f+((r=i>this._kY*(t-p-h)-n)?1:0)),this._matrixCahce[d]>0?g.copyFromArray(v,d+1):(y=2*f,T=this._hullCache[10],A=this._hullCache[11],b=this._hullCache[8]+f*T,E=this._hullCache[9]+f*A,C=this._vertices,r?this._getAffineTransform(p+h,-a,h,800,C[y+2],C[y+3],C[y],C[y+1],b+T,E+A,e._helpTransform,g,!0):this._getAffineTransform(p,-n,h,800,b,E,b+T,E+A,C[y],C[y+1],e._helpTransform,g,!1),v[d]=1,v[d+1]=g.a,v[d+2]=g.b,v[d+3]=g.c,v[d+4]=g.d,v[d+5]=g.tx,v[d+6]=g.ty)}else if(i>=a){if(t<-a||t>=a)return this.globalTransformMatrix;d=7*(2*(o*(c+1)+o+c+_)+((r=i>this._kY*(t-p-h)+a)?1:0)),this._matrixCahce[d]>0?g.copyFromArray(v,d+1):(y=c*(l+2)+2*f,T=this._hullCache[10],A=this._hullCache[11],b=this._hullCache[6]-(o-f)*T,E=this._hullCache[7]-(o-f)*A,C=this._vertices,r?this._getAffineTransform(p+h,n,h,800,b+T,E+A,b,E,C[y+2],C[y+3],e._helpTransform,g,!0):this._getAffineTransform(p,a,h,800,C[y],C[y+1],C[y+2],C[y+3],b,E,e._helpTransform,g,!1),v[d]=1,v[d+1]=g.a,v[d+2]=g.b,v[d+3]=g.c,v[d+4]=g.d,v[d+5]=g.tx,v[d+6]=g.ty)}else d=7*(2*(o*_+f)+((r=i>this._k*(t-p-h)+m)?1:0)),this._matrixCahce[d]>0?g.copyFromArray(v,d+1):(y=2*f+_*(l+2),C=this._vertices,r?this._getAffineTransform(p+h,m+u,h,u,C[y+l+4],C[y+l+5],C[y+l+2],C[y+l+3],C[y+2],C[y+3],e._helpTransform,g,!0):this._getAffineTransform(p,m,h,u,C[y],C[y+1],C[y+2],C[y+3],C[y+l+2],C[y+l+3],e._helpTransform,g,!1),v[d]=1,v[d+1]=g.a,v[d+2]=g.b,v[d+3]=g.c,v[d+4]=g.d,v[d+5]=g.tx,v[d+6]=g.ty);return g},e.prototype.init=function(e,i){if(null===this._boneData){t.prototype.init.call(this,e,i);var n=e.segmentX,r=e.segmentY,a=e.vertices.length;this._dX=400/n,this._dY=400/r,this._k=-this._dY/this._dX,this._kX=-this._dY/800,this._kY=-800/this._dX,this._vertices.length=a,this._deformVertices.length=a,this._matrixCahce.length=14*(n*r+2*n+2*r),this._hullCache.length=10;for(var s=0;s<a;++s)this._deformVertices[s]=0}},e.prototype.update=function(t){if(this._blendState.dirty=!1,t>=0&&null!==this._cachedFrameIndices){var i=this._cachedFrameIndices[t];if(i>=0&&this._cachedFrameIndex===i)this._transformDirty=!1;else if(i>=0)this._transformDirty=!0,this._cachedFrameIndex=i;else{if(this._hasConstraint)for(var n=0,r=this._armature._constraints;n<r.length;n++)(o=r[n])._root===this&&o.update();this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var a=0,s=this._armature._constraints;a<s.length;a++){var o;(o=s[a])._root===this&&o.update()}(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1)}if(this._transformDirty){this._transformDirty=!1,this._childrenTransformDirty=!0;for(var c=0,l=this._matrixCahce.length;c<l;c+=7)this._matrixCahce[c]=-1;if(this._updateVertices(),this._cachedFrameIndex<0){var h=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(h),h&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);var u=2*this.global.x,f=2*this.global.y,_=e._helpPoint;this.globalTransformMatrix.transformPoint(1e3,-200,_),this._hullCache[0]=_.x,this._hullCache[1]=_.y,this._hullCache[2]=u-_.x,this._hullCache[3]=f-_.y,this.globalTransformMatrix.transformPoint(0,this._dY,_,!0),this._hullCache[4]=_.x,this._hullCache[5]=_.y,this.globalTransformMatrix.transformPoint(200,1e3,_),this._hullCache[6]=_.x,this._hullCache[7]=_.y,this._hullCache[8]=u-_.x,this._hullCache[9]=f-_.y,this.globalTransformMatrix.transformPoint(this._dX,0,_,!0),this._hullCache[10]=_.x,this._hullCache[11]=_.y}else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},e})(t.Bone);t.Surface=e})(r||(r={})),(function(t){var e=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._localMatrix=new t.Matrix,i._colorTransform=new t.ColorTransform,i._displayDatas=[],i._displayList=[],i._deformVertices=null,i._rawDisplay=null,i._meshDisplay=null,i}return a(i,e),i.prototype._onClear=function(){e.prototype._onClear.call(this);for(var i=[],n=0,r=this._displayList;n<r.length;n++)null!==(o=r[n])&&o!==this._rawDisplay&&o!==this._meshDisplay&&i.indexOf(o)<0&&i.push(o);for(var a=0,s=i;a<s.length;a++){var o;(o=s[a])instanceof t.Armature?o.dispose():this._disposeDisplay(o,!0)}null!==this._deformVertices&&this._deformVertices.returnToPool(),null!==this._meshDisplay&&this._meshDisplay!==this._rawDisplay&&this._disposeDisplay(this._meshDisplay,!1),null!==this._rawDisplay&&this._disposeDisplay(this._rawDisplay,!1),this.displayController=null,this._displayDirty=!1,this._zOrderDirty=!1,this._blendModeDirty=!1,this._colorDirty=!1,this._transformDirty=!1,this._visible=!0,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._displayList.length=0,this._displayDatas.length=0,this._slotData=null,this._rawDisplayDatas=null,this._displayData=null,this._boundingBoxData=null,this._textureData=null,this._deformVertices=null,this._rawDisplay=null,this._meshDisplay=null,this._display=null,this._childArmature=null,this._parent=null,this._cachedFrameIndices=null},i.prototype._getDefaultRawDisplayData=function(t){var e=this._armature._armatureData.defaultSkin;if(null!==e){var i=e.getDisplays(this._slotData.name);if(null!==i)return t<i.length?i[t]:null}return null},i.prototype._updateDisplayData=function(){var e=this._displayData,n=null!==this._deformVertices?this._deformVertices.verticesData:null,r=this._textureData,a=null,s=null;if(this._displayData=null,this._boundingBoxData=null,this._textureData=null,this._displayIndex>=0&&(null!==this._rawDisplayDatas&&(a=this._displayIndex<this._rawDisplayDatas.length?this._rawDisplayDatas[this._displayIndex]:null),null===a&&(a=this._getDefaultRawDisplayData(this._displayIndex)),this._displayIndex<this._displayDatas.length&&(this._displayData=this._displayDatas[this._displayIndex])),null!==this._displayData&&(2===this._displayData.type?s=this._displayData.vertices:4===this._displayData.type?s=this._displayData.vertices:null!==a&&(2===a.type?s=a.vertices:4===a.type&&(s=a.vertices)),3===this._displayData.type?this._boundingBoxData=this._displayData.boundingBox:null!==a&&3===a.type&&(this._boundingBoxData=a.boundingBox),0===this._displayData.type?this._textureData=this._displayData.texture:2===this._displayData.type&&(this._textureData=this._displayData.texture)),this._displayData!==e||s!==n||this._textureData!==r){if(null===s&&null!==this._textureData){var o=this._displayData,c=this._textureData.parent.scale*this._armature._armatureData.scale,l=this._textureData.frame;this._pivotX=o.pivot.x,this._pivotY=o.pivot.y;var h=null!==l?l:this._textureData.region,u=h.width,f=h.height;this._textureData.rotated&&null===l&&(u=h.height,f=h.width),this._pivotX*=u*c,this._pivotY*=f*c,null!==l&&(this._pivotX+=l.x*c,this._pivotY+=l.y*c),null!==this._displayData&&null!==a&&this._displayData!==a&&(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),t.DragonBones.yDown||(this._pivotY=(this._textureData.rotated?this._textureData.region.width:this._textureData.region.height)*c-this._pivotY)}else this._pivotX=0,this._pivotY=0;null!==a?this.origin=a.transform:null!==this._displayData?this.origin=this._displayData.transform:this.origin=null,s!==n?(null===this._deformVertices&&(this._deformVertices=t.BaseObject.borrowObject(t.DeformVertices)),this._deformVertices.init(s,this._armature)):null!==this._deformVertices&&this._textureData!==r&&(this._deformVertices.verticesDirty=!0),this._displayDirty=!0,this._transformDirty=!0}},i.prototype._updateDisplay=function(){var e=null!==this._display?this._display:this._rawDisplay,i=this._childArmature;this._displayIndex>=0&&this._displayIndex<this._displayList.length?(this._display=this._displayList[this._displayIndex],null!==this._display&&this._display instanceof t.Armature?(this._childArmature=this._display,this._display=this._childArmature.display):this._childArmature=null):(this._display=null,this._childArmature=null);var n=null!==this._display?this._display:this._rawDisplay;if(n!==e&&(this._onUpdateDisplay(),this._replaceDisplay(e),this._transformDirty=!0,this._visibleDirty=!0,this._blendModeDirty=!0,this._colorDirty=!0),n!==this._rawDisplay&&n!==this._meshDisplay||this._updateFrame(),this._childArmature!==i&&(null!==i&&(i._parent=null,i.clock=null,i.inheritAnimation&&i.animation.reset()),null!==this._childArmature&&(this._childArmature._parent=this,this._childArmature.clock=this._armature.clock,this._childArmature.inheritAnimation))){if(0===this._childArmature.cacheFrameRate){var r=this._armature.cacheFrameRate;0!==r&&(this._childArmature.cacheFrameRate=r)}var a=null;if(null!==this._displayData&&1===this._displayData.type)a=this._displayData.actions;else if(this._displayIndex>=0&&null!==this._rawDisplayDatas){var s=this._displayIndex<this._rawDisplayDatas.length?this._rawDisplayDatas[this._displayIndex]:null;null===s&&(s=this._getDefaultRawDisplayData(this._displayIndex)),null!==s&&1===s.type&&(a=s.actions)}if(null!==a&&a.length>0)for(var o=0,c=a;o<c.length;o++){var l=c[o],h=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(l,h,this._armature),h.slot=this,this._armature._bufferAction(h,!1)}else this._childArmature.animation.play()}},i.prototype._updateGlobalTransformMatrix=function(t){var e=0===this._parent._boneData.type?this._parent.globalTransformMatrix:this._parent._getGlobalTransformMatrix(this.global.x,this.global.y);this.globalTransformMatrix.copyFrom(this._localMatrix),this.globalTransformMatrix.concat(e),t?this.global.fromMatrix(this.globalTransformMatrix):this._globalDirty=!0},i.prototype._setDisplayIndex=function(t,e){if(void 0===e&&(e=!1),e){if(this._animationDisplayIndex===t)return!1;this._animationDisplayIndex=t}return this._displayIndex!==t&&(this._displayIndex=t,this._displayDirty=!0,this._updateDisplayData(),this._displayDirty)},i.prototype._setZorder=function(t){return this._zOrder,this._zOrder=t,this._zOrderDirty=!0,this._zOrderDirty},i.prototype._setColor=function(t){return this._colorTransform.copyFrom(t),this._colorDirty=!0,this._colorDirty},i.prototype._setDisplayList=function(e){if(null!==e&&e.length>0){this._displayList.length!==e.length&&(this._displayList.length=e.length);for(var i=0,n=e.length;i<n;++i){var r=e[i];null!==r&&r!==this._rawDisplay&&r!==this._meshDisplay&&!(r instanceof t.Armature)&&this._displayList.indexOf(r)<0&&this._initDisplay(r,!0),this._displayList[i]=r}}else this._displayList.length>0&&(this._displayList.length=0);return this._displayIndex>=0&&this._displayIndex<this._displayList.length?this._displayDirty=this._display!==this._displayList[this._displayIndex]:this._displayDirty=null!==this._display,this._updateDisplayData(),this._displayDirty},i.prototype.init=function(t,e,i,n){if(null===this._slotData){this._slotData=t,this._isFromCache=!1,this._visibleDirty=!0,this._blendModeDirty=!0,this._colorDirty=!0,this._blendMode=this._slotData.blendMode,this._zOrder=this._slotData.zOrder,this._colorTransform.copyFrom(this._slotData.color),this._rawDisplay=i,this._meshDisplay=n,this._armature=e;var r=this._armature.getBone(this._slotData.parent.name);null!==r&&(this._parent=r),this._armature._addSlot(this),this._initDisplay(this._rawDisplay,!1),this._rawDisplay!==this._meshDisplay&&this._initDisplay(this._meshDisplay,!1),this._onUpdateDisplay(),this._addDisplay()}},i.prototype.update=function(t){if(this._isFromCache=!1,this._displayDirty&&(this._displayDirty=!1,this._updateDisplay(),this._transformDirty&&(null!==this.origin?this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix):this.global.copyFrom(this.offset).toMatrix(this._localMatrix))),this._zOrderDirty&&(this._zOrderDirty=!1,this._updateZOrder()),t>=0&&null!==this._cachedFrameIndices){var e=this._cachedFrameIndices[t];e>=0&&this._cachedFrameIndex===e?this._transformDirty=!1:e>=0?(this._transformDirty=!0,this._cachedFrameIndex=e):this._transformDirty||this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}else(this._transformDirty||this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1);if(null!==this._display){if(this._visibleDirty&&(this._visibleDirty=!1,this._updateVisible()),this._blendModeDirty&&(this._blendModeDirty=!1,this._updateBlendMode()),this._colorDirty&&(this._colorDirty=!1,this._updateColor()),null!==this._deformVertices&&null!==this._deformVertices.verticesData&&this._display===this._meshDisplay){var i=null!==this._deformVertices.verticesData.weight,n=0!==this._parent._boneData.type;if((this._deformVertices.verticesDirty||i&&this._deformVertices.isBonesUpdate()||n&&this._parent._childrenTransformDirty)&&(this._deformVertices.verticesDirty=!1,this._updateMesh()),i||n)return}if(this._transformDirty){if(this._transformDirty=!1,this._cachedFrameIndex<0){var r=t>=0;this._updateGlobalTransformMatrix(r),r&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._isFromCache=!0,this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);this._updateTransform()}}},i.prototype.updateTransformAndMatrix=function(){this._transformDirty&&(this._transformDirty=!1,this._updateGlobalTransformMatrix(!1))},i.prototype.replaceDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0&&(e=this._displayIndex<0?0:this._displayIndex),this._displayDatas.length<=e){this._displayDatas.length=e+1;for(var i=0,n=this._displayDatas.length;i<n;++i)this._displayDatas[i]||(this._displayDatas[i]=null)}this._displayDatas[e]=t},i.prototype.containsPoint=function(t,e){return null!==this._boundingBoxData&&(this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(this.globalTransformMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(t,e,i._helpPoint),this._boundingBoxData.containsPoint(i._helpPoint.x,i._helpPoint.y))},i.prototype.intersectsSegment=function(t,e,n,r,a,s,o){if(void 0===a&&(a=null),void 0===s&&(s=null),void 0===o&&(o=null),null===this._boundingBoxData)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(n,r,i._helpPoint),n=i._helpPoint.x,r=i._helpPoint.y;var c=this._boundingBoxData.intersectsSegment(t,e,n,r,a,s,o);return c>0&&(1===c||2===c?null!==a?(this.globalTransformMatrix.transformPoint(a.x,a.y,a),null!==s&&(s.x=a.x,s.y=a.y)):null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s):(null!==a&&this.globalTransformMatrix.transformPoint(a.x,a.y,a),null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s)),null!==o&&(this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),i._helpPoint,!0),o.x=Math.atan2(i._helpPoint.y,i._helpPoint.x),this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),i._helpPoint,!0),o.y=Math.atan2(i._helpPoint.y,i._helpPoint.x))),c},i.prototype.invalidUpdate=function(){this._displayDirty=!0,this._transformDirty=!0},Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._updateVisible())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){this._setDisplayIndex(t)&&this.update(-1)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this._slotData.name},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var i=this._displayList.concat(),n=new Array;this._setDisplayList(e)&&this.update(-1);for(var r=0,a=i;r<a.length;r++)null!==(c=a[r])&&c!==this._rawDisplay&&c!==this._meshDisplay&&this._displayList.indexOf(c)<0&&n.indexOf(c)<0&&n.push(c);for(var s=0,o=n;s<o.length;s++){var c;(c=o[s])instanceof t.Armature||this._disposeDisplay(c,!0)}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"slotData",{get:function(){return this._slotData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rawDisplayDatas",{get:function(){return this._rawDisplayDatas},set:function(t){if(this._rawDisplayDatas!==t)if(this._displayDirty=!0,this._rawDisplayDatas=t,null!==this._rawDisplayDatas){this._displayDatas.length=this._rawDisplayDatas.length;for(var e=0,i=this._displayDatas.length;e<i;++e){var n=this._rawDisplayDatas[e];null===n&&(n=this._getDefaultRawDisplayData(e)),this._displayDatas[e]=n}}else this._displayDatas.length=0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayData",{get:function(){return this._displayData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"boundingBoxData",{get:function(){return this._boundingBoxData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rawDisplay",{get:function(){return this._rawDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"meshDisplay",{get:function(){return this._meshDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"display",{get:function(){return this._display},set:function(t){if(this._display!==t){var e=this._displayList.length;if(this._displayIndex<0&&0===e&&(this._displayIndex=0),!(this._displayIndex<0)){var i=this.displayList;e<=this._displayIndex&&(i.length=this._displayIndex+1),i[this._displayIndex]=t,this.displayList=i}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"childArmature",{get:function(){return this._childArmature},set:function(t){this._childArmature!==t&&(this.display=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),i.prototype.getDisplay=function(){return this._display},i.prototype.setDisplay=function(t){this.display=t},i})(t.TransformObject);t.Slot=e})(r||(r={})),(function(t){var e=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),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:!0,configurable:!0}),i._helpMatrix=new t.Matrix,i._helpTransform=new t.Transform,i._helpPoint=new t.Point,i})(t.BaseObject);t.Constraint=e;var i=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),i.toString=function(){return"[class dragonBones.IKConstraint]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this._scaleEnabled=!1,this._bendPositive=!1,this._weight=1,this._constraintData=null},i.prototype._computeA=function(){var e=this._target.global,i=this._root.global,n=this._root.globalTransformMatrix,r=Math.atan2(e.y-i.y,e.x-i.x);i.scaleX<0&&(r+=Math.PI),i.rotation+=t.Transform.normalizeRadian(r-i.rotation)*this._weight,i.toMatrix(n)},i.prototype._computeB=function(){var e=this._bone._boneData.length,i=this._root,n=this._target.global,r=i.global,a=this._bone.global,s=this._bone.globalTransformMatrix,o=s.a*e,c=s.b*e,l=o*o+c*c,h=Math.sqrt(l),u=a.x-r.x,f=a.y-r.y,_=u*u+f*f,d=Math.sqrt(_),p=a.rotation,m=r.rotation,v=Math.atan2(f,u),g=(u=n.x-r.x)*u+(f=n.y-r.y)*f,y=Math.sqrt(g),T=0;if(h+d<=y||y+h<=d||y+d<=h)T=Math.atan2(n.y-r.y,n.x-r.x),h+d<=y||d<h&&(T+=Math.PI);else{var A=(_-l+g)/(2*g),b=Math.sqrt(_-A*A*g)/y,E=r.x+u*A,C=r.y+f*A,x=-f*b,S=u*b,w=!1,D=i.parent;if(null!==D){var M=D.globalTransformMatrix;w=M.a*M.d-M.b*M.c<0}w!==this._bendPositive?(a.x=E-x,a.y=C-S):(a.x=E+x,a.y=C+S),T=Math.atan2(a.y-r.y,a.x-r.x)}var R=t.Transform.normalizeRadian(T-v);r.rotation=m+R*this._weight,r.toMatrix(i.globalTransformMatrix);var I=v+R*this._weight;a.x=r.x+Math.cos(I)*d,a.y=r.y+Math.sin(I)*d;var O=Math.atan2(n.y-a.y,n.x-a.x);a.scaleX<0&&(O+=Math.PI),a.rotation=r.rotation+p-m+t.Transform.normalizeRadian(O-R-p)*this._weight,a.toMatrix(s)},i.prototype.init=function(t,e){if(null===this._constraintData){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=null!==this._constraintData.bone?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=!0}},i.prototype.update=function(){this._root.updateByConstraint(),null!==this._bone?(this._bone.updateByConstraint(),this._computeB()):this._computeA()},i.prototype.invalidUpdate=function(){this._root.invalidUpdate(),null!==this._bone&&this._bone.invalidUpdate()},i})(e);t.IKConstraint=i;var n=(function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._bones=[],t._spaces=[],t._positions=[],t._curves=[],t._boneLengths=[],t._pathGlobalVertices=[],t._segments=[10],t}return a(i,e),i.toString=function(){return"[class dragonBones.PathConstraint]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.dirty=!1,this.pathOffset=0,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=1,this.translateMix=1,this._pathSlot=null,this._bones.length=0,this._spaces.length=0,this._positions.length=0,this._curves.length=0,this._boneLengths.length=0,this._pathGlobalVertices.length=0},i.prototype._updatePathVertices=function(t){var e=this._armature,i=e.armatureData.parent,n=e.armatureData.scale,r=i.intArray,a=i.floatArray,s=t.offset,o=r[s+0],c=r[s+2];this._pathGlobalVertices.length=2*o;var l=t.weight;if(null!==l)for(var h=this._pathSlot._deformVertices.bones,u=l.bones.length,f=l.offset,_=r[f+1],d=f+2+u,p=(C=0,0);C<o;C++){for(var m=0,v=0,g=0,y=r[d++];g<y;g++){var T=h[r[d++]];if(null!==T){T.updateByConstraint(),E=T.globalTransformMatrix;var A=a[_++];S=a[_++]*n,w=a[_++]*n,m+=(E.a*S+E.c*w+E.tx)*A,v+=(E.b*S+E.d*w+E.ty)*A}}this._pathGlobalVertices[p++]=m,this._pathGlobalVertices[p++]=v}else{var b=this._pathSlot.parent;b.updateByConstraint();for(var E=b.globalTransformMatrix,C=0,x=c;C<o;C+=2){var S=a[x++]*n,w=a[x++]*n,D=E.a*S+E.c*w+E.tx,M=E.b*S+E.d*w+E.ty;this._pathGlobalVertices[C]=D,this._pathGlobalVertices[C+1]=M}}},i.prototype._computeVertices=function(t,e,i,n){for(var r=i,a=t;r<e;r+=2)n[r]=this._pathGlobalVertices[a++],n[r+1]=this._pathGlobalVertices[a++]},i.prototype._computeBezierCurve=function(t,e,i,n,r){var a=this._armature.armatureData.parent.intArray[t.vertices.offset+0],s=this._positions,o=this._spaces,c=t.closed,l=Array(),h=2*a,u=h/6,f=-1,_=this.position;s.length=3*e+2;var d=0;if(t.constantSpeed){c?(h+=2,l.length=a,this._computeVertices(2,h-4,0,l),this._computeVertices(0,2,h-4,l),l[h-2]=l[0],l[h-1]=l[1]):(u--,h-=4,l.length=h,this._computeVertices(2,h,0,l));var p=new Array(u);d=0;for(var m,v,g,y,T,A,b,E,C=l[0],x=l[1],S=0,w=0,D=0,M=0,R=0,I=0,O=(G=0,2);G<u;G++,O+=6)S=l[O],w=l[O+1],D=l[O+2],M=l[O+3],T=2*(m=.1875*(C-2*S+D))+(g=.09375*(3*(S-D)-C+(R=l[O+4]))),A=2*(v=.1875*(x-2*w+M))+(y=.09375*(3*(w-M)-x+(I=l[O+5]))),b=.75*(S-C)+m+.16666667*g,E=.75*(w-x)+v+.16666667*y,d+=Math.sqrt(b*b+E*E),b+=T,E+=A,T+=g,A+=y,d+=Math.sqrt(b*b+E*E),b+=T,E+=A,d+=Math.sqrt(b*b+E*E),b+=T+g,E+=A+y,d+=Math.sqrt(b*b+E*E),p[G]=d,C=R,x=I;if(n&&(_*=d),r)for(G=0;G<e;G++)o[G]*=d;for(var P=this._segments,N=0,F=(G=0,H=0,W=0,0);G<e;G++,H+=3){var L=_+=o[G];if(c)(L%=d)<0&&(L+=d),W=0;else{if(L<0)continue;if(L>d)continue}for(;;W++){var B=p[W];if(!(L>B)){0===W?L/=B:L=(L-(U=p[W-1]))/(B-U);break}}if(W!==f){f=W;var k=6*W;for(C=l[k],x=l[k+1],S=l[k+2],w=l[k+3],D=l[k+4],M=l[k+5],T=2*(m=.03*(C-2*S+D))+(g=.006*(3*(S-D)-C+(R=l[k+6]))),A=2*(v=.03*(x-2*w+M))+(y=.006*(3*(w-M)-x+(I=l[k+7]))),b=.3*(S-C)+m+.16666667*g,E=.3*(w-x)+v+.16666667*y,N=Math.sqrt(b*b+E*E),P[0]=N,k=1;k<8;k++)b+=T,E+=A,T+=g,A+=y,N+=Math.sqrt(b*b+E*E),P[k]=N;b+=T,E+=A,N+=Math.sqrt(b*b+E*E),P[8]=N,b+=T+g,E+=A+y,N+=Math.sqrt(b*b+E*E),P[9]=N,F=0}for(L*=N;;F++){var V=P[F];if(!(L>V)){var U;0===F?L/=V:L=F+(L-(U=P[F-1]))/(V-U);break}}this.addCurvePosition(.1*L,C,x,S,w,D,M,R,I,s,H,i)}}else{var z=t.curveLengths;if(d=z[u-=c?1:2],n&&(_*=d),r)for(var G=0;G<e;G++)o[G]*=d;l.length=8;G=0;for(var H=0,W=0;G<e;G++,H+=3){if(_+=o[G],c)(_%=d)<0&&(_+=d),W=0;else{if(_<0)continue;if(_>d)continue}for(var j=0;;W++){var Y=z[W];if(!(_>Y)){if(0===W)j=_/Y;else{var X=z[W-1];j=(_-X)/(Y-X)}break}}W!==f&&(f=W,c&&W===u?(this._computeVertices(h-4,4,0,l),this._computeVertices(0,4,4,l)):this._computeVertices(6*W+2,8,0,l)),this.addCurvePosition(j,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],s,H,i)}}},i.prototype.addCurvePosition=function(t,e,i,n,r,a,s,o,c,l,h,u){if(0===t)return l[h]=e,l[h+1]=i,void(l[h+2]=0);if(1===t)return l[h]=o,l[h+1]=c,void(l[h+2]=0);var f=1-t,_=f*f,d=t*t,p=_*f,m=_*t*3,v=f*d*3,g=t*d,y=p*e+m*n+v*a+g*o,T=p*i+m*r+v*s+g*c;l[h]=y,l[h+1]=T,l[h+2]=u?Math.atan2(T-(p*i+m*r+v*s),y-(p*e+m*n+v*a)):0},i.prototype.init=function(t,e){this._constraintData=t,this._armature=e;var i=t;this.pathOffset=i.pathDisplayData.vertices.offset,this.position=i.position,this.spacing=i.spacing,this.rotateOffset=i.rotateOffset,this.rotateMix=i.rotateMix,this.translateMix=i.translateMix,this._root=this._armature.getBone(i.root.name),this._target=this._armature.getBone(i.target.name),this._pathSlot=this._armature.getSlot(i.pathSlot.name);for(var n=0,r=i.bones.length;n<r;n++){var a=this._armature.getBone(i.bones[n].name);null!==a&&this._bones.push(a)}2===i.rotateMode&&(this._boneLengths.length=this._bones.length),this._root._hasConstraint=!0},i.prototype.update=function(){var e=this._pathSlot;if(null!==e._deformVertices&&null!==e._deformVertices.verticesData&&e._deformVertices.verticesData.offset===this.pathOffset){var i=this._constraintData,n=e._displayData,r=!1,a=e._deformVertices;if(this._root._childrenTransformDirty?(this._updatePathVertices(n.vertices),r=!0):null!==a&&(a.verticesDirty||a.isBonesUpdate())&&(this._updatePathVertices(n.vertices),a.verticesDirty=!1,r=!0),r||this.dirty){var s=i.positionMode,o=i.spacingMode,c=i.rotateMode,l=this._bones,h=0===o,u=2===c,f=0===c,_=l.length,d=f?_:_+1,p=this.spacing,m=this._spaces;if(m.length=d,u||h){m[0]=0;for(var v=0,g=d-1;v<g;v++){(I=l[v]).updateByConstraint();var y=I._boneData.length,T=y*(O=I.globalTransformMatrix).a,A=y*O.b,b=Math.sqrt(T*T+A*A);u&&(this._boneLengths[v]=b),m[v+1]=(y+p)*b/y}}else for(v=0;v<d;v++)m[v]=p;this._computeBezierCurve(n,d,f,1===s,2===o);var E,C=this._positions,x=this.rotateOffset,S=C[0],w=C[1];0===x?E=1===c:(E=!1,null!==(I=e.parent)&&(x*=(O=I.globalTransformMatrix).a*O.d-O.b*O.c>0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD));for(var D=this.rotateMix,M=this.translateMix,R=(v=0,3);v<_;v++,R+=3){var I,O;(I=l[v]).updateByConstraint(),(O=I.globalTransformMatrix).tx+=(S-O.tx)*M,O.ty+=(w-O.ty)*M;var P=(T=C[R])-S,N=(A=C[R+1])-w;if(u){var F=this._boneLengths[v],L=(Math.sqrt(P*P+N*N)/F-1)*D+1;O.a*=L,O.b*=L}if(S=T,w=A,D>0){var B=O.a,k=O.b,V=O.c,U=O.d,z=void 0,G=void 0,H=void 0;if(z=f?C[R-1]:Math.atan2(N,P),z-=Math.atan2(k,B),E){G=Math.cos(z),H=Math.sin(z);var W=I._boneData.length;S+=(W*(G*B-H*k)-P)*D,w+=(W*(H*B+G*k)-N)*D}else z+=x;z>t.Transform.PI?z-=t.Transform.PI_D:z<-t.Transform.PI&&(z+=t.Transform.PI_D),z*=D,G=Math.cos(z),H=Math.sin(z),O.a=G*B-H*k,O.b=H*B+G*k,O.c=G*V-H*U,O.d=H*V+G*U}I.global.fromMatrix(O)}this.dirty=!1}}},i.prototype.invalidUpdate=function(){},i})(e);t.PathConstraint=n})(r||(r={})),(function(t){var e=(function(){function t(t){void 0===t&&(t=0),this.time=0,this.timeScale=1,this._systemTime=0,this._animatebles=[],this._clock=null,this.time=t,this._systemTime=.001*(new Date).getTime()}return t.prototype.advanceTime=function(t){t!=t&&(t=0);var e=.001*Date.now();if(t<0&&(t=e-this._systemTime),this._systemTime=e,1!==this.timeScale&&(t*=this.timeScale),0!==t){t<0?this.time-=t:this.time+=t;for(var i=0,n=0,r=this._animatebles.length;i<r;++i){var a=this._animatebles[i];null!==a?(n>0&&(this._animatebles[i-n]=a,this._animatebles[i]=null),a.advanceTime(t)):n++}if(n>0){for(r=this._animatebles.length;i<r;++i){var s=this._animatebles[i];null!==s?this._animatebles[i-n]=s:n++}this._animatebles.length-=n}}},t.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.clock;return e===this},t.prototype.add=function(t){this._animatebles.indexOf(t)<0&&(this._animatebles.push(t),t.clock=this)},t.prototype.remove=function(t){var e=this._animatebles.indexOf(t);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];null!==i&&(i.clock=null)}},Object.defineProperty(t.prototype,"clock",{get:function(){return this._clock},set:function(t){this._clock!==t&&(null!==this._clock&&this._clock.remove(this),this._clock=t,null!==this._clock&&this._clock.add(this))},enumerable:!0,configurable:!0}),t.clock=new t,t})();t.WorldClock=e})(r||(r={})),(function(t){var e=(function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._animationNames=[],t._animationStates=[],t._animations={},t._animationConfig=null,t}return a(i,e),i.toString=function(){return"[class dragonBones.Animation]"},i.prototype._onClear=function(){for(var t=0,e=this._animationStates;t<e.length;t++)e[t].returnToPool();for(var i in this._animations)delete this._animations[i];null!==this._animationConfig&&this._animationConfig.returnToPool(),this.timeScale=1,this._lockUpdate=!1,this._animationDirty=!1,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++)null===(l=i[e])._parent&&l.layer===t.layer&&l.fadeOut(t.fadeOutTime,t.pauseFadeOut);break;case 2:for(var n=0,r=this._animationStates;n<r.length;n++)null===(l=r[n])._parent&&l.group===t.group&&l.fadeOut(t.fadeOutTime,t.pauseFadeOut);break;case 3:for(var a=0,s=this._animationStates;a<s.length;a++)null===(l=s[a])._parent&&l.layer===t.layer&&l.group===t.group&&l.fadeOut(t.fadeOutTime,t.pauseFadeOut);break;case 4:for(var o=0,c=this._animationStates;o<c.length;o++){var l;null===(l=c[o])._parent&&l.fadeOut(t.fadeOutTime,t.pauseFadeOut)}}},i.prototype.init=function(e){null===this._armature&&(this._armature=e,this._animationConfig=t.BaseObject.borrowObject(t.AnimationConfig))},i.prototype.advanceTime=function(t){t<0&&(t=-t),this._armature.inheritAnimation&&null!==this._armature._parent?this._inheritTimeScale=this._armature._parent._armature.animation._inheritTimeScale*this.timeScale:this._inheritTimeScale=this.timeScale,1!==this._inheritTimeScale&&(t*=this._inheritTimeScale);var e=this._animationStates.length;if(1===e)if((d=this._animationStates[0])._fadeState>0&&d._subFadeState>0)this._armature._dragonBones.bufferObject(d),this._animationStates.length=0,this._lastAnimationState=null;else{var i=d._animationData,n=i.cacheFrameRate;if(this._animationDirty&&n>0){this._animationDirty=!1;for(var r=0,a=this._armature.getBones();r<a.length;r++){var s=a[r];s._cachedFrameIndices=i.getBoneCachedFrameIndices(s.name)}for(var o=0,c=this._armature.getSlots();o<c.length;o++){var l=c[o],h=l.rawDisplayDatas;if(null!==h&&h.length>0){var u=h[0];if(null!==u&&u.parent===this._armature.armatureData.defaultSkin){l._cachedFrameIndices=i.getSlotCachedFrameIndices(l.name);continue}}l._cachedFrameIndices=null}}d.advanceTime(t,n)}else if(e>1){for(var f=0,_=0;f<e;++f){var d;(d=this._animationStates[f])._fadeState>0&&d._subFadeState>0?(_++,this._armature._dragonBones.bufferObject(d),this._animationDirty=!0,this._lastAnimationState===d&&(this._lastAnimationState=null)):(_>0&&(this._animationStates[f-_]=d),d.advanceTime(t,0)),f===e-1&&_>0&&(this._animationStates.length-=_,null===this._lastAnimationState&&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++)e[t].returnToPool();this._animationDirty=!1,this._animationConfig.clear(),this._animationStates.length=0,this._lastAnimationState=null},i.prototype.stop=function(t){if(void 0===t&&(t=null),null!==t)null!==(n=this.getState(t))&&n.stop();else for(var e=0,i=this._animationStates;e<i.length;e++){var n;(n=i[e]).stop()}},i.prototype.playConfig=function(e){var i=e.animation;if(!(i in this._animations))return console.warn("Non-existent animation.\n","DragonBones name: "+this._armature.armatureData.parent.name,"Armature name: "+this._armature.name,"Animation name: "+i),null;var n=this._animations[i];if(5===e.fadeOutMode)for(var r=0,a=this._animationStates;r<a.length;r++){var s=a[r];if(s._animationData===n)return s}0===this._animationStates.length?e.fadeInTime=0:e.fadeInTime<0&&(e.fadeInTime=n.fadeInTime),e.fadeOutTime<0&&(e.fadeOutTime=e.fadeInTime),e.timeScale<=-100&&(e.timeScale=1/n.scale),n.frameCount>1?(e.position<0?(e.position%=n.duration,e.position=n.duration-e.position):e.position===n.duration?e.position-=1e-6:e.position>n.duration&&(e.position%=n.duration),e.duration>0&&e.position+e.duration>n.duration&&(e.duration=n.duration-e.position),e.playTimes<0&&(e.playTimes=n.playTimes)):(e.playTimes=1,e.position=0,e.duration>0&&(e.duration=0)),0===e.duration&&(e.duration=-1),this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);if(o.init(this._armature,n,e),this._animationDirty=!0,this._armature._cacheFrameIndex=-1,this._animationStates.length>0){for(var c=!1,l=0,h=this._animationStates.length;l<h;++l){if(o.layer>this._animationStates[l].layer){c=!0,this._animationStates.splice(l,0,o);break}if(l!==h-1&&o.layer>this._animationStates[l+1].layer){c=!0,this._animationStates.splice(l+1,0,o);break}}c||this._animationStates.push(o)}else this._animationStates.push(o);for(var u=0,f=this._armature.getSlots();u<f.length;u++){var _=f[u].childArmature;null!==_&&_.inheritAnimation&&_.animation.hasAnimation(i)&&null===_.animation.getState(i)&&_.animation.fadeIn(i)}var d=!1;for(var p in n.animationTimelines){this._lockUpdate||(d=!0,this._lockUpdate=!0);var m=this.fadeIn(p,e.fadeInTime,1,o.layer,null,0);null!==m&&(m.resetToPose=!1,m._parent=o,m.stop())}return d&&(this._lockUpdate=!1),this._lockUpdate||(e.fadeInTime<=0&&this._armature.advanceTime(0),this._lastAnimationState=o),o},i.prototype.play=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=null!==t?t:"",null!==t&&t.length>0)this.playConfig(this._animationConfig);else if(null===this._lastAnimationState){var i=this._armature.armatureData.defaultAnimation;null!==i&&(this._animationConfig.animation=i.name,this.playConfig(this._animationConfig))}else this._lastAnimationState.isPlaying||this._lastAnimationState.isCompleted?(this._animationConfig.animation=this._lastAnimationState.name,this.playConfig(this._animationConfig)):this._lastAnimationState.play();return this._lastAnimationState},i.prototype.fadeIn=function(t,e,i,n,r,a){return void 0===e&&(e=-1),void 0===i&&(i=-1),void 0===n&&(n=0),void 0===r&&(r=null),void 0===a&&(a=3),this._animationConfig.clear(),this._animationConfig.fadeOutMode=a,this._animationConfig.playTimes=i,this._animationConfig.layer=n,this._animationConfig.fadeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==r?r:"",this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByTime=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.position=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t,this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByFrame=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return null!==n&&(this._animationConfig.position=n.duration*e/n.frameCount),this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByProgress=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return null!==n&&(this._animationConfig.position=n.duration*(e>0?e:0)),this.playConfig(this._animationConfig)},i.prototype.gotoAndStopByTime=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByTime(t,e,1);return null!==i&&i.stop(),i},i.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByFrame(t,e,1);return null!==i&&i.stop(),i},i.prototype.gotoAndStopByProgress=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByProgress(t,e,1);return null!==i&&i.stop(),i},i.prototype.getState=function(t){for(var e=this._animationStates.length;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++)if(e[t].isPlaying)return!0;return!1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isCompleted",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++)if(!e[t].isCompleted)return!1;return this._animationStates.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastAnimationName",{get:function(){return null!==this._lastAnimationState?this._lastAnimationState.name:""},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations!==t){for(var e in this._animationNames.length=0,this._animations)delete this._animations[e];for(var e in t)this._animationNames.push(e),this._animations[e]=t[e]}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationConfig",{get:function(){return this._animationConfig.clear(),this._animationConfig},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:!0,configurable:!0}),i.prototype.gotoAndPlay=function(t,e,i,n,r,a,s,o,c){void 0===e&&(e=-1),void 0===i&&(i=-1),void 0===n&&(n=-1),void 0===r&&(r=0),void 0===a&&(a=null),void 0===s&&(s=3),void 0===o&&(o=!0),void 0===c&&(c=!0),console.warn("Deprecated."),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.fadeOutMode=s,this._animationConfig.playTimes=n,this._animationConfig.layer=r,this._animationConfig.fadeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==a?a:"";var l=this._animations[t];return l&&i>0&&(this._animationConfig.timeScale=l.duration/i),this.playConfig(this._animationConfig)},i.prototype.gotoAndStop=function(t,e){return void 0===e&&(e=0),console.warn("Deprecated."),this.gotoAndStopByTime(t,e)},Object.defineProperty(i.prototype,"animationList",{get:function(){return console.warn("Deprecated."),this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationDataList",{get:function(){console.warn("Deprecated.");for(var t=[],e=0,i=this._animationNames.length;e<i;++e)t.push(this._animations[this._animationNames[e]]);return t},enumerable:!0,configurable:!0}),i})(t.BaseObject);t.Animation=e})(r||(r={})),(function(t){var e=(function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._blendState=new n,t._boneMask=[],t._boneTimelines=[],t._surfaceTimelines=[],t._slotTimelines=[],t._constraintTimelines=[],t._animationTimelines=[],t._poseTimelines=[],t._bonePoses={},t._actionTimeline=null,t._zOrderTimeline=null,t._parent=null,t}return a(r,e),r.toString=function(){return"[class dragonBones.AnimationState]"},r.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t<e.length;t++)e[t].returnToPool();for(var i=0,n=this._surfaceTimelines;i<n.length;i++)n[i].returnToPool();for(var r=0,a=this._slotTimelines;r<a.length;r++)a[r].returnToPool();for(var s=0,o=this._constraintTimelines;s<o.length;s++)o[s].returnToPool();for(var c=0,l=this._animationTimelines;c<l.length;c++)l[c].returnToPool();for(var h in this._bonePoses)this._bonePoses[h].returnToPool(),delete this._bonePoses[h];null!==this._actionTimeline&&this._actionTimeline.returnToPool(),null!==this._zOrderTimeline&&this._zOrderTimeline.returnToPool(),this.actionEnabled=!1,this.additiveBlending=!1,this.displayControl=!1,this.resetToPose=!1,this.playTimes=1,this.layer=0,this.timeScale=1,this.weight=1,this.autoFadeOutTime=0,this.fadeTotalTime=0,this.name="",this.group="",this._timelineDirty=2,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._blendState.clear(),this._boneMask.length=0,this._boneTimelines.length=0,this._surfaceTimelines.length=0,this._slotTimelines.length=0,this._constraintTimelines.length=0,this._animationTimelines.length=0,this._poseTimelines.length=0,this._animationData=null,this._armature=null,this._actionTimeline=null,this._zOrderTimeline=null,this._parent=null},r.prototype._updateTimelines=function(){for(var e=0,i=this._armature._constraints;e<i.length;e++){var n=i[e];if(null!==(c=this._animationData.getConstraintTimelines(n.name)))for(var r=0,a=c;r<a.length;r++)switch((f=a[r]).type){case 30:(_=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).constraint=n,_.init(this._armature,this,f),this._constraintTimelines.push(_)}else this.resetToPose&&((_=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).constraint=n,_.init(this._armature,this,null),this._constraintTimelines.push(_),this._poseTimelines.push(_))}for(var s=0,o=this._armature.animation.getStates();s<o.length;s++){var c,l=o[s];if(l._parent===this&&null!==(c=this._animationData.getAnimationTimelines(l.name)))for(var h=0,u=c;h<u.length;h++){var f;switch((f=u[h]).type){case 40:var _;(_=t.BaseObject.borrowObject(t.AnimationTimelineState)).animationState=l,_.init(this._armature,this,f),this._animationTimelines.push(_)}}}},r.prototype._updateBoneAndSlotTimelines=function(){for(var e={},n=0,r=this._boneTimelines;n<r.length;n++)(c=(g=r[n]).bone.name)in e||(e[c]=[]),e[c].push(g);for(var a=0,s=this._armature.getBones();a<s.length;a++){var o=s[a],c=o.name;if(this.containsBoneMask(c))if(c in e)delete e[c];else if(0===o._boneData.type){var l=this._animationData.getBoneTimelines(c),h=c in this._bonePoses?this._bonePoses[c]:this._bonePoses[c]=t.BaseObject.borrowObject(i);if(null!==l)for(var u=0,f=l;u<f.length;u++)switch((I=f[u]).type){case 10:(g=t.BaseObject.borrowObject(t.BoneAllTimelineState)).bone=o,g.bonePose=h,g.init(this._armature,this,I),this._boneTimelines.push(g);break;case 11:(g=t.BaseObject.borrowObject(t.BoneTranslateTimelineState)).bone=o,g.bonePose=h,g.init(this._armature,this,I),this._boneTimelines.push(g);break;case 12:(g=t.BaseObject.borrowObject(t.BoneRotateTimelineState)).bone=o,g.bonePose=h,g.init(this._armature,this,I),this._boneTimelines.push(g);break;case 13:(g=t.BaseObject.borrowObject(t.BoneScaleTimelineState)).bone=o,g.bonePose=h,g.init(this._armature,this,I),this._boneTimelines.push(g)}else this.resetToPose&&((g=t.BaseObject.borrowObject(t.BoneAllTimelineState)).bone=o,g.bonePose=h,g.init(this._armature,this,null),this._boneTimelines.push(g),this._poseTimelines.push(g))}else if(1===o._boneData.type)if(null!==(l=this._animationData.getSurfaceTimelines(c)))for(var _=0,d=l;_<d.length;_++)switch((I=d[_]).type){case 50:(g=t.BaseObject.borrowObject(t.SurfaceTimelineState)).surface=o,g.init(this._armature,this,I),this._surfaceTimelines.push(g)}else this.resetToPose&&((g=t.BaseObject.borrowObject(t.SurfaceTimelineState)).surface=o,g.init(this._armature,this,null),this._surfaceTimelines.push(g),this._poseTimelines.push(g))}for(var p in e)for(var m=0,v=e[p];m<v.length;m++){var g=v[m];this._boneTimelines.splice(this._boneTimelines.indexOf(g),1),g.returnToPool()}for(var y={},T=[],A=0,b=this._slotTimelines;A<b.length;A++)(c=(g=b[A]).slot.name)in y||(y[c]=[]),y[c].push(g);for(var E=0,C=this._armature.getSlots();E<C.length;E++){var x=C[E],S=x.parent.name;if(this.containsBoneMask(S))if(c=x.name,l=this._animationData.getSlotTimelines(c),c in y)delete y[c];else{var w=!1,D=!1;if(T.length=0,null!==l)for(var M=0,R=l;M<R.length;M++){var I;switch((I=R[M]).type){case 20:(g=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).slot=x,g.init(this._armature,this,I),this._slotTimelines.push(g),w=!0;break;case 21:(g=t.BaseObject.borrowObject(t.SlotColorTimelineState)).slot=x,g.init(this._armature,this,I),this._slotTimelines.push(g),D=!0;break;case 22:(g=t.BaseObject.borrowObject(t.DeformTimelineState)).slot=x,g.init(this._armature,this,I),this._slotTimelines.push(g),T.push(g.vertexOffset)}}if(this.resetToPose&&(w||((g=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).slot=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g)),D||((g=t.BaseObject.borrowObject(t.SlotColorTimelineState)).slot=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g)),null!==x.rawDisplayDatas))for(var O=0,P=x.rawDisplayDatas;O<P.length;O++){var N=P[O];if(null!==N&&2===N.type){var F=N.vertices.offset;T.indexOf(F)<0&&((g=t.BaseObject.borrowObject(t.DeformTimelineState)).vertexOffset=F,g.slot=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g))}}}}for(var p in y)for(var L=0,B=y[p];L<B.length;L++)g=B[L],this._slotTimelines.splice(this._slotTimelines.indexOf(g),1),g.returnToPool()},r.prototype._advanceFadeTime=function(e){var i,n=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var r=n?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;this._armature.eventDispatcher.hasDBEventListener(r)&&((i=t.BaseObject.borrowObject(t.EventObject)).type=r,i.armature=this._armature,i.animationState=this,this._armature._dragonBones.bufferEvent(i))}(e<0&&(e=-e),this._fadeTime+=e,this._fadeTime>=this.fadeTotalTime?(this._subFadeState=1,this._fadeProgress=n?0:1):this._fadeTime>0?this._fadeProgress=n?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeProgress=n?1:0,this._subFadeState>0)&&(n||(this._playheadState|=1,this._fadeState=0),r=n?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE,this._armature.eventDispatcher.hasDBEventListener(r)&&((i=t.BaseObject.borrowObject(t.EventObject)).type=r,i.armature=this._armature,i.animationState=this,this._armature._dragonBones.bufferEvent(i)))},r.prototype.init=function(e,i,n){if(null===this._armature){if(this._armature=e,this._animationData=i,this.resetToPose=n.resetToPose,this.additiveBlending=n.additiveBlending,this.displayControl=n.displayControl,this.actionEnabled=n.actionEnabled,this.layer=n.layer,this.playTimes=n.playTimes,this.timeScale=n.timeScale,this.fadeTotalTime=n.fadeInTime,this.autoFadeOutTime=n.autoFadeOutTime,this.weight=n.weight,this.name=n.name.length>0?n.name:n.animation,this.group=n.group,n.pauseFadeIn?this._playheadState=2:this._playheadState=3,n.duration<0?(this._position=0,this._duration=this._animationData.duration,0!==n.position?this.timeScale>=0?this._time=n.position:this._time=n.position-this._duration:this._time=0):(this._position=n.position,this._duration=n.duration,this._time=0),this.timeScale<0&&0===this._time&&(this._time=-1e-6),this.fadeTotalTime<=0&&(this._fadeProgress=.999999),n.boneMask.length>0){this._boneMask.length=n.boneMask.length;for(var r=0,a=this._boneMask.length;r<a;++r)this._boneMask[r]=n.boneMask[r]}this._actionTimeline=t.BaseObject.borrowObject(t.ActionTimelineState),this._actionTimeline.init(this._armature,this,this._animationData.actionTimeline),this._actionTimeline.currentTime=this._time,this._actionTimeline.currentTime<0&&(this._actionTimeline.currentTime=this._duration-this._actionTimeline.currentTime),null!==this._animationData.zOrderTimeline&&(this._zOrderTimeline=t.BaseObject.borrowObject(t.ZOrderTimelineState),this._zOrderTimeline.init(this._armature,this,this._animationData.zOrderTimeline))}},r.prototype.advanceTime=function(e,i){if(this._blendState.dirty=!1,0===this._fadeState&&0===this._subFadeState||this._advanceFadeTime(e),3===this._playheadState&&(1!==this.timeScale&&(e*=this.timeScale),this._time+=e),0!==this._timelineDirty&&(2===this._timelineDirty&&this._updateTimelines(),this._timelineDirty=0,this._updateBoneAndSlotTimelines()),0!==this.weight){var n=0===this._fadeState&&i>0,r=!0,a=!0,s=this._time;if(this._weightResult=this.weight*this._fadeProgress,null!==this._parent&&(this._weightResult*=this._parent._weightResult/this._parent._fadeProgress),this._actionTimeline.playState<=0&&this._actionTimeline.update(s),n){var o=2*i;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(null!==this._zOrderTimeline&&this._zOrderTimeline.playState<=0&&this._zOrderTimeline.update(s),n){var c=Math.floor(this._actionTimeline.currentTime*i);this._armature._cacheFrameIndex===c?(r=!1,a=!1):(this._armature._cacheFrameIndex=c,this._animationData.cachedFrames[c]?a=!1:this._animationData.cachedFrames[c]=!0)}if(r){if(a)for(var l=0,h=this._boneTimelines.length;l<h;++l)(p=this._boneTimelines[l]).playState<=0&&p.update(s),(l===h-1||p.bone!==this._boneTimelines[l+1].bone)&&0!==(u=p.bone._blendState.update(this._weightResult,this.layer))&&p.blend(u);for(l=0,h=this._surfaceTimelines.length;l<h;++l){var u=(p=this._surfaceTimelines[l]).surface._blendState.update(this._weightResult,this.layer);p.playState<=0&&p.update(s),0!==u&&p.blend(u)}if(this.displayControl)for(l=0,h=this._slotTimelines.length;l<h;++l){var f=(p=this._slotTimelines[l]).slot.displayController;null!==f&&f!==this.name&&f!==this.group||p.playState<=0&&p.update(s)}for(l=0,h=this._constraintTimelines.length;l<h;++l)(p=this._constraintTimelines[l]).playState<=0&&p.update(s);for(l=0,h=this._animationTimelines.length;l<h;++l)u=(p=this._animationTimelines[l]).animationState._blendState.update(this._weightResult,this.layer),p.playState<=0&&p.update(s),0!==u&&p.blend(u)}if(0===this._fadeState){if(this._subFadeState>0&&(this._subFadeState=0,this._poseTimelines.length>0)){for(var _=0,d=this._poseTimelines;_<d.length;_++){var p;(p=d[_])instanceof t.BoneTimelineState?this._boneTimelines.splice(this._boneTimelines.indexOf(p),1):p instanceof t.SurfaceTimelineState?this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(p),1):p instanceof t.SlotTimelineState?this._slotTimelines.splice(this._slotTimelines.indexOf(p),1):p instanceof t.ConstraintTimelineState&&this._constraintTimelines.splice(this._constraintTimelines.indexOf(p),1),p.returnToPool()}this._poseTimelines.length=0}this._actionTimeline.playState>0&&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(void 0===e&&(e=!0),t<0&&(t=0),e&&(this._playheadState&=2),this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime)return}else{this._fadeState=1,this._subFadeState=-1,(t<=0||this._fadeProgress<=0)&&(this._fadeProgress=1e-6);for(var i=0,n=this._boneTimelines;i<n.length;i++)(f=n[i]).fadeOut();for(var r=0,a=this._surfaceTimelines;r<a.length;r++)(f=a[r]).fadeOut();for(var s=0,o=this._slotTimelines;s<o.length;s++)(f=o[s]).fadeOut();for(var c=0,l=this._constraintTimelines;c<l.length;c++)(f=l[c]).fadeOut();for(var h=0,u=this._animationTimelines;h<u.length;h++){var f;(f=u[h]).animationState.fadeOut(t,e),f.fadeOut()}}this.displayControl=!1,this.fadeTotalTime=this._fadeProgress>1e-6?t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)},r.prototype.containsBoneMask=function(t){return 0===this._boneMask.length||this._boneMask.indexOf(t)>=0},r.prototype.addBoneMask=function(t,e){void 0===e&&(e=!0);var i=this._armature.getBone(t);if(null!==i){if(this._boneMask.indexOf(t)<0&&this._boneMask.push(t),e)for(var n=0,r=this._armature.getBones();n<r.length;n++){var a=r[n];this._boneMask.indexOf(a.name)<0&&i.contains(a)&&this._boneMask.push(a.name)}this._timelineDirty=1}},r.prototype.removeBoneMask=function(t,e){void 0===e&&(e=!0);var i=this._boneMask.indexOf(t);if(i>=0&&this._boneMask.splice(i,1),e){var n=this._armature.getBone(t);if(null!==n){var r=this._armature.getBones();if(this._boneMask.length>0)for(var a=0,s=r;a<s.length;a++){var o=s[a],c=this._boneMask.indexOf(o.name);c>=0&&n.contains(o)&&this._boneMask.splice(c,1)}else for(var l=0,h=r;l<h.length;l++)(o=h[l])!==n&&(n.contains(o)||this._boneMask.push(o.name))}}this._timelineDirty=1},r.prototype.removeAllBoneMask=function(){this._boneMask.length=0,this._timelineDirty=1},Object.defineProperty(r.prototype,"isFadeIn",{get:function(){return this._fadeState<0},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isFadeOut",{get:function(){return this._fadeState>0},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return 0===this._fadeState},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isPlaying",{get:function(){return 0!=(2&this._playheadState)&&this._actionTimeline.playState<=0},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),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)<0&&(t+=this._duration),this.playTimes>0&&e===this.playTimes-1&&t===this._duration&&(t=this._duration-1e-6),this._time!==t){this._time=t,this._actionTimeline.setCurrentTime(this._time),null!==this._zOrderTimeline&&(this._zOrderTimeline.playState=-1);for(var i=0,n=this._boneTimelines;i<n.length;i++)n[i].playState=-1;for(var r=0,a=this._slotTimelines;r<a.length;r++)a[r].playState=-1}},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"animationData",{get:function(){return this._animationData},enumerable:!0,configurable:!0}),r})(t.BaseObject);t.AnimationState=e;var i=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.current=new t.Transform,i.delta=new t.Transform,i.result=new t.Transform,i}return a(i,e),i.toString=function(){return"[class dragonBones.BonePose]"},i.prototype._onClear=function(){this.current.identity(),this.delta.identity(),this.result.identity()},i})(t.BaseObject);t.BonePose=i;var n=(function(){function t(){}return t.prototype.update=function(t,e){if(this.dirty){if(!(this.leftWeight>0))return 0;if(this.layer!==e){if(this.layerWeight>=this.leftWeight)return this.leftWeight=0,0;this.layer=e,this.leftWeight-=this.layerWeight,this.layerWeight=0}return t*=this.leftWeight,this.layerWeight+=t,this.blendWeight=t,2}return this.dirty=!0,this.layer=e,this.layerWeight=t,this.leftWeight=1,this.blendWeight=t,1},t.prototype.clear=function(){this.dirty=!1,this.layer=0,this.leftWeight=0,this.layerWeight=0,this.blendWeight=0},t})();t.BlendState=n})(r||(r={})),(function(t){var e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),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,i=this.currentPlayTimes,n=this.currentTime;if(null!==this._actionTimeline&&this._frameCount<=1)this.playState=this._actionTimeline.playState>=0?1:-1,this.currentPlayTimes=1,this.currentTime=this._actionTimeline.currentTime;else if(null===this._actionTimeline||1!==this._timeScale||0!==this._timeOffset){var r=this._animationState.playTimes,a=r*this._duration;t*=this._timeScale,0!==this._timeOffset&&(t+=this._timeOffset*this._animationData.duration),r>0&&(t>=a||t<=-a)?(this.playState<=0&&3===this._animationState._playheadState&&(this.playState=1),this.currentPlayTimes=r,this.currentTime=t<0?0:this._duration+1e-6):(0!==this.playState&&3===this._animationState._playheadState&&(this.playState=0),t<0?(t=-t,this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=this._duration-t%this._duration):(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;return(this.currentPlayTimes!==i||this.currentTime!==n)&&((e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==i)&&(this._frameIndex=-1),!0)},e.prototype.init=function(t,e,i){this._armature=t,this._animationState=e,this._timelineData=i,this._actionTimeline=this._animationState._actionTimeline,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,null!==this._timelineData&&(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=.01*this._timelineArray[this._timelineData.offset+1])},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),i=this._frameIndices[this._timelineData.frameIndicesOffset+e];this._frameIndex!==i&&(this._frameIndex=i,this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex],this._onArriveAtFrame())}else this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData&&(this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]),this._onArriveAtFrame());0!==this._tweenState&&this._onUpdateFrame()}},e})(t.BaseObject);t.TimelineState=e;var i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e._getEasingValue=function(t,e,i){var n=e;switch(t){case 3:n=Math.pow(e,2);break;case 4:n=1-Math.pow(1-e,2);break;case 5:n=.5*(1-Math.cos(e*Math.PI))}return(n-e)*i+e},e._getEasingCurveValue=function(t,e,i,n){if(t<=0)return 0;if(t>=1)return 1;var r=i+1,a=Math.floor(t*r),s=0===a?0:e[n+a-1];return 1e-4*(s+((a===r-1?1e4:e[n+a])-s)*(t*r-a))},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||0===this._animationState.playTimes||this._animationState.currentPlayTimes<this._animationState.playTimes-1))if(this._tweenType=this._frameArray[this._frameOffset+1],this._tweenState=0===this._tweenType?1:2,2===this._tweenType?this._curveCount=this._frameArray[this._frameOffset+2]:0!==this._tweenType&&1!==this._tweenType&&(this._tweenEasing=.01*this._frameArray[this._frameOffset+2]),this._framePosition=this._frameArray[this._frameOffset]*this._frameRateR,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],e=this._frameArray[t]*this._frameRateR-this._framePosition;this._frameDurationR=e>0?1/e:0}else this._tweenState=1},e.prototype._onUpdateFrame=function(){2===this._tweenState?(this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR,2===this._tweenType?this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3):1!==this._tweenType&&(this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing))):this._tweenProgress=0},e})(e);t.TweenTimelineState=i;var n=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this.bone=null,this.bonePose=null},e.prototype.blend=function(t){var e=this.bone._blendState.blendWeight,i=this.bone.animationPose,n=this.bonePose.result;2===t?(i.x+=n.x*e,i.y+=n.y*e,i.rotation+=n.rotation*e,i.skew+=n.skew*e,i.scaleX+=(n.scaleX-1)*e,i.scaleY+=(n.scaleY-1)*e):1!==e?(i.x=n.x*e,i.y=n.y*e,i.rotation=n.rotation*e,i.skew=n.skew*e,i.scaleX=(n.scaleX-1)*e+1,i.scaleY=(n.scaleY-1)*e+1):(i.x=n.x,i.y=n.y,i.rotation=n.rotation,i.skew=n.skew,i.scaleX=n.scaleX,i.scaleY=n.scaleY),0===this._animationState._fadeState&&0===this._animationState._subFadeState||(this.bone._transformDirty=!0)},e})(i);t.BoneTimelineState=n;var r=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this.slot=null},e})(i);t.SlotTimelineState=r;var s=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this.constraint=null},e})(i);t.ConstraintTimelineState=s})(r||(r={})),(function(t){var e=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),i.toString=function(){return"[class dragonBones.ActionTimelineState]"},i.prototype._onCrossFrame=function(e){var i=this._armature.eventDispatcher;if(this._animationState.actionEnabled)for(var n=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e],r=this._frameArray[n+1],a=this._animationData.parent.actions,s=0;s<r;++s){var o=a[this._frameArray[n+2+s]];if(0===o.type)(c=t.BaseObject.borrowObject(t.EventObject)).time=this._frameArray[n]/this._frameRate,c.animationState=this._animationState,t.EventObject.actionDataToInstance(o,c,this._armature),this._armature._bufferAction(c,!0);else{var c,l=10===o.type?t.EventObject.FRAME_EVENT:t.EventObject.SOUND_EVENT;(11===o.type||i.hasDBEventListener(l))&&((c=t.BaseObject.borrowObject(t.EventObject)).time=this._frameArray[n]/this._frameRate,c.animationState=this._animationState,t.EventObject.actionDataToInstance(o,c,this._armature),this._armature._dragonBones.bufferEvent(c))}}},i.prototype._onArriveAtFrame=function(){},i.prototype._onUpdateFrame=function(){},i.prototype.update=function(e){var i=this.playState,n=this.currentPlayTimes,r=this.currentTime;if(this._setCurrentTime(e)){var a=this._armature.eventDispatcher;if(i<0){if(this.playState===i)return;if(this._animationState.displayControl&&this._animationState.resetToPose&&this._armature._sortZOrder(null,0),n=this.currentPlayTimes,a.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)}}var o=this._animationState.timeScale<0,c=null,l=null;if(this.currentPlayTimes!==n&&(a.hasDBEventListener(t.EventObject.LOOP_COMPLETE)&&((c=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.LOOP_COMPLETE,c.armature=this._armature,c.animationState=this._animationState),this.playState>0&&a.hasDBEventListener(t.EventObject.COMPLETE)&&((l=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.COMPLETE,l.armature=this._armature,l.animationState=this._animationState)),this._frameCount>1){var h=this._timelineData,u=Math.floor(this.currentTime*this._frameRate),f=this._frameIndices[h.frameIndicesOffset+u];if(this._frameIndex!==f){var _=this._frameIndex;if(this._frameIndex=f,null!==this._timelineArray)if(this._frameOffset=this._animationData.frameOffset+this._timelineArray[h.offset+5+this._frameIndex],o){if(_<0){var d=Math.floor(r*this._frameRate);_=this._frameIndices[h.frameIndicesOffset+d],this.currentPlayTimes===n&&_===f&&(_=-1)}for(;_>=0;){var p=this._animationData.frameOffset+this._timelineArray[h.offset+5+_],m=this._frameArray[p]/this._frameRate;if(this._position<=m&&m<=this._position+this._duration&&this._onCrossFrame(_),null!==c&&0===_&&(this._armature._dragonBones.bufferEvent(c),c=null),_>0?_--:_=this._frameCount-1,_===f)break}}else for(_<0&&(d=Math.floor(r*this._frameRate),_=this._frameIndices[h.frameIndicesOffset+d],p=this._animationData.frameOffset+this._timelineArray[h.offset+5+_],m=this._frameArray[p]/this._frameRate,this.currentPlayTimes===n&&(r<=m?_>0?_--:_=this._frameCount-1:_===f&&(_=-1)));_>=0&&(_<this._frameCount-1?_++:_=0,p=this._animationData.frameOffset+this._timelineArray[h.offset+5+_],m=this._frameArray[p]/this._frameRate,this._position<=m&&m<=this._position+this._duration&&this._onCrossFrame(_),null!==c&&0===_&&(this._armature._dragonBones.bufferEvent(c),c=null),_!==f););}}else this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData)&&(this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5],m=this._frameArray[this._frameOffset]/this._frameRate,this.currentPlayTimes===n?r<=m&&this._onCrossFrame(this._frameIndex):this._position<=m&&(o||null===c||(this._armature._dragonBones.bufferEvent(c),c=null),this._onCrossFrame(this._frameIndex)));null!==c&&this._armature._dragonBones.bufferEvent(c),null!==l&&this._armature._dragonBones.bufferEvent(l)}},i.prototype.setCurrentTime=function(t){this._setCurrentTime(t),this._frameIndex=-1},i})(t.TimelineState);t.ActionTimelineState=e;var i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.ZOrderTimelineState]"},e.prototype._onArriveAtFrame=function(){this.playState>=0&&(this._frameArray[this._frameOffset+1]>0?this._armature._sortZOrder(this._frameArray,this._frameOffset+2):this._armature._sortZOrder(null,0))},e.prototype._onUpdateFrame=function(){},e})(t.TimelineState);t.ZOrderTimelineState=i;var n=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),i.toString=function(){return"[class dragonBones.BoneAllTimelineState]"},i.prototype._onArriveAtFrame=function(){if(e.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var t=this._animationData.frameFloatOffset+this._frameValueOffset+6*this._frameIndex,i=this._armature._armatureData.scale,n=this._frameFloatArray,r=this.bonePose.current,a=this.bonePose.delta;r.x=n[t++]*i,r.y=n[t++]*i,r.rotation=n[t++],r.skew=n[t++],r.scaleX=n[t++],r.scaleY=n[t++],2===this._tweenState?(this._frameIndex===this._frameCount-1&&(t=this._animationData.frameFloatOffset+this._frameValueOffset),a.x=n[t++]*i-r.x,a.y=n[t++]*i-r.y,a.rotation=n[t++]-r.rotation,a.skew=n[t++]-r.skew,a.scaleX=n[t++]-r.scaleX,a.scaleY=n[t++]-r.scaleY):(a.x=0,a.y=0,a.rotation=0,a.skew=0,a.scaleX=0,a.scaleY=0)}else r=this.bonePose.current,a=this.bonePose.delta,r.x=0,r.y=0,r.rotation=0,r.skew=0,r.scaleX=1,r.scaleY=1,a.x=0,a.y=0,a.rotation=0,a.skew=0,a.scaleX=0,a.scaleY=0},i.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._transformDirty=!0,2!==this._tweenState&&(this._tweenState=0),n.x=t.x+i.x*this._tweenProgress,n.y=t.y+i.y*this._tweenProgress,n.rotation=t.rotation+i.rotation*this._tweenProgress,n.skew=t.skew+i.skew*this._tweenProgress,n.scaleX=t.scaleX+i.scaleX*this._tweenProgress,n.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)},i})(t.BoneTimelineState);t.BoneAllTimelineState=n;var r=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.frameFloatOffset+this._frameValueOffset+2*this._frameIndex,i=this._armature._armatureData.scale,n=this._frameFloatArray,r=this.bonePose.current,a=this.bonePose.delta;r.x=n[e++]*i,r.y=n[e++]*i,2===this._tweenState?(this._frameIndex===this._frameCount-1&&(e=this._animationData.frameFloatOffset+this._frameValueOffset),a.x=n[e++]*i-r.x,a.y=n[e++]*i-r.y):(a.x=0,a.y=0)}else r=this.bonePose.current,a=this.bonePose.delta,r.x=0,r.y=0,a.x=0,a.y=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._transformDirty=!0,2!==this._tweenState&&(this._tweenState=0),n.x=e.x+i.x*this._tweenProgress,n.y=e.y+i.y*this._tweenProgress},e})(t.BoneTimelineState);t.BoneTranslateTimelineState=r;var s=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),i.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"},i.prototype._onArriveAtFrame=function(){if(e.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var i=this._animationData.frameFloatOffset+this._frameValueOffset+2*this._frameIndex,n=this._frameFloatArray,r=this.bonePose.current,a=this.bonePose.delta;r.rotation=n[i++],r.skew=n[i++],2===this._tweenState?(this._frameIndex===this._frameCount-1?(i=this._animationData.frameFloatOffset+this._frameValueOffset,a.rotation=t.Transform.normalizeRadian(n[i++]-r.rotation)):a.rotation=n[i++]-r.rotation,a.skew=n[i++]-r.skew):(a.rotation=0,a.skew=0)}else r=this.bonePose.current,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,i=this.bonePose.delta,n=this.bonePose.result;this.bone._transformDirty=!0,2!==this._tweenState&&(this._tweenState=0),n.rotation=t.rotation+i.rotation*this._tweenProgress,n.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)},i})(t.BoneTimelineState);t.BoneRotateTimelineState=s;var o=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.frameFloatOffset+this._frameValueOffset+2*this._frameIndex,i=this._frameFloatArray,n=this.bonePose.current,r=this.bonePose.delta;n.scaleX=i[e++],n.scaleY=i[e++],2===this._tweenState?(this._frameIndex===this._frameCount-1&&(e=this._animationData.frameFloatOffset+this._frameValueOffset),r.scaleX=i[e++]-n.scaleX,r.scaleY=i[e++]-n.scaleY):(r.scaleX=0,r.scaleY=0)}else n=this.bonePose.current,r=this.bonePose.delta,n.scaleX=1,n.scaleY=1,r.scaleX=0,r.scaleY=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._transformDirty=!0,2!==this._tweenState&&(this._tweenState=0),n.scaleX=e.scaleX+i.scaleX*this._tweenProgress,n.scaleY=e.scaleY+i.scaleY*this._tweenProgress},e})(t.BoneTimelineState);t.BoneScaleTimelineState=o;var c=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._current=[],e._delta=[],e._result=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.surface=null,this._frameFloatOffset=0,this._valueCount=0,this._deformCount=0,this._valueOffset=0,this._current.length=0,this._delta.length=0,this._result.length=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount,i=this._armature._armatureData.scale,n=this._frameFloatArray;if(2===this._tweenState){var r=e+this._valueCount;this._frameIndex===this._frameCount-1&&(r=this._animationData.frameFloatOffset+this._frameValueOffset);for(var a=0;a<this._valueCount;++a)this._delta[a]=n[r+a]*i-(this._current[a]=n[e+a]*i)}else for(a=0;a<this._valueCount;++a)this._current[a]=n[e+a]*i}else for(a=0;a<this._valueCount;++a)this._current[a]=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this.surface._transformDirty=!0,2!==this._tweenState&&(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,n){if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._deformCount=this._frameIntArray[r+1],this._valueCount=this._frameIntArray[r+2],this._valueOffset=this._frameIntArray[r+3],this._frameFloatOffset=this._frameIntArray[r+4]+this._animationData.frameFloatOffset}else this._deformCount=this.surface._deformVertices.length,this._valueCount=this._deformCount,this._valueOffset=0,this._frameFloatOffset=0;this._current.length=this._valueCount,this._delta.length=this._valueCount,this._result.length=this._valueCount;for(var a=0;a<this._valueCount;++a)this._delta[a]=0},e.prototype.blend=function(t){for(var e=this.surface._blendState.blendWeight,i=this.surface._deformVertices,n=0;n<this._deformCount;++n){var r;r=n<this._valueOffset?this._frameFloatArray[this._frameFloatOffset+n]:n<this._valueOffset+this._valueCount?this._result[n-this._valueOffset]:this._frameFloatArray[this._frameFloatOffset+n-this._valueCount],2===t?i[n]+=r*e:i[n]=1!==e?r*e:r}0===this._animationState._fadeState&&0===this._animationState._subFadeState||(this.surface._transformDirty=!0)},e})(t.TweenTimelineState);t.SurfaceTimelineState=c;var l=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"},e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=null!==this._timelineData?this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;this.slot.displayIndex!==t&&this.slot._setDisplayIndex(t,!0)}},e})(t.SlotTimelineState);t.SlotDislayTimelineState=l;var h=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return 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],e}return a(e,t),e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._dirty=!1},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._dragonBonesData.intArray,i=this._frameIntArray,n=this._animationData.frameIntOffset+this._frameValueOffset+1*this._frameIndex,r=i[n];r<0&&(r+=65536),this._current[0]=e[r++],this._current[1]=e[r++],this._current[2]=e[r++],this._current[3]=e[r++],this._current[4]=e[r++],this._current[5]=e[r++],this._current[6]=e[r++],this._current[7]=e[r++],2===this._tweenState&&((r=this._frameIndex===this._frameCount-1?i[this._animationData.frameIntOffset+this._frameValueOffset]:i[n+1])<0&&(r+=65536),this._delta[0]=e[r++]-this._current[0],this._delta[1]=e[r++]-this._current[1],this._delta[2]=e[r++]-this._current[2],this._delta[3]=e[r++]-this._current[3],this._delta[4]=e[r++]-this._current[4],this._delta[5]=e[r++]-this._current[5],this._delta[6]=e[r++]-this._current[6],this._delta[7]=e[r++]-this._current[7])}else{var a=this.slot._slotData.color;this._current[0]=100*a.alphaMultiplier,this._current[1]=100*a.redMultiplier,this._current[2]=100*a.greenMultiplier,this._current[3]=100*a.blueMultiplier,this._current[4]=a.alphaOffset,this._current[5]=a.redOffset,this._current[6]=a.greenOffset,this._current[7]=a.blueOffset}},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._dirty=!0,2!==this._tweenState&&(this._tweenState=0),this._result[0]=.01*(this._current[0]+this._delta[0]*this._tweenProgress),this._result[1]=.01*(this._current[1]+this._delta[1]*this._tweenProgress),this._result[2]=.01*(this._current[2]+this._delta[2]*this._tweenProgress),this._result[3]=.01*(this._current[3]+this._delta[3]*this._tweenProgress),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=!1},e.prototype.update=function(e){if(t.prototype.update.call(this,e),0!==this._tweenState||this._dirty){var i=this.slot._colorTransform;if(0!==this._animationState._fadeState||0!==this._animationState._subFadeState){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 n=Math.pow(this._animationState._fadeProgress,4);i.alphaMultiplier+=(this._result[0]-i.alphaMultiplier)*n,i.redMultiplier+=(this._result[1]-i.redMultiplier)*n,i.greenMultiplier+=(this._result[2]-i.greenMultiplier)*n,i.blueMultiplier+=(this._result[3]-i.blueMultiplier)*n,i.alphaOffset+=(this._result[4]-i.alphaOffset)*n,i.redOffset+=(this._result[5]-i.redOffset)*n,i.greenOffset+=(this._result[6]-i.greenOffset)*n,i.blueOffset+=(this._result[7]-i.blueOffset)*n,this.slot._colorDirty=!0}}else this._dirty&&(this._dirty=!1,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=!0))}},e})(t.SlotTimelineState);t.SlotColorTimelineState=h;var u=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._current=[],e._delta=[],e._result=[],e}return a(e,t),e.toString=function(){return"[class dragonBones.DeformTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.vertexOffset=0,this._dirty=!1,this._frameFloatOffset=0,this._valueCount=0,this._deformCount=0,this._valueOffset=0,this._current.length=0,this._delta.length=0,this._result.length=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount,i=this._armature._armatureData.scale,n=this._frameFloatArray;if(2===this._tweenState){var r=e+this._valueCount;this._frameIndex===this._frameCount-1&&(r=this._animationData.frameFloatOffset+this._frameValueOffset);for(var a=0;a<this._valueCount;++a)this._delta[a]=n[r+a]*i-(this._current[a]=n[e+a]*i)}else for(a=0;a<this._valueCount;++a)this._current[a]=n[e+a]*i}else for(a=0;a<this._valueCount;++a)this._current[a]=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._dirty=!0,2!==this._tweenState&&(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,n){if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this.vertexOffset=this._frameIntArray[r+0],this.vertexOffset<0&&(this.vertexOffset+=65536),this._deformCount=this._frameIntArray[r+1],this._valueCount=this._frameIntArray[r+2],this._valueOffset=this._frameIntArray[r+3],this._frameFloatOffset=this._frameIntArray[r+4]+this._animationData.frameFloatOffset}else{var a=this.slot._deformVertices;this._deformCount=null!==a?a.vertices.length:0,this._valueCount=this._deformCount,this._valueOffset=0,this._frameFloatOffset=0}this._current.length=this._valueCount,this._delta.length=this._valueCount,this._result.length=this._valueCount;for(var s=0;s<this._valueCount;++s)this._delta[s]=0},e.prototype.fadeOut=function(){this._tweenState=0,this._dirty=!1},e.prototype.update=function(e){var i=this.slot._deformVertices;if(null!==i&&null!==i.verticesData&&i.verticesData.offset===this.vertexOffset&&(t.prototype.update.call(this,e),0!==this._tweenState||this._dirty)){var n=i.vertices;if(0!==this._animationState._fadeState||0!==this._animationState._subFadeState){for(var r=Math.pow(this._animationState._fadeProgress,2),a=0;a<this._deformCount;++a)a<this._valueOffset?n[a]+=(this._frameFloatArray[this._frameFloatOffset+a]-n[a])*r:a<this._valueOffset+this._valueCount?n[a]+=(this._result[a-this._valueOffset]-n[a])*r:n[a]+=(this._frameFloatArray[this._frameFloatOffset+a-this._valueCount]-n[a])*r;i.verticesDirty=!0}else if(this._dirty){for(this._dirty=!1,a=0;a<this._deformCount;++a)a<this._valueOffset?n[a]=this._frameFloatArray[this._frameFloatOffset+a]:a<this._valueOffset+this._valueCount?n[a]=this._result[a-this._valueOffset]:n[a]=this._frameFloatArray[this._frameFloatOffset+a-this._valueCount];i.verticesDirty=!0}}},e})(t.SlotTimelineState);t.DeformTimelineState=u;var f=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),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(null!==this._timelineData){var i=this._animationData.frameIntOffset+this._frameValueOffset+2*this._frameIndex,n=this._frameIntArray,r=0!==n[i++];this._current=.01*n[i++],2===this._tweenState?(this._frameIndex===this._frameCount-1&&(i=this._animationData.frameIntOffset+this._frameValueOffset),this._delta=.01*n[i+1]-this._current):this._delta=0,e._bendPositive=r}else{var a=e._constraintData;this._current=a.weight,this._delta=0,e._bendPositive=a.bendPositive}e.invalidUpdate()},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),2!==this._tweenState&&(this._tweenState=0);var e=this.constraint;e._weight=this._current+this._delta*this._tweenProgress,e.invalidUpdate()},e})(t.ConstraintTimelineState);t.IKConstraintTimelineState=f;var _=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._floats=[0,0,0,0,0,0],e}return a(e,t),e.toString=function(){return"[class dragonBones.AnimationTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.animationState=null},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.frameIntOffset+this._frameValueOffset+2*this._frameIndex,i=1/this.animationState._animationData.parent.frameRate,n=this._frameIntArray;this._floats[0]=n[e++]*i,this._floats[3]=.01*n[e++],2===this._tweenState?(this._frameIndex===this._frameCount-1&&(e=this._animationData.frameIntOffset+this._frameValueOffset),this._floats[1]=n[e++]*i-this._floats[0],this._floats[4]=.01*n[e++]-this._floats[3]):(this._floats[1]=0,this._floats[4]=0)}},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),2!==this._tweenState&&(this._tweenState=0),this._floats[0]>=0&&(this._floats[2]=this._floats[0]+this._floats[1]*this._tweenProgress),this._floats[5]=this._floats[3]+this._floats[4]*this._tweenProgress},e.prototype.blend=function(t){var e=this.animationState,i=e._blendState.blendWeight;2===t?(e.weight+=this._floats[5]*i,e.currentTime+=this._floats[2]*i):(e.weight=this._floats[5]*i,e.currentTime=this._floats[2]*i)},e})(t.TweenTimelineState);t.AnimationTimelineState=_})(r||(r={})),(function(t){var e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.actionDataToInstance=function(t,i,n){0===t.type?i.type=e.FRAME_EVENT:i.type=10===t.type?e.FRAME_EVENT:e.SOUND_EVENT,i.name=t.name,i.armature=n,i.actionData=t,i.data=t.data,null!==t.bone&&(i.bone=n.getBone(t.bone.name)),null!==t.slot&&(i.slot=n.getSlot(t.slot.name))},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.actionData=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",e})(t.BaseObject);t.EventObject=e})(r||(r={})),(function(t){var e=(function(){function e(){}return e._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}},e._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":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;case"path":return 4;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._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}},e._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}},e._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}},e.parseDragonBonesData=function(e){return console.warn("Deprecated."),e instanceof ArrayBuffer?t.BinaryDataParser.getInstance().parseDragonBonesData(e):t.ObjectDataParser.getInstance().parseDragonBonesData(e)},e.parseTextureAtlasData=function(i,n){void 0===n&&(n=1),console.warn("\u5df2\u5e9f\u5f03");for(var r={},a=i[e.SUB_TEXTURE],s=0,o=a.length;s<o;s++){var c=a[s],l=c[e.NAME],h=new t.Rectangle,u=null;h.x=c[e.X]/n,h.y=c[e.Y]/n,h.width=c[e.WIDTH]/n,h.height=c[e.HEIGHT]/n,e.FRAME_WIDTH in c&&((u=new t.Rectangle).x=c[e.FRAME_X]/n,u.y=c[e.FRAME_Y]/n,u.width=c[e.FRAME_WIDTH]/n,u.height=c[e.FRAME_HEIGHT]/n),r[l]={region:h,frame:u,rotated:!1}}return r},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.SURFACE="surface",e.SLOT="slot",e.CONSTRAINT="constraint",e.IK="ik",e.PATH_CONSTRAINT="path",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_DEFORM="inheritDeform",e.SEGMENT_X="segmentX",e.SEGMENT_Y="segmentY",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.GLUE_WEIGHTS="glueWeights",e.GLUE_MESHES="glueMeshes",e.BONES="bones",e.POSITION_MODE="positionMode",e.SPACING_MODE="spacingMode",e.ROTATE_MODE="rotateMode",e.SPACING="spacing",e.ROTATE_OFFSET="rotateOffset",e.ROTATE_MIX="rotateMix",e.TRANSLATE_MIX="translateMix",e.TARGET_DISPLAY="targetDisplay",e.CLOSED="closed",e.CONSTANT_SPEED="constantSpeed",e.VERTEX_COUNT="vertexCount",e.LENGTHS="lengths",e.GOTO_AND_PLAY="gotoAndPlay",e.DEFAULT_NAME="default",e})();t.DataParser=e})(r||(r={})),(function(t){var e=(function(e){function n(){var i=null!==e&&e.apply(this,arguments)||this;return i._rawTextureAtlasIndex=0,i._rawBones=[],i._data=null,i._armature=null,i._bone=null,i._surface=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._cacheRawMeshes=[],i._cacheMeshes=[],i._actionFrames=[],i._weightSlotPose={},i._weightBonePoses={},i._cacheBones={},i._slotChildActions={},i}return a(n,e),n._getBoolean=function(t,e,i){if(e in t){var n=t[e],r=typeof n;if("boolean"===r)return n;if("string"!==r)return!!n;switch(n){case"0":case"NaN":case"":case"false":case"null":case"undefined":return!1;default:return!0}}return i},n._getNumber=function(t,e,i){if(e in t){var n=t[e];return null===n||"NaN"===n?i:+n||0}return i},n._getString=function(e,i,n){if(i in e){var r=e[i];if("string"==typeof r){if(t.DragonBones.webAssembly)for(var a=0,s=r.length;a<s;++a)if(r.charCodeAt(a)>255)return encodeURI(r);return r}return String(r)}return n},n.prototype._getCurvePoint=function(t,e,i,n,r,a,s,o,c,l){var h=1-c,u=h*h,f=c*c,_=h*u,d=3*c*u,p=3*h*f,m=c*f;l.x=_*t+d*i+p*r+m*s,l.y=_*e+d*n+p*a+m*o},n.prototype._samplingEasingCurve=function(t,e){for(var i=t.length,n=-2,r=0,a=e.length;r<a;++r){for(var s=(r+1)/(a+1);(n+6<i?t[n+6]:1)<s;)n+=6;for(var o=n>=0&&n+6<i,c=o?t[n]:0,l=o?t[n+1]:0,h=t[n+2],u=t[n+3],f=t[n+4],_=t[n+5],d=o?t[n+6]:1,p=o?t[n+7]:1,m=0,v=1;v-m>1e-4;){var g=.5*(v+m);this._getCurvePoint(c,l,h,u,f,_,d,p,g,this._helpPoint),s-this._helpPoint.x>0?m=g:v=g}e[r]=this._helpPoint.y}},n.prototype._parseActionDataInFrame=function(e,i,n,r){t.DataParser.EVENT in e&&this._mergeActionFrame(e[t.DataParser.EVENT],i,10,n,r),t.DataParser.SOUND in e&&this._mergeActionFrame(e[t.DataParser.SOUND],i,11,n,r),t.DataParser.ACTION in e&&this._mergeActionFrame(e[t.DataParser.ACTION],i,0,n,r),t.DataParser.EVENTS in e&&this._mergeActionFrame(e[t.DataParser.EVENTS],i,10,n,r),t.DataParser.ACTIONS in e&&this._mergeActionFrame(e[t.DataParser.ACTIONS],i,0,n,r)},n.prototype._mergeActionFrame=function(e,n,r,a,s){for(var o=t.DragonBones.webAssembly?this._armature.actions.size():this._armature.actions.length,c=this._parseActionData(e,r,a,s),l=0,h=null,u=0,f=c;u<f.length;u++){var _=f[u];this._armature.addAction(_,!1)}0===this._actionFrames.length&&((h=new i).frameStart=0,this._actionFrames.push(h),h=null);for(var d=0,p=this._actionFrames;d<p.length;d++){var m=p[d];if(m.frameStart===n){h=m;break}if(m.frameStart>n)break;l++}null===h&&((h=new i).frameStart=n,this._actionFrames.splice(l+1,0,h));for(var v=0;v<c.length;++v)h.actions.push(o+v)},n.prototype._parseArmature=function(e,i){var r=t.BaseObject.borrowObject(t.ArmatureData);if(r.name=n._getString(e,t.DataParser.NAME,""),r.frameRate=n._getNumber(e,t.DataParser.FRAME_RATE,this._data.frameRate),r.scale=i,t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?r.type=t.DataParser._getArmatureType(e[t.DataParser.TYPE]):r.type=n._getNumber(e,t.DataParser.TYPE,0),0===r.frameRate&&(r.frameRate=24),this._armature=r,t.DataParser.CANVAS in e){var a=e[t.DataParser.CANVAS],s=t.BaseObject.borrowObject(t.CanvasData);t.DataParser.COLOR in a?s.hasBackground=!0:s.hasBackground=!1,s.color=n._getNumber(a,t.DataParser.COLOR,0),s.x=n._getNumber(a,t.DataParser.X,0)*r.scale,s.y=n._getNumber(a,t.DataParser.Y,0)*r.scale,s.width=n._getNumber(a,t.DataParser.WIDTH,0)*r.scale,s.height=n._getNumber(a,t.DataParser.HEIGHT,0)*r.scale,r.canvas=s}if(t.DataParser.AABB in e){var o=e[t.DataParser.AABB];r.aabb.x=n._getNumber(o,t.DataParser.X,0)*r.scale,r.aabb.y=n._getNumber(o,t.DataParser.Y,0)*r.scale,r.aabb.width=n._getNumber(o,t.DataParser.WIDTH,0)*r.scale,r.aabb.height=n._getNumber(o,t.DataParser.HEIGHT,0)*r.scale}if(t.DataParser.BONE in e)for(var c=0,l=e[t.DataParser.BONE];c<l.length;c++){var h=l[c],u=n._getString(h,t.DataParser.PARENT,""),f=this._parseBone(h);if(u.length>0){var _=r.getBone(u);null!==_?f.parent=_:(u in this._cacheBones||(this._cacheBones[u]=[]),this._cacheBones[u].push(f))}if(f.name in this._cacheBones){for(var d=0,p=this._cacheBones[f.name];d<p.length;d++)p[d].parent=f;delete this._cacheBones[f.name]}r.addBone(f),this._rawBones.push(f)}if(t.DataParser.IK in e)for(var m=0,v=e[t.DataParser.IK];m<v.length;m++){var g=v[m];(D=this._parseIKConstraint(g))&&r.addConstraint(D)}if(r.sortBones(),t.DataParser.SLOT in e)for(var y=0,T=0,A=e[t.DataParser.SLOT];T<A.length;T++){var b=A[T];r.addSlot(this._parseSlot(b,y++))}if(t.DataParser.SKIN in e)for(var E=0,C=e[t.DataParser.SKIN];E<C.length;E++){var x=C[E];r.addSkin(this._parseSkin(x))}if(t.DataParser.PATH_CONSTRAINT in e)for(var S=0,w=e[t.DataParser.PATH_CONSTRAINT];S<w.length;S++){var D,M=w[S];(D=this._parsePathConstraint(M))&&r.addConstraint(D)}for(var R=0,I=this._cacheRawMeshes.length;R<I;++R){var O=this._cacheRawMeshes[R];t.DataParser.GLUE_WEIGHTS in O&&t.DataParser.GLUE_MESHES in O&&this._parseMeshGlue(O,this._cacheMeshes[R])}for(R=0,I=this._cacheRawMeshes.length;R<I;++R){var P=this._cacheRawMeshes[R],N=n._getString(P,t.DataParser.SHARE,"");if(0!==N.length){var F=n._getString(P,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME);0===F.length&&(F=t.DataParser.DEFAULT_NAME);var L=r.getMesh(F,"",N);null!==L&&this._cacheMeshes[R].vertices.shareFrom(L.vertices)}}if(t.DataParser.ANIMATION in e)for(var B=0,k=e[t.DataParser.ANIMATION];B<k.length;B++){var V=k[B],U=this._parseAnimation(V);r.addAnimation(U)}if(t.DataParser.DEFAULT_ACTIONS in e)for(var z=0,G=this._parseActionData(e[t.DataParser.DEFAULT_ACTIONS],0,null,null);z<G.length;z++){var H=G[z];r.addAction(H,!0),0===H.type&&null!==(U=r.getAnimation(H.name))&&(r.defaultAnimation=U)}if(t.DataParser.ACTIONS in e)for(var W=0,j=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);W<j.length;W++)H=j[W],r.addAction(H,!1);for(var Y in this._rawBones.length=0,this._cacheRawMeshes.length=0,this._cacheMeshes.length=0,this._armature=null,this._weightSlotPose)delete this._weightSlotPose[Y];for(var Y in this._weightBonePoses)delete this._weightBonePoses[Y];for(var Y in this._cacheBones)delete this._cacheBones[Y];for(var Y in this._slotChildActions)delete this._slotChildActions[Y];return r},n.prototype._parseBone=function(e){var i=this._armature.scale;if(0===(t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?t.DataParser._getBoneType(e[t.DataParser.TYPE]):n._getNumber(e,t.DataParser.TYPE,0))){var r=t.BaseObject.borrowObject(t.BoneData);return r.inheritTranslation=n._getBoolean(e,t.DataParser.INHERIT_TRANSLATION,!0),r.inheritRotation=n._getBoolean(e,t.DataParser.INHERIT_ROTATION,!0),r.inheritScale=n._getBoolean(e,t.DataParser.INHERIT_SCALE,!0),r.inheritReflection=n._getBoolean(e,t.DataParser.INHERIT_REFLECTION,!0),r.length=n._getNumber(e,t.DataParser.LENGTH,0)*i,r.name=n._getString(e,t.DataParser.NAME,""),t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],r.transform,i),r}var a=t.BaseObject.borrowObject(t.SurfaceData);if(a.name=n._getString(e,t.DataParser.NAME,""),a.segmentX=n._getNumber(e,t.DataParser.SEGMENT_X,0),a.segmentY=n._getNumber(e,t.DataParser.SEGMENT_Y,0),a.vertices.length=(a.segmentX+1)*(a.segmentY+1)*2,t.DataParser.VERTICES in e)for(var s=e[t.DataParser.VERTICES],o=0,c=a.vertices.length;o<c;++o)o<s.length?a.vertices[o]=s[o]*i:a.vertices[o]=0;return a},n.prototype._parseIKConstraint=function(e){var i=this._armature.getBone(n._getString(e,t.DataParser.BONE,""));if(null===i)return null;var r=this._armature.getBone(n._getString(e,t.DataParser.TARGET,""));if(null===r)return null;var a=t.BaseObject.borrowObject(t.IKConstraintData);return a.scaleEnabled=n._getBoolean(e,t.DataParser.SCALE,!1),a.bendPositive=n._getBoolean(e,t.DataParser.BEND_POSITIVE,!0),a.weight=n._getNumber(e,t.DataParser.WEIGHT,1),a.name=n._getString(e,t.DataParser.NAME,""),a.type=0,a.target=r,n._getNumber(e,t.DataParser.CHAIN,0)>0&&null!==i.parent?(a.root=i.parent,a.bone=i):(a.root=i,a.bone=null),a},n.prototype._parsePathConstraint=function(e){var i=this._armature.getSlot(n._getString(e,t.DataParser.TARGET,""));if(null===i)return null;var r=this._armature.defaultSkin;if(null===r)return null;var a=r.getDisplay(i.name,n._getString(e,t.DataParser.TARGET_DISPLAY,i.name));if(null===a||!(a instanceof t.PathDisplayData))return null;var s=e[t.DataParser.BONES];if(null===s||0===s.length)return null;var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=n._getString(e,t.DataParser.NAME,""),o.type=1,o.pathSlot=i,o.pathDisplayData=a,o.target=i.parent,o.positionMode=t.DataParser._getPositionMode(n._getString(e,t.DataParser.POSITION_MODE,"")),o.spacingMode=t.DataParser._getSpacingMode(n._getString(e,t.DataParser.SPACING_MODE,"")),o.rotateMode=t.DataParser._getRotateMode(n._getString(e,t.DataParser.ROTATE_MODE,"")),o.position=n._getNumber(e,t.DataParser.POSITION,0),o.spacing=n._getNumber(e,t.DataParser.SPACING,0),o.rotateOffset=n._getNumber(e,t.DataParser.ROTATE_OFFSET,0),o.rotateMix=n._getNumber(e,t.DataParser.ROTATE_MIX,1),o.translateMix=n._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var c=0,l=s;c<l.length;c++){var h=l[c],u=this._armature.getBone(h);null!==u&&(o.AddBone(u),null===o.root&&(o.root=u))}return o},n.prototype._parseSlot=function(e,i){var r=t.BaseObject.borrowObject(t.SlotData);return r.displayIndex=n._getNumber(e,t.DataParser.DISPLAY_INDEX,0),r.zOrder=i,r.name=n._getString(e,t.DataParser.NAME,""),r.parent=this._armature.getBone(n._getString(e,t.DataParser.PARENT,"")),t.DataParser.BLEND_MODE in e&&"string"==typeof e[t.DataParser.BLEND_MODE]?r.blendMode=t.DataParser._getBlendMode(e[t.DataParser.BLEND_MODE]):r.blendMode=n._getNumber(e,t.DataParser.BLEND_MODE,0),t.DataParser.COLOR in e?(r.color=t.SlotData.createColor(),this._parseColorTransform(e[t.DataParser.COLOR],r.color)):r.color=t.SlotData.DEFAULT_COLOR,t.DataParser.ACTIONS in e&&(this._slotChildActions[r.name]=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null)),r},n.prototype._parseSkin=function(e){var i=t.BaseObject.borrowObject(t.SkinData);if(i.name=n._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME),t.DataParser.SLOT in e){var r=e[t.DataParser.SLOT];this._skin=i;for(var a=0,s=r;a<s.length;a++){var o=s[a],c=n._getString(o,t.DataParser.NAME,""),l=this._armature.getSlot(c);if(null!==l){if(this._slot=l,t.DataParser.DISPLAY in o)for(var h=0,u=o[t.DataParser.DISPLAY];h<u.length;h++){var f=u[h];f?i.addDisplay(c,this._parseDisplay(f)):i.addDisplay(c,null)}this._slot=null}}this._skin=null}return i},n.prototype._parseDisplay=function(e){var i=n._getString(e,t.DataParser.NAME,""),r=n._getString(e,t.DataParser.PATH,""),a=0,s=null;switch(a=t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?t.DataParser._getDisplayType(e[t.DataParser.TYPE]):n._getNumber(e,t.DataParser.TYPE,a)){case 0:var o=s=t.BaseObject.borrowObject(t.ImageDisplayData);o.name=i,o.path=r.length>0?r:i,this._parsePivot(e,o);break;case 1:var c=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);if(c.name=i,c.path=r.length>0?r:i,c.inheritAnimation=!0,t.DataParser.ACTIONS in e)for(var l=0,h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);l<h.length;l++){var u=h[l];c.addAction(u)}else if(this._slot.name in this._slotChildActions){var f=this._skin.getDisplays(this._slot.name);if(null===f?0===this._slot.displayIndex:this._slot.displayIndex===f.length){for(var _=0,d=this._slotChildActions[this._slot.name];_<d.length;_++)u=d[_],c.addAction(u);delete this._slotChildActions[this._slot.name]}}break;case 2:var p=s=t.BaseObject.borrowObject(t.MeshDisplayData);p.vertices.inheritDeform=n._getBoolean(e,t.DataParser.INHERIT_DEFORM,!0),p.name=i,p.path=r.length>0?r:i,p.vertices.data=this._data,t.DataParser.SHARE in e?(this._cacheRawMeshes.push(e),this._cacheMeshes.push(p)):this._parseMesh(e,p),t.DataParser.GLUE_WEIGHTS in e&&t.DataParser.GLUE_MESHES in e&&(this._cacheRawMeshes.push(e),this._cacheMeshes.push(p));break;case 3:var m=this._parseBoundingBox(e);if(null!==m){var v=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);v.name=i,v.path=r.length>0?r:i,v.boundingBox=m}break;case 4:var g=e[t.DataParser.LENGTHS],y=s=t.BaseObject.borrowObject(t.PathDisplayData);y.closed=n._getBoolean(e,t.DataParser.CLOSED,!1),y.constantSpeed=n._getBoolean(e,t.DataParser.CONSTANT_SPEED,!1),y.name=i,y.path=r.length>0?r:i,y.vertices.data=this._data,y.curveLengths.length=g.length;for(var T=0,A=g.length;T<A;++T)y.curveLengths[T]=g[T];this._parsePath(e,y)}return null!==s&&t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],s.transform,this._armature.scale),s},n.prototype._parsePath=function(e,i){var r=e[t.DataParser.VERTICES],a=n._getNumber(e,t.DataParser.VERTEX_COUNT,0),s=this._floatArray.length,o=this._intArray.length;if(i.vertices.offset=o,this._intArray.length+=2,this._intArray[o+0]=a,this._intArray[o+2]=s,t.DataParser.WEIGHTS in e){var c=e[t.DataParser.WEIGHTS],l=e[t.DataParser.BONES],h=l.length,u=Math.floor(c.length-a)/2,f=this._intArray.length,_=this._floatArray.length,d=this._armature.sortedBones,p=t.BaseObject.borrowObject(t.WeightData);for(p.count=u,p.offset=f,this._intArray.length+=2+h+a+u,this._intArray[f+0]=h,this._intArray[f+1]=_,D=0;D<h;D++){var m=l[D],v=this._rawBones[m];p.addBone(v),this._intArray[f+2+D]=d.indexOf(v)}this._floatArray.length+=3*u,D=0;for(var g=0,y=0,T=f+2+h,A=_;D<u;D++){var b=c[g++];this._intArray[T++]=b;for(var E=0;E<b;E++){var C=c[g++],x=c[g++],S=r[y++],w=r[y++];this._intArray[T++]=l.indexOf(C),this._floatArray[A++]=x,this._floatArray[A++]=S,this._floatArray[A++]=w}}i.vertices.weight=p}else{this._floatArray.length+=r.length;for(var D=0,M=r.length;D<M;++D)this._floatArray[s+D]=r[D]}},n.prototype._parsePivot=function(e,i){if(t.DataParser.PIVOT in e){var r=e[t.DataParser.PIVOT];i.pivot.x=n._getNumber(r,t.DataParser.X,0),i.pivot.y=n._getNumber(r,t.DataParser.Y,0)}else i.pivot.x=.5,i.pivot.y=.5},n.prototype._parseMesh=function(e,i){var n=e[t.DataParser.VERTICES],r=e[t.DataParser.UVS],a=e[t.DataParser.TRIANGLES],s=Math.floor(n.length/2),o=Math.floor(a.length/3),c=this._floatArray.length,l=c+2*s,h=this._intArray.length,u=this._skin.name+"_"+this._slot.name+"_"+i.name;i.vertices.offset=h,this._intArray.length+=4+3*o,this._intArray[h+0]=s,this._intArray[h+1]=o,this._intArray[h+2]=c;for(var f=0,_=3*o;f<_;++f)this._intArray[h+4+f]=a[f];for(this._floatArray.length+=2*s+2*s,f=0,_=2*s;f<_;++f)this._floatArray[c+f]=n[f],this._floatArray[l+f]=r[f];if(t.DataParser.WEIGHTS in e){var d=e[t.DataParser.WEIGHTS],p=e[t.DataParser.SLOT_POSE],m=e[t.DataParser.BONE_POSE],v=this._armature.sortedBones,g=new Array,y=Math.floor(m.length/7),T=this._floatArray.length,A=Math.floor(d.length-s)/2,b=this._intArray.length,E=t.BaseObject.borrowObject(t.WeightData);for(E.count=A,E.offset=b,g.length=y,this._intArray.length+=2+y+s+A,this._intArray[b+1]=T,f=0;f<y;++f){var C=m[7*f],x=this._rawBones[C];E.addBone(x),g[f]=C,this._intArray[b+2+f]=v.indexOf(x)}this._floatArray.length+=3*A,this._helpMatrixA.copyFromArray(p,0),f=0;for(var S=0,w=b+2+y,D=T;f<s;++f){var M=2*f,R=this._intArray[w++]=d[S++],I=this._floatArray[c+M],O=this._floatArray[c+M+1];this._helpMatrixA.transformPoint(I,O,this._helpPoint),I=this._helpPoint.x,O=this._helpPoint.y;for(var P=0;P<R;++P){C=d[S++];var N=g.indexOf(C);this._helpMatrixB.copyFromArray(m,7*N+1),this._helpMatrixB.invert(),this._helpMatrixB.transformPoint(I,O,this._helpPoint),this._intArray[w++]=N,this._floatArray[D++]=d[S++],this._floatArray[D++]=this._helpPoint.x,this._floatArray[D++]=this._helpPoint.y}}i.vertices.weight=E,this._weightSlotPose[u]=p,this._weightBonePoses[u]=m}},n.prototype._parseMeshGlue=function(){},n.prototype._parseBoundingBox=function(e){var i=null,r=0;switch(r=t.DataParser.SUB_TYPE in e&&"string"==typeof e[t.DataParser.SUB_TYPE]?t.DataParser._getBoundingBoxType(e[t.DataParser.SUB_TYPE]):n._getNumber(e,t.DataParser.SUB_TYPE,r)){case 0:i=t.BaseObject.borrowObject(t.RectangleBoundingBoxData);break;case 1:i=t.BaseObject.borrowObject(t.EllipseBoundingBoxData);break;case 2:i=this._parsePolygonBoundingBox(e)}return null!==i&&(i.color=n._getNumber(e,t.DataParser.COLOR,0),0!==i.type&&1!==i.type||(i.width=n._getNumber(e,t.DataParser.WIDTH,0),i.height=n._getNumber(e,t.DataParser.HEIGHT,0))),i},n.prototype._parsePolygonBoundingBox=function(e){var i=t.BaseObject.borrowObject(t.PolygonBoundingBoxData);if(t.DataParser.VERTICES in e){var n=this._armature.scale,r=e[t.DataParser.VERTICES],a=i.vertices;t.DragonBones.webAssembly?a.resize(r.length,0):a.length=r.length;for(var s=0,o=r.length;s<o;s+=2){var c=r[s]*n,l=r[s+1]*n;t.DragonBones.webAssembly?(a.set(s,c),a.set(s+1,l)):(a[s]=c,a[s+1]=l),0===s?(i.x=c,i.y=l,i.width=c,i.height=l):(c<i.x?i.x=c:c>i.width&&(i.width=c),l<i.y?i.y=l:l>i.height&&(i.height=l))}i.width-=i.x,i.height-=i.y}else console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.");return i},n.prototype._parseAnimation=function(e){var i=t.BaseObject.borrowObject(t.AnimationData);if(i.frameCount=Math.max(n._getNumber(e,t.DataParser.DURATION,1),1),i.playTimes=n._getNumber(e,t.DataParser.PLAY_TIMES,1),i.duration=i.frameCount/this._armature.frameRate,i.fadeInTime=n._getNumber(e,t.DataParser.FADE_IN_TIME,0),i.scale=n._getNumber(e,t.DataParser.SCALE,1),i.name=n._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME),i.frameIntOffset=this._frameIntArray.length,i.frameFloatOffset=this._frameFloatArray.length,i.frameOffset=this._frameArray.length,this._animation=i,t.DataParser.FRAME in e){var r=e[t.DataParser.FRAME],a=r.length;if(a>0)for(var s=0,o=0;s<a;++s){var c=r[s];this._parseActionDataInFrame(c,o,null,null),o+=n._getNumber(c,t.DataParser.DURATION,1)}}if(t.DataParser.Z_ORDER in e&&(this._animation.zOrderTimeline=this._parseTimeline(e[t.DataParser.Z_ORDER],null,t.DataParser.FRAME,1,!1,!1,0,this._parseZOrderFrame)),t.DataParser.BONE in e)for(var l=0,h=e[t.DataParser.BONE];l<h.length;l++){var u=h[l];this._parseBoneTimeline(u)}if(t.DataParser.SURFACE in e)for(var f=0,_=e[t.DataParser.SURFACE];f<_.length;f++){u=_[f];var d=n._getString(u,t.DataParser.NAME,"");this._surface=this._armature.getBone(d),null!==this._surface&&(null!==(D=this._parseTimeline(u,null,t.DataParser.FRAME,50,!1,!0,0,this._parseSurfaceFrame))&&this._animation.addSurfaceTimeline(this._surface,D),this._surface=null)}if(t.DataParser.SLOT in e){for(var p=0,m=e[t.DataParser.SLOT];p<m.length;p++)u=m[p],this._parseSlotTimeline(u);this._actionFrames.sort((function(t,e){return t.frameStart-e.frameStart}))}if(t.DataParser.FFD in e)for(var v=0,g=e[t.DataParser.FFD];v<g.length;v++){u=g[v];var y=n._getString(u,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME),T=n._getString(u,t.DataParser.SLOT,""),A=n._getString(u,t.DataParser.NAME,"");0===y.length&&(y=t.DataParser.DEFAULT_NAME),this._slot=this._armature.getSlot(T),this._mesh=this._armature.getMesh(y,T,A),null!==this._slot&&null!==this._mesh&&(null!==(D=this._parseTimeline(u,null,t.DataParser.FRAME,22,!1,!0,0,this._parseSlotFFDFrame))&&this._animation.addSlotTimeline(this._slot,D),this._slot=null,this._mesh=null)}if(t.DataParser.IK in e)for(var b=0,E=e[t.DataParser.IK];b<E.length;b++){u=E[b];var C=n._getString(u,t.DataParser.NAME,""),x=this._armature.getConstraint(C);null!==x&&null!==(D=this._parseTimeline(u,null,t.DataParser.FRAME,30,!0,!1,2,this._parseIKConstraintFrame))&&this._animation.addConstraintTimeline(x,D)}if(t.DataParser.ANIMATION in e)for(var S=0,w=e[t.DataParser.ANIMATION];S<w.length;S++){u=w[S];var D,M=n._getString(u,t.DataParser.NAME,"");null!==(D=this._parseTimeline(u,null,t.DataParser.FRAME,40,!0,!1,2,this._parseAnimationFrame))&&this._animation.addAnimationTimeline(M,D)}return this._actionFrames.length>0&&(this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,!1,!1,0,this._parseActionFrame),this._actionFrames.length=0),this._animation=null,i},n.prototype._parseTimeline=function(e,r,a,s,o,c,l,h){if(null!==e&&a.length>0&&a in e&&(r=e[a]),null===r)return null;var u=r.length;if(0===u)return null;var f=this._frameIntArray.length,_=this._frameFloatArray.length,d=t.BaseObject.borrowObject(t.TimelineData),p=this._timelineArray.length;if(this._timelineArray.length+=5+u,null!==e?(this._timelineArray[p+0]=Math.round(100*n._getNumber(e,t.DataParser.SCALE,1)),this._timelineArray[p+1]=Math.round(100*n._getNumber(e,t.DataParser.OFFSET,0))):(this._timelineArray[p+0]=100,this._timelineArray[p+1]=0),this._timelineArray[p+2]=u,this._timelineArray[p+3]=l,this._timelineArray[p+4]=o?f-this._animation.frameIntOffset:c?_-this._animation.frameFloatOffset:0,this._timeline=d,d.type=s,d.offset=p,1===u)d.frameIndicesOffset=-1,this._timelineArray[p+5+0]=h.call(this,r[0],0,0)-this._animation.frameOffset;else{var m=this._animation.frameCount+1,v=this._data.frameIndices,g=0;t.DragonBones.webAssembly?(g=v.size(),v.resize(g+m,0)):(g=v.length,v.length+=m),d.frameIndicesOffset=g;for(var y=0,T=0,A=0,b=0;y<m;++y){if(A+b<=y&&T<u){var E=r[T];A=y,b=T===u-1?this._animation.frameCount-A:E instanceof i?this._actionFrames[T+1].frameStart-A:n._getNumber(E,t.DataParser.DURATION,1),this._timelineArray[p+5+T]=h.call(this,E,A,b)-this._animation.frameOffset,T++}t.DragonBones.webAssembly?v.set(g+y,T-1):v[g+y]=T-1}}return this._timeline=null,d},n.prototype._parseBoneTimeline=function(e){var i,r=this._armature.getBone(n._getString(e,t.DataParser.NAME,""));null!==r&&(this._bone=r,this._slot=this._armature.getSlot(this._bone.name),t.DataParser.TRANSLATE_FRAME in e&&null!==(i=this._parseTimeline(e,null,t.DataParser.TRANSLATE_FRAME,11,!1,!0,2,this._parseBoneTranslateFrame))&&this._animation.addBoneTimeline(r,i),t.DataParser.ROTATE_FRAME in e&&null!==(i=this._parseTimeline(e,null,t.DataParser.ROTATE_FRAME,12,!1,!0,2,this._parseBoneRotateFrame))&&this._animation.addBoneTimeline(r,i),t.DataParser.SCALE_FRAME in e&&null!==(i=this._parseTimeline(e,null,t.DataParser.SCALE_FRAME,13,!1,!0,2,this._parseBoneScaleFrame))&&this._animation.addBoneTimeline(r,i),t.DataParser.FRAME in e&&null!==(i=this._parseTimeline(e,null,t.DataParser.FRAME,10,!1,!0,6,this._parseBoneAllFrame))&&this._animation.addBoneTimeline(r,i),this._bone=null,this._slot=null)},n.prototype._parseSlotTimeline=function(e){var i=this._armature.getSlot(n._getString(e,t.DataParser.NAME,""));if(null!==i){this._slot=i;var r;null!==(r=t.DataParser.DISPLAY_FRAME in e?this._parseTimeline(e,null,t.DataParser.DISPLAY_FRAME,20,!1,!1,0,this._parseSlotDisplayFrame):this._parseTimeline(e,null,t.DataParser.FRAME,20,!1,!1,0,this._parseSlotDisplayFrame))&&this._animation.addSlotTimeline(i,r);var a;null!==(a=t.DataParser.COLOR_FRAME in e?this._parseTimeline(e,null,t.DataParser.COLOR_FRAME,21,!0,!1,1,this._parseSlotColorFrame):this._parseTimeline(e,null,t.DataParser.FRAME,21,!0,!1,1,this._parseSlotColorFrame))&&this._animation.addSlotTimeline(i,a),this._slot=null}},n.prototype._parseFrame=function(t,e){var i=this._frameArray.length;return this._frameArray.length+=1,this._frameArray[i+0]=e,i},n.prototype._parseTweenFrame=function(e,i,r){var a=this._parseFrame(e,i,r);if(r>0)if(t.DataParser.CURVE in e){var s=r+1;this._helpArray.length=s,this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray),this._frameArray.length+=2+this._helpArray.length,this._frameArray[a+1]=2,this._frameArray[a+2]=s;for(var o=0;o<s;++o)this._frameArray[a+3+o]=Math.round(1e4*this._helpArray[o])}else{var c=-2;t.DataParser.TWEEN_EASING in e&&(c=n._getNumber(e,t.DataParser.TWEEN_EASING,-2)),-2===c?(this._frameArray.length+=1,this._frameArray[a+1]=0):0===c?(this._frameArray.length+=1,this._frameArray[a+1]=1):c<0?(this._frameArray.length+=2,this._frameArray[a+1]=3,this._frameArray[a+2]=Math.round(100*-c)):c<=1?(this._frameArray.length+=2,this._frameArray[a+1]=4,this._frameArray[a+2]=Math.round(100*c)):(this._frameArray.length+=2,this._frameArray[a+1]=5,this._frameArray[a+2]=Math.round(100*c-100))}else this._frameArray.length+=1,this._frameArray[a+1]=0;return a},n.prototype._parseActionFrame=function(t,e){var i=this._frameArray.length,n=t.actions.length;this._frameArray.length+=2+n,this._frameArray[i+0]=e,this._frameArray[i+0+1]=n;for(var r=0;r<n;++r)this._frameArray[i+0+2+r]=t.actions[r];return i},n.prototype._parseZOrderFrame=function(e,i,n){var r=this._parseFrame(e,i,n);if(t.DataParser.Z_ORDER in e){var a=e[t.DataParser.Z_ORDER];if(a.length>0){for(var s=this._armature.sortedSlots.length,o=new Array(s-a.length/2),c=new Array(s),l=0;l<o.length;++l)o[l]=0;for(var h=0;h<s;++h)c[h]=-1;for(var u=0,f=0,_=0,d=a.length;_<d;_+=2){for(var p=a[_],m=a[_+1];u!==p;)o[f++]=u++;c[u+m]=u++}for(;u<s;)o[f++]=u++;this._frameArray.length+=1+s,this._frameArray[r+1]=s;for(var v=s;v--;)-1===c[v]?this._frameArray[r+2+v]=o[--f]||0:this._frameArray[r+2+v]=c[v]||0;return r}}return this._frameArray.length+=1,this._frameArray[r+1]=0,r},n.prototype._parseBoneAllFrame=function(e,i,r){this._helpTransform.identity(),t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],this._helpTransform,1);var a=this._helpTransform.rotation;0!==i&&(0===this._prevClockwise?a=this._prevRotation+t.Transform.normalizeRadian(a-this._prevRotation):((this._prevClockwise>0?a>=this._prevRotation:a<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),a=this._prevRotation+a-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._getNumber(e,t.DataParser.TWEEN_ROTATE,0),this._prevRotation=a;var s=this._parseTweenFrame(e,i,r),o=this._frameFloatArray.length;return this._frameFloatArray.length+=6,this._frameFloatArray[o++]=this._helpTransform.x,this._frameFloatArray[o++]=this._helpTransform.y,this._frameFloatArray[o++]=a,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),s},n.prototype._parseBoneTranslateFrame=function(e,i,r){var a=this._parseTweenFrame(e,i,r),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.X,0),this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.Y,0),a},n.prototype._parseBoneRotateFrame=function(e,i,r){var a=n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;0!==i&&(0===this._prevClockwise?a=this._prevRotation+t.Transform.normalizeRadian(a-this._prevRotation):((this._prevClockwise>0?a>=this._prevRotation:a<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),a=this._prevRotation+a-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._getNumber(e,t.DataParser.CLOCK_WISE,0),this._prevRotation=a;var s=this._parseTweenFrame(e,i,r),o=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[o++]=a,this._frameFloatArray[o++]=n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD,s},n.prototype._parseBoneScaleFrame=function(e,i,r){var a=this._parseTweenFrame(e,i,r),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.X,1),this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.Y,1),a},n.prototype._parseSurfaceFrame=function(e,i,r){var a=this._frameFloatArray.length,s=this._parseTweenFrame(e,i,r),o=e[t.DataParser.VERTICES],c=n._getNumber(e,t.DataParser.OFFSET,0),l=this._surface.vertices.length/2,h=0,u=0;this._frameFloatArray.length+=2*l;for(var f=0;f<2*l;f+=2)h=f<c||f-c>=o.length?0:o[f-c],u=f+1<c||f+1-c>=o.length?0:o[f+1-c],this._frameFloatArray[a+f]=h,this._frameFloatArray[a+f+1]=u;if(0===i){var _=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[_+0]=0,this._frameIntArray[_+1]=this._frameFloatArray.length-a,this._frameIntArray[_+2]=this._frameFloatArray.length-a,this._frameIntArray[_+3]=0,this._frameIntArray[_+4]=a-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return s},n.prototype._parseSlotDisplayFrame=function(e,i,r){var a=this._parseFrame(e,i,r);return this._frameArray.length+=1,t.DataParser.VALUE in e?this._frameArray[a+1]=n._getNumber(e,t.DataParser.VALUE,0):this._frameArray[a+1]=n._getNumber(e,t.DataParser.DISPLAY_INDEX,0),this._parseActionDataInFrame(e,i,this._slot.parent,this._slot),a},n.prototype._parseSlotColorFrame=function(e,i,n){var r=this._parseTweenFrame(e,i,n),a=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){this._parseColorTransform(s,this._helpColorTransform),a=this._intArray.length,this._intArray.length+=8,this._intArray[a++]=Math.round(100*this._helpColorTransform.alphaMultiplier),this._intArray[a++]=Math.round(100*this._helpColorTransform.redMultiplier),this._intArray[a++]=Math.round(100*this._helpColorTransform.greenMultiplier),this._intArray[a++]=Math.round(100*this._helpColorTransform.blueMultiplier),this._intArray[a++]=Math.round(this._helpColorTransform.alphaOffset),this._intArray[a++]=Math.round(this._helpColorTransform.redOffset),this._intArray[a++]=Math.round(this._helpColorTransform.greenOffset),this._intArray[a++]=Math.round(this._helpColorTransform.blueOffset),a-=8;break}}a<0&&(this._defaultColorOffset<0&&(this._defaultColorOffset=a=this._intArray.length,this._intArray.length+=8,this._intArray[a++]=100,this._intArray[a++]=100,this._intArray[a++]=100,this._intArray[a++]=100,this._intArray[a++]=0,this._intArray[a++]=0,this._intArray[a++]=0,this._intArray[a++]=0),a=this._defaultColorOffset);var c=this._frameIntArray.length;return this._frameIntArray.length+=1,this._frameIntArray[c]=a,r},n.prototype._parseSlotFFDFrame=function(e,i,r){var a=this._frameFloatArray.length,s=this._parseTweenFrame(e,i,r),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null,c=n._getNumber(e,t.DataParser.OFFSET,0),l=this._intArray[this._mesh.vertices.offset+0],h=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name,u=this._mesh.vertices.weight,f=0,_=0,d=0,p=0;if(null!==u){var m=this._weightSlotPose[h];this._helpMatrixA.copyFromArray(m,0),this._frameFloatArray.length+=2*u.count,d=u.offset+2+u.bones.length}else this._frameFloatArray.length+=2*l;for(var v=0;v<2*l;v+=2)if(null===o?(f=0,_=0):(f=v<c||v-c>=o.length?0:o[v-c],_=v+1<c||v+1-c>=o.length?0:o[v+1-c]),null!==u){var g=this._weightBonePoses[h],y=this._intArray[d++];this._helpMatrixA.transformPoint(f,_,this._helpPoint,!0),f=this._helpPoint.x,_=this._helpPoint.y;for(var T=0;T<y;++T){var A=this._intArray[d++];this._helpMatrixB.copyFromArray(g,7*A+1),this._helpMatrixB.invert(),this._helpMatrixB.transformPoint(f,_,this._helpPoint,!0),this._frameFloatArray[a+p++]=this._helpPoint.x,this._frameFloatArray[a+p++]=this._helpPoint.y}}else this._frameFloatArray[a+v]=f,this._frameFloatArray[a+v+1]=_;if(0===i){var b=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[b+0]=this._mesh.vertices.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._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=b-this._animation.frameIntOffset}return s},n.prototype._parseIKConstraintFrame=function(e,i,r){var a=this._parseTweenFrame(e,i,r),s=this._frameIntArray.length;return this._frameIntArray.length+=2,this._frameIntArray[s++]=n._getBoolean(e,t.DataParser.BEND_POSITIVE,!0)?1:0,this._frameIntArray[s++]=Math.round(100*n._getNumber(e,t.DataParser.WEIGHT,1)),a},n.prototype._parseAnimationFrame=function(e,i,r){var a=this._parseTweenFrame(e,i,r),s=this._frameIntArray.length;return this._frameIntArray.length+=2,this._frameIntArray[s++]=n._getNumber(e,t.DataParser.VALUE,0),this._frameIntArray[s++]=Math.round(100*n._getNumber(e,t.DataParser.WEIGHT,1)),a},n.prototype._parseActionData=function(e,i,r,a){var s=new Array;if("string"==typeof e)(h=t.BaseObject.borrowObject(t.ActionData)).type=i,h.name=e,h.bone=r,h.slot=a,s.push(h);else if(e instanceof Array)for(var o=0,c=e;o<c.length;o++){var l=c[o],h=t.BaseObject.borrowObject(t.ActionData);if(t.DataParser.GOTO_AND_PLAY in l?(h.type=0,h.name=n._getString(l,t.DataParser.GOTO_AND_PLAY,"")):(t.DataParser.TYPE in l&&"string"==typeof l[t.DataParser.TYPE]?h.type=t.DataParser._getActionType(l[t.DataParser.TYPE]):h.type=n._getNumber(l,t.DataParser.TYPE,i),h.name=n._getString(l,t.DataParser.NAME,"")),t.DataParser.BONE in l){var u=n._getString(l,t.DataParser.BONE,"");h.bone=this._armature.getBone(u)}else h.bone=r;if(t.DataParser.SLOT in l){var f=n._getString(l,t.DataParser.SLOT,"");h.slot=this._armature.getSlot(f)}else h.slot=a;var _=null;if(t.DataParser.INTS in l){null===_&&(_=t.BaseObject.borrowObject(t.UserData));for(var d=0,p=l[t.DataParser.INTS];d<p.length;d++){var m=p[d];_.addInt(m)}}if(t.DataParser.FLOATS in l){null===_&&(_=t.BaseObject.borrowObject(t.UserData));for(var v=0,g=l[t.DataParser.FLOATS];v<g.length;v++)m=g[v],_.addFloat(m)}if(t.DataParser.STRINGS in l){null===_&&(_=t.BaseObject.borrowObject(t.UserData));for(var y=0,T=l[t.DataParser.STRINGS];y<T.length;y++)m=T[y],_.addString(m)}h.data=_,s.push(h)}return s},n.prototype._parseTransform=function(e,i,r){i.x=n._getNumber(e,t.DataParser.X,0)*r,i.y=n._getNumber(e,t.DataParser.Y,0)*r,t.DataParser.ROTATE in e||t.DataParser.SKEW in e?(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)):(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e)&&(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-i.rotation),i.scaleX=n._getNumber(e,t.DataParser.SCALE_X,1),i.scaleY=n._getNumber(e,t.DataParser.SCALE_Y,1)},n.prototype._parseColorTransform=function(e,i){i.alphaMultiplier=.01*n._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100),i.redMultiplier=.01*n._getNumber(e,t.DataParser.RED_MULTIPLIER,100),i.greenMultiplier=.01*n._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100),i.blueMultiplier=.01*n._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100),i.alphaOffset=n._getNumber(e,t.DataParser.ALPHA_OFFSET,0),i.redOffset=n._getNumber(e,t.DataParser.RED_OFFSET,0),i.greenOffset=n._getNumber(e,t.DataParser.GREEN_OFFSET,0),i.blueOffset=n._getNumber(e,t.DataParser.BLUE_OFFSET,0)},n.prototype._parseArray=function(){this._intArray.length=0,this._floatArray.length=0,this._frameIntArray.length=0,this._frameFloatArray.length=0,this._frameArray.length=0,this._timelineArray.length=0},n.prototype._modifyArray=function(){this._intArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._intArray.push(0),this._frameIntArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._frameIntArray.push(0),this._frameArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._frameArray.push(0),this._timelineArray.length%Uint16Array.BYTES_PER_ELEMENT!=0&&this._timelineArray.push(0);var e=this._intArray.length*Int16Array.BYTES_PER_ELEMENT,i=this._floatArray.length*Float32Array.BYTES_PER_ELEMENT,n=this._frameIntArray.length*Int16Array.BYTES_PER_ELEMENT,r=this._frameFloatArray.length*Float32Array.BYTES_PER_ELEMENT,a=this._frameArray.length*Int16Array.BYTES_PER_ELEMENT,s=this._timelineArray.length*Uint16Array.BYTES_PER_ELEMENT,o=e+i+n+r+a+s;if(t.DragonBones.webAssembly){for(var c=t.webAssemblyModule.HEAP16.buffer,l=t.webAssemblyModule._malloc(o),h=new Int16Array(c,l,this._intArray.length),u=new Float32Array(c,l+e,this._floatArray.length),f=new Int16Array(c,l+e+i,this._frameIntArray.length),_=new Float32Array(c,l+e+i+n,this._frameFloatArray.length),d=new Int16Array(c,l+e+i+n+r,this._frameArray.length),p=new Uint16Array(c,l+e+i+n+r+a,this._timelineArray.length),m=0,v=this._intArray.length;m<v;++m)h[m]=this._intArray[m];for(m=0,v=this._floatArray.length;m<v;++m)u[m]=this._floatArray[m];for(m=0,v=this._frameIntArray.length;m<v;++m)f[m]=this._frameIntArray[m];for(m=0,v=this._frameFloatArray.length;m<v;++m)_[m]=this._frameFloatArray[m];for(m=0,v=this._frameArray.length;m<v;++m)d[m]=this._frameArray[m];for(m=0,v=this._timelineArray.length;m<v;++m)p[m]=this._timelineArray[m];t.webAssemblyModule.setDataBinary(this._data,l,e,i,n,r,a,s)}else{var g=new ArrayBuffer(o);for(h=new Int16Array(g,0,this._intArray.length),u=new Float32Array(g,e,this._floatArray.length),f=new Int16Array(g,e+i,this._frameIntArray.length),_=new Float32Array(g,e+i+n,this._frameFloatArray.length),d=new Int16Array(g,e+i+n+r,this._frameArray.length),p=new Uint16Array(g,e+i+n+r+a,this._timelineArray.length),m=0,v=this._intArray.length;m<v;++m)h[m]=this._intArray[m];for(m=0,v=this._floatArray.length;m<v;++m)u[m]=this._floatArray[m];for(m=0,v=this._frameIntArray.length;m<v;++m)f[m]=this._frameIntArray[m];for(m=0,v=this._frameFloatArray.length;m<v;++m)_[m]=this._frameFloatArray[m];for(m=0,v=this._frameArray.length;m<v;++m)d[m]=this._frameArray[m];for(m=0,v=this._timelineArray.length;m<v;++m)p[m]=this._timelineArray[m];this._data.binary=g,this._data.intArray=h,this._data.floatArray=u,this._data.frameIntArray=f,this._data.frameFloatArray=_,this._data.frameArray=d,this._data.timelineArray=p}this._defaultColorOffset=-1},n.prototype.parseDragonBonesData=function(e,i){void 0===i&&(i=1),console.assert(null!=e,"Data error.");var r=n._getString(e,t.DataParser.VERSION,""),a=n._getString(e,t.DataParser.COMPATIBLE_VERSION,"");if(t.DataParser.DATA_VERSIONS.indexOf(r)>=0||t.DataParser.DATA_VERSIONS.indexOf(a)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);if(s.version=r,s.name=n._getString(e,t.DataParser.NAME,""),s.frameRate=n._getNumber(e,t.DataParser.FRAME_RATE,24),0===s.frameRate&&(s.frameRate=24),t.DataParser.ARMATURE in e){this._data=s,this._parseArray(e);for(var o=0,c=e[t.DataParser.ARMATURE];o<c.length;o++){var l=c[o];s.addArmature(this._parseArmature(l,i))}this._data.binary||this._modifyArray(),t.DataParser.STAGE in e?s.stage=s.getArmature(n._getString(e,t.DataParser.STAGE,"")):s.armatureNames.length>0&&(s.stage=s.getArmature(s.armatureNames[0])),this._data=null}return t.DataParser.TEXTURE_ATLAS in e&&(this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]),s}return console.assert(!1,"Nonsupport data version: "+r+"\nPlease convert DragonBones data to support version.\nRead more: https://github.com/DragonBones/Tools/"),null},n.prototype.parseTextureAtlasData=function(e,i,r){if(void 0===r&&(r=1),console.assert(void 0!==e),null===e){if(null===this._rawTextureAtlases||0===this._rawTextureAtlases.length)return!1;var a=this._rawTextureAtlases[this._rawTextureAtlasIndex++];return this.parseTextureAtlasData(a,i,r),this._rawTextureAtlasIndex>=this._rawTextureAtlases.length&&(this._rawTextureAtlasIndex=0,this._rawTextureAtlases=null),!0}if(i.width=n._getNumber(e,t.DataParser.WIDTH,0),i.height=n._getNumber(e,t.DataParser.HEIGHT,0),i.scale=1===r?1/n._getNumber(e,t.DataParser.SCALE,1):r,i.name=n._getString(e,t.DataParser.NAME,""),i.imagePath=n._getString(e,t.DataParser.IMAGE_PATH,""),t.DataParser.SUB_TEXTURE in e)for(var s=e[t.DataParser.SUB_TEXTURE],o=0,c=s.length;o<c;++o){var l=s[o],h=i.createTexture();h.rotated=n._getBoolean(l,t.DataParser.ROTATED,!1),h.name=n._getString(l,t.DataParser.NAME,""),h.region.x=n._getNumber(l,t.DataParser.X,0),h.region.y=n._getNumber(l,t.DataParser.Y,0),h.region.width=n._getNumber(l,t.DataParser.WIDTH,0),h.region.height=n._getNumber(l,t.DataParser.HEIGHT,0);var u=n._getNumber(l,t.DataParser.FRAME_WIDTH,-1),f=n._getNumber(l,t.DataParser.FRAME_HEIGHT,-1);u>0&&f>0&&(h.frame=t.TextureData.createRectangle(),h.frame.x=n._getNumber(l,t.DataParser.FRAME_X,0),h.frame.y=n._getNumber(l,t.DataParser.FRAME_Y,0),h.frame.width=u,h.frame.height=f),i.addTexture(h)}return!0},n.getInstance=function(){return null===n._objectDataParserInstance&&(n._objectDataParserInstance=new n),n._objectDataParserInstance},n._objectDataParserInstance=null,n})(t.DataParser);t.ObjectDataParser=e;var i=function(){this.frameStart=0,this.actions=[]};t.ActionFrame=i})(r||(r={})),(function(t){var e=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),i.prototype._inRange=function(t,e,i){return e<=t&&t<=i},i.prototype._decodeUTF8=function(t){for(var e,i=0,n="",r=0,a=0,s=0,o=0;t.length>i;){var c=t[i++];if(-1===c)e=0!==a?65533:-1;else if(0===a)this._inRange(c,0,127)?e=c:(this._inRange(c,194,223)?(a=1,o=128,r=c-192):this._inRange(c,224,239)?(a=2,o=2048,r=c-224):this._inRange(c,240,244)&&(a=3,o=65536,r=c-240),r*=Math.pow(64,a),e=null);else if(this._inRange(c,128,191))if(s+=1,r+=(c-128)*Math.pow(64,a-s),s!==a)e=null;else{var l=r,h=o;r=0,a=0,s=0,o=0,e=this._inRange(l,h,1114111)&&!this._inRange(l,55296,57343)?l:c}else r=0,a=0,s=0,o=0,i--,e=c;null!==e&&-1!==e&&(e<=65535?e>0&&(n+=String.fromCharCode(e)):(e-=65536,n+=String.fromCharCode(55296+(e>>10&1023)),n+=String.fromCharCode(56320+(1023&e))))}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,n){void 0===n&&(n=null);var r=null!==n?n:t.BaseObject.borrowObject(t.TimelineData);r.type=e,r.offset=i,this._timeline=r;var a=this._timelineArrayBuffer[r.offset+2];if(1===a)r.frameIndicesOffset=-1;else{var s=0,o=this._animation.frameCount+1,c=this._data.frameIndices;t.DragonBones.webAssembly?(s=c.size(),c.resize(s+o,0)):(s=c.length,c.length+=o),r.frameIndicesOffset=s;for(var l=0,h=0,u=0,f=0;l<o;++l)u+f<=l&&h<a&&(u=this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.offset+5+h]],f=h===a-1?this._animation.frameCount-u:this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.offset+5+h+1]]-u,h++),t.DragonBones.webAssembly?c.set(s+l,h-1):c[s+l]=h-1}return this._timeline=null,r},i.prototype._parseVertices=function(e,i){i.offset=e[t.DataParser.OFFSET];var n=this._intArrayBuffer[i.offset+3];if(n>=0){var r=t.BaseObject.borrowObject(t.WeightData),a=this._intArrayBuffer[i.offset+0],s=this._intArrayBuffer[n+0];r.offset=n;for(var o=0;o<s;++o){var c=this._intArrayBuffer[n+2+o];r.addBone(this._rawBones[c])}for(var l=n+2+s,h=0,u=(o=0,a);o<u;++o){var f=this._intArrayBuffer[l++];h+=f,l+=f}r.count=h,i.weight=r}},i.prototype._parseMesh=function(t,e){this._parseVertices(t,e.vertices)},i.prototype._parsePath=function(t,e){this._parseVertices(t,e.vertices)},i.prototype._parseAnimation=function(e){var i=t.BaseObject.borrowObject(t.AnimationData);i.frameCount=Math.max(t.ObjectDataParser._getNumber(e,t.DataParser.DURATION,1),1),i.playTimes=t.ObjectDataParser._getNumber(e,t.DataParser.PLAY_TIMES,1),i.duration=i.frameCount/this._armature.frameRate,i.fadeInTime=t.ObjectDataParser._getNumber(e,t.DataParser.FADE_IN_TIME,0),i.scale=t.ObjectDataParser._getNumber(e,t.DataParser.SCALE,1),i.name=t.ObjectDataParser._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME);var n=e[t.DataParser.OFFSET];if(i.frameIntOffset=n[0],i.frameFloatOffset=n[1],i.frameOffset=n[2],this._animation=i,t.DataParser.ACTION in e&&(i.actionTimeline=this._parseBinaryTimeline(0,e[t.DataParser.ACTION])),t.DataParser.Z_ORDER in e&&(i.zOrderTimeline=this._parseBinaryTimeline(1,e[t.DataParser.Z_ORDER])),t.DataParser.BONE in e){var r=e[t.DataParser.BONE];for(var a in r){var s=r[a];t.DragonBones.webAssembly&&(a=this._getUTF16Key(a));var o=this._armature.getBone(a);if(null!==o)for(var c=0,l=s.length;c<l;c+=2){var h=s[c],u=s[c+1],f=this._parseBinaryTimeline(h,u);this._animation.addBoneTimeline(o,f)}}}if(t.DataParser.SURFACE in e)for(var a in r=e[t.DataParser.SURFACE]){s=r[a],t.DragonBones.webAssembly&&(a=this._getUTF16Key(a));var _=this._armature.getBone(a);if(null!==_)for(c=0,l=s.length;c<l;c+=2)h=s[c],u=s[c+1],f=this._parseBinaryTimeline(h,u),this._animation.addSurfaceTimeline(_,f)}if(t.DataParser.SLOT in e)for(var a in r=e[t.DataParser.SLOT]){s=r[a],t.DragonBones.webAssembly&&(a=this._getUTF16Key(a));var d=this._armature.getSlot(a);if(null!==d)for(c=0,l=s.length;c<l;c+=2)h=s[c],u=s[c+1],f=this._parseBinaryTimeline(h,u),this._animation.addSlotTimeline(d,f)}if(t.DataParser.CONSTRAINT in e)for(var a in r=e[t.DataParser.CONSTRAINT]){s=r[a],t.DragonBones.webAssembly&&(a=this._getUTF16Key(a));var p=this._armature.getConstraint(a);if(null!==p)for(c=0,l=s.length;c<l;c+=2)h=s[c],u=s[c+1],f=this._parseBinaryTimeline(h,u),this._animation.addConstraintTimeline(p,f)}if(t.DataParser.ANIMATION in e)for(var a in r=e[t.DataParser.ANIMATION])for(s=r[a],t.DragonBones.webAssembly&&(a=this._getUTF16Key(a)),c=0,l=s.length;c<l;c+=2)h=s[c],u=s[c+1],f=this._parseBinaryTimeline(h,u),this._animation.addAnimationTimeline(a,f);return this._animation=null,i},i.prototype._parseArray=function(e){var i=e[t.DataParser.OFFSET],n=i[1],r=i[3],a=i[5],s=i[7],o=i[9],c=i[11],l=new Int16Array(this._binary,this._binaryOffset+i[0],n/Int16Array.BYTES_PER_ELEMENT),h=new Float32Array(this._binary,this._binaryOffset+i[2],r/Float32Array.BYTES_PER_ELEMENT),u=new Int16Array(this._binary,this._binaryOffset+i[4],a/Int16Array.BYTES_PER_ELEMENT),f=new Float32Array(this._binary,this._binaryOffset+i[6],s/Float32Array.BYTES_PER_ELEMENT),_=new Int16Array(this._binary,this._binaryOffset+i[8],o/Int16Array.BYTES_PER_ELEMENT),d=new Uint16Array(this._binary,this._binaryOffset+i[10],c/Uint16Array.BYTES_PER_ELEMENT);if(t.DragonBones.webAssembly){for(var p=n+r+a+s+o+c,m=t.webAssemblyModule._malloc(p),v=new Uint8Array(this._binary,this._binaryOffset,p/Uint8Array.BYTES_PER_ELEMENT),g=new Uint8Array(t.webAssemblyModule.HEAP16.buffer,m,v.length),y=0,T=v.length;y<T;++y)g[y]=v[y];t.webAssemblyModule.setDataBinary(this._data,m,n,r,a,s,o,c),this._intArrayBuffer=l,this._floatArrayBuffer=h,this._frameIntArrayBuffer=u,this._frameFloatArrayBuffer=f,this._frameArrayBuffer=_,this._timelineArrayBuffer=d}else this._data.binary=this._binary,this._data.intArray=this._intArrayBuffer=l,this._data.floatArray=this._floatArrayBuffer=h,this._data.frameIntArray=this._frameIntArrayBuffer=u,this._data.frameFloatArray=this._frameFloatArrayBuffer=f,this._data.frameArray=this._frameArrayBuffer=_,this._data.timelineArray=this._timelineArrayBuffer=d},i.prototype.parseDragonBonesData=function(t,i){void 0===i&&(i=1),console.assert(null!=t&&t instanceof ArrayBuffer,"Data error.");var n=new Uint8Array(t,0,8);if(n[0]!=="D".charCodeAt(0)||n[1]!=="B".charCodeAt(0)||n[2]!=="D".charCodeAt(0)||n[3]!=="T".charCodeAt(0))return console.assert(!1,"Nonsupport data."),null;var r=new Uint32Array(t,8,1)[0],a=new Uint8Array(t,12,r),s=this._decodeUTF8(a),o=JSON.parse(s);return this._binaryOffset=12+r,this._binary=t,e.prototype.parseDragonBonesData.call(this,o,i)},i.getInstance=function(){return null===i._binaryDataParserInstance&&(i._binaryDataParserInstance=new i),i._binaryDataParserInstance},i._binaryDataParserInstance=null,i})(t.ObjectDataParser);t.BinaryDataParser=e})(r||(r={})),(function(t){var e=(function(){function e(i){void 0===i&&(i=null),this.autoSearch=!1,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dragonBones=null,this._dataParser=null,null===e._objectParser&&(e._objectParser=new t.ObjectDataParser),null===e._binaryParser&&(e._binaryParser=new t.BinaryDataParser),this._dataParser=null!==i?i:e._objectParser}return e.prototype._isSupportMesh=function(){return!0},e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap)for(var i=0,n=this._textureAtlasDataMap[t];i<n.length;i++)if(null!==(c=(o=n[i]).getTexture(e)))return c;if(this.autoSearch)for(var r in this._textureAtlasDataMap)for(var a=0,s=this._textureAtlasDataMap[r];a<s.length;a++){var o,c;if((o=s[a]).autoSearch&&null!==(c=o.getTexture(e)))return c}return null},e.prototype._fillBuildArmaturePackage=function(t,e,i,n,r){var a=null,s=null;if(e.length>0&&e in this._dragonBonesDataMap&&(s=(a=this._dragonBonesDataMap[e]).getArmature(i)),null===s&&(0===e.length||this.autoSearch))for(var o in this._dragonBonesDataMap)if(a=this._dragonBonesDataMap[o],(0===e.length||a.autoSearch)&&null!==(s=a.getArmature(i))){e=o;break}if(null!==s){if(t.dataName=e,t.textureAtlasName=r,t.data=a,t.armature=s,t.skin=null,n.length>0&&(t.skin=s.getSkin(n),null===t.skin&&this.autoSearch))for(var o in this._dragonBonesDataMap){var c=this._dragonBonesDataMap[o].getArmature(n);if(null!==c){t.skin=c.defaultSkin;break}}return null===t.skin&&(t.skin=s.defaultSkin),!0}return!1},e.prototype._buildBones=function(e,i){for(var n=0,r=e.armature.sortedBones;n<r.length;n++){var a=r[n];t.BaseObject.borrowObject(0===a.type?t.Bone:t.Surface).init(a,i)}},e.prototype._buildSlots=function(e,i){var n=e.skin,r=e.armature.defaultSkin;if(null!==n&&null!==r){var a={};for(var s in r.displays){var o=r.getDisplays(s);a[s]=o}if(n!==r)for(var s in n.displays)o=n.getDisplays(s),a[s]=o;for(var c=0,l=e.armature.sortedSlots;c<l.length;c++){var h=l[c],u=h.name in a?a[h.name]:null,f=this._buildSlot(e,h,i);if(f.rawDisplayDatas=u,null!==u){for(var _=new Array,d=0,p=t.DragonBones.webAssembly?u.size():u.length;d<p;++d){var m=t.DragonBones.webAssembly?u.get(d):u[d];null!==m?_.push(this._getSlotDisplay(e,m,null,f)):_.push(null)}f._setDisplayList(_)}f._setDisplayIndex(h.displayIndex,!0)}}},e.prototype._buildConstraints=function(e,i){var n=e.armature.constraints;for(var r in n){var a=n[r];switch(a.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(a,i),i._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(a,i),i._addConstraint(o);break;default:var c=t.BaseObject.borrowObject(t.IKConstraint);c.init(a,i),i._addConstraint(c)}}},e.prototype._buildChildArmature=function(t,e,i){return this.buildArmature(i.path,null!==t?t.dataName:"","",null!==t?t.textureAtlasName:"")},e.prototype._getSlotDisplay=function(e,i,n,r){var a=null!==e?e.dataName:i.parent.parent.parent.name,s=null;switch(i.type){case 0:var o=i;null!==e&&e.textureAtlasName.length>0&&(o.texture=this._getTextureData(e.textureAtlasName,i.path)),null===o.texture&&(o.texture=this._getTextureData(a,i.path)),s=null!==n&&2===n.type&&this._isSupportMesh()?r.meshDisplay:r.rawDisplay;break;case 2:var c=i;null!==e&&e.textureAtlasName.length>0&&(c.texture=this._getTextureData(e.textureAtlasName,c.path)),null===c.texture&&(c.texture=this._getTextureData(a,c.path)),s=this._isSupportMesh()?r.meshDisplay:r.rawDisplay;break;case 1:var l=i,h=this._buildChildArmature(e,r,i);if(null!==h){if(h.inheritAnimation=l.inheritAnimation,!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 d=_[f],p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(d,p,r.armature),p.slot=r,r.armature._bufferAction(p,!1)}else h.animation.play()}l.armature=h.armatureData}s=h}return s},e.prototype.parseDragonBonesData=function(t,i,n){void 0===i&&(i=null),void 0===n&&(n=1);for(var r=t instanceof ArrayBuffer?e._binaryParser:this._dataParser,a=r.parseDragonBonesData(t,n);;){var s=this._buildTextureAtlasData(null,null);if(!r.parseTextureAtlasData(null,s,n)){s.returnToPool();break}this.addTextureAtlasData(s,i)}return null!==a&&this.addDragonBonesData(a,i),a},e.prototype.parseTextureAtlasData=function(t,e,i,n){void 0===i&&(i=null),void 0===n&&(n=1);var r=this._buildTextureAtlasData(null,null);return this._dataParser.parseTextureAtlasData(t,r,n),this._buildTextureAtlasData(r,e||null),this.addTextureAtlasData(r,i),r},e.prototype.updateTextureAtlasData=function(t,e){var i=this.getTextureAtlasData(t);if(null!==i)for(var n=0,r=i.length;n<r;++n)n<e.length&&this._buildTextureAtlasData(i[n],e[n])},e.prototype.getDragonBonesData=function(t){return t in this._dragonBonesDataMap?this._dragonBonesDataMap[t]:null},e.prototype.addDragonBonesData=function(t,e){if(void 0===e&&(e=null),(e=null!==e?e:t.name)in this._dragonBonesDataMap){if(this._dragonBonesDataMap[e]===t)return;console.warn("Can not add same name data: "+e)}else this._dragonBonesDataMap[e]=t},e.prototype.removeDragonBonesData=function(t,e){void 0===e&&(e=!0),t in this._dragonBonesDataMap&&(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){void 0===e&&(e=null);var i=(e=null!==e?e:t.name)in this._textureAtlasDataMap?this._textureAtlasDataMap[e]:this._textureAtlasDataMap[e]=[];i.indexOf(t)<0&&i.push(t)},e.prototype.removeTextureAtlasData=function(t,e){if(void 0===e&&(e=!0),t in this._textureAtlasDataMap){var i=this._textureAtlasDataMap[t];if(e)for(var n=0,r=i;n<r.length;n++){var a=r[n];this._dragonBones.bufferObject(a)}delete this._textureAtlasDataMap[t]}},e.prototype.getArmatureData=function(t,e){void 0===e&&(e="");var n=new i;return this._fillBuildArmaturePackage(n,e,t,"","")?n.armature:null},e.prototype.clear=function(t){for(var e in void 0===t&&(t=!0),this._dragonBonesDataMap)t&&this._dragonBones.bufferObject(this._dragonBonesDataMap[e]),delete this._dragonBonesDataMap[e];for(var e in this._textureAtlasDataMap){if(t)for(var i=0,n=this._textureAtlasDataMap[e];i<n.length;i++){var r=n[i];this._dragonBones.bufferObject(r)}delete this._textureAtlasDataMap[e]}},e.prototype.buildArmature=function(t,e,n,r){void 0===e&&(e=""),void 0===n&&(n=""),void 0===r&&(r="");var a=new i;if(!this._fillBuildArmaturePackage(a,e||"",t,n||"",r||""))return console.warn("No armature data: "+t+", "+(null!==e?e:"")),null;var s=this._buildArmature(a);return this._buildBones(a,s),this._buildSlots(a,s),this._buildConstraints(a,s),s.invalidUpdate(null,!0),s.advanceTime(0),s},e.prototype.replaceDisplay=function(e,i,n){void 0===n&&(n=-1),n<0&&(n=e.displayIndex),n<0&&(n=0),e.replaceDisplayData(i,n);var r=e.displayList;if(r.length<=n){r.length=n+1;for(var a=0,s=r.length;a<s;++a)r[a]||(r[a]=null)}if(null!==i){var o=e.rawDisplayDatas,c=null;o&&(t.DragonBones.webAssembly?n<o.size()&&(c=o.get(n)):n<o.length&&(c=o[n])),r[n]=this._getSlotDisplay(null,i,c,e)}else r[n]=null;e.displayList=r},e.prototype.replaceSlotDisplay=function(t,e,i,n,r,a){void 0===a&&(a=-1);var s=this.getArmatureData(e,t||"");if(!s||!s.defaultSkin)return!1;var o=s.defaultSkin.getDisplay(i,n);return!!o&&(this.replaceDisplay(r,o,a),!0)},e.prototype.replaceSlotDisplayList=function(e,i,n,r){var a=this.getArmatureData(i,e||"");if(!a||!a.defaultSkin)return!1;var s=a.defaultSkin.getDisplays(n);if(!s)return!1;for(var o=0,c=0,l=t.DragonBones.webAssembly?s.size():s.length;c<l;++c){var h=t.DragonBones.webAssembly?s.get(c):s[c];this.replaceDisplay(r,h,o++)}return!0},e.prototype.replaceSkin=function(e,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=null);for(var a=!1,s=i.parent.defaultSkin,o=0,c=e.getSlots();o<c.length;o++){var l=c[o];if(!(null!==r&&r.indexOf(l.name)>=0)){var h=i.getDisplays(l.name);if(h||(null!==s&&i!==s&&(h=s.getDisplays(l.name)),h)){var u=t.DragonBones.webAssembly?h.size():h.length,f=l.displayList;f.length=u;for(var _=0,d=u;_<d;++_){var p=t.DragonBones.webAssembly?h.get(_):h[_];f[_]=null!==p?this._getSlotDisplay(null,p,null,l):null}a=!0,l.rawDisplayDatas=h,l.displayList=f}else n&&(l.rawDisplayDatas=null,l.displayList=[])}}return a},e.prototype.replaceAnimation=function(e,i,n){void 0===n&&(n=!0);var r=i.defaultSkin;if(null===r)return!1;if(n)e.animation.animations=i.animations;else{var a=e.animation.animations,s={};for(var o in a)s[o]=a[o];for(var o in i.animations)s[o]=i.animations[o];e.animation.animations=s}for(var c=0,l=e.getSlots();c<l.length;c++)for(var h=l[c],u=0,f=0,_=h.displayList;f<_.length;f++){var d=_[f];if(d instanceof t.Armature){var p=r.getDisplays(h.name);if(null!==p&&u<(t.DragonBones.webAssembly?p.size():p.length)){var m=t.DragonBones.webAssembly?p.get(u):p[u];if(null!==m&&1===m.type){var v=this.getArmatureData(m.path,m.parent.parent.parent.name);v&&this.replaceAnimation(d,v,n)}}}u++}return!0},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:!0,configurable:!0}),Object.defineProperty(e.prototype,"dragonBones",{get:function(){return this._dragonBones},enumerable:!0,configurable:!0}),e.prototype.changeSkin=function(t,e,i){return void 0===i&&(i=null),this.replaceSkin(t,e,!1,i)},e.prototype.copyAnimationsToArmature=function(t,e,i,n,r){void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=!0);var a=this.getArmatureData(e,n);return!!a&&this.replaceAnimation(t,a,r)},e._objectParser=null,e._binaryParser=null,e})();t.BaseFactory=e;var i=function(){this.dataName="",this.textureAtlasName="",this.skin=null};t.BuildArmaturePackage=i})(r||(r={})),e.exports=r}),{}],329:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../cocos2d/core/renderer/assembler")),r=a(t("../../cocos2d/core/value-types/mat4"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var o,c,l,h,u,f,_,d,p,m,v,g,y,T,A,b,E,C,x,S,w,D,M,R,I,O,P,N,F,L,B=t("./ArmatureDisplay"),k=t("../../cocos2d/core/renderer/render-flow"),V=cc.gfx,U=cc.color(255,0,0,255),z=cc.color(0,0,255,255),G=cc.color(0,255,0,255);function H(t,e){if(!t)return null;var i,n;switch(e){case 1:i=u?cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE;break;case 10:i=cc.macro.DST_COLOR,n=cc.macro.ONE_MINUS_SRC_ALPHA;break;case 12:i=cc.macro.ONE,n=cc.macro.ONE_MINUS_SRC_COLOR;break;case 0:default:i=u?cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE_MINUS_SRC_ALPHA}var r=!v.enableBatch,a=v._materials[0];if(!a)return null;var s=v._materialCache,o=t.getId()+i+n+r,c=s[o];return c||(s.baseMaterial?c=cc.MaterialVariant.create(a):(c=a,s.baseMaterial=a),c.define("CC_USE_MODEL",r),c.setProperty("texture",t),c.setBlend(!0,V.BLEND_FUNC_ADD,i,n,V.BLEND_FUNC_ADD,i,n),s[o]=c),c}function W(t,e){M=t.a*e*h,f=u?M/255:1,S=t.r*o*f,w=t.g*c*f,D=t.b*l*f,x=(M<<24>>>0)+(D<<16)+(w<<8)+S}var j=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,s(e,i);var a=n.prototype;return a.updateRenderData=function(){},a.realTimeTraverse=function(t,e,i){for(var n,a,s,o,c,l,h,u,f,v,S=t._slots,w=0,D=S.length;w<D;w++)if(h=(u=S[w])._color,u._visible&&u._displayData)if(e?u._mulMat(u._worldMatrix,e,u._matrix):r.default.copy(u._worldMatrix,u._matrix),u.childArmature)this.realTimeTraverse(u.childArmature,u._worldMatrix,i*h.a/255);else if(o=H(u.getTexture(),u._blendMode)){(_||o.getHash()!==m.material.getHash())&&(_=!1,m._flush(),m.node=p,m.material=o),W(h,i),f=u._worldMatrix.m,c=u._localVertices,A=c.length>>2,l=u._indices,b=l.length,v=d.request(A,b),y=v.indiceOffset,g=v.byteOffset>>2,T=v.vertexOffset,n=d._vData,a=d._iData,s=d._uintVData,I=f[0],O=f[4],P=f[12],N=f[1],F=f[5],L=f[13];for(var M=0,R=c.length;M<R;)E=c[M++],C=c[M++],n[g++]=E*I+C*O+P,n[g++]=E*N+C*F+L,n[g++]=c[M++],n[g++]=c[M++],s[g++]=x;for(var B=0,k=l.length;B<k;B++)a[y++]=T+l[B]}},a.cacheTraverse=function(t,e){if(t){var i=t.segments;if(0!=i.length){var n,r,a,s,o,c=t.vertices,l=t.indices,h=0,u=0,f=0;if(e){var v=e.m;I=v[0],N=v[1],O=v[4],F=v[5],P=v[12],L=v[13]}var S=16&R,w=S&&1===I&&0===N&&0===O&&1===F,D=0,M=t.colors,B=M[D++],k=B.vfOffset;W(B,1);for(var V=0,U=i.length;V<U;V++){var z=i[V];s=H(z.tex,z.blendMode),(_||s.getHash()!==m.material.getHash())&&(_=!1,m._flush(),m.node=p,m.material=s),A=z.vertexCount,b=z.indexCount,o=d.request(A,b),y=o.indiceOffset,T=o.vertexOffset,g=o.byteOffset>>2,n=d._vData,r=d._iData,a=d._uintVData;for(var G=y,j=y+b;G<j;G++)r[G]=T+l[u++];if(f=z.vfCount,n.set(c.subarray(h,h+f),g),h+=f,w)for(var Y=g,X=g+f;Y<X;Y+=5)n[Y]+=P,n[Y+1]+=L;else if(S)for(var q=g,Z=g+f;q<Z;q+=5)E=n[q],C=n[q+1],n[q]=E*I+C*O+P,n[q+1]=E*N+C*F+L;if(1&R)for(var K=h-f,J=g+4,Q=g+4+f;J<Q;J+=5,K+=5)K>=k&&(W(B=M[D++],1),k=B.vfOffset),a[J]=x}}}},a.fillBuffers=function(t,e){t.node._renderFlag|=k.FLAG_UPDATE_RENDER_DATA;var i=t._armature;if(i){_=!0,u=t.premultipliedAlpha,p=t.node,d=e._meshBuffer,m=e,v=t,R=0;var n=p._color;o=n.r/255,c=n.g/255,l=n.b/255,h=n.a/255,4294967295!==n._val&&(R|=1);var r=void 0;if(v.enableBatch&&(r=p._worldMatrix,_=!1,R|=16),t.isAnimationCached())this.cacheTraverse(t._curFrame,r);else{this.realTimeTraverse(i,r,1);var a=t._debugDraw;if(t.debugBones&&a){a.clear(),a.lineWidth=5,a.strokeColor=U,a.fillColor=z;for(var s=i.getBones(),f=0,g=s.length;f<g;f++){var y=s[f],T=Math.max(y.boneData.length,5),A=y.globalTransformMatrix.tx,b=y.globalTransformMatrix.ty,E=A+y.globalTransformMatrix.a*T,C=b+y.globalTransformMatrix.b*T;a.moveTo(A,b),a.lineTo(E,C),a.stroke(),a.circle(A,b,2*Math.PI),a.fill(),0===f&&(a.fillColor=G)}}}e.worldMatDirty++,t.attachUtil._syncAttachedNode(),p=void 0,d=void 0,m=void 0,v=void 0}},a.postFillBuffers=function(t,e){e.worldMatDirty--},n})(n.default);i.default=j,n.default.register(B,j),e.exports=i.default}),{"../../cocos2d/core/renderer/assembler":196,"../../cocos2d/core/renderer/render-flow":200,"../../cocos2d/core/value-types/mat4":259,"./ArmatureDisplay":319}],330:[(function(t,e){"use strict";var i,n=(i=t("../../cocos2d/core/value-types/mat4"))&&i.__esModule?i:{default:i},r=t("../../cocos2d/core/renderer/render-flow").FLAG_TRANSFORM,a=function(){},s=function(t){Object.defineProperty(t,"_worldMatDirty",{get:function(){return!0},set:function(){}}),t._calculWorldMatrix=a,t._mulMat=a},o=new n.default,c=cc.Class({name:"sp.AttachUtil",ctor:function(){this._inited=!1,this._skeleton=null,this._skeletonNode=null,this._skeletonComp=null,this._attachedRootNode=null,this._attachedNodeArray=[],this._boneIndexToNode={}},init:function(t){this._inited=!0,this._skeleton=t._skeleton,this._skeletonNode=t.node,this._skeletonComp=t},reset:function(){this._inited=!1,this._skeleton=null,this._skeletonNode=null,this._skeletonComp=null},_prepareAttachNode:function(){if(this._skeleton){var t=this._skeletonNode.getChildByName("ATTACHED_NODE_TREE");return t&&t.isValid||(t=new cc.Node("ATTACHED_NODE_TREE"),s(t),this._skeletonNode.addChild(t)),this._skeletonComp.isAnimationCached()&&this._skeletonComp._frameCache&&this._skeletonComp._frameCache.enableCacheAttachedInfo(),this._attachedRootNode=t,t}},_buildBoneAttachedNode:function(t,e){var i="ATTACHED_NODE:"+t.data.name,n=new cc.Node(i);return this._buildBoneRelation(n,t,e),n},_buildBoneRelation:function(t,e,i){s(t),t._bone=e,t._boneIndex=i,this._attachedNodeArray.push(t),this._boneIndexToNode[i]=t},getAttachedRootNode:function(){return this._attachedRootNode},getAttachedNodes:function(t){var e=this._attachedNodeArray,i=[];if(!this._inited)return i;for(var n=0,r=e.length;n<r;n++){var a=e[n];a&&a.isValid&&a.name==="ATTACHED_NODE:"+t&&i.push(a)}return i},_rebuildNodeArray:function(){for(var t=this._boneIndexToNode={},e=this._attachedNodeArray,i=this._attachedNodeArray=[],n=0,r=e.length;n<r;n++){var a=e[n];a&&a.isValid&&!a._toRemove&&(i.push(a),t[a._boneIndex]=a)}},_sortNodeArray:function(){this._attachedNodeArray.sort((function(t,e){return t._boneIndex<e._boneIndex?-1:1}))},_getNodeByBoneIndex:function(t){var e=this._boneIndexToNode[t];return e&&e.isValid?e:null},destroyAttachedNodes:function(t){if(this._inited){for(var e=this._attachedNodeArray,i=function t(e){for(var i=e.children,n=0,r=i.length;n<r;n++){var a=i[n];a&&t(a)}e._toRemove=!0},n=0,r=e.length;n<r;n++){var a=e[n];a&&a.isValid&&a.name.split("ATTACHED_NODE:")[1]===t&&(i(a),a.removeFromParent(!0),a.destroy(),e[n]=null)}this._rebuildNodeArray()}},generateAttachedNodes:function(t){var e=[];if(!this._inited)return e;var i=this._prepareAttachNode();if(!i)return e;for(var n=[],r=this._skeleton.bones,a=0,s=r.length;a<s;a++){var o=r[a];o.data.name==t&&n.push(o)}for(var c=function(t){if(t){var e=t.data,n=this._getNodeByBoneIndex(e.index);if(n)return n;n=this._buildBoneAttachedNode(t,e.index);var r=c(t.parent)||i;return n.parent=r,n}}.bind(this),l=0,h=n.length;l<h;l++){var u=c(n[l]);e.push(u)}return this._sortNodeArray(),e},destroyAllAttachedNodes:function(){if(this._attachedRootNode=null,this._attachedNodeArray.length=0,this._boneIndexToNode={},this._inited){var t=this._skeletonNode.getChildByName("ATTACHED_NODE_TREE");t&&(t.removeFromParent(!0),t.destroy(),t=null)}},generateAllAttachedNodes:function(){if(this._inited){this._boneIndexToNode={},this._attachedNodeArray.length=0;var t=this._prepareAttachNode();if(t){for(var e=this._skeleton.bones,i=0,n=e.length;i<n;i++){var r=e[i],a=r.data,s=null;if(r.parent){var o=r.parent.data.index;s=this._boneIndexToNode[o]}else s=t;if(s){var c=s.getChildByName("ATTACHED_NODE:"+a.name);c&&c.isValid?this._buildBoneRelation(c,r,a.index):(c=this._buildBoneAttachedNode(r,a.index),s.addChild(c))}}return t}}},_hasAttachedNode:function(){return!!this._inited&&!!this._skeletonNode.getChildByName("ATTACHED_NODE_TREE")},_associateAttachedNode:function(){if(this._inited){var t=this._skeletonNode.getChildByName("ATTACHED_NODE_TREE");if(t&&t.isValid){this._attachedRootNode=t,this._boneIndexToNode={},this._attachedNodeArray.length=0,s(t),this._skeletonComp.isAnimationCached()&&this._skeletonComp._frameCache&&this._skeletonComp._frameCache.enableCacheAttachedInfo();for(var e=this._skeleton.bones,i=0,n=e.length;i<n;i++){var r=e[i],a=r.data,o=null;if(r.parent){var c=r.parent.data.index;o=this._boneIndexToNode[c]}else o=t;if(o){var l=o.getChildByName("ATTACHED_NODE:"+a.name);l&&l.isValid&&this._buildBoneRelation(l,r,a.index)}}}}},_syncAttachedNode:function(){if(this._inited){var t=this._attachedRootNode,e=this._attachedNodeArray;if(!t||!t.isValid)return this._attachedRootNode=null,void(e.length=0);var i=this._skeletonNode._worldMatrix;n.default.copy(t._worldMatrix,i),t._renderFlag&=~r;var a;if(a=this._skeletonComp.isAnimationCached()?this._skeletonComp._curFrame&&this._skeletonComp._curFrame.boneInfos:this._skeleton.bones){for(var s=this._skeletonNode._mulMat,c=function(t,e,i){var n=o.m;n[0]=i.a,n[1]=i.c,n[4]=i.b,n[5]=i.d,n[12]=i.worldX,n[13]=i.worldY,s(t,e,o)},l=!1,h=0,u=e.length;h<u;h++){var f=e[h];if(f&&f.isValid){var _=a[f._boneIndex];_?(c(f._worldMatrix,t._worldMatrix,_),f._renderFlag&=~r):(f.removeFromParent(!0),f.destroy(),e[h]=null,l=!0)}else e[h]=null,l=!0}l&&this._rebuildNodeArray()}}}});e.exports=sp.AttachUtil=c}),{"../../cocos2d/core/renderer/render-flow":200,"../../cocos2d/core/value-types/mat4":259}],331:[(function(t,e){"use strict";var i=t("./track-entry-listeners"),n=t("../../cocos2d/core/components/CCRenderComponent"),r=t("./lib/spine"),a=t("../../cocos2d/core/graphics/graphics"),s=t("../../cocos2d/core/renderer/render-flow").FLAG_POST_RENDER,o=t("./skeleton-cache"),c=t("./AttachUtil"),l=cc.Enum({default:-1}),h=cc.Enum({"<None>":0}),u=cc.Enum({REALTIME:0,SHARED_CACHE:1,PRIVATE_CACHE:2});sp.Skeleton=cc.Class({name:"sp.Skeleton",extends:n,editor:!1,statics:{AnimationCacheMode:u},properties:{paused:{default:!1,visible:!1},skeletonData:{default:null,type:sp.SkeletonData,notify:function(){this.defaultSkin="",this.defaultAnimation="",this._updateSkeletonData()},tooltip:!1},defaultSkin:{default:"",visible:!1},defaultAnimation:{default:"",visible:!1},animation:{get:function(){if(this.isAnimationCached())return this._animationName;var t=this.getCurrent(0);return t&&t.animation.name||""},set:function(t){this.defaultAnimation=t,t?this.setAnimation(0,t,this.loop):this.isAnimationCached()||(this.clearTrack(0),this.setToSetupPose())},visible:!1},_defaultSkinIndex:{get:function(){if(this.skeletonData){var t=this.skeletonData.getSkinsEnum();if(t)if(""===this.defaultSkin){if(t.hasOwnProperty(0))return this._defaultSkinIndex=0,0}else{var e=t[this.defaultSkin];if(void 0!==e)return e}}return 0},set:function(t){var e;if(this.skeletonData&&(e=this.skeletonData.getSkinsEnum()),!e)return cc.errorID("",this.name);var i=e[t];void 0!==i?(this.defaultSkin=i,this.setSkin(this.defaultSkin)):cc.errorID(7501,this.name)},type:l,visible:!0,animatable:!1,displayName:"Default Skin",tooltip:!1},_animationIndex:{get:function(){var t=this.animation;if(this.skeletonData&&t){var e=this.skeletonData.getAnimsEnum();if(e){var i=e[t];if(void 0!==i)return i}}return 0},set:function(t){if(0!==t){var e;if(this.skeletonData&&(e=this.skeletonData.getAnimsEnum()),!e)return cc.errorID(7502,this.name);var i=e[t];void 0!==i?this.animation=i:cc.errorID(7503,this.name)}else this.animation=""},type:h,visible:!0,animatable:!1,displayName:"Animation",tooltip:!1},_preCacheMode:-1,_cacheMode:u.REALTIME,_defaultCacheMode:{default:0,type:u,notify:function(){this.setAnimationCacheMode(this._defaultCacheMode)},editorOnly:!0,visible:!0,animatable:!1,displayName:"Animation Cache Mode",tooltip:!1},loop:{default:!0,tooltip:!1},premultipliedAlpha:{default:!0,tooltip:!1},timeScale:{default:1,tooltip:!1},debugSlots:{default:!1,editorOnly:!0,tooltip:!1,notify:function(){this._updateDebugDraw()}},debugBones:{default:!1,editorOnly:!0,tooltip:!1,notify:function(){this._updateDebugDraw()}},debugMesh:{default:!1,editorOnly:!0,tooltip:!1,notify:function(){this._updateDebugDraw()}},useTint:{default:!1,tooltip:!1,notify:function(){this._updateUseTint()}},enableBatch:{default:!1,notify:function(){this._updateBatch()},tooltip:!1},_accTime:0,_playCount:0,_frameCache:null,_curFrame:null,_skeletonCache:null,_animationName:"",_animationQueue:[],_headAniInfo:null,_playTimes:0,_isAniComplete:!0},ctor:function(){this._effectDelegate=null,this._skeleton=null,this._rootBone=null,this._listener=null,this._materialCache={},this._debugRenderer=null,this._startSlotIndex=-1,this._endSlotIndex=-1,this._startEntry={animation:{name:""},trackIndex:0},this._endEntry={animation:{name:""},trackIndex:0},this.attachUtil=new c},_getDefaultMaterial:function(){return cc.Material.getBuiltinMaterial("2d-spine")},_updateMaterial:function(){var t=this.useTint||this.isAnimationCached()&&!0,e=this.getMaterial(0);if(e){e.define("USE_TINT",t),e.define("CC_USE_MODEL",!this.enableBatch);var i=this.premultipliedAlpha?cc.gfx.BLEND_ONE:cc.gfx.BLEND_SRC_ALPHA,n=cc.gfx.BLEND_ONE_MINUS_SRC_ALPHA;e.setBlend(!0,cc.gfx.BLEND_FUNC_ADD,i,i,cc.gfx.BLEND_FUNC_ADD,n,n)}this._materialCache={}},disableRender:function(){this._super(),this.node._renderFlag&=~s},markForRender:function(t){this._super(t),t?this.node._renderFlag|=s:this.node._renderFlag&=~s},_updateUseTint:function(){var t=this.getMaterial(0);if(t){var e=this.useTint||this.isAnimationCached()&&!0;t.define("USE_TINT",e)}this._materialCache={}},_updateBatch:function(){var t=this.getMaterial(0);t&&t.define("CC_USE_MODEL",!this.enableBatch),this._materialCache={}},_validateRender:function(){var t=this.skeletonData;t&&t.isTexturesLoaded()?this._super():this.disableRender()},setSkeletonData:function(t){if(null!=t.width&&null!=t.height&&this.node.setContentSize(t.width,t.height),this._cacheMode===u.SHARED_CACHE?this._skeletonCache=o.sharedCache:this._cacheMode===u.PRIVATE_CACHE&&(this._skeletonCache=new o,this._skeletonCache.enablePrivateMode()),this.isAnimationCached()){(this.debugBones||this.debugSlots)&&cc.warn("Debug bones or slots is invalid in cached mode");var e=this._skeletonCache.getSkeletonCache(this.skeletonData._uuid,t);this._skeleton=e.skeleton,this._clipper=e.clipper,this._rootBone=this._skeleton.getRootBone()}else this._skeleton=new r.Skeleton(t),this._clipper=new r.SkeletonClipping,this._rootBone=this._skeleton.getRootBone();this.markForRender(!0)},setSlotsRange:function(t,e){this.isAnimationCached()?cc.warn("Slots visible range can not be modified in cached mode."):(this._startSlotIndex=t,this._endSlotIndex=e)},setAnimationStateData:function(t){if(this.isAnimationCached())cc.warn("'setAnimationStateData' interface can not be invoked in cached mode.");else{var e=new r.AnimationState(t);this._listener&&(this._state&&this._state.removeListener(this._listener),e.addListener(this._listener)),this._state=e}},__preload:function(){this._super();for(var t=this.node.children,e=0,i=t.length;e<i;e++){var n=t[e];n&&"DEBUG_DRAW_NODE"===n._name&&n.destroy()}this._updateSkeletonData(),this._updateDebugDraw(),this._updateUseTint(),this._updateBatch()},setAnimationCacheMode:function(t){this._preCacheMode!==t&&(this._cacheMode=t,this._updateSkeletonData(),this._updateUseTint())},isAnimationCached:function(){return this._cacheMode!==u.REALTIME},update:function(t){if(!this.paused)if(t*=this.timeScale*sp.timeScale,this.isAnimationCached()){if(this._isAniComplete){if(0===this._animationQueue.length&&!this._headAniInfo){var e=this._frameCache;if(e&&e.isInvalid()){e.updateToFrame();var i=e.frames;this._curFrame=i[i.length-1]}return}if(this._headAniInfo||(this._headAniInfo=this._animationQueue.shift()),this._accTime+=t,this._accTime>this._headAniInfo.delay){var n=this._headAniInfo;this._headAniInfo=null,this.setAnimation(0,n.animationName,n.loop)}return}this._updateCache(t)}else this._updateRealtime(t)},_emitCacheCompleteEvent:function(){this._listener&&(this._endEntry.animation.name=this._animationName,this._listener.complete&&this._listener.complete(this._endEntry),this._listener.end&&this._listener.end(this._endEntry))},_updateCache:function(t){var e=this._frameCache;if(e.isInited()){var i=e.frames,n=o.FrameTime;0==this._accTime&&0==this._playCount&&(this._startEntry.animation.name=this._animationName,this._listener&&this._listener.start&&this._listener.start(this._startEntry)),this._accTime+=t;var r=Math.floor(this._accTime/n);if(e.isCompleted||e.updateToFrame(r),e.isCompleted&&r>=i.length){if(this._playCount++,this._playTimes>0&&this._playCount>=this._playTimes)return this._curFrame=i[i.length-1],this._accTime=0,this._playCount=0,this._isAniComplete=!0,void this._emitCacheCompleteEvent();this._accTime=0,r=0,this._emitCacheCompleteEvent()}this._curFrame=i[r]}},_updateRealtime:function(t){var e=this._skeleton,i=this._state;e&&(e.update(t),i&&(i.update(t),i.apply(e)))},setVertexEffectDelegate:function(t){this._effectDelegate=t},updateWorldTransform:function(){this.isAnimationCached()&&this._skeleton&&this._skeleton.updateWorldTransform()},setToSetupPose:function(){this._skeleton&&this._skeleton.setToSetupPose()},setBonesToSetupPose:function(){this._skeleton&&this._skeleton.setBonesToSetupPose()},setSlotsToSetupPose:function(){this._skeleton&&this._skeleton.setSlotsToSetupPose()},updateAnimationCache:function(t){if(this.isAnimationCached()){var e=this.skeletonData._uuid;this._skeletonCache&&this._skeletonCache.updateAnimationCache(e,t)}},invalidAnimationCache:function(){this.isAnimationCached()&&this._skeletonCache&&this._skeletonCache.invalidAnimationCache(this.skeletonData._uuid)},findBone:function(t){return this._skeleton?this._skeleton.findBone(t):null},findSlot:function(t){return this._skeleton?this._skeleton.findSlot(t):null},setSkin:function(t){this._skeleton&&(this._skeleton.setSkinByName(t),this._skeleton.setSlotsToSetupPose()),this.invalidAnimationCache()},getAttachment:function(t,e){return this._skeleton?this._skeleton.getAttachmentByName(t,e):null},setAttachment:function(t,e){this._skeleton&&this._skeleton.setAttachment(t,e),this.invalidAnimationCache()},getTextureAtlas:function(t){return t.region},setMix:function(t,e,i){this._state&&this._state.data.setMix(t,e,i)},setAnimation:function(t,e,i){if(this._playTimes=i?0:1,this._animationName=e,this.isAnimationCached()){if(0!==t&&cc.warn("Track index can not greater than 0 in cached mode."),!this._skeletonCache)return null;var n=this._skeletonCache.getAnimationCache(this.skeletonData._uuid,e);n||(n=this._skeletonCache.initAnimationCache(this.skeletonData._uuid,e)),n&&(this._isAniComplete=!1,this._accTime=0,this._playCount=0,this._frameCache=n,this.attachUtil._hasAttachedNode()&&this._frameCache.enableCacheAttachedInfo(),this._frameCache.updateToFrame(0),this._curFrame=this._frameCache.frames[0])}else if(this._skeleton){var r=this._skeleton.data.findAnimation(e);if(!r)return cc.logID(7509,e),null;var a=this._state.setAnimationWith(t,r,i);return this._state.apply(this._skeleton),a}return null},addAnimation:function(t,e,i,n){if(n=n||0,this.isAnimationCached())0!==t&&cc.warn("Track index can not greater than 0 in cached mode."),this._animationQueue.push({animationName:e,loop:i,delay:n});else if(this._skeleton){var r=this._skeleton.data.findAnimation(e);return r?this._state.addAnimationWith(t,r,i,n):(cc.logID(7510,e),null)}return null},findAnimation:function(t){return this._skeleton?this._skeleton.data.findAnimation(t):null},getCurrent:function(t){if(this.isAnimationCached())cc.warn("'getCurrent' interface can not be invoked in cached mode.");else if(this._state)return this._state.getCurrent(t);return null},clearTracks:function(){this.isAnimationCached()?cc.warn("'clearTracks' interface can not be invoked in cached mode."):this._state&&this._state.clearTracks()},clearTrack:function(t){this.isAnimationCached()?cc.warn("'clearTrack' interface can not be invoked in cached mode."):this._state&&this._state.clearTrack(t)},setStartListener:function(t){this._ensureListener(),this._listener.start=t},setInterruptListener:function(t){this._ensureListener(),this._listener.interrupt=t},setEndListener:function(t){this._ensureListener(),this._listener.end=t},setDisposeListener:function(t){this._ensureListener(),this._listener.dispose=t},setCompleteListener:function(t){this._ensureListener(),this._listener.complete=t},setEventListener:function(t){this._ensureListener(),this._listener.event=t},setTrackStartListener:function(t,e){i.getListeners(t).start=e},setTrackInterruptListener:function(t,e){i.getListeners(t).interrupt=e},setTrackEndListener:function(t,e){i.getListeners(t).end=e},setTrackDisposeListener:function(t,e){i.getListeners(t).dispose=e},setTrackCompleteListener:function(t,e){i.getListeners(t).complete=function(t){var i=Math.floor(t.trackTime/t.animationEnd);e(t,i)}},setTrackEventListener:function(t,e){i.getListeners(t).event=e},getState:function(){return this._state},_resetDefaultAnim:!1,_resetDefaultSkin:!1,_updateAnimEnum:!1,_updateSkinEnum:!1,_ensureListener:function(){this._listener||(this._listener=new i,this._state&&this._state.addListener(this._listener))},_updateSkeletonData:function(){if(this.skeletonData){var t=this.skeletonData.getRuntimeData();if(t){try{this.setSkeletonData(t),this.isAnimationCached()||this.setAnimationStateData(new r.AnimationStateData(this._skeleton.data)),this.defaultSkin&&this.setSkin(this.defaultSkin)}catch(e){cc.warn(e)}this.attachUtil.init(this),this.attachUtil._associateAttachedNode(),this._preCacheMode=this._cacheMode,this.animation=this.defaultAnimation}else this.disableRender()}else this.disableRender()},_refreshInspector:function(){this._updateAnimEnum(),this._updateSkinEnum(),Editor.Utils.refreshSelectedInspector("node",this.node.uuid)},_updateDebugDraw:function(){if(this.debugBones||this.debugSlots){if(!this._debugRenderer){var t=new cc.PrivateNode;t.name="DEBUG_DRAW_NODE";var e=t.addComponent(a);e.lineWidth=1,e.strokeColor=cc.color(255,0,0,255),this._debugRenderer=e}this._debugRenderer.node.parent=this.node,this.isAnimationCached()&&cc.warn("Debug bones or slots is invalid in cached mode")}else this._debugRenderer&&(this._debugRenderer.node.parent=null)}}),e.exports=sp.Skeleton}),{"../../cocos2d/core/components/CCRenderComponent":115,"../../cocos2d/core/graphics/graphics":157,"../../cocos2d/core/renderer/render-flow":200,"./AttachUtil":330,"./lib/spine":333,"./skeleton-cache":334,"./track-entry-listeners":338}],332:[(function(t){"use strict";var e="undefined"==typeof window?global:window;e.spine=t("./lib/spine"),e.sp=e.sp||{},sp._timeScale=1,Object.defineProperty(sp,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale=t},configurable:!0}),sp.ATTACHMENT_TYPE={REGION:0,BOUNDING_BOX:1,MESH:2,SKINNED_MESH:3},sp.AnimationEventType=cc.Enum({START:0,INTERRUPT:1,END:2,DISPOSE:3,COMPLETE:4,EVENT:5}),sp.spine=e.spine,t("./skeleton-texture"),t("./skeleton-data"),t("./vertex-effect-delegate"),t("./Skeleton"),t("./spine-assembler")}),{"./Skeleton":331,"./lib/spine":333,"./skeleton-data":335,"./skeleton-texture":336,"./spine-assembler":337,"./vertex-effect-delegate":339}],333:[(function(t,e){"use strict";var i,n,r,a=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});(function(t){var e,i,n,r=(function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n<e.length;n++)this.timelineIds[e[n].getPropertyId()]=!0;this.duration=i}return t.prototype.hasTimeline=function(t){return 1==this.timelineIds[t]},t.prototype.apply=function(t,e,i,n,r,a,s,o){if(null==t)throw new Error("skeleton cannot be null.");n&&0!=this.duration&&(i%=this.duration,e>0&&(e%=this.duration));for(var c=this.timelines,l=0,h=c.length;l<h;l++)c[l].apply(t,e,i,r,a,s,o)},t.binarySearch=function(t,e,i){void 0===i&&(i=1);var n=0,r=t.length/i-2;if(0==r)return i;for(var a=r>>>1;;){if(t[(a+1)*i]<=e?n=a+1:r=a,n==r)return(n+1)*i;a=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t})();t.Animation=r,(function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"})(e=t.MixBlend||(t.MixBlend={})),(function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"})(i=t.MixDirection||(t.MixDirection={})),(function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"})(n=t.TimelineType||(t.TimelineType={}));var s=(function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,a){var s=.03*(2*-i+r),o=.03*(2*-n+a),c=.006*(3*(i-r)+1),l=.006*(3*(n-a)+1),h=2*s+c,u=2*o+l,f=.3*i+s+.16666667*c,_=.3*n+o+.16666667*l,d=t*e.BEZIER_SIZE,p=this.curves;p[d++]=e.BEZIER;for(var m=f,v=_,g=d+e.BEZIER_SIZE-1;d<g;d+=2)p[d]=m,p[d+1]=v,f+=h,_+=u,h+=c,u+=l,m+=f,v+=_},e.prototype.getCurvePercent=function(i,n){n=t.MathUtils.clamp(n,0,1);var r=this.curves,a=i*e.BEZIER_SIZE,s=r[a];if(s==e.LINEAR)return n;if(s==e.STEPPED)return 0;for(var o=0,c=++a,l=a+e.BEZIER_SIZE-1;a<l;a+=2)if((o=r[a])>=n){var h=void 0,u=void 0;return a==c?(h=0,u=0):(h=r[a-2],u=r[a-1]),u+(r[a+1]-u)*(n-h)/(o-h)}var f=r[a-1];return f+(1-f)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e})();t.CurveTimeline=s;var o=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},s.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+s.ROTATION]=i},s.prototype.apply=function(t,i,n,a,o,c){var l=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n<l[0])switch(c){case e.setup:return void(h.rotation=h.data.rotation);case e.first:var u=h.data.rotation-h.rotation;h.rotation+=(u-360*(16384-(16384.499999999996-u/360|0)))*o}else if(n>=l[l.length-s.ENTRIES]){var f=l[l.length+s.PREV_ROTATION];switch(c){case e.setup:h.rotation=h.data.rotation+f*o;break;case e.first:case e.replace:f+=h.data.rotation-h.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:h.rotation+=f*o}}else{var _=r.binarySearch(l,n,s.ENTRIES),d=l[_+s.PREV_ROTATION],p=l[_],m=this.getCurvePercent((_>>1)-1,1-(n-p)/(l[_+s.PREV_TIME]-p)),v=l[_+s.ROTATION]-d;switch(v=d+(v-360*(16384-(16384.499999999996-v/360|0)))*m,c){case e.setup:h.rotation=h.data.rotation+(v-360*(16384-(16384.499999999996-v/360|0)))*o;break;case e.first:case e.replace:v+=h.data.rotation-h.rotation;case e.add:h.rotation+=(v-360*(16384-(16384.499999999996-v/360|0)))*o}}},s.ENTRIES=2,s.PREV_TIME=-2,s.PREV_ROTATION=-1,s.ROTATION=1,s})(s);t.RotateTimeline=o;var c=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*s.ENTRIES),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},s.prototype.setFrame=function(t,e,i,n){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.X]=i,this.frames[t+s.Y]=n},s.prototype.apply=function(t,i,n,a,o,c){var l=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n<l[0])switch(c){case e.setup:return h.x=h.data.x,void(h.y=h.data.y);case e.first:h.x+=(h.data.x-h.x)*o,h.y+=(h.data.y-h.y)*o}else{var u=0,f=0;if(n>=l[l.length-s.ENTRIES])u=l[l.length+s.PREV_X],f=l[l.length+s.PREV_Y];else{var _=r.binarySearch(l,n,s.ENTRIES);u=l[_+s.PREV_X],f=l[_+s.PREV_Y];var d=l[_],p=this.getCurvePercent(_/s.ENTRIES-1,1-(n-d)/(l[_+s.PREV_TIME]-d));u+=(l[_+s.X]-u)*p,f+=(l[_+s.Y]-f)*p}switch(c){case e.setup:h.x=h.data.x+u*o,h.y=h.data.y+f*o;break;case e.first:case e.replace:h.x+=(h.data.x+u-h.x)*o,h.y+=(h.data.y+f-h.y)*o;break;case e.add:h.x+=u*o,h.y+=f*o}}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_X=-2,s.PREV_Y=-1,s.X=1,s.Y=2,s})(s);t.TranslateTimeline=c;var l=(function(s){function o(t){return s.call(this,t)||this}return a(o,s),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,a,s,c,l,h,u){var f=this.frames,_=n.bones[this.boneIndex];if(_.active)if(s<f[0])switch(h){case e.setup:return _.scaleX=_.data.scaleX,void(_.scaleY=_.data.scaleY);case e.first:_.scaleX+=(_.data.scaleX-_.scaleX)*l,_.scaleY+=(_.data.scaleY-_.scaleY)*l}else{var d=0,p=0;if(s>=f[f.length-o.ENTRIES])d=f[f.length+o.PREV_X]*_.data.scaleX,p=f[f.length+o.PREV_Y]*_.data.scaleY;else{var m=r.binarySearch(f,s,o.ENTRIES);d=f[m+o.PREV_X],p=f[m+o.PREV_Y];var v=f[m],g=this.getCurvePercent(m/o.ENTRIES-1,1-(s-v)/(f[m+o.PREV_TIME]-v));d=(d+(f[m+o.X]-d)*g)*_.data.scaleX,p=(p+(f[m+o.Y]-p)*g)*_.data.scaleY}if(1==l)h==e.add?(_.scaleX+=d-_.data.scaleX,_.scaleY+=p-_.data.scaleY):(_.scaleX=d,_.scaleY=p);else{var y=0,T=0;if(u==i.mixOut)switch(h){case e.setup:y=_.data.scaleX,T=_.data.scaleY,_.scaleX=y+(Math.abs(d)*t.MathUtils.signum(y)-y)*l,_.scaleY=T+(Math.abs(p)*t.MathUtils.signum(T)-T)*l;break;case e.first:case e.replace:y=_.scaleX,T=_.scaleY,_.scaleX=y+(Math.abs(d)*t.MathUtils.signum(y)-y)*l,_.scaleY=T+(Math.abs(p)*t.MathUtils.signum(T)-T)*l;break;case e.add:y=_.scaleX,T=_.scaleY,_.scaleX=y+(Math.abs(d)*t.MathUtils.signum(y)-_.data.scaleX)*l,_.scaleY=T+(Math.abs(p)*t.MathUtils.signum(T)-_.data.scaleY)*l}else switch(h){case e.setup:y=Math.abs(_.data.scaleX)*t.MathUtils.signum(d),T=Math.abs(_.data.scaleY)*t.MathUtils.signum(p),_.scaleX=y+(d-y)*l,_.scaleY=T+(p-T)*l;break;case e.first:case e.replace:y=Math.abs(_.scaleX)*t.MathUtils.signum(d),T=Math.abs(_.scaleY)*t.MathUtils.signum(p),_.scaleX=y+(d-y)*l,_.scaleY=T+(p-T)*l;break;case e.add:y=t.MathUtils.signum(d),T=t.MathUtils.signum(p),_.scaleX=Math.abs(_.scaleX)*y+(d-Math.abs(_.data.scaleX)*y)*l,_.scaleY=Math.abs(_.scaleY)*T+(p-Math.abs(_.data.scaleY)*T)*l}}}},o})(c);t.ScaleTimeline=l;var h=(function(t){function i(e){return t.call(this,e)||this}return a(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,a,s,o,c){var l=this.frames,h=t.bones[this.boneIndex];if(h.active)if(a<l[0])switch(c){case e.setup:return h.shearX=h.data.shearX,void(h.shearY=h.data.shearY);case e.first:h.shearX+=(h.data.shearX-h.shearX)*o,h.shearY+=(h.data.shearY-h.shearY)*o}else{var u=0,f=0;if(a>=l[l.length-i.ENTRIES])u=l[l.length+i.PREV_X],f=l[l.length+i.PREV_Y];else{var _=r.binarySearch(l,a,i.ENTRIES);u=l[_+i.PREV_X],f=l[_+i.PREV_Y];var d=l[_],p=this.getCurvePercent(_/i.ENTRIES-1,1-(a-d)/(l[_+i.PREV_TIME]-d));u+=(l[_+i.X]-u)*p,f+=(l[_+i.Y]-f)*p}switch(c){case e.setup:h.shearX=h.data.shearX+u*o,h.shearY=h.data.shearY+f*o;break;case e.first:case e.replace:h.shearX+=(h.data.shearX+u-h.shearX)*o,h.shearY+=(h.data.shearY+f-h.shearY)*o;break;case e.add:h.shearX+=u*o,h.shearY+=f*o}}},i})(c);t.ShearTimeline=h;var u=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*s.ENTRIES),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},s.prototype.setFrame=function(t,e,i,n,r,a){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.R]=i,this.frames[t+s.G]=n,this.frames[t+s.B]=r,this.frames[t+s.A]=a},s.prototype.apply=function(t,i,n,a,o,c){var l=t.slots[this.slotIndex];if(l.bone.active){var h=this.frames;if(n<h[0])switch(c){case e.setup:return void l.color.setFromColor(l.data.color);case e.first:var u=l.color,f=l.data.color;u.add((f.r-u.r)*o,(f.g-u.g)*o,(f.b-u.b)*o,(f.a-u.a)*o)}else{var _=0,d=0,p=0,m=0;if(n>=h[h.length-s.ENTRIES]){var v=h.length;_=h[v+s.PREV_R],d=h[v+s.PREV_G],p=h[v+s.PREV_B],m=h[v+s.PREV_A]}else{var g=r.binarySearch(h,n,s.ENTRIES);_=h[g+s.PREV_R],d=h[g+s.PREV_G],p=h[g+s.PREV_B],m=h[g+s.PREV_A];var y=h[g],T=this.getCurvePercent(g/s.ENTRIES-1,1-(n-y)/(h[g+s.PREV_TIME]-y));_+=(h[g+s.R]-_)*T,d+=(h[g+s.G]-d)*T,p+=(h[g+s.B]-p)*T,m+=(h[g+s.A]-m)*T}1==o?l.color.set(_,d,p,m):(u=l.color,c==e.setup&&u.setFromColor(l.data.color),u.add((_-u.r)*o,(d-u.g)*o,(p-u.b)*o,(m-u.a)*o))}}},s.ENTRIES=5,s.PREV_TIME=-5,s.PREV_R=-4,s.PREV_G=-3,s.PREV_B=-2,s.PREV_A=-1,s.R=1,s.G=2,s.B=3,s.A=4,s})(s);t.ColorTimeline=u;var f=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*s.ENTRIES),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},s.prototype.setFrame=function(t,e,i,n,r,a,o,c,l){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.R]=i,this.frames[t+s.G]=n,this.frames[t+s.B]=r,this.frames[t+s.A]=a,this.frames[t+s.R2]=o,this.frames[t+s.G2]=c,this.frames[t+s.B2]=l},s.prototype.apply=function(t,i,n,a,o,c){var l=t.slots[this.slotIndex];if(l.bone.active){var h=this.frames;if(n<h[0])switch(c){case e.setup:return l.color.setFromColor(l.data.color),void l.darkColor.setFromColor(l.data.darkColor);case e.first:var u=l.color,f=l.darkColor,_=l.data.color,d=l.data.darkColor;u.add((_.r-u.r)*o,(_.g-u.g)*o,(_.b-u.b)*o,(_.a-u.a)*o),f.add((d.r-f.r)*o,(d.g-f.g)*o,(d.b-f.b)*o,0)}else{var p=0,m=0,v=0,g=0,y=0,T=0,A=0;if(n>=h[h.length-s.ENTRIES]){var b=h.length;p=h[b+s.PREV_R],m=h[b+s.PREV_G],v=h[b+s.PREV_B],g=h[b+s.PREV_A],y=h[b+s.PREV_R2],T=h[b+s.PREV_G2],A=h[b+s.PREV_B2]}else{var E=r.binarySearch(h,n,s.ENTRIES);p=h[E+s.PREV_R],m=h[E+s.PREV_G],v=h[E+s.PREV_B],g=h[E+s.PREV_A],y=h[E+s.PREV_R2],T=h[E+s.PREV_G2],A=h[E+s.PREV_B2];var C=h[E],x=this.getCurvePercent(E/s.ENTRIES-1,1-(n-C)/(h[E+s.PREV_TIME]-C));p+=(h[E+s.R]-p)*x,m+=(h[E+s.G]-m)*x,v+=(h[E+s.B]-v)*x,g+=(h[E+s.A]-g)*x,y+=(h[E+s.R2]-y)*x,T+=(h[E+s.G2]-T)*x,A+=(h[E+s.B2]-A)*x}1==o?(l.color.set(p,m,v,g),l.darkColor.set(y,T,A,1)):(u=l.color,f=l.darkColor,c==e.setup&&(u.setFromColor(l.data.color),f.setFromColor(l.data.darkColor)),u.add((p-u.r)*o,(m-u.g)*o,(v-u.b)*o,(g-u.a)*o),f.add((y-f.r)*o,(T-f.g)*o,(A-f.b)*o,0))}}},s.ENTRIES=8,s.PREV_TIME=-8,s.PREV_R=-7,s.PREV_G=-6,s.PREV_B=-5,s.PREV_A=-4,s.PREV_R2=-3,s.PREV_G2=-2,s.PREV_B2=-1,s.R=1,s.G=2,s.B=3,s.A=4,s.R2=5,s.G2=6,s.B2=7,s})(s);t.TwoColorTimeline=f;var _=(function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return a.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},a.prototype.apply=function(t,n,a,s,o,c,l){var h=t.slots[this.slotIndex];if(h.bone.active)if(l!=i.mixOut||c!=e.setup){var u=this.frames;if(a<u[0]){if(c==e.setup||c==e.first){var f=h.data.attachmentName;h.setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else{var _;_=a>=u[u.length-1]?u.length-1:r.binarySearch(u,a,1)-1;var d=this.attachmentNames[_];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var p=h.data.attachmentName;h.setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}},a})();t.AttachmentTimeline=_;var d=null,p=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==d&&(d=t.Utils.newFloatArray(64)),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},s.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},s.prototype.apply=function(i,n,a,s,o,c){var l=i.slots[this.slotIndex];if(l.bone.active){var h=l.getAttachment();if(h instanceof t.VertexAttachment&&h.deformAttachment==this.attachment){var u=l.deform;0==u.length&&(c=e.setup);var f=this.frameVertices,_=f[0].length,d=this.frames;if(a<d[0]){var p=h;switch(c){case e.setup:return void(u.length=0);case e.first:if(1==o){u.length=0;break}var m=t.Utils.setArraySize(u,_);if(null==p.bones)for(var v=p.vertices,g=0;g<_;g++)m[g]+=(v[g]-m[g])*o;else for(o=1-o,g=0;g<_;g++)m[g]*=o}}else{var y=t.Utils.setArraySize(u,_);if(a>=d[d.length-1]){var T=f[d.length-1];if(1==o)if(c==e.add)if(null==(p=h).bones){v=p.vertices;for(var A=0;A<_;A++)y[A]+=T[A]-v[A]}else for(var b=0;b<_;b++)y[b]+=T[b];else t.Utils.arrayCopy(T,0,y,0,_);else switch(c){case e.setup:var E=h;if(null==E.bones){v=E.vertices;for(var C=0;C<_;C++){var x=v[C];y[C]=x+(T[C]-x)*o}}else for(var S=0;S<_;S++)y[S]=T[S]*o;break;case e.first:case e.replace:for(var w=0;w<_;w++)y[w]+=(T[w]-y[w])*o;case e.add:if(null==(p=h).bones){v=p.vertices;for(var D=0;D<_;D++)y[D]+=(T[D]-v[D])*o}else for(var M=0;M<_;M++)y[M]+=T[M]*o}}else{var R=r.binarySearch(d,a),I=f[R-1],O=f[R],P=d[R],N=this.getCurvePercent(R-1,1-(a-P)/(d[R-1]-P));if(1==o)if(c==e.add)if(null==(p=h).bones){v=p.vertices;for(var F=0;F<_;F++){var L=I[F];y[F]+=L+(O[F]-L)*N-v[F]}}else for(var B=0;B<_;B++)L=I[B],y[B]+=L+(O[B]-L)*N;else for(var k=0;k<_;k++)L=I[k],y[k]=L+(O[k]-L)*N;else switch(c){case e.setup:var V=h;if(null==V.bones){v=V.vertices;for(var U=0;U<_;U++)L=I[U],x=v[U],y[U]=x+(L+(O[U]-L)*N-x)*o}else for(var z=0;z<_;z++)L=I[z],y[z]=(L+(O[z]-L)*N)*o;break;case e.first:case e.replace:for(var G=0;G<_;G++)L=I[G],y[G]+=(L+(O[G]-L)*N-y[G])*o;break;case e.add:if(null==(p=h).bones){v=p.vertices;for(var H=0;H<_;H++)L=I[H],y[H]+=(L+(O[H]-L)*N-v[H])*o}else for(var W=0;W<_;W++)L=I[W],y[W]+=(L+(O[W]-L)*N)*o}}}}}},s})(s);t.DeformTimeline=p;var m=(function(){function e(e){this.frames=t.Utils.newFloatArray(e),this.events=new Array(e)}return e.prototype.getPropertyId=function(){return n.event<<24},e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,i,n,a,s,o){if(null!=n){var c=this.frames,l=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,n,a,s,o),e=-1;else if(e>=c[l-1])return;if(!(i<c[0])){var h=0;if(e<c[0])h=0;else for(var u=c[h=r.binarySearch(c,e)];h>0&&c[h-1]==u;)h--;for(;h<l&&i>=c[h];h++)n.push(this.events[h])}}},e})();t.EventTimeline=m;var v=(function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return a.prototype.getPropertyId=function(){return n.drawOrder<<24},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},a.prototype.apply=function(n,a,s,o,c,l,h){var u=n.drawOrder,f=n.slots;if(h!=i.mixOut||l!=e.setup){var _=this.frames;if(s<_[0])l!=e.setup&&l!=e.first||t.Utils.arrayCopy(n.slots,0,n.drawOrder,0,n.slots.length);else{var d;d=s>=_[_.length-1]?_.length-1:r.binarySearch(_,s)-1;var p=this.drawOrders[d];if(null==p)t.Utils.arrayCopy(f,0,u,0,f.length);else for(var m=0,v=p.length;m<v;m++)u[m]=f[p[m]]}}else t.Utils.arrayCopy(n.slots,0,n.drawOrder,0,n.slots.length)},a})();t.DrawOrderTimeline=v;var g=(function(s){function o(e){var i=s.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return a(o,s),o.prototype.getPropertyId=function(){return(n.ikConstraint<<24)+this.ikConstraintIndex},o.prototype.setFrame=function(t,e,i,n,r,a,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.MIX]=i,this.frames[t+o.SOFTNESS]=n,this.frames[t+o.BEND_DIRECTION]=r,this.frames[t+o.COMPRESS]=a?1:0,this.frames[t+o.STRETCH]=s?1:0},o.prototype.apply=function(t,n,a,s,c,l,h){var u=this.frames,f=t.ikConstraints[this.ikConstraintIndex];if(f.active)if(a<u[0])switch(l){case e.setup:return f.mix=f.data.mix,f.softness=f.data.softness,f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,void(f.stretch=f.data.stretch);case e.first:f.mix+=(f.data.mix-f.mix)*c,f.softness+=(f.data.softness-f.softness)*c,f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch}else if(a>=u[u.length-o.ENTRIES])l==e.setup?(f.mix=f.data.mix+(u[u.length+o.PREV_MIX]-f.data.mix)*c,f.softness=f.data.softness+(u[u.length+o.PREV_SOFTNESS]-f.data.softness)*c,h==i.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=u[u.length+o.PREV_BEND_DIRECTION],f.compress=0!=u[u.length+o.PREV_COMPRESS],f.stretch=0!=u[u.length+o.PREV_STRETCH])):(f.mix+=(u[u.length+o.PREV_MIX]-f.mix)*c,f.softness+=(u[u.length+o.PREV_SOFTNESS]-f.softness)*c,h==i.mixIn&&(f.bendDirection=u[u.length+o.PREV_BEND_DIRECTION],f.compress=0!=u[u.length+o.PREV_COMPRESS],f.stretch=0!=u[u.length+o.PREV_STRETCH]));else{var _=r.binarySearch(u,a,o.ENTRIES),d=u[_+o.PREV_MIX],p=u[_+o.PREV_SOFTNESS],m=u[_],v=this.getCurvePercent(_/o.ENTRIES-1,1-(a-m)/(u[_+o.PREV_TIME]-m));l==e.setup?(f.mix=f.data.mix+(d+(u[_+o.MIX]-d)*v-f.data.mix)*c,f.softness=f.data.softness+(p+(u[_+o.SOFTNESS]-p)*v-f.data.softness)*c,h==i.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=u[_+o.PREV_BEND_DIRECTION],f.compress=0!=u[_+o.PREV_COMPRESS],f.stretch=0!=u[_+o.PREV_STRETCH])):(f.mix+=(d+(u[_+o.MIX]-d)*v-f.mix)*c,f.softness+=(p+(u[_+o.SOFTNESS]-p)*v-f.softness)*c,h==i.mixIn&&(f.bendDirection=u[_+o.PREV_BEND_DIRECTION],f.compress=0!=u[_+o.PREV_COMPRESS],f.stretch=0!=u[_+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o})(s);t.IkConstraintTimeline=g;var y=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*s.ENTRIES),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},s.prototype.setFrame=function(t,e,i,n,r,a){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.ROTATE]=i,this.frames[t+s.TRANSLATE]=n,this.frames[t+s.SCALE]=r,this.frames[t+s.SHEAR]=a},s.prototype.apply=function(t,i,n,a,o,c){var l=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(n<l[0]){var u=h.data;switch(c){case e.setup:return h.rotateMix=u.rotateMix,h.translateMix=u.translateMix,h.scaleMix=u.scaleMix,void(h.shearMix=u.shearMix);case e.first:h.rotateMix+=(u.rotateMix-h.rotateMix)*o,h.translateMix+=(u.translateMix-h.translateMix)*o,h.scaleMix+=(u.scaleMix-h.scaleMix)*o,h.shearMix+=(u.shearMix-h.shearMix)*o}}else{var f=0,_=0,d=0,p=0;if(n>=l[l.length-s.ENTRIES]){var m=l.length;f=l[m+s.PREV_ROTATE],_=l[m+s.PREV_TRANSLATE],d=l[m+s.PREV_SCALE],p=l[m+s.PREV_SHEAR]}else{var v=r.binarySearch(l,n,s.ENTRIES);f=l[v+s.PREV_ROTATE],_=l[v+s.PREV_TRANSLATE],d=l[v+s.PREV_SCALE],p=l[v+s.PREV_SHEAR];var g=l[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(n-g)/(l[v+s.PREV_TIME]-g));f+=(l[v+s.ROTATE]-f)*y,_+=(l[v+s.TRANSLATE]-_)*y,d+=(l[v+s.SCALE]-d)*y,p+=(l[v+s.SHEAR]-p)*y}c==e.setup?(u=h.data,h.rotateMix=u.rotateMix+(f-u.rotateMix)*o,h.translateMix=u.translateMix+(_-u.translateMix)*o,h.scaleMix=u.scaleMix+(d-u.scaleMix)*o,h.shearMix=u.shearMix+(p-u.shearMix)*o):(h.rotateMix+=(f-h.rotateMix)*o,h.translateMix+=(_-h.translateMix)*o,h.scaleMix+=(d-h.scaleMix)*o,h.shearMix+=(p-h.shearMix)*o)}},s.ENTRIES=5,s.PREV_TIME=-5,s.PREV_ROTATE=-4,s.PREV_TRANSLATE=-3,s.PREV_SCALE=-2,s.PREV_SHEAR=-1,s.ROTATE=1,s.TRANSLATE=2,s.SCALE=3,s.SHEAR=4,s})(s);t.TransformConstraintTimeline=y;var T=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*s.ENTRIES),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},s.prototype.setFrame=function(t,e,i){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.VALUE]=i},s.prototype.apply=function(t,i,n,a,o,c){var l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n<l[0])switch(c){case e.setup:return void(h.position=h.data.position);case e.first:h.position+=(h.data.position-h.position)*o}else{var u=0;if(n>=l[l.length-s.ENTRIES])u=l[l.length+s.PREV_VALUE];else{var f=r.binarySearch(l,n,s.ENTRIES);u=l[f+s.PREV_VALUE];var _=l[f],d=this.getCurvePercent(f/s.ENTRIES-1,1-(n-_)/(l[f+s.PREV_TIME]-_));u+=(l[f+s.VALUE]-u)*d}c==e.setup?h.position=h.data.position+(u-h.data.position)*o:h.position+=(u-h.position)*o}},s.ENTRIES=2,s.PREV_TIME=-2,s.PREV_VALUE=-1,s.VALUE=1,s})(s);t.PathConstraintPositionTimeline=T;var A=(function(t){function i(e){return t.call(this,e)||this}return a(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,a,s,o,c){var l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(a<l[0])switch(c){case e.setup:return void(h.spacing=h.data.spacing);case e.first:h.spacing+=(h.data.spacing-h.spacing)*o}else{var u=0;if(a>=l[l.length-i.ENTRIES])u=l[l.length+i.PREV_VALUE];else{var f=r.binarySearch(l,a,i.ENTRIES);u=l[f+i.PREV_VALUE];var _=l[f],d=this.getCurvePercent(f/i.ENTRIES-1,1-(a-_)/(l[f+i.PREV_TIME]-_));u+=(l[f+i.VALUE]-u)*d}c==e.setup?h.spacing=h.data.spacing+(u-h.data.spacing)*o:h.spacing+=(u-h.spacing)*o}},i})(T);t.PathConstraintSpacingTimeline=A;var b=(function(i){function s(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*s.ENTRIES),n}return a(s,i),s.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},s.prototype.setFrame=function(t,e,i,n){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.ROTATE]=i,this.frames[t+s.TRANSLATE]=n},s.prototype.apply=function(t,i,n,a,o,c){var l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n<l[0])switch(c){case e.setup:return h.rotateMix=h.data.rotateMix,void(h.translateMix=h.data.translateMix);case e.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*o,h.translateMix+=(h.data.translateMix-h.translateMix)*o}else{var u=0,f=0;if(n>=l[l.length-s.ENTRIES])u=l[l.length+s.PREV_ROTATE],f=l[l.length+s.PREV_TRANSLATE];else{var _=r.binarySearch(l,n,s.ENTRIES);u=l[_+s.PREV_ROTATE],f=l[_+s.PREV_TRANSLATE];var d=l[_],p=this.getCurvePercent(_/s.ENTRIES-1,1-(n-d)/(l[_+s.PREV_TIME]-d));u+=(l[_+s.ROTATE]-u)*p,f+=(l[_+s.TRANSLATE]-f)*p}c==e.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*o,h.translateMix=h.data.translateMix+(f-h.data.translateMix)*o):(h.rotateMix+=(u-h.rotateMix)*o,h.translateMix+=(f-h.translateMix)*o)}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_ROTATE=-2,s.PREV_TRANSLATE=-1,s.ROTATE=1,s.TRANSLATE=2,s})(s);t.PathConstraintMixTimeline=b})(r||(r={})),(function(t){var e=(function(){function e(e){this.tracks=new Array,this.timeScale=1,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool(function(){return new i}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i<n;i++){var r=e[i];if(null!=r){r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;var a=t*r.timeScale;if(r.delay>0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}var s=r.next;if(null!=s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=a,this.setCurrent(i,s,!0);null!=s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var c=r.mixingFrom;for(r.mixingFrom=null,null!=c&&(c.mixingTo=null);null!=c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,a=!1,s=0,o=r.length;s<o;s++){var c=r[s];if(!(null==c||c.delay>0)){a=!0;var l=0==s?t.MixBlend.first:c.mixBlend,h=c.alpha;null!=c.mixingFrom?h*=this.applyMixingFrom(c,i,l):c.trackTime>=c.trackEnd&&null==c.next&&(h=0);var u=c.animationLast,f=c.getAnimationTime(),_=c.animation.timelines.length,d=c.animation.timelines;if(0==s&&1==h||l==t.MixBlend.add)for(var p=0;p<_;p++)t.Utils.webkit602BugfixHelper(h,l),d[p].apply(i,u,f,n,h,l,t.MixDirection.mixIn);else{var m=c.timelineMode,v=0==c.timelinesRotation.length;v&&t.Utils.setArraySize(c.timelinesRotation,_<<1,null);var g=c.timelinesRotation;for(p=0;p<_;p++){var y=d[p],T=(m[p]&e.NOT_LAST-1)==e.SUBSEQUENT?l:t.MixBlend.setup;y instanceof t.RotateTimeline?this.applyRotateTimeline(y,i,f,h,T,g,p<<1,v):(t.Utils.webkit602BugfixHelper(h,l),y.apply(i,u,f,n,h,T,t.MixDirection.mixIn))}}this.queueEvents(c,f),n.length=0,c.nextAnimationLast=f,c.nextTrackLast=c.trackTime}}return this.queue.drain(),a},e.prototype.applyMixingFrom=function(i,n,r){var a=i.mixingFrom;null!=a.mixingFrom&&this.applyMixingFrom(a,n,r);var s=0;0==i.mixDuration?(s=1,r==t.MixBlend.first&&(r=t.MixBlend.setup)):((s=i.mixTime/i.mixDuration)>1&&(s=1),r!=t.MixBlend.first&&(r=a.mixBlend));var o=s<a.eventThreshold?this.events:null,c=s<a.attachmentThreshold,l=s<a.drawOrderThreshold,h=a.animationLast,u=a.getAnimationTime(),f=a.animation.timelines.length,_=a.animation.timelines,d=a.alpha*i.interruptAlpha,p=d*(1-s);if(r==t.MixBlend.add)for(var m=0;m<f;m++)_[m].apply(n,h,u,o,p,r,t.MixDirection.mixOut);else{var v=a.timelineMode,g=a.timelineHoldMix,y=0==a.timelinesRotation.length;y&&t.Utils.setArraySize(a.timelinesRotation,f<<1,null);var T=a.timelinesRotation;for(a.totalAlpha=0,m=0;m<f;m++){var A=_[m],b=t.MixDirection.mixOut,E=void 0,C=0;switch(v[m]&e.NOT_LAST-1){case e.SUBSEQUENT:if(E=r,!c&&A instanceof t.AttachmentTimeline){if((v[m]&e.NOT_LAST)==e.NOT_LAST)continue;E=t.MixBlend.setup}if(!l&&A instanceof t.DrawOrderTimeline)continue;C=p;break;case e.FIRST:E=t.MixBlend.setup,C=p;break;case e.HOLD:E=t.MixBlend.setup,C=d;break;default:E=t.MixBlend.setup;var x=g[m];C=d*Math.max(0,1-x.mixTime/x.mixDuration)}a.totalAlpha+=C,A instanceof t.RotateTimeline?this.applyRotateTimeline(A,n,u,C,E,T,m<<1,y):(t.Utils.webkit602BugfixHelper(C,r),E==t.MixBlend.setup&&(A instanceof t.AttachmentTimeline?(c||(v[m]&e.NOT_LAST)==e.NOT_LAST)&&(b=t.MixDirection.mixIn):A instanceof t.DrawOrderTimeline&&l&&(b=t.MixDirection.mixIn)),A.apply(n,h,u,o,C,E,b))}}return i.mixDuration>0&&this.queueEvents(a,u),this.events.length=0,a.nextAnimationLast=u,a.nextTrackLast=a.trackTime,s},e.prototype.applyRotateTimeline=function(e,i,n,r,a,s,o,c){if(c&&(s[o]=0),1!=r){var l=e,h=l.frames,u=i.bones[l.boneIndex];if(u.active){var f=0,_=0;if(n<h[0])switch(a){case t.MixBlend.setup:u.rotation=u.data.rotation;default:return;case t.MixBlend.first:f=u.rotation,_=u.data.rotation}else if(f=a==t.MixBlend.setup?u.data.rotation:u.rotation,n>=h[h.length-t.RotateTimeline.ENTRIES])_=u.data.rotation+h[h.length+t.RotateTimeline.PREV_ROTATION];else{var d=t.Animation.binarySearch(h,n,t.RotateTimeline.ENTRIES),p=h[d+t.RotateTimeline.PREV_ROTATION],m=h[d],v=l.getCurvePercent((d>>1)-1,1-(n-m)/(h[d+t.RotateTimeline.PREV_TIME]-m));_=h[d+t.RotateTimeline.ROTATION]-p,_=p+(_-=360*(16384-(16384.499999999996-_/360|0)))*v+u.data.rotation,_-=360*(16384-(16384.499999999996-_/360|0))}var g=0,y=_-f;if(0==(y-=360*(16384-(16384.499999999996-y/360|0))))g=s[o];else{var T=0,A=0;c?(T=0,A=y):(T=s[o],A=s[o+1]);var b=y>0,E=T>=0;t.MathUtils.signum(A)!=t.MathUtils.signum(y)&&Math.abs(A)<=90&&(Math.abs(T)>180&&(T+=360*t.MathUtils.signum(T)),E=b),g=y+T-T%360,E!=b&&(g+=360*t.MathUtils.signum(T)),s[o]=g}s[o+1]=y,f+=g*r,u.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(i,0,n,null,1,a,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,a=t.trackLast%r,s=this.events,o=0,c=s.length;o<c;o++){var l=s[o];if(l.time<a)break;l.time>n||this.queue.event(t,l)}for((t.loop?0==r||a>t.trackTime%r:e>=n&&t.animationLast<n)&&this.queue.complete(t);o<c;o++)s[o].time<i||this.queue.event(t,s[o])},e.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,i=this.tracks.length;e<i;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var a=this.trackEntry(t,e,i,r);return this.setCurrent(t,a,n),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var a=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,a,!0),this.queue.drain();else if(r.next=a,n<=0){var s=r.animationEnd-r.animationStart;0!=s?(r.loop?n+=s*(1+(r.trackTime/s|0)):n+=Math.max(s,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return a.delay=n,a},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i<n;i++){var r=this.tracks[i];null!=r&&this.setEmptyAnimation(r.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.prototype.expandToIndex=function(e){return e<this.tracks.length?this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)},e.prototype.trackEntry=function(t,e,i,n){var r=this.trackEntryPool.obtain();return r.trackIndex=t,r.animation=e,r.loop=i,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=e.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=null==n?0:this.data.getMix(n.animation,e),r},e.prototype.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var e=0,i=this.tracks.length;e<i;e++)if(null!=(n=this.tracks[e])){for(;null!=n.mixingFrom;)n=n.mixingFrom;do{null!=n.mixingFrom&&n.mixBlend==t.MixBlend.add||this.computeHold(n),n=n.mixingTo}while(null!=n)}for(this.propertyIDs.clear(),e=this.tracks.length-1;e>=0;e--)for(var n=this.tracks[e];null!=n;)this.computeNotLast(n),n=n.mixingFrom},e.prototype.computeHold=function(i){var n=i.mixingTo,r=i.animation.timelines,a=i.animation.timelines.length,s=t.Utils.setArraySize(i.timelineMode,a);i.timelineHoldMix.length=0;var o=t.Utils.setArraySize(i.timelineHoldMix,a),c=this.propertyIDs;if(null!=n&&n.holdPrevious)for(var l=0;l<a;l++)c.add(r[l].getPropertyId()),s[l]=e.HOLD;else t:for(l=0;l<a;l++){var h=r[l],u=h.getPropertyId();if(c.add(u))if(null==n||h instanceof t.AttachmentTimeline||h instanceof t.DrawOrderTimeline||h instanceof t.EventTimeline||!n.animation.hasTimeline(u))s[l]=e.FIRST;else{for(var f=n.mixingTo;null!=f;f=f.mixingTo)if(!f.animation.hasTimeline(u)){if(i.mixDuration>0){s[l]=e.HOLD_MIX,o[l]=f;continue t}break}s[l]=e.HOLD}else s[l]=e.SUBSEQUENT}},e.prototype.computeNotLast=function(i){for(var n=i.animation.timelines,r=i.animation.timelines.length,a=i.timelineMode,s=this.propertyIDs,o=0;o<r;o++)if(n[o]instanceof t.AttachmentTimeline){var c=n[o];s.add(c.slotIndex)||(a[o]|=e.NOT_LAST)}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("<empty>",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD=2,e.HOLD_MIX=3,e.NOT_LAST=4,e})();t.AnimationState=e;var i=(function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e})();t.TrackEntry=i;var n,r=(function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i<t.length;i+=2){var r=t[i],a=t[i+1];switch(r){case n.start:null!=a.listener&&a.listener.start&&a.listener.start(a);for(var s=0;s<e.length;s++)e[s].start&&e[s].start(a);break;case n.interrupt:for(null!=a.listener&&a.listener.interrupt&&a.listener.interrupt(a),s=0;s<e.length;s++)e[s].interrupt&&e[s].interrupt(a);break;case n.end:for(null!=a.listener&&a.listener.end&&a.listener.end(a),s=0;s<e.length;s++)e[s].end&&e[s].end(a);case n.dispose:for(null!=a.listener&&a.listener.dispose&&a.listener.dispose(a),s=0;s<e.length;s++)e[s].dispose&&e[s].dispose(a);this.animState.trackEntryPool.free(a);break;case n.complete:for(null!=a.listener&&a.listener.complete&&a.listener.complete(a),s=0;s<e.length;s++)e[s].complete&&e[s].complete(a);break;case n.event:var o=t[2+i++];for(null!=a.listener&&a.listener.event&&a.listener.event(a,o),s=0;s<e.length;s++)e[s].event&&e[s].event(a,o)}}this.clear(),this.drainDisabled=!1}},t.prototype.clear=function(){this.objects.length=0},t})();t.EventQueue=r,(function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"})(n=t.EventType||(t.EventType={}));var a=(function(){function t(){}return t.prototype.start=function(){},t.prototype.interrupt=function(){},t.prototype.end=function(){},t.prototype.dispose=function(){},t.prototype.complete=function(){},t.prototype.event=function(){},t})();t.AnimationStateAdapter=a})(r||(r={})),(function(t){var e=(function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,i){var n=this.skeletonData.findAnimation(t);if(null==n)throw new Error("Animation not found: "+t);var r=this.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);this.setMixWith(n,r,i)},t.prototype.setMixWith=function(t,e,i){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var n=t.name+"."+e.name;this.animationToMixTime[n]=i},t.prototype.getMix=function(t,e){var i=t.name+"."+e.name,n=this.animationToMixTime[i];return void 0===n?this.defaultMix:n},t})();t.AnimationStateData=e})(r||(r={})),(function(t){var e=(function(){function e(t,e){void 0===e&&(e=""),this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e}return e.downloadText=function(t,e,i){var n=new XMLHttpRequest;n.open("GET",t,!0),n.onload=function(){200==n.status?e(n.responseText):i(n.status,n.responseText)},n.onerror=function(){i(n.status,n.responseText)},n.send()},e.downloadBinary=function(t,e,i){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status?e(new Uint8Array(n.response)):i(n.status,n.responseText)},n.onerror=function(){i(n.status,n.responseText)},n.send()},e.prototype.loadBinary=function(t,i,n){var r=this;void 0===i&&(i=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad++,e.downloadBinary(t,(function(e){r.assets[t]=e,i&&i(t,e),r.toLoad--,r.loaded++}),(function(e,i){r.errors[t]="Couldn't load binary "+t+": status "+status+", "+i,n&&n(t,"Couldn't load binary "+t+": status "+status+", "+i),r.toLoad--,r.loaded++}))},e.prototype.loadText=function(t,i,n){var r=this;void 0===i&&(i=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad++,e.downloadText(t,(function(e){r.assets[t]=e,i&&i(t,e),r.toLoad--,r.loaded++}),(function(e,i){r.errors[t]="Couldn't load text "+t+": status "+status+", "+i,n&&n(t,"Couldn't load text "+t+": status "+status+", "+i),r.toLoad--,r.loaded++}))},e.prototype.loadTexture=function(t,e,i){var n=this;void 0===e&&(e=null),void 0===i&&(i=null),t=this.pathPrefix+t,this.toLoad++;var r=new Image;r.crossOrigin="anonymous",r.onload=function(){var i=n.textureLoader(r);n.assets[t]=i,n.toLoad--,n.loaded++,e&&e(t,r)},r.onerror=function(){n.errors[t]="Couldn't load image "+t,n.toLoad--,n.loaded++,i&&i(t,"Couldn't load image "+t)},r.src=t},e.prototype.loadTextureData=function(t,e,i,n){var r=this;void 0===i&&(i=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad++;var a=new Image;a.onload=function(){var e=r.textureLoader(a);r.assets[t]=e,r.toLoad--,r.loaded++,i&&i(t,a)},a.onerror=function(){r.errors[t]="Couldn't load image "+t,r.toLoad--,r.loaded++,n&&n(t,"Couldn't load image "+t)},a.src=e},e.prototype.loadTextureAtlas=function(i,n,r){var a=this;void 0===n&&(n=null),void 0===r&&(r=null);var s=i.lastIndexOf("/")>=0?i.substring(0,i.lastIndexOf("/")):"";i=this.pathPrefix+i,this.toLoad++,e.downloadText(i,(function(e){var o={count:0},c=new Array;try{new t.TextureAtlas(e,function(e){c.push(s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)})}catch(_){var l=_;return a.errors[i]="Couldn't load texture atlas "+i+": "+l.message,r&&r(i,"Couldn't load texture atlas "+i+": "+l.message),a.toLoad--,void a.loaded++}for(var h=function(l){var h=!1;a.loadTexture(l,(function(l){if(o.count++,o.count==c.length)if(h)a.errors[i]="Couldn't load texture atlas page "+l+"} of atlas "+i,r&&r(i,"Couldn't load texture atlas page "+l+" of atlas "+i),a.toLoad--,a.loaded++;else try{var u=new t.TextureAtlas(e,function(t){return a.get(s+"/"+t)});a.assets[i]=u,n&&n(i,u),a.toLoad--,a.loaded++}catch(_){var f=_;a.errors[i]="Couldn't load texture atlas "+i+": "+f.message,r&&r(i,"Couldn't load texture atlas "+i+": "+f.message),a.toLoad--,a.loaded++}}),(function(t){h=!0,o.count++,o.count==c.length&&(a.errors[i]="Couldn't load texture atlas page "+t+"} of atlas "+i,r&&r(i,"Couldn't load texture atlas page "+t+" of atlas "+i),a.toLoad--,a.loaded++)}))},u=0,f=c;u<f.length;u++)h(f[u])}),(function(t,e){a.errors[i]="Couldn't load texture atlas "+i+": status "+status+", "+e,r&&r(i,"Couldn't load texture atlas "+i+": status "+status+", "+e),a.toLoad--,a.loaded++}))},e.prototype.get=function(t){return t=this.pathPrefix+t,this.assets[t]},e.prototype.remove=function(t){t=this.pathPrefix+t;var e=this.assets[t];e.dispose&&e.dispose(),this.assets[t]=null},e.prototype.removeAll=function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}},e.prototype.isLoadingComplete=function(){return 0==this.toLoad},e.prototype.getToLoad=function(){return this.toLoad},e.prototype.getLoaded=function(){return this.loaded},e.prototype.dispose=function(){this.removeAll()},e.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},e.prototype.getErrors=function(){return this.errors},e})();t.AssetManager=e})(r||(r={})),(function(t){var e=(function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)return null;r.renderObject=r;var a=new t.RegionAttachment(i);return a.setRegion(r),a},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)return null;r.renderObject=r;var a=new t.MeshAttachment(i);return a.region=r,a},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e})();t.AtlasAttachmentLoader=e})(r||(r={})),(function(t){(function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"})(t.BlendMode||(t.BlendMode={}))})(r||(r={})),(function(t){var e=(function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,a,s,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=a,this.ashearX=s,this.ashearY=o,this.appliedValid=!0;var c=this.parent;if(null==c){var l=this.skeleton,h=n+90+o,u=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(n+s)*r*u,this.b=t.MathUtils.cosDeg(h)*a*u,this.c=t.MathUtils.sinDeg(n+s)*r*f,this.d=t.MathUtils.sinDeg(h)*a*f,this.worldX=e*u+l.x,void(this.worldY=i*f+l.y)}var _=c.a,d=c.b,p=c.c,m=c.d;switch(this.worldX=_*e+d*i+c.worldX,this.worldY=p*e+m*i+c.worldY,this.data.transformMode){case t.TransformMode.Normal:h=n+90+o;var v=t.MathUtils.cosDeg(n+s)*r,g=t.MathUtils.cosDeg(h)*a,y=t.MathUtils.sinDeg(n+s)*r,T=t.MathUtils.sinDeg(h)*a;return this.a=_*v+d*y,this.b=_*g+d*T,this.c=p*v+m*y,void(this.d=p*g+m*T);case t.TransformMode.OnlyTranslation:h=n+90+o,this.a=t.MathUtils.cosDeg(n+s)*r,this.b=t.MathUtils.cosDeg(h)*a,this.c=t.MathUtils.sinDeg(n+s)*r,this.d=t.MathUtils.sinDeg(h)*a;break;case t.TransformMode.NoRotationOrReflection:var A=0;(C=_*_+p*p)>1e-4?(d=p*(C=Math.abs(_*m-d*p)/C),m=_*C,A=Math.atan2(p,_)*t.MathUtils.radDeg):(_=0,p=0,A=90-Math.atan2(m,d)*t.MathUtils.radDeg);var b=n+s-A,E=n+o-A+90;v=t.MathUtils.cosDeg(b)*r,g=t.MathUtils.cosDeg(E)*a,y=t.MathUtils.sinDeg(b)*r,T=t.MathUtils.sinDeg(E)*a,this.a=_*v-d*y,this.b=_*g-d*T,this.c=p*v+m*y,this.d=p*g+m*T;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var C,x=t.MathUtils.cosDeg(n),S=t.MathUtils.sinDeg(n),w=(_*x+d*S)/this.skeleton.scaleX,D=(p*x+m*S)/this.skeleton.scaleY;(C=Math.sqrt(w*w+D*D))>1e-5&&(C=1/C),w*=C,D*=C,C=Math.sqrt(w*w+D*D),this.data.transformMode==t.TransformMode.NoScale&&_*m-d*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(C=-C);var M=Math.PI/2+Math.atan2(D,w),R=Math.cos(M)*C,I=Math.sin(M)*C;v=t.MathUtils.cosDeg(s)*r,g=t.MathUtils.cosDeg(90+o)*a,y=t.MathUtils.sinDeg(s)*r,T=t.MathUtils.sinDeg(90+o)*a,this.a=w*v+R*y,this.b=w*g+R*T,this.c=D*v+I*y,this.d=D*g+I*T}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,a=e.d,s=1/(i*a-n*r),o=this.worldX-e.worldX,c=this.worldY-e.worldY;this.ax=o*a*s-c*n*s,this.ay=c*i*s-o*r*s;var l=s*a,h=s*i,u=s*n,f=s*r,_=l*this.a-u*this.c,d=l*this.b-u*this.d,p=h*this.c-f*this.a,m=h*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(_*_+p*p),this.ascaleX>1e-4){var v=_*m-d*p;this.ascaleY=v/this.ascaleX,this.ashearY=Math.atan2(_*d+p*m,v)*t.MathUtils.radDeg,this.arotation=Math.atan2(p,_)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,a=1/(e*r-i*n),s=t.x-this.worldX,o=t.y-this.worldY;return t.x=s*r*a-o*i*a,t.y=o*e*a-s*n*a,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,a=this.d,s=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=s*i-o*r,this.b=s*n-o*a,this.c=o*i+s*r,this.d=o*n+s*a,this.appliedValid=!1},e})();t.Bone=e})(r||(r={})),(function(t){var e;t.BoneData=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r},(function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"})(e=t.TransformMode||(t.TransformMode={}))})(r||(r={})),(function(t){t.ConstraintData=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i}})(r||(r={})),(function(t){t.Event=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}})(r||(r={})),(function(t){t.EventData=function(t){this.name=t}})(r||(r={})),(function(t){var e=(function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}return e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},e.prototype.apply1=function(e,i,n,r,a,s,o){e.appliedValid||e.updateAppliedTransform();var c=e.parent,l=1/(c.a*c.d-c.b*c.c),h=i-c.worldX,u=n-c.worldY,f=(h*c.d-u*c.b)*l-e.ax,_=(u*c.a-h*c.c)*l-e.ay,d=Math.atan2(_,f)*t.MathUtils.radDeg-e.ashearX-e.arotation;e.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360);var p=e.ascaleX,m=e.ascaleY;if(r||a){var v=e.data.length*p,g=Math.sqrt(f*f+_*_);if(r&&g<v||a&&g>v&&v>1e-4){var y=(g/v-1)*o+1;p*=y,s&&(m*=y)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*o,p,m,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,a,s,o,c){if(0!=c){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,h=e.ay,u=e.ascaleX,f=u,_=e.ascaleY,d=i.ascaleX,p=0,m=0,v=0;u<0?(u=-u,p=180,v=-1):(p=0,v=1),_<0&&(_=-_,v=-v),d<0?(d=-d,m=180):m=0;var g=i.ax,y=0,T=0,A=0,b=e.a,E=e.b,C=e.c,x=e.d,S=Math.abs(u-_)<=1e-4;S?(T=b*g+E*(y=i.ay)+e.worldX,A=C*g+x*y+e.worldY):(y=0,T=b*g+e.worldX,A=C*g+e.worldY);var w=e.parent;b=w.a,E=w.b,C=w.c;var D,M,R=1/(b*(x=w.d)-E*C),I=T-w.worldX,O=A-w.worldY,P=(I*x-O*E)*R-l,N=(O*b-I*C)*R-h,F=Math.sqrt(P*P+N*N),L=i.data.length*d;if(F<1e-4)return this.apply1(e,n,r,!1,s,!1,c),void i.updateWorldTransformWith(g,y,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var B=((I=n-w.worldX)*x-(O=r-w.worldY)*E)*R-l,k=(O*b-I*C)*R-h,V=B*B+k*k;if(0!=o){o*=u*(d+1)/2;var U=Math.sqrt(V),z=U-F-L*u+o;if(z>0){var G=Math.min(1,z/(2*o))-1;V=(B-=(G=(z-o*(1-G*G))/U)*B)*B+(k-=G*k)*k}}t:if(S){var H=(V-F*F-(L*=u)*L)/(2*F*L);H<-1?H=-1:H>1&&(H=1,s&&(f*=(Math.sqrt(V)/(F+L)-1)*c+1)),M=Math.acos(H)*a,b=F+L*H,E=L*Math.sin(M),D=Math.atan2(k*b-B*E,B*b+k*E)}else{var W=(b=u*L)*b,j=(E=_*L)*E,Y=Math.atan2(k,B),X=-2*j*F,q=j-W;if((x=X*X-4*q*(C=j*F*F+W*V-W*j))>=0){var Z=Math.sqrt(x);X<0&&(Z=-Z);var K=(Z=-(X+Z)/2)/q,J=C/Z,Q=Math.abs(K)<Math.abs(J)?K:J;if(Q*Q<=V){O=Math.sqrt(V-Q*Q)*a,D=Y-Math.atan2(O,Q),M=Math.atan2(O/_,(Q-F)/u);break t}}var $=t.MathUtils.PI,tt=F-b,et=tt*tt,it=0,nt=0,rt=F+b,at=rt*rt,st=0;(C=-b*F/(W-j))>=-1&&C<=1&&(C=Math.acos(C),(x=(I=b*Math.cos(C)+F)*I+(O=E*Math.sin(C))*O)<et&&($=C,et=x,tt=I,it=O),x>at&&(nt=C,at=x,rt=I,st=O)),V<=(et+at)/2?(D=Y-Math.atan2(it*a,tt),M=$*a):(D=Y-Math.atan2(st*a,rt),M=nt*a)}var ot=Math.atan2(y,g)*v,ct=e.arotation;(D=(D-ot)*t.MathUtils.radDeg+p-ct)>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(l,h,ct+D*c,f,e.ascaleY,0,0),ct=i.arotation,(M=((M+ot)*t.MathUtils.radDeg-i.ashearX)*v+m-ct)>180?M-=360:M<-180&&(M+=360),i.updateWorldTransformWith(g,y,ct+M*c,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e})();t.IkConstraint=e})(r||(r={})),(function(t){var e=(function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return a(e,t),e})(t.ConstraintData);t.IkConstraintData=e})(r||(r={})),(function(t){var e=(function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i<n;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}return e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var i=this.target.getAttachment();if(i instanceof t.PathAttachment){var n=this.rotateMix,r=this.translateMix,a=n>0;if(r>0||a){var s=this.data,o=s.spacingMode==t.SpacingMode.Percent,c=s.rotateMode,l=c==t.RotateMode.Tangent,h=c==t.RotateMode.ChainScale,u=this.bones.length,f=l?u:u+1,_=this.bones,d=t.Utils.setArraySize(this.spaces,f),p=null,m=this.spacing;if(h||!o){h&&(p=t.Utils.setArraySize(this.lengths,u));for(var v=s.spacingMode==t.SpacingMode.Length,g=0,y=f-1;g<y;){var T=(I=_[g]).data.length;if(T<e.epsilon)h&&(p[g]=0),d[++g]=0;else if(o){if(h){var A=T*I.a,b=T*I.c,E=Math.sqrt(A*A+b*b);p[g]=E}d[++g]=m}else{A=T*I.a,b=T*I.c;var C=Math.sqrt(A*A+b*b);h&&(p[g]=C),d[++g]=(v?T+m:m)*C/T}}}else for(g=1;g<f;g++)d[g]=m;var x=this.computeWorldPositions(i,f,l,s.positionMode==t.PositionMode.Percent,o),S=x[0],w=x[1],D=s.offsetRotation,M=!1;0==D?M=c==t.RotateMode.Chain:(M=!1,D*=(R=this.target.bone).a*R.d-R.b*R.c>0?t.MathUtils.degRad:-t.MathUtils.degRad),g=0;for(var R=3;g<u;g++,R+=3){var I;(I=_[g]).worldX+=(S-I.worldX)*r,I.worldY+=(w-I.worldY)*r;var O=(A=x[R])-S,P=(b=x[R+1])-w;if(h){var N=p[g];if(0!=N){var F=(Math.sqrt(O*O+P*P)/N-1)*n+1;I.a*=F,I.c*=F}}if(S=A,w=b,a){var L=I.a,B=I.b,k=I.c,V=I.d,U=0,z=0,G=0;if(U=l?x[R-1]:0==d[g+1]?x[R+2]:Math.atan2(P,O),U-=Math.atan2(k,L),M){z=Math.cos(U),G=Math.sin(U);var H=I.data.length;S+=(H*(z*L-G*k)-O)*n,w+=(H*(G*L+z*k)-P)*n}else U+=D;U>t.MathUtils.PI?U-=t.MathUtils.PI2:U<-t.MathUtils.PI&&(U+=t.MathUtils.PI2),U*=n,z=Math.cos(U),G=Math.sin(U),I.a=z*L-G*k,I.b=z*B-G*V,I.c=G*L+z*k,I.d=G*B+z*V}I.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,a,s){var o=this.target,c=this.position,l=this.spaces,h=t.Utils.setArraySize(this.positions,3*n+2),u=null,f=i.closed,_=i.worldVerticesLength,d=_/6,p=e.NONE;if(!i.constantSpeed){var m=i.lengths,v=m[d-=f?1:2];if(a&&(c*=v),s)for(var g=1;g<n;g++)l[g]*=v;u=t.Utils.setArraySize(this.world,8),g=0;for(var y=0,T=0;g<n;g++,y+=3){var A=c+=j=l[g];if(f)(A%=v)<0&&(A+=v),T=0;else{if(A<0){p!=e.BEFORE&&(p=e.BEFORE,i.computeWorldVertices(o,2,4,u,0,2)),this.addBeforePosition(A,u,0,h,y);continue}if(A>v){p!=e.AFTER&&(p=e.AFTER,i.computeWorldVertices(o,_-6,4,u,0,2)),this.addAfterPosition(A-v,u,0,h,y);continue}}for(;;T++){var b=m[T];if(!(A>b)){0==T?A/=b:A=(A-(Z=m[T-1]))/(b-Z);break}}T!=p&&(p=T,f&&T==d?(i.computeWorldVertices(o,_-4,4,u,0,2),i.computeWorldVertices(o,0,4,u,4,2)):i.computeWorldVertices(o,6*T+2,8,u,0,2)),this.addCurvePosition(A,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],h,y,r||g>0&&0==j)}return h}f?(_+=2,u=t.Utils.setArraySize(this.world,_),i.computeWorldVertices(o,2,_-4,u,0,2),i.computeWorldVertices(o,0,2,u,_-4,2),u[_-2]=u[0],u[_-1]=u[1]):(d--,_-=4,u=t.Utils.setArraySize(this.world,_),i.computeWorldVertices(o,2,_,u,0,2));for(var E=t.Utils.setArraySize(this.curves,d),C=0,x=u[0],S=u[1],w=0,D=0,M=0,R=0,I=0,O=0,P=0,N=0,F=0,L=0,B=0,k=0,V=0,U=0,z=(g=0,2);g<d;g++,z+=6)w=u[z],D=u[z+1],M=u[z+2],R=u[z+3],B=2*(P=.1875*(x-2*w+M))+(F=.09375*(3*(w-M)-x+(I=u[z+4]))),k=2*(N=.1875*(S-2*D+R))+(L=.09375*(3*(D-R)-S+(O=u[z+5]))),V=.75*(w-x)+P+.16666667*F,U=.75*(D-S)+N+.16666667*L,C+=Math.sqrt(V*V+U*U),V+=B,U+=k,B+=F,k+=L,C+=Math.sqrt(V*V+U*U),V+=B,U+=k,C+=Math.sqrt(V*V+U*U),V+=B+F,U+=k+L,C+=Math.sqrt(V*V+U*U),E[g]=C,x=I,S=O;if(c*=a?C:C/i.lengths[d-1],s)for(g=1;g<n;g++)l[g]*=C;for(var G=this.segments,H=0,W=(g=0,y=0,T=0,0);g<n;g++,y+=3){var j;if(A=c+=j=l[g],f)(A%=C)<0&&(A+=C),T=0;else{if(A<0){this.addBeforePosition(A,u,0,h,y);continue}if(A>C){this.addAfterPosition(A-C,u,_-4,h,y);continue}}for(;;T++){var Y=E[T];if(!(A>Y)){0==T?A/=Y:A=(A-(Z=E[T-1]))/(Y-Z);break}}if(T!=p){p=T;var X=6*T;for(x=u[X],S=u[X+1],w=u[X+2],D=u[X+3],M=u[X+4],R=u[X+5],B=2*(P=.03*(x-2*w+M))+(F=.006*(3*(w-M)-x+(I=u[X+6]))),k=2*(N=.03*(S-2*D+R))+(L=.006*(3*(D-R)-S+(O=u[X+7]))),V=.3*(w-x)+P+.16666667*F,U=.3*(D-S)+N+.16666667*L,H=Math.sqrt(V*V+U*U),G[0]=H,X=1;X<8;X++)V+=B,U+=k,B+=F,k+=L,H+=Math.sqrt(V*V+U*U),G[X]=H;V+=B,U+=k,H+=Math.sqrt(V*V+U*U),G[8]=H,V+=B+F,U+=k+L,H+=Math.sqrt(V*V+U*U),G[9]=H,W=0}for(A*=H;;W++){var q=G[W];if(!(A>q)){var Z;0==W?A/=q:A=W+(A-(Z=G[W-1]))/(q-Z);break}}this.addCurvePosition(.1*A,x,S,w,D,M,R,I,O,h,y,r||g>0&&0==j)}return h},e.prototype.addBeforePosition=function(t,e,i,n,r){var a=e[i],s=e[i+1],o=e[i+2]-a,c=e[i+3]-s,l=Math.atan2(c,o);n[r]=a+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var a=e[i+2],s=e[i+3],o=a-e[i],c=s-e[i+1],l=Math.atan2(c,o);n[r]=a+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,a,s,o,c,l,h,u){if(0==t||isNaN(t))return l[h]=e,l[h+1]=i,void(l[h+2]=Math.atan2(r-i,n-e));var f=t*t,_=f*t,d=1-t,p=d*d,m=p*d,v=d*t,g=3*v,y=d*g,T=g*t,A=e*m+n*y+a*T+o*_,b=i*m+r*y+s*T+c*_;l[h]=A,l[h+1]=b,u&&(l[h+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(b-(i*p+r*v*2+s*f),A-(e*p+n*v*2+a*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e})();t.PathConstraint=e})(r||(r={})),(function(t){var e=(function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return a(e,t),e})(t.ConstraintData);t.PathConstraintData=e,(function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"})(t.PositionMode||(t.PositionMode={})),(function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"})(t.SpacingMode||(t.SpacingMode={})),(function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"})(t.RotateMode||(t.RotateMode={}))})(r||(r={})),(function(t){var e=(function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t})(),i=(function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text "+e+": status "+n.status+", "+n.responseText)},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text "+e+": status "+n.status+", "+n.responseText)},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i)){var r=new Image;r.src=i,r.crossOrigin="anonymous",r.onload=function(){n.rawAssets[i]=r},r.onerror=function(){n.errors[i]="Couldn't load image "+i}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e<t.toLoad.length;e++){var i=t.toLoad[e];if(null==t.assets[i]){var n=this.rawAssets[i];if(null==n)continue;n instanceof HTMLImageElement?t.assets[i]=t.textureLoader(n):t.assets[i]=n}}},t.prototype.isLoadingComplete=function(t){var e=this.clientAssets[t];return null==e||(this.updateClientAssets(e),e.toLoad.length==e.loaded())},t.prototype.dispose=function(){},t.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return this.errors},t})();t.SharedAssetManager=i})(r||(r={})),(function(t){var e=(function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i<e.bones.length;i++){var n=e.bones[i],r=void 0;if(null==n.parent)r=new t.Bone(n,this,null);else{var a=this.bones[n.parent.index];r=new t.Bone(n,this,a),a.children.push(r)}this.bones.push(r)}for(this.slots=new Array,this.drawOrder=new Array,i=0;i<e.slots.length;i++){var s=e.slots[i],o=(r=this.bones[s.boneData.index],new t.Slot(s,r));this.slots.push(o),this.drawOrder.push(o)}for(this.ikConstraints=new Array,i=0;i<e.ikConstraints.length;i++){var c=e.ikConstraints[i];this.ikConstraints.push(new t.IkConstraint(c,this))}for(this.transformConstraints=new Array,i=0;i<e.transformConstraints.length;i++){var l=e.transformConstraints[i];this.transformConstraints.push(new t.TransformConstraint(l,this))}for(this.pathConstraints=new Array,i=0;i<e.pathConstraints.length;i++){var h=e.pathConstraints[i];this.pathConstraints.push(new t.PathConstraint(h,this))}this.color=new t.Color(1,1,1,1),this.updateCache()}return e.prototype.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,i=t.length;e<i;e++)(r=t[e]).sorted=r.data.skinRequired,r.active=!r.sorted;if(null!=this.skin){var n=this.skin.bones;for(e=0,i=this.skin.bones.length;e<i;e++){var r=this.bones[n[e].index];do{r.sorted=!1,r.active=!0,r=r.parent}while(null!=r)}}var a=this.ikConstraints,s=this.transformConstraints,o=this.pathConstraints,c=a.length,l=s.length,h=o.length,u=c+l+h;t:for(e=0;e<u;e++){for(var f=0;f<c;f++)if((_=a[f]).data.order==e){this.sortIkConstraint(_);continue t}for(f=0;f<l;f++)if((_=s[f]).data.order==e){this.sortTransformConstraint(_);continue t}for(f=0;f<h;f++){var _;if((_=o[f]).data.order==e){this.sortPathConstraint(_);continue t}}}for(e=0,i=t.length;e<i;e++)this.sortBone(t[e])},e.prototype.sortIkConstraint=function(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target;this.sortBone(i);var n=e.bones,r=n[0];if(this.sortBone(r),n.length>1){var a=n[n.length-1];this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var a=0,s=this.data.skins.length;a<s;a++)this.sortPathConstraintAttachment(this.data.skins[a],n,r);var o=i.getAttachment();o instanceof t.PathAttachment&&this.sortPathConstraintAttachmentWith(o,r);var c=e.bones,l=c.length;for(a=0;a<l;a++)this.sortBone(c[a]);for(this._updateCache.push(e),a=0;a<l;a++)this.sortReset(c[a].children);for(a=0;a<l;a++)c[a].sorted=!0}},e.prototype.sortTransformConstraint=function(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){this.sortBone(e.target);var i=e.bones,n=i.length;if(e.data.local)for(var r=0;r<n;r++){var a=i[r];this.sortBone(a.parent),this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}else for(r=0;r<n;r++)this.sortBone(i[r]);this._updateCache.push(e);for(var s=0;s<n;s++)this.sortReset(i[s].children);for(s=0;s<n;s++)i[s].sorted=!0}},e.prototype.sortPathConstraintAttachment=function(t,e,i){var n=t.attachments[e];if(n)for(var r in n)this.sortPathConstraintAttachmentWith(n[r],i)},e.prototype.sortPathConstraintAttachmentWith=function(e,i){if(e instanceof t.PathAttachment){var n=e.bones;if(null==n)this.sortBone(i);else for(var r=this.bones,a=0;a<n.length;)for(var s=n[a++],o=a+s;a<o;a++){var c=n[a];this.sortBone(r[c])}}},e.prototype.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},e.prototype.sortReset=function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];n.active&&(n.sorted&&this.sortReset(n.children),n.sorted=!1)}},e.prototype.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,i=t.length;e<i;e++){var n=t[e];n.ax=n.x,n.ay=n.y,n.arotation=n.rotation,n.ascaleX=n.scaleX,n.ascaleY=n.scaleY,n.ashearX=n.shearX,n.ashearY=n.shearY,n.appliedValid=!0}var r=this._updateCache;for(e=0,i=r.length;e<i;e++)r[e].update()},e.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},e.prototype.setBonesToSetupPose=function(){for(var t=this.bones,e=0,i=t.length;e<i;e++)t[e].setToSetupPose();var n=this.ikConstraints;for(e=0,i=n.length;e<i;e++)(o=n[e]).mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch;var r=this.transformConstraints;for(e=0,i=r.length;e<i;e++){var a=(o=r[e]).data;o.rotateMix=a.rotateMix,o.translateMix=a.translateMix,o.scaleMix=a.scaleMix,o.shearMix=a.shearMix}var s=this.pathConstraints;for(e=0,i=s.length;e<i;e++){var o;a=(o=s[e]).data,o.position=a.position,o.spacing=a.spacing,o.rotateMix=a.rotateMix,o.translateMix=a.translateMix}},e.prototype.setSlotsToSetupPose=function(){var e=this.slots;t.Utils.arrayCopy(e,0,this.drawOrder,0,e.length);for(var i=0,n=e.length;i<n;i++)e[i].setToSetupPose()},e.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},e.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return null},e.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,i=0,n=e.length;i<n;i++)if(e[i].data.name==t)return i;return-1},e.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return null},e.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,i=0,n=e.length;i<n;i++)if(e[i].data.name==t)return i;return-1},e.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found: "+t);this.setSkin(e)},e.prototype.setSkin=function(t){if(t!=this.skin){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,i=0,n=e.length;i<n;i++){var r=e[i],a=r.data.attachmentName;if(null!=a){var s=t.getAttachment(i,a);null!=s&&r.setAttachment(s)}}this.skin=t,this.updateCache()}},e.prototype.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},e.prototype.getAttachment=function(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){var i=this.skin.getAttachment(t,e);if(null!=i)return i}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},e.prototype.setAttachment=function(t,e){if(null==t)throw new Error("slotName cannot be null.");for(var i=this.slots,n=0,r=i.length;n<r;n++){var a=i[n];if(a.data.name==t){var s=null;if(null!=e&&null==(s=this.getAttachment(n,e)))throw new Error("Attachment not found: "+e+", for slot: "+t);return void a.setAttachment(s)}}throw new Error("Slot not found: "+t)},e.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return null},e.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return null},e.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return null},e.prototype.getBounds=function(e,i,n){if(void 0===n&&(n=new Array(2)),null==e)throw new Error("offset cannot be null.");if(null==i)throw new Error("size cannot be null.");for(var r=this.drawOrder,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=0,h=r.length;l<h;l++){var u=r[l];if(u.bone.active){var f=0,_=null,d=u.getAttachment();if(d instanceof t.RegionAttachment)f=8,_=t.Utils.setArraySize(n,f,0),d.computeWorldVertices(u.bone,_,0,2);else if(d instanceof t.MeshAttachment){var p=d;f=p.worldVerticesLength,_=t.Utils.setArraySize(n,f,0),p.computeWorldVertices(u,0,f,_,0,2)}if(null!=_)for(var m=0,v=_.length;m<v;m+=2){var g=_[m],y=_[m+1];a=Math.min(a,g),s=Math.min(s,y),o=Math.max(o,g),c=Math.max(c,y)}}}e.set(a,s),i.set(o-a,c-s)},e.prototype.update=function(t){this.time+=t},e})();t.Skeleton=e})(r||(r={})),(function(t){var e=(function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(n){var r=this.scale,a=new t.SkeletonData;a.name="";var s=new i(n);a.hash=s.readString(),a.version=s.readString(),a.x=s.readFloat(),a.y=s.readFloat(),a.width=s.readFloat(),a.height=s.readFloat();var o=s.readBoolean();o&&(a.fps=s.readFloat(),a.imagesPath=s.readString(),a.audioPath=s.readString());var c=0;c=s.readInt(!0);for(var l=0;l<c;l++)s.strings.push(s.readString());for(c=s.readInt(!0),l=0;l<c;l++){var h=s.readString(),u=0==l?null:a.bones[s.readInt(!0)];(d=new t.BoneData(l,h,u)).rotation=s.readFloat(),d.x=s.readFloat()*r,d.y=s.readFloat()*r,d.scaleX=s.readFloat(),d.scaleY=s.readFloat(),d.shearX=s.readFloat(),d.shearY=s.readFloat(),d.length=s.readFloat()*r,d.transformMode=e.TransformModeValues[s.readInt(!0)],d.skinRequired=s.readBoolean(),o&&t.Color.rgba8888ToColor(d.color,s.readInt32()),a.bones.push(d)}for(c=s.readInt(!0),l=0;l<c;l++){var f=s.readString(),_=a.bones[s.readInt(!0)],d=new t.SlotData(l,f,_);t.Color.rgba8888ToColor(d.color,s.readInt32());var p=s.readInt32();-1!=p&&t.Color.rgb888ToColor(d.darkColor=new t.Color,p),d.attachmentName=s.readStringRef(),d.blendMode=e.BlendModeValues[s.readInt(!0)],a.slots.push(d)}c=s.readInt(!0),l=0;for(var m=void 0;l<c;l++){(d=new t.IkConstraintData(s.readString())).order=s.readInt(!0),d.skinRequired=s.readBoolean(),m=s.readInt(!0);for(var v=0;v<m;v++)d.bones.push(a.bones[s.readInt(!0)]);d.target=a.bones[s.readInt(!0)],d.mix=s.readFloat(),d.softness=s.readFloat()*r,d.bendDirection=s.readByte(),d.compress=s.readBoolean(),d.stretch=s.readBoolean(),d.uniform=s.readBoolean(),a.ikConstraints.push(d)}for(c=s.readInt(!0),l=0,m=void 0;l<c;l++){for((d=new t.TransformConstraintData(s.readString())).order=s.readInt(!0),d.skinRequired=s.readBoolean(),m=s.readInt(!0),v=0;v<m;v++)d.bones.push(a.bones[s.readInt(!0)]);d.target=a.bones[s.readInt(!0)],d.local=s.readBoolean(),d.relative=s.readBoolean(),d.offsetRotation=s.readFloat(),d.offsetX=s.readFloat()*r,d.offsetY=s.readFloat()*r,d.offsetScaleX=s.readFloat(),d.offsetScaleY=s.readFloat(),d.offsetShearY=s.readFloat(),d.rotateMix=s.readFloat(),d.translateMix=s.readFloat(),d.scaleMix=s.readFloat(),d.shearMix=s.readFloat(),a.transformConstraints.push(d)}for(c=s.readInt(!0),l=0,m=void 0;l<c;l++){for((d=new t.PathConstraintData(s.readString())).order=s.readInt(!0),d.skinRequired=s.readBoolean(),m=s.readInt(!0),v=0;v<m;v++)d.bones.push(a.bones[s.readInt(!0)]);d.target=a.slots[s.readInt(!0)],d.positionMode=e.PositionModeValues[s.readInt(!0)],d.spacingMode=e.SpacingModeValues[s.readInt(!0)],d.rotateMode=e.RotateModeValues[s.readInt(!0)],d.offsetRotation=s.readFloat(),d.position=s.readFloat(),d.positionMode==t.PositionMode.Fixed&&(d.position*=r),d.spacing=s.readFloat(),d.spacingMode!=t.SpacingMode.Length&&d.spacingMode!=t.SpacingMode.Fixed||(d.spacing*=r),d.rotateMix=s.readFloat(),d.translateMix=s.readFloat(),a.pathConstraints.push(d)}var g=this.readSkin(s,a,!0,o);for(null!=g&&(a.defaultSkin=g,a.skins.push(g)),l=a.skins.length,t.Utils.setArraySize(a.skins,c=l+s.readInt(!0));l<c;l++)a.skins[l]=this.readSkin(s,a,!1,o);for(c=this.linkedMeshes.length,l=0;l<c;l++){var y=this.linkedMeshes[l],T=null==y.skin?a.defaultSkin:a.findSkin(y.skin);if(null==T)throw new Error("Skin not found: "+y.skin);var A=T.getAttachment(y.slotIndex,y.parent);if(null==A)throw new Error("Parent mesh not found: "+y.parent);y.mesh.deformAttachment=y.inheritDeform?A:y.mesh,y.mesh.setParentMesh(A),y.mesh.updateUVs()}for(this.linkedMeshes.length=0,c=s.readInt(!0),l=0;l<c;l++)(d=new t.EventData(s.readStringRef())).intValue=s.readInt(!1),d.floatValue=s.readFloat(),d.stringValue=s.readString(),d.audioPath=s.readString(),null!=d.audioPath&&(d.volume=s.readFloat(),d.balance=s.readFloat()),a.events.push(d);for(c=s.readInt(!0),l=0;l<c;l++)a.animations.push(this.readAnimation(s,s.readString(),a));return a},e.prototype.readSkin=function(e,i,n,r){var a=null,s=0;if(n){if(0==(s=e.readInt(!0)))return null;a=new t.Skin("default")}else{(a=new t.Skin(e.readStringRef())).bones.length=e.readInt(!0);for(var o=0,c=a.bones.length;o<c;o++)a.bones[o]=i.bones[e.readInt(!0)];for(o=0,c=e.readInt(!0);o<c;o++)a.constraints.push(i.ikConstraints[e.readInt(!0)]);for(o=0,c=e.readInt(!0);o<c;o++)a.constraints.push(i.transformConstraints[e.readInt(!0)]);for(o=0,c=e.readInt(!0);o<c;o++)a.constraints.push(i.pathConstraints[e.readInt(!0)]);s=e.readInt(!0)}for(o=0;o<s;o++)for(var l=e.readInt(!0),h=0,u=e.readInt(!0);h<u;h++){var f=e.readStringRef(),_=this.readAttachment(e,i,a,l,f,r);null!=_&&a.setAttachment(l,f,_)}return a},e.prototype.readAttachment=function(i,r,a,s,o,c){var l=this.scale,h=i.readStringRef();null==h&&(h=o);var u=i.readByte();switch(e.AttachmentTypeValues[u]){case t.AttachmentType.Region:var f=i.readStringRef(),_=i.readFloat(),d=i.readFloat(),p=i.readFloat(),m=i.readFloat(),v=i.readFloat(),g=i.readFloat(),y=i.readFloat(),T=i.readInt32();null==f&&(f=h);var A=this.attachmentLoader.newRegionAttachment(a,h,f);return null==A?null:(A.path=f,A.x=d*l,A.y=p*l,A.scaleX=m,A.scaleY=v,A.rotation=_,A.width=g*l,A.height=y*l,t.Color.rgba8888ToColor(A.color,T),A.updateOffset(),A);case t.AttachmentType.BoundingBox:var b=i.readInt(!0),E=this.readVertices(i,b),C=(T=c?i.readInt32():0,this.attachmentLoader.newBoundingBoxAttachment(a,h));return null==C?null:(C.worldVerticesLength=b<<1,C.vertices=E.vertices,C.bones=E.bones,c&&t.Color.rgba8888ToColor(C.color,T),C);case t.AttachmentType.Mesh:f=i.readStringRef(),T=i.readInt32(),b=i.readInt(!0);var x=this.readFloatArray(i,b<<1,1),S=this.readShortArray(i),w=(E=this.readVertices(i,b),i.readInt(!0)),D=null;return g=0,y=0,c&&(D=this.readShortArray(i),g=i.readFloat(),y=i.readFloat()),null==f&&(f=h),null==(M=this.attachmentLoader.newMeshAttachment(a,h,f))?null:(M.path=f,t.Color.rgba8888ToColor(M.color,T),M.bones=E.bones,M.vertices=E.vertices,M.worldVerticesLength=b<<1,M.triangles=S,M.regionUVs=x,M.updateUVs(),M.hullLength=w<<1,c&&(M.edges=D,M.width=g*l,M.height=y*l),M);case t.AttachmentType.LinkedMesh:f=i.readStringRef(),T=i.readInt32();var M,R=i.readStringRef(),I=i.readStringRef(),O=i.readBoolean();return g=0,y=0,c&&(g=i.readFloat(),y=i.readFloat()),null==f&&(f=h),null==(M=this.attachmentLoader.newMeshAttachment(a,h,f))?null:(M.path=f,t.Color.rgba8888ToColor(M.color,T),c&&(M.width=g*l,M.height=y*l),this.linkedMeshes.push(new n(M,R,s,I,O)),M);case t.AttachmentType.Path:for(var P=i.readBoolean(),N=i.readBoolean(),F=(b=i.readInt(!0),E=this.readVertices(i,b),t.Utils.newArray(b/3,0)),L=0,B=F.length;L<B;L++)F[L]=i.readFloat()*l;return T=c?i.readInt32():0,null==(f=this.attachmentLoader.newPathAttachment(a,h))?null:(f.closed=P,f.constantSpeed=N,f.worldVerticesLength=b<<1,f.vertices=E.vertices,f.bones=E.bones,f.lengths=F,c&&t.Color.rgba8888ToColor(f.color,T),f);case t.AttachmentType.Point:_=i.readFloat(),d=i.readFloat(),p=i.readFloat(),T=c?i.readInt32():0;var k=this.attachmentLoader.newPointAttachment(a,h);return null==k?null:(k.x=d*l,k.y=p*l,k.rotation=_,c&&t.Color.rgba8888ToColor(k.color,T),k);case t.AttachmentType.Clipping:var V=i.readInt(!0),U=(b=i.readInt(!0),E=this.readVertices(i,b),T=c?i.readInt32():0,this.attachmentLoader.newClippingAttachment(a,h));return null==U?null:(U.endSlot=r.slots[V],U.worldVerticesLength=b<<1,U.vertices=E.vertices,U.bones=E.bones,c&&t.Color.rgba8888ToColor(U.color,T),U)}return null},e.prototype.readVertices=function(e,i){var n=i<<1,a=new r,s=this.scale;if(!e.readBoolean())return a.vertices=this.readFloatArray(e,n,s),a;for(var o=new Array,c=new Array,l=0;l<i;l++){var h=e.readInt(!0);c.push(h);for(var u=0;u<h;u++)c.push(e.readInt(!0)),o.push(e.readFloat()*s),o.push(e.readFloat()*s),o.push(e.readFloat())}return a.vertices=t.Utils.toFloatArray(o),a.bones=c,a},e.prototype.readFloatArray=function(t,e,i){var n=new Array(e);if(1==i)for(var r=0;r<e;r++)n[r]=t.readFloat();else for(r=0;r<e;r++)n[r]=t.readFloat()*i;return n},e.prototype.readShortArray=function(t){for(var e=t.readInt(!0),i=new Array(e),n=0;n<e;n++)i[n]=t.readShort();return i},e.prototype.readAnimation=function(i,n,r){for(var a=new Array,s=this.scale,o=0,c=new t.Color,l=new t.Color,h=0,u=i.readInt(!0);h<u;h++)for(var f=i.readInt(!0),_=0,d=i.readInt(!0);_<d;_++){var p=i.readByte(),m=i.readInt(!0);switch(p){case e.SLOT_ATTACHMENT:(T=new t.AttachmentTimeline(m)).slotIndex=f;for(var v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readStringRef());a.push(T),o=Math.max(o,T.frames[m-1]);break;case e.SLOT_COLOR:for((T=new t.ColorTimeline(m)).slotIndex=f,v=0;v<m;v++){var g=i.readFloat();t.Color.rgba8888ToColor(c,i.readInt32()),T.setFrame(v,g,c.r,c.g,c.b,c.a),v<m-1&&this.readCurve(i,v,T)}a.push(T),o=Math.max(o,T.frames[(m-1)*t.ColorTimeline.ENTRIES]);break;case e.SLOT_TWO_COLOR:for((T=new t.TwoColorTimeline(m)).slotIndex=f,v=0;v<m;v++)g=i.readFloat(),t.Color.rgba8888ToColor(c,i.readInt32()),t.Color.rgb888ToColor(l,i.readInt32()),T.setFrame(v,g,c.r,c.g,c.b,c.a,l.r,l.g,l.b),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.TwoColorTimeline.ENTRIES])}}for(h=0,u=i.readInt(!0);h<u;h++){var y=i.readInt(!0);for(_=0,d=i.readInt(!0);_<d;_++)switch(p=i.readByte(),m=i.readInt(!0),p){case e.BONE_ROTATE:for((T=new t.RotateTimeline(m)).boneIndex=y,v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readFloat()),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.RotateTimeline.ENTRIES]);break;case e.BONE_TRANSLATE:case e.BONE_SCALE:case e.BONE_SHEAR:var T=void 0,A=1;for(p==e.BONE_SCALE?T=new t.ScaleTimeline(m):p==e.BONE_SHEAR?T=new t.ShearTimeline(m):(T=new t.TranslateTimeline(m),A=s),T.boneIndex=y,v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readFloat()*A,i.readFloat()*A),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.TranslateTimeline.ENTRIES])}}for(h=0,u=i.readInt(!0);h<u;h++){var b=i.readInt(!0);for(m=i.readInt(!0),(T=new t.IkConstraintTimeline(m)).ikConstraintIndex=b,v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readFloat(),i.readFloat()*s,i.readByte(),i.readBoolean(),i.readBoolean()),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.IkConstraintTimeline.ENTRIES])}for(h=0,u=i.readInt(!0);h<u;h++){for(b=i.readInt(!0),m=i.readInt(!0),(T=new t.TransformConstraintTimeline(m)).transformConstraintIndex=b,v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readFloat(),i.readFloat(),i.readFloat(),i.readFloat()),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.TransformConstraintTimeline.ENTRIES])}for(h=0,u=i.readInt(!0);h<u;h++){b=i.readInt(!0);var E=r.pathConstraints[b];for(_=0,d=i.readInt(!0);_<d;_++)switch(p=i.readByte(),m=i.readInt(!0),p){case e.PATH_POSITION:case e.PATH_SPACING:for(T=void 0,A=1,p==e.PATH_SPACING?(T=new t.PathConstraintSpacingTimeline(m),E.spacingMode!=t.SpacingMode.Length&&E.spacingMode!=t.SpacingMode.Fixed||(A=s)):(T=new t.PathConstraintPositionTimeline(m),E.positionMode==t.PositionMode.Fixed&&(A=s)),T.pathConstraintIndex=b,v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readFloat()*A),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.PathConstraintPositionTimeline.ENTRIES]);break;case e.PATH_MIX:for((T=new t.PathConstraintMixTimeline(m)).pathConstraintIndex=b,v=0;v<m;v++)T.setFrame(v,i.readFloat(),i.readFloat(),i.readFloat()),v<m-1&&this.readCurve(i,v,T);a.push(T),o=Math.max(o,T.frames[(m-1)*t.PathConstraintMixTimeline.ENTRIES])}}for(h=0,u=i.readInt(!0);h<u;h++){var C=r.skins[i.readInt(!0)];for(_=0,d=i.readInt(!0);_<d;_++){f=i.readInt(!0);for(var x=0,S=i.readInt(!0);x<S;x++){var w=C.getAttachment(f,i.readStringRef()),D=null!=w.bones,M=w.vertices,R=D?M.length/3*2:M.length;for(m=i.readInt(!0),(T=new t.DeformTimeline(m)).slotIndex=f,T.attachment=w,v=0;v<m;v++){g=i.readFloat();var I=void 0,O=i.readInt(!0);if(0==O)I=D?t.Utils.newFloatArray(R):M;else{I=t.Utils.newFloatArray(R);var P=i.readInt(!0);if(O+=P,1==s)for(var N=P;N<O;N++)I[N]=i.readFloat();else for(N=P;N<O;N++)I[N]=i.readFloat()*s;if(!D){N=0;for(var F=I.length;N<F;N++)I[N]+=M[N]}}T.setFrame(v,g,I),v<m-1&&this.readCurve(i,v,T)}a.push(T),o=Math.max(o,T.frames[m-1])}}}var L=i.readInt(!0);if(L>0){T=new t.DrawOrderTimeline(L);var B=r.slots.length;for(h=0;h<L;h++){g=i.readFloat();var k=i.readInt(!0),V=t.Utils.newArray(B,0);for(_=B-1;_>=0;_--)V[_]=-1;var U=t.Utils.newArray(B-k,0),z=0,G=0;for(_=0;_<k;_++){for(f=i.readInt(!0);z!=f;)U[G++]=z++;V[z+i.readInt(!0)]=z++}for(;z<B;)U[G++]=z++;for(_=B-1;_>=0;_--)-1==V[_]&&(V[_]=U[--G]);T.setFrame(h,g,V)}a.push(T),o=Math.max(o,T.frames[L-1])}var H=i.readInt(!0);if(H>0){for(T=new t.EventTimeline(H),h=0;h<H;h++){g=i.readFloat();var W=r.events[i.readInt(!0)],j=new t.Event(g,W);j.intValue=i.readInt(!1),j.floatValue=i.readFloat(),j.stringValue=i.readBoolean()?i.readString():W.stringValue,null!=j.data.audioPath&&(j.volume=i.readFloat(),j.balance=i.readFloat()),T.setFrame(h,j)}a.push(T),o=Math.max(o,T.frames[H-1])}return new t.Animation(n,a,o)},e.prototype.readCurve=function(t,i,n){switch(t.readByte()){case e.CURVE_STEPPED:n.setStepped(i);break;case e.CURVE_BEZIER:this.setCurve(n,i,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat())}},e.prototype.setCurve=function(t,e,i,n,r,a){t.setCurve(e,i,n,r,a)},e.AttachmentTypeValues=[0,1,2,3,4,5,6],e.TransformModeValues=[t.TransformMode.Normal,t.TransformMode.OnlyTranslation,t.TransformMode.NoRotationOrReflection,t.TransformMode.NoScale,t.TransformMode.NoScaleOrReflection],e.PositionModeValues=[t.PositionMode.Fixed,t.PositionMode.Percent],e.SpacingModeValues=[t.SpacingMode.Length,t.SpacingMode.Fixed,t.SpacingMode.Percent],e.RotateModeValues=[t.RotateMode.Tangent,t.RotateMode.Chain,t.RotateMode.ChainScale],e.BlendModeValues=[t.BlendMode.Normal,t.BlendMode.Additive,t.BlendMode.Multiply,t.BlendMode.Screen],e.BONE_ROTATE=0,e.BONE_TRANSLATE=1,e.BONE_SCALE=2,e.BONE_SHEAR=3,e.SLOT_ATTACHMENT=0,e.SLOT_COLOR=1,e.SLOT_TWO_COLOR=2,e.PATH_POSITION=0,e.PATH_SPACING=1,e.PATH_MIX=2,e.CURVE_LINEAR=0,e.CURVE_STEPPED=1,e.CURVE_BEZIER=2,e})();t.SkeletonBinary=e;var i=(function(){function t(t,e,i,n){void 0===e&&(e=new Array),void 0===i&&(i=0),void 0===n&&(n=new DataView(t.buffer)),this.strings=e,this.index=i,this.buffer=n}return t.prototype.readByte=function(){return this.buffer.getInt8(this.index++)},t.prototype.readShort=function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t},t.prototype.readInt32=function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t},t.prototype.readInt=function(t){var e=this.readByte(),i=127&e;return 0!=(128&e)&&(i|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(i|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(i|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(i|=(127&(e=this.readByte()))<<28)))),t?i:i>>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i<t;){var n=this.readByte();switch(n>>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t})(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}})(r||(r={})),(function(t){var e=(function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool(function(){return t.Utils.newFloatArray(16)})}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,a=this.polygonPool,s=e.slots,o=s.length;n.length=0,a.freeAll(r),r.length=0;for(var c=0;c<o;c++){var l=s[c];if(l.bone.active){var h=l.getAttachment();if(h instanceof t.BoundingBoxAttachment){var u=h;n.push(u);var f=a.obtain();f.length!=u.worldVerticesLength&&(f=t.Utils.newFloatArray(u.worldVerticesLength)),r.push(f),u.computeWorldVertices(l,0,u.worldVerticesLength,f,0,2)}}}i?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)},e.prototype.aabbCompute=function(){for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=this.polygons,a=0,s=r.length;a<s;a++)for(var o=r[a],c=o,l=0,h=o.length;l<h;l+=2){var u=c[l],f=c[l+1];t=Math.min(t,u),e=Math.min(e,f),i=Math.max(i,u),n=Math.max(n,f)}this.minX=t,this.minY=e,this.maxX=i,this.maxY=n},e.prototype.aabbContainsPoint=function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=a&&n<=a||t>=s&&i>=s||e>=o&&n>=o)return!1;var c=(n-e)/(i-t),l=c*(r-t)+e;if(l>a&&l<o)return!0;if((l=c*(s-t)+e)>a&&l<o)return!0;var h=(a-e)/c+t;return h>r&&h<s||(h=(o-e)/c+t)>r&&h<s},e.prototype.aabbIntersectsSkeleton=function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n<r;n++)if(this.containsPointPolygon(i[n],t,e))return this.boundingBoxes[n];return null},e.prototype.containsPointPolygon=function(t,e,i){for(var n=t,r=t.length,a=r-2,s=!1,o=0;o<r;o+=2){var c=n[o+1],l=n[a+1];if(c<i&&l>=i||l<i&&c>=i){var h=n[o];h+(i-c)/(l-c)*(n[a]-h)<e&&(s=!s)}a=o}return s},e.prototype.intersectsSegment=function(t,e,i,n){for(var r=this.polygons,a=0,s=r.length;a<s;a++)if(this.intersectsSegmentPolygon(r[a],t,e,i,n))return this.boundingBoxes[a];return null},e.prototype.intersectsSegmentPolygon=function(t,e,i,n,r){for(var a=t,s=t.length,o=e-n,c=i-r,l=e*r-i*n,h=a[s-2],u=a[s-1],f=0;f<s;f+=2){var _=a[f],d=a[f+1],p=h*d-u*_,m=h-_,v=u-d,g=o*v-c*m,y=(l*m-o*p)/g;if((y>=h&&y<=_||y>=_&&y<=h)&&(y>=e&&y<=n||y>=n&&y<=e)){var T=(l*v-c*p)/g;if((T>=u&&T<=d||T>=d&&T<=u)&&(T>=i&&T<=r||T>=r&&T<=i))return!0}h=_,u=d}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e})();t.SkeletonBounds=e})(r||(r={})),(function(t){var e=(function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,a=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,a,0,2);var s=this.clippingPolygon;e.makeClockwise(s);for(var o=this.clippingPolygons=this.triangulator.decompose(s,this.triangulator.triangulate(s)),c=0,l=o.length;c<l;c++){var h=o[c];e.makeClockwise(h),h.push(h[0]),h.push(h[1])}return o.length},e.prototype.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},e.prototype.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},e.prototype.isClipping=function(){return null!=this.clipAttachment},e.prototype.clipTriangles=function(e,i,n,r,a,s,o,c,l,h,u,f){var _=this.clipOutput,d=this.clippedVertices,p=this.clippedTriangles,m=this.clippingPolygons,v=this.clippingPolygons.length,g=c?12:8,y=0;h=h||0,u=u||0,f=f||0,d.length=0,p.length=0;t:for(var T=h,A=h+r;T<A;T+=3){var b=n[T]*l,E=b+u,C=b+f,x=e[E],S=e[E+1],w=a[C],D=a[C+1];C=(b=n[T+1]*l)+f;var M=e[E=b+u],R=e[E+1],I=a[C],O=a[C+1];C=(b=n[T+2]*l)+f;for(var P=e[E=b+u],N=e[E+1],F=a[C],L=a[C+1],B=0;B<v;B++){var k=d.length;if(!this.clip(x,S,M,R,P,N,m[B],_)){(X=t.Utils.setArraySize(d,k+3*g))[k]=x,X[k+1]=S,X[k+2]=s.r,X[k+3]=s.g,X[k+4]=s.b,X[k+5]=s.a,c?(X[k+6]=w,X[k+7]=D,X[k+8]=o.r,X[k+9]=o.g,X[k+10]=o.b,X[k+11]=o.a,X[k+12]=M,X[k+13]=R,X[k+14]=s.r,X[k+15]=s.g,X[k+16]=s.b,X[k+17]=s.a,X[k+18]=I,X[k+19]=O,X[k+20]=o.r,X[k+21]=o.g,X[k+22]=o.b,X[k+23]=o.a,X[k+24]=P,X[k+25]=N,X[k+26]=s.r,X[k+27]=s.g,X[k+28]=s.b,X[k+29]=s.a,X[k+30]=F,X[k+31]=L,X[k+32]=o.r,X[k+33]=o.g,X[k+34]=o.b,X[k+35]=o.a):(X[k+6]=w,X[k+7]=D,X[k+8]=M,X[k+9]=R,X[k+10]=s.r,X[k+11]=s.g,X[k+12]=s.b,X[k+13]=s.a,X[k+14]=I,X[k+15]=O,X[k+16]=P,X[k+17]=N,X[k+18]=s.r,X[k+19]=s.g,X[k+20]=s.b,X[k+21]=s.a,X[k+22]=F,X[k+23]=L),k=p.length,(it=t.Utils.setArraySize(p,k+3))[k]=y,it[k+1]=y+1,it[k+2]=y+2,y+=3;continue t}var V=_.length;if(0!=V){for(var U=R-N,z=P-M,G=x-P,H=N-S,W=1/(U*G+z*(S-N)),j=V>>1,Y=this.clipOutput,X=t.Utils.setArraySize(d,k+j*g),q=0;q<V;q+=2){var Z=Y[q],K=Y[q+1];X[k]=Z,X[k+1]=K,X[k+2]=s.r,X[k+3]=s.g,X[k+4]=s.b,X[k+5]=s.a;var J=Z-P,Q=K-N,$=(U*J+z*Q)*W,tt=(H*J+G*Q)*W,et=1-$-tt;X[k+6]=w*$+I*tt+F*et,X[k+7]=D*$+O*tt+L*et,c&&(X[k+8]=o.r,X[k+9]=o.g,X[k+10]=o.b,X[k+11]=o.a),k+=g}k=p.length;var it=t.Utils.setArraySize(p,k+3*(j-2));for(j--,q=1;q<j;q++)it[k]=y,it[k+1]=y+q,it[k+2]=y+q+1,k+=3;y+=j+1}}}},e.prototype.clip=function(t,e,i,n,r,a,s,o){var c=o,l=!1,h=null;s.length%4>=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(n),h.push(r),h.push(a),h.push(t),h.push(e),o.length=0;for(var u=s,f=s.length-4,_=0;;_+=2){for(var d=u[_],p=u[_+1],m=u[_+2],v=u[_+3],g=d-m,y=p-v,T=h,A=h.length-2,b=o.length,E=0;E<A;E+=2){var C=T[E],x=T[E+1],S=T[E+2],w=T[E+3],D=g*(w-v)-y*(S-m)>0;if(g*(x-v)-y*(C-m)>0){if(D){o.push(S),o.push(w);continue}var M=(I=w-x)*(m-d)-(O=S-C)*(v-p);if(Math.abs(M)>1e-6){var R=(O*(p-x)-I*(d-C))/M;o.push(d+(m-d)*R),o.push(p+(v-p)*R)}else o.push(d),o.push(p)}else if(D){var I,O;M=(I=w-x)*(m-d)-(O=S-C)*(v-p),Math.abs(M)>1e-6?(R=(O*(p-x)-I*(d-C))/M,o.push(d+(m-d)*R),o.push(p+(v-p)*R)):(o.push(d),o.push(p)),o.push(S),o.push(w)}l=!0}if(b==o.length)return c.length=0,!0;if(o.push(o[0]),o.push(o[1]),_==f)break;var P=o;(o=h).length=0,h=P}if(c!=o){c.length=0,_=0;for(var N=o.length-2;_<N;_++)c[_]=o[_]}else c.length=c.length-2;return l},e.makeClockwise=function(t){for(var e=t,i=t.length,n=e[i-2]*e[1]-e[0]*e[i-1],r=0,a=0,s=0,o=0,c=i-3;o<c;o+=2)r=e[o],a=e[o+1],s=e[o+2],n+=r*e[o+3]-s*a;if(!(n<0)){o=0;var l=i-2;for(c=i>>1;o<c;o+=2){var h=e[o],u=e[o+1],f=l-o;e[o]=e[f],e[o+1]=e[f+1],e[f]=h,e[f+1]=u}}},e})();t.SkeletonClipping=e})(r||(r={})),(function(t){var e=(function(){function t(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,i=0,n=e.length;i<n;i++)if(e[i].name==t)return i;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,i=0,n=e.length;i<n;i++)if(e[i].name==t)return i;return-1},t.prototype.findSkin=function(t){if(null==t)throw new Error("skinName cannot be null.");for(var e=this.skins,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findEvent=function(t){if(null==t)throw new Error("eventDataName cannot be null.");for(var e=this.events,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findAnimation=function(t){if(null==t)throw new Error("animationName cannot be null.");for(var e=this.animations,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return null},t.prototype.findPathConstraintIndex=function(t){if(null==t)throw new Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,i=0,n=e.length;i<n;i++)if(e[i].name==t)return i;return-1},t})();t.SkeletonData=e})(r||(r={})),(function(t){var e=(function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(i){var n=this.scale,r=new t.SkeletonData,a="string"==typeof i?JSON.parse(i):i,s=a.skeleton;if(null!=s&&(r.hash=s.hash,r.version=s.spine,r.x=s.x,r.y=s.y,r.width=s.width,r.height=s.height,r.fps=s.fps,r.imagesPath=s.images),a.bones)for(var o=0;o<a.bones.length;o++){var c=a.bones[o],l=null,h=this.getValue(c,"parent",null);if(null!=h&&null==(l=r.findBone(h)))throw new Error("Parent bone not found: "+h);(d=new t.BoneData(r.bones.length,c.name,l)).length=this.getValue(c,"length",0)*n,d.x=this.getValue(c,"x",0)*n,d.y=this.getValue(c,"y",0)*n,d.rotation=this.getValue(c,"rotation",0),d.scaleX=this.getValue(c,"scaleX",1),d.scaleY=this.getValue(c,"scaleY",1),d.shearX=this.getValue(c,"shearX",0),d.shearY=this.getValue(c,"shearY",0),d.transformMode=e.transformModeFromString(this.getValue(c,"transform","normal")),d.skinRequired=this.getValue(c,"skin",!1),r.bones.push(d)}if(a.slots)for(o=0;o<a.slots.length;o++){var u=(M=a.slots[o]).name,f=M.bone,_=r.findBone(f);if(null==_)throw new Error("Slot bone not found: "+f);var d=new t.SlotData(r.slots.length,u,_),p=this.getValue(M,"color",null);null!=p&&d.color.setFromString(p);var m=this.getValue(M,"dark",null);null!=m&&(d.darkColor=new t.Color(1,1,1,1),d.darkColor.setFromString(m)),d.attachmentName=this.getValue(M,"attachment",null),d.blendMode=e.blendModeFromString(this.getValue(M,"blend","normal")),r.slots.push(d)}if(a.ik)for(o=0;o<a.ik.length;o++){var v=a.ik[o];(d=new t.IkConstraintData(v.name)).order=this.getValue(v,"order",0),d.skinRequired=this.getValue(v,"skin",!1);for(var g=0;g<v.bones.length;g++){if(f=v.bones[g],null==(S=r.findBone(f)))throw new Error("IK bone not found: "+f);d.bones.push(S)}var y=v.target;if(d.target=r.findBone(y),null==d.target)throw new Error("IK target bone not found: "+y);d.mix=this.getValue(v,"mix",1),d.softness=this.getValue(v,"softness",0)*n,d.bendDirection=this.getValue(v,"bendPositive",!0)?1:-1,d.compress=this.getValue(v,"compress",!1),d.stretch=this.getValue(v,"stretch",!1),d.uniform=this.getValue(v,"uniform",!1),r.ikConstraints.push(d)}if(a.transform)for(o=0;o<a.transform.length;o++){for(v=a.transform[o],(d=new t.TransformConstraintData(v.name)).order=this.getValue(v,"order",0),d.skinRequired=this.getValue(v,"skin",!1),g=0;g<v.bones.length;g++){if(f=v.bones[g],null==(S=r.findBone(f)))throw new Error("Transform constraint bone not found: "+f);d.bones.push(S)}if(y=v.target,d.target=r.findBone(y),null==d.target)throw new Error("Transform constraint target bone not found: "+y);d.local=this.getValue(v,"local",!1),d.relative=this.getValue(v,"relative",!1),d.offsetRotation=this.getValue(v,"rotation",0),d.offsetX=this.getValue(v,"x",0)*n,d.offsetY=this.getValue(v,"y",0)*n,d.offsetScaleX=this.getValue(v,"scaleX",0),d.offsetScaleY=this.getValue(v,"scaleY",0),d.offsetShearY=this.getValue(v,"shearY",0),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translateMix",1),d.scaleMix=this.getValue(v,"scaleMix",1),d.shearMix=this.getValue(v,"shearMix",1),r.transformConstraints.push(d)}if(a.path)for(o=0;o<a.path.length;o++){for(v=a.path[o],(d=new t.PathConstraintData(v.name)).order=this.getValue(v,"order",0),d.skinRequired=this.getValue(v,"skin",!1),g=0;g<v.bones.length;g++){if(f=v.bones[g],null==(S=r.findBone(f)))throw new Error("Transform constraint bone not found: "+f);d.bones.push(S)}if(y=v.target,d.target=r.findSlot(y),null==d.target)throw new Error("Path target slot not found: "+y);d.positionMode=e.positionModeFromString(this.getValue(v,"positionMode","percent")),d.spacingMode=e.spacingModeFromString(this.getValue(v,"spacingMode","length")),d.rotateMode=e.rotateModeFromString(this.getValue(v,"rotateMode","tangent")),d.offsetRotation=this.getValue(v,"rotation",0),d.position=this.getValue(v,"position",0),d.positionMode==t.PositionMode.Fixed&&(d.position*=n),d.spacing=this.getValue(v,"spacing",0),d.spacingMode!=t.SpacingMode.Length&&d.spacingMode!=t.SpacingMode.Fixed||(d.spacing*=n),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translateMix",1),r.pathConstraints.push(d)}if(a.skins){var T=a.skins;if(!(T instanceof Array)){var A=[];for(var b in T)A.push({name:b,attachments:T[b]});T=A}for(o=0;o<T.length;o++){var E=T[o],C=new t.Skin(E.name);if(E.bones)for(var x=0;x<E.bones.length;x++){var S;if(null==(S=r.findBone(E.bones[x])))throw new Error("Skin bone not found: "+E.bones[o]);C.bones.push(S)}if(E.ik)for(x=0;x<E.ik.length;x++){if(null==(w=r.findIkConstraint(E.ik[x])))throw new Error("Skin IK constraint not found: "+E.ik[o]);C.constraints.push(w)}if(E.transform)for(x=0;x<E.transform.length;x++){if(null==(w=r.findTransformConstraint(E.transform[x])))throw new Error("Skin transform constraint not found: "+E.transform[o]);C.constraints.push(w)}if(E.path)for(x=0;x<E.path.length;x++){var w;if(null==(w=r.findPathConstraint(E.path[x])))throw new Error("Skin path constraint not found: "+E.path[o]);C.constraints.push(w)}for(var u in E.attachments){var D=r.findSlot(u);if(null==D)throw new Error("Slot not found: "+u);var M=E.attachments[u];for(var R in M){var I=this.readAttachment(M[R],C,D.index,R,r);null!=I&&C.setAttachment(D.index,R,I)}}r.skins.push(C),"default"==C.name&&(r.defaultSkin=C)}}o=0;for(var O=this.linkedMeshes.length;o<O;o++){var P=this.linkedMeshes[o];if(null==(C=null==P.skin?r.defaultSkin:r.findSkin(P.skin)))throw new Error("Skin not found: "+P.skin);var N=C.getAttachment(P.slotIndex,P.parent);if(null==N)throw new Error("Parent mesh not found: "+P.parent);P.mesh.deformAttachment=P.inheritDeform?N:P.mesh,P.mesh.setParentMesh(N),P.mesh.updateUVs()}if(this.linkedMeshes.length=0,a.events)for(var F in a.events){var L=a.events[F];(d=new t.EventData(F)).intValue=this.getValue(L,"int",0),d.floatValue=this.getValue(L,"float",0),d.stringValue=this.getValue(L,"string",""),d.audioPath=this.getValue(L,"audio",null),null!=d.audioPath&&(d.volume=this.getValue(L,"volume",1),d.balance=this.getValue(L,"balance",0)),r.events.push(d)}if(a.animations)for(var B in a.animations){var k=a.animations[B];this.readAnimation(k,B,r)}return r},e.prototype.readAttachment=function(e,n,r,a,s){var o=this.scale;switch(a=this.getValue(e,"name",a),this.getValue(e,"type","region")){case"region":var c=this.getValue(e,"path",a),l=this.attachmentLoader.newRegionAttachment(n,a,c);return null==l?null:(l.path=c,l.x=this.getValue(e,"x",0)*o,l.y=this.getValue(e,"y",0)*o,l.scaleX=this.getValue(e,"scaleX",1),l.scaleY=this.getValue(e,"scaleY",1),l.rotation=this.getValue(e,"rotation",0),l.width=e.width*o,l.height=e.height*o,null!=(y=this.getValue(e,"color",null))&&l.color.setFromString(y),l.updateOffset(),l);case"boundingbox":var h=this.attachmentLoader.newBoundingBoxAttachment(n,a);return null==h?null:(this.readVertices(e,h,e.vertexCount<<1),null!=(y=this.getValue(e,"color",null))&&h.color.setFromString(y),h);case"mesh":case"linkedmesh":c=this.getValue(e,"path",a);var u=this.attachmentLoader.newMeshAttachment(n,a,c);if(null==u)return null;u.path=c,null!=(y=this.getValue(e,"color",null))&&u.color.setFromString(y),u.width=this.getValue(e,"width",0)*o,u.height=this.getValue(e,"height",0)*o;var f=this.getValue(e,"parent",null);if(null!=f)return this.linkedMeshes.push(new i(u,this.getValue(e,"skin",null),r,f,this.getValue(e,"deform",!0))),u;var _=e.uvs;return this.readVertices(e,u,_.length),u.triangles=e.triangles,u.regionUVs=_,u.updateUVs(),u.edges=this.getValue(e,"edges",null),u.hullLength=2*this.getValue(e,"hull",0),u;case"path":if(null==(c=this.attachmentLoader.newPathAttachment(n,a)))return null;c.closed=this.getValue(e,"closed",!1),c.constantSpeed=this.getValue(e,"constantSpeed",!0);var d=e.vertexCount;this.readVertices(e,c,d<<1);for(var p=t.Utils.newArray(d/3,0),m=0;m<e.lengths.length;m++)p[m]=e.lengths[m]*o;return c.lengths=p,null!=(y=this.getValue(e,"color",null))&&c.color.setFromString(y),c;case"point":var v=this.attachmentLoader.newPointAttachment(n,a);return null==v?null:(v.x=this.getValue(e,"x",0)*o,v.y=this.getValue(e,"y",0)*o,v.rotation=this.getValue(e,"rotation",0),null!=(y=this.getValue(e,"color",null))&&v.color.setFromString(y),v);case"clipping":var g=this.attachmentLoader.newClippingAttachment(n,a);if(null==g)return null;var y,T=this.getValue(e,"end",null);if(null!=T){var A=s.findSlot(T);if(null==A)throw new Error("Clipping end slot not found: "+T);g.endSlot=A}return d=e.vertexCount,this.readVertices(e,g,d<<1),null!=(y=this.getValue(e,"color",null))&&g.color.setFromString(y),g}return null},e.prototype.readVertices=function(e,i,n){var r=this.scale;i.worldVerticesLength=n;var a=e.vertices;if(n!=a.length){var s=new Array,o=new Array;for(u=0,f=a.length;u<f;){var c=a[u++];o.push(c);for(var l=u+4*c;u<l;u+=4)o.push(a[u]),s.push(a[u+1]*r),s.push(a[u+2]*r),s.push(a[u+3])}i.bones=o,i.vertices=t.Utils.toFloatArray(s)}else{var h=t.Utils.toFloatArray(a);if(1!=r)for(var u=0,f=a.length;u<f;u++)h[u]*=r;i.vertices=h}},e.prototype.readAnimation=function(e,i,n){var r=this.scale,a=new Array,s=0;if(e.slots)for(var o in e.slots){var c=e.slots[o];if(-1==(J=n.findSlotIndex(o)))throw new Error("Slot not found: "+o);for(var l in c){var h=c[l];if("attachment"==l){(T=new t.AttachmentTimeline(h.length)).slotIndex=J;for(var u=0,f=0;f<h.length;f++){var _=h[f];T.setFrame(u++,this.getValue(_,"time",0),_.name)}a.push(T),s=Math.max(s,T.frames[T.getFrameCount()-1])}else if("color"==l){for((T=new t.ColorTimeline(h.length)).slotIndex=J,u=0,f=0;f<h.length;f++){_=h[f];var d=new t.Color;d.setFromString(_.color),T.setFrame(u,this.getValue(_,"time",0),d.r,d.g,d.b,d.a),this.readCurve(_,T,u),u++}a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.ColorTimeline.ENTRIES])}else{if("twoColor"!=l)throw new Error("Invalid timeline type for a slot: "+l+" ("+o+")");for((T=new t.TwoColorTimeline(h.length)).slotIndex=J,u=0,f=0;f<h.length;f++){_=h[f];var p=new t.Color,m=new t.Color;p.setFromString(_.light),m.setFromString(_.dark),T.setFrame(u,this.getValue(_,"time",0),p.r,p.g,p.b,p.a,m.r,m.g,m.b),this.readCurve(_,T,u),u++}a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.TwoColorTimeline.ENTRIES])}}}if(e.bones)for(var v in e.bones){var g=e.bones[v],y=n.findBoneIndex(v);if(-1==y)throw new Error("Bone not found: "+v);for(var l in g)if(h=g[l],"rotate"===l){for((T=new t.RotateTimeline(h.length)).boneIndex=y,u=0,f=0;f<h.length;f++)_=h[f],T.setFrame(u,this.getValue(_,"time",0),this.getValue(_,"angle",0)),this.readCurve(_,T,u),u++;a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.RotateTimeline.ENTRIES])}else{if("translate"!==l&&"scale"!==l&&"shear"!==l)throw new Error("Invalid timeline type for a bone: "+l+" ("+v+")");var T=null,A=1,b=0;for("scale"===l?(T=new t.ScaleTimeline(h.length),b=1):"shear"===l?T=new t.ShearTimeline(h.length):(T=new t.TranslateTimeline(h.length),A=r),T.boneIndex=y,u=0,f=0;f<h.length;f++){_=h[f];var E=this.getValue(_,"x",b),C=this.getValue(_,"y",b);T.setFrame(u,this.getValue(_,"time",0),E*A,C*A),this.readCurve(_,T,u),u++}a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.TranslateTimeline.ENTRIES])}}if(e.ik)for(var x in e.ik){var S=e.ik[x],w=n.findIkConstraint(x);for((T=new t.IkConstraintTimeline(S.length)).ikConstraintIndex=n.ikConstraints.indexOf(w),u=0,f=0;f<S.length;f++)_=S[f],T.setFrame(u,this.getValue(_,"time",0),this.getValue(_,"mix",1),this.getValue(_,"softness",0)*r,this.getValue(_,"bendPositive",!0)?1:-1,this.getValue(_,"compress",!1),this.getValue(_,"stretch",!1)),this.readCurve(_,T,u),u++;a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.IkConstraintTimeline.ENTRIES])}if(e.transform)for(var x in e.transform){for(S=e.transform[x],w=n.findTransformConstraint(x),(T=new t.TransformConstraintTimeline(S.length)).transformConstraintIndex=n.transformConstraints.indexOf(w),u=0,f=0;f<S.length;f++)_=S[f],T.setFrame(u,this.getValue(_,"time",0),this.getValue(_,"rotateMix",1),this.getValue(_,"translateMix",1),this.getValue(_,"scaleMix",1),this.getValue(_,"shearMix",1)),this.readCurve(_,T,u),u++;a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.TransformConstraintTimeline.ENTRIES])}var D=e.path||e.paths;if(D)for(var x in D){S=D[x];var M=n.findPathConstraintIndex(x);if(-1==M)throw new Error("Path constraint not found: "+x);var R=n.pathConstraints[M];for(var l in S)if(h=S[l],"position"===l||"spacing"===l){for(T=null,A=1,"spacing"===l?(T=new t.PathConstraintSpacingTimeline(h.length),R.spacingMode!=t.SpacingMode.Length&&R.spacingMode!=t.SpacingMode.Fixed||(A=r)):(T=new t.PathConstraintPositionTimeline(h.length),R.positionMode==t.PositionMode.Fixed&&(A=r)),T.pathConstraintIndex=M,u=0,f=0;f<h.length;f++)_=h[f],T.setFrame(u,this.getValue(_,"time",0),this.getValue(_,l,0)*A),this.readCurve(_,T,u),u++;a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.PathConstraintPositionTimeline.ENTRIES])}else if("mix"===l){for((T=new t.PathConstraintMixTimeline(h.length)).pathConstraintIndex=M,u=0,f=0;f<h.length;f++)_=h[f],T.setFrame(u,this.getValue(_,"time",0),this.getValue(_,"rotateMix",1),this.getValue(_,"translateMix",1)),this.readCurve(_,T,u),u++;a.push(T),s=Math.max(s,T.frames[(T.getFrameCount()-1)*t.PathConstraintMixTimeline.ENTRIES])}}if(e.deform)for(var I in e.deform){var O=e.deform[I],P=n.findSkin(I);if(null==P)throw new Error("Skin not found: "+I);for(var o in O){if(c=O[o],-1==(J=n.findSlotIndex(o)))throw new Error("Slot not found: "+c.name);for(var l in c){h=c[l];var N=P.getAttachment(J,l);if(null!=N){var F=null!=N.bones,L=N.vertices,B=F?L.length/3*2:L.length;(T=new t.DeformTimeline(h.length)).slotIndex=J,T.attachment=N,u=0;for(var k=0;k<h.length;k++){_=h[k];var V=void 0,U=this.getValue(_,"vertices",null);if(null==U)V=F?t.Utils.newFloatArray(B):L;else{V=t.Utils.newFloatArray(B);var z=this.getValue(_,"offset",0);if(t.Utils.arrayCopy(U,0,V,z,U.length),1!=r)for(var G=(f=z)+U.length;f<G;f++)V[f]*=r;if(!F)for(f=0;f<B;f++)V[f]+=L[f]}T.setFrame(u,this.getValue(_,"time",0),V),this.readCurve(_,T,u),u++}a.push(T),s=Math.max(s,T.frames[T.getFrameCount()-1])}}}}var H=e.drawOrder;if(null==H&&(H=e.draworder),null!=H){T=new t.DrawOrderTimeline(H.length);var W=n.slots.length;for(u=0,k=0;k<H.length;k++){var j=H[k],Y=null,X=this.getValue(j,"offsets",null);if(null!=X){Y=t.Utils.newArray(W,-1);var q=t.Utils.newArray(W-X.length,0),Z=0,K=0;for(f=0;f<X.length;f++){var J,Q=X[f];if(-1==(J=n.findSlotIndex(Q.slot)))throw new Error("Slot not found: "+Q.slot);for(;Z!=J;)q[K++]=Z++;Y[Z+Q.offset]=Z++}for(;Z<W;)q[K++]=Z++;for(f=W-1;f>=0;f--)-1==Y[f]&&(Y[f]=q[--K])}T.setFrame(u++,this.getValue(j,"time",0),Y)}a.push(T),s=Math.max(s,T.frames[T.getFrameCount()-1])}if(e.events){for(T=new t.EventTimeline(e.events.length),u=0,f=0;f<e.events.length;f++){var $=e.events[f],tt=n.findEvent($.name);if(null==tt)throw new Error("Event not found: "+$.name);var et=new t.Event(t.Utils.toSinglePrecision(this.getValue($,"time",0)),tt);et.intValue=this.getValue($,"int",tt.intValue),et.floatValue=this.getValue($,"float",tt.floatValue),et.stringValue=this.getValue($,"string",tt.stringValue),null!=et.data.audioPath&&(et.volume=this.getValue($,"volume",1),et.balance=this.getValue($,"balance",0)),T.setFrame(u++,et)}a.push(T),s=Math.max(s,T.frames[T.getFrameCount()-1])}if(isNaN(s))throw new Error("Error while parsing animation, duration is NaN");n.animations.push(new t.Animation(i,a,s))},e.prototype.readCurve=function(t,e,i){var n=t.curve;n&&("stepped"==n?e.setStepped(i):"[object Array]"===Object.prototype.toString.call(n)?e.setCurve(i,n[0],n[1],n[2],n[3]):e.setCurve(i,n,this.getValue(t,"c2",0),this.getValue(t,"c3",1),this.getValue(t,"c4",1)))},e.prototype.getValue=function(t,e,i){return void 0!==t[e]?t[e]:i},e.blendModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.BlendMode.Normal;if("additive"==e)return t.BlendMode.Additive;if("multiply"==e)return t.BlendMode.Multiply;if("screen"==e)return t.BlendMode.Screen;throw new Error("Unknown blend mode: "+e)},e.positionModeFromString=function(e){if("fixed"==(e=e.toLowerCase()))return t.PositionMode.Fixed;if("percent"==e)return t.PositionMode.Percent;throw new Error("Unknown position mode: "+e)},e.spacingModeFromString=function(e){if("length"==(e=e.toLowerCase()))return t.SpacingMode.Length;if("fixed"==e)return t.SpacingMode.Fixed;if("percent"==e)return t.SpacingMode.Percent;throw new Error("Unknown position mode: "+e)},e.rotateModeFromString=function(e){if("tangent"==(e=e.toLowerCase()))return t.RotateMode.Tangent;if("chain"==e)return t.RotateMode.Chain;if("chainscale"==e)return t.RotateMode.ChainScale;throw new Error("Unknown rotate mode: "+e)},e.transformModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.TransformMode.Normal;if("onlytranslation"==e)return t.TransformMode.OnlyTranslation;if("norotationorreflection"==e)return t.TransformMode.NoRotationOrReflection;if("noscale"==e)return t.TransformMode.NoScale;if("noscaleorreflection"==e)return t.TransformMode.NoScaleOrReflection;throw new Error("Unknown transform mode: "+e)},e})();t.SkeletonJson=e;var i=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r}})(r||(r={})),(function(t){var e=function(t,e,i){this.slotIndex=t,this.name=e,this.attachment=i};t.SkinEntry=e;var i=(function(){function i(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,null==t)throw new Error("name cannot be null.");this.name=t}return i.prototype.setAttachment=function(t,e,i){if(null==i)throw new Error("attachment cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var i=t.bones[e],n=!1,r=0;r<this.bones.length;r++)if(this.bones[r]==i){n=!0;break}n||this.bones.push(i)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(n=!1,r=0;r<this.constraints.length;r++)if(this.constraints[r]==a){n=!0;break}n||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];this.setAttachment(o.slotIndex,o.name,o.attachment)}},i.prototype.copySkin=function(e){for(var i=0;i<e.bones.length;i++){for(var n=e.bones[i],r=!1,a=0;a<this.bones.length;a++)if(this.bones[a]==n){r=!0;break}r||this.bones.push(n)}for(i=0;i<e.constraints.length;i++){var s=e.constraints[i];for(r=!1,a=0;a<this.constraints.length;a++)if(this.constraints[a]==s){r=!0;break}r||this.constraints.push(s)}var o=e.getAttachments();for(i=0;i<o.length;i++){var c=o[i];null!=c.attachment&&(c.attachment instanceof t.MeshAttachment?(c.attachment=c.attachment.newLinkedMesh(),this.setAttachment(c.slotIndex,c.name,c.attachment)):(c.attachment=c.attachment.copy(),this.setAttachment(c.slotIndex,c.name,c.attachment)))}},i.prototype.getAttachment=function(t,e){var i=this.attachments[t];return i?i[e]:null},i.prototype.removeAttachment=function(t,e){var i=this.attachments[t];i&&(i[e]=null)},i.prototype.getAttachments=function(){for(var t=new Array,i=0;i<this.attachments.length;i++){var n=this.attachments[i];if(n)for(var r in n){var a=n[r];a&&t.push(new e(i,r,a))}}return t},i.prototype.getAttachmentsForSlot=function(t,i){var n=this.attachments[t];if(n)for(var r in n){var a=n[r];a&&i.push(new e(t,r,a))}},i.prototype.clear=function(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0},i.prototype.attachAll=function(t,e){for(var i=0,n=0;n<t.slots.length;n++){var r=t.slots[n],a=r.getAttachment();if(a&&i<e.attachments.length){var s=e.attachments[i];for(var o in s)if(a==s[o]){var c=this.getAttachment(i,o);null!=c&&r.setAttachment(c);break}}i++}},i})();t.Skin=i})(r||(r={})),(function(t){var e=(function(){function e(e,i){if(this.deform=new Array,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("bone cannot be null.");this.data=e,this.bone=i,this.color=new t.Color,this.darkColor=null==e.darkColor?null:new t.Color,this.setToSetupPose()}return e.prototype.getSkeleton=function(){return this.bone.skeleton},e.prototype.getAttachment=function(){return this.attachment},e.prototype.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)},e.prototype.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},e.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},e.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},e})();t.Slot=e})(r||(r={})),(function(t){t.SlotData=function(e,i,n){if(this.color=new t.Color(1,1,1,1),e<0)throw new Error("index must be >= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n}})(r||(r={})),(function(t){var e,i,n=(function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t})();t.Texture=n,(function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"})(e=t.TextureFilter||(t.TextureFilter={})),(function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"})(i=t.TextureWrap||(t.TextureWrap={}));t.TextureRegion=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};var r=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.setFilters=function(){},e.prototype.setWraps=function(){},e.prototype.dispose=function(){},e})(n);t.FakeTexture=r})(r||(r={})),(function(t){var e=(function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,a){if(null==a)throw new Error("textureLoader cannot be null.");for(var s=new i(e),o=new Array(4),c=null;;){var l=s.readLine();if(null==l)break;if(0==(l=l.trim()).length)c=null;else if(c){var h=new r;h.name=l,h.page=c;var u=s.readValue();"true"==u.toLocaleLowerCase()?h.degrees=90:"false"==u.toLocaleLowerCase()?h.degrees=0:h.degrees=parseFloat(u),h.rotate=90==h.degrees,s.readTuple(o);var f=parseInt(o[0]),_=parseInt(o[1]);s.readTuple(o);var d=parseInt(o[0]),p=parseInt(o[1]);h.u=f/c.width,h.v=_/c.height,h.rotate?(h.u2=(f+p)/c.width,h.v2=(_+d)/c.height):(h.u2=(f+d)/c.width,h.v2=(_+p)/c.height),h.x=f,h.y=_,h.width=Math.abs(d),h.height=Math.abs(p),4==s.readTuple(o)&&4==s.readTuple(o)&&s.readTuple(o),h.originalWidth=parseInt(o[0]),h.originalHeight=parseInt(o[1]),s.readTuple(o),h.offsetX=parseInt(o[0]),h.offsetY=parseInt(o[1]),h.index=parseInt(s.readValue()),h.texture=c.texture,this.regions.push(h)}else{(c=new n).name=l,2==s.readTuple(o)&&(c.width=parseInt(o[0]),c.height=parseInt(o[1]),s.readTuple(o)),s.readTuple(o),c.minFilter=t.Texture.filterFromString(o[0]),c.magFilter=t.Texture.filterFromString(o[1]);var m=s.readValue();c.uWrap=t.TextureWrap.ClampToEdge,c.vWrap=t.TextureWrap.ClampToEdge,"x"==m?c.uWrap=t.TextureWrap.Repeat:"y"==m?c.vWrap=t.TextureWrap.Repeat:"xy"==m&&(c.uWrap=c.vWrap=t.TextureWrap.Repeat),c.texture=a(l),c.texture.setFilters(c.minFilter,c.magFilter),c.texture.setWraps(c.uWrap,c.vWrap),c.width=c.texture.getImage().width,c.height=c.texture.getImage().height,this.pages.push(c)}}},e.prototype.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},e.prototype.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()},e})();t.TextureAtlas=e;var i=(function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}return t.prototype.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var a=e.indexOf(",",r);if(-1==a)break;t[n]=e.substr(r,a-r).trim(),r=a+1}return t[n]=e.substring(r).trim(),n+1},t})(),n=function(){};t.TextureAtlasPage=n;var r=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e})(t.TextureRegion);t.TextureAtlasRegion=r})(r||(r={})),(function(t){var e=(function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n<e.bones.length;n++)this.bones.push(i.findBone(e.bones[n].name));this.target=i.findBone(e.target.name)}return e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target,s=a.a,o=a.b,c=a.c,l=a.d,h=s*l-o*c>0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*h,f=this.data.offsetShearY*h,_=this.bones,d=0,p=_.length;d<p;d++){var m=_[d],v=!1;if(0!=e){var g=m.a,y=m.b,T=m.c,A=m.d;(w=Math.atan2(c,s)-Math.atan2(T,g)+u)>t.MathUtils.PI?w-=t.MathUtils.PI2:w<-t.MathUtils.PI&&(w+=t.MathUtils.PI2),w*=e;var b=Math.cos(w),E=Math.sin(w);m.a=b*g-E*T,m.b=b*y-E*A,m.c=E*g+b*T,m.d=E*y+b*A,v=!0}if(0!=i){var C=this.temp;a.localToWorld(C.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(C.x-m.worldX)*i,m.worldY+=(C.y-m.worldY)*i,v=!0}if(n>0){var x=Math.sqrt(m.a*m.a+m.c*m.c),S=Math.sqrt(s*s+c*c);x>1e-5&&(x=(x+(S-x+this.data.offsetScaleX)*n)/x),m.a*=x,m.c*=x,x=Math.sqrt(m.b*m.b+m.d*m.d),S=Math.sqrt(o*o+l*l),x>1e-5&&(x=(x+(S-x+this.data.offsetScaleY)*n)/x),m.b*=x,m.d*=x,v=!0}if(r>0){y=m.b,A=m.d;var w,D=Math.atan2(A,y);(w=Math.atan2(l,o)-Math.atan2(c,s)-(D-Math.atan2(m.c,m.a)))>t.MathUtils.PI?w-=t.MathUtils.PI2:w<-t.MathUtils.PI&&(w+=t.MathUtils.PI2),w=D+(w+f)*r,x=Math.sqrt(y*y+A*A),m.b=Math.cos(w)*x,m.d=Math.sin(w)*x,v=!0}v&&(m.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target,s=a.a,o=a.b,c=a.c,l=a.d,h=s*l-o*c>0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*h,f=this.data.offsetShearY*h,_=this.bones,d=0,p=_.length;d<p;d++){var m,v=_[d],g=!1;if(0!=e){var y=v.a,T=v.b,A=v.c,b=v.d;(m=Math.atan2(c,s)+u)>t.MathUtils.PI?m-=t.MathUtils.PI2:m<-t.MathUtils.PI&&(m+=t.MathUtils.PI2),m*=e;var E=Math.cos(m),C=Math.sin(m);v.a=E*y-C*A,v.b=E*T-C*b,v.c=C*y+E*A,v.d=C*T+E*b,g=!0}if(0!=i){var x=this.temp;a.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),v.worldX+=x.x*i,v.worldY+=x.y*i,g=!0}if(n>0){var S=(Math.sqrt(s*s+c*c)-1+this.data.offsetScaleX)*n+1;v.a*=S,v.c*=S,S=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,v.b*=S,v.d*=S,g=!0}if(r>0)(m=Math.atan2(l,o)-Math.atan2(c,s))>t.MathUtils.PI?m-=t.MathUtils.PI2:m<-t.MathUtils.PI&&(m+=t.MathUtils.PI2),T=v.b,b=v.d,m=Math.atan2(b,T)+(m-t.MathUtils.PI/2+f)*r,S=Math.sqrt(T*T+b*b),v.b=Math.cos(m)*S,v.d=Math.sin(m)*S,g=!0;g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var a=this.bones,s=0,o=a.length;s<o;s++){var c=a[s];c.appliedValid||c.updateAppliedTransform();var l=c.arotation;if(0!=t){var h=r.arotation-l+this.data.offsetRotation;l+=(h-=360*(16384-(16384.499999999996-h/360|0)))*t}var u=c.ax,f=c.ay;0!=e&&(u+=(r.ax-u+this.data.offsetX)*e,f+=(r.ay-f+this.data.offsetY)*e);var _=c.ascaleX,d=c.ascaleY;0!=i&&(_>1e-5&&(_=(_+(r.ascaleX-_+this.data.offsetScaleX)*i)/_),d>1e-5&&(d=(d+(r.ascaleY-d+this.data.offsetScaleY)*i)/d));var p=c.ashearY;0!=n&&(h=r.ashearY-p+this.data.offsetShearY,h-=360*(16384-(16384.499999999996-h/360|0)),c.shearY+=h*n),c.updateWorldTransformWith(u,f,l,_,d,c.ashearX,p)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var a=this.bones,s=0,o=a.length;s<o;s++){var c=a[s];c.appliedValid||c.updateAppliedTransform();var l=c.arotation;0!=t&&(l+=(r.arotation+this.data.offsetRotation)*t);var h=c.ax,u=c.ay;0!=e&&(h+=(r.ax+this.data.offsetX)*e,u+=(r.ay+this.data.offsetY)*e);var f=c.ascaleX,_=c.ascaleY;0!=i&&(f>1e-5&&(f*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),_>1e-5&&(_*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var d=c.ashearY;0!=n&&(d+=(r.ashearY+this.data.offsetShearY)*n),c.updateWorldTransformWith(h,u,l,f,_,c.ashearX,d)}},e})();t.TransformConstraint=e})(r||(r={})),(function(t){var e=(function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return a(e,t),e})(t.ConstraintData);t.TransformConstraintData=e})(r||(r={})),(function(t){var e=(function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool(function(){return new Array}),this.polygonIndicesPool=new t.Pool(function(){return new Array})}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var a=0;a<n;a++)r[a]=a;var s=this.isConcaveArray;s.length=0,a=0;for(var o=n;a<o;++a)s[a]=e.isConcave(a,n,i,r);var c=this.triangles;for(c.length=0;n>3;){for(var l=n-1,h=(a=0,1);;){t:if(!s[a]){for(var u=r[l]<<1,f=r[a]<<1,_=r[h]<<1,d=i[u],p=i[u+1],m=i[f],v=i[f+1],g=i[_],y=i[_+1],T=(h+1)%n;T!=l;T=(T+1)%n)if(s[T]){var A=r[T]<<1,b=i[A],E=i[A+1];if(e.positiveArea(g,y,d,p,b,E)&&e.positiveArea(d,p,m,v,b,E)&&e.positiveArea(m,v,g,y,b,E))break t}break}if(0==h){do{if(!s[a])break;a--}while(a>0);break}l=a,a=h,h=(h+1)%n}c.push(r[(n+a-1)%n]),c.push(r[a]),c.push(r[(a+1)%n]),r.splice(a,1),s.splice(a,1);var C=(--n+a-1)%n,x=a==n?0:a;s[C]=e.isConcave(C,n,i,r),s[x]=e.isConcave(x,n,i,r)}return 3==n&&(c.push(r[2]),c.push(r[0]),c.push(r[1])),c},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var c=-1,l=0,h=0,u=i.length;h<u;h+=3){var f=i[h]<<1,_=i[h+1]<<1,d=i[h+2]<<1,p=n[f],m=n[f+1],v=n[_],g=n[_+1],y=n[d],T=n[d+1],A=!1;if(c==f){var b=o.length-4,E=e.winding(o[b],o[b+1],o[b+2],o[b+3],y,T),C=e.winding(y,T,o[0],o[1],o[2],o[3]);E==l&&C==l&&(o.push(y),o.push(T),s.push(d),A=!0)}A||(o.length>0?(r.push(o),a.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(p),o.push(m),o.push(v),o.push(g),o.push(y),o.push(T),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(_),s.push(d),l=e.winding(p,m,v,g,y,T),c=f)}for(o.length>0&&(r.push(o),a.push(s)),h=0,u=r.length;h<u;h++)if(0!=(s=a[h]).length)for(var x=s[0],S=s[s.length-1],w=(o=r[h])[b=o.length-4],D=o[b+1],M=o[b+2],R=o[b+3],I=o[0],O=o[1],P=o[2],N=o[3],F=e.winding(w,D,M,R,I,O),L=0;L<u;L++)if(L!=h){var B=a[L];if(3==B.length){var k=B[0],V=B[1],U=B[2],z=r[L];y=z[z.length-2],T=z[z.length-1],k==x&&V==S&&(E=e.winding(w,D,M,R,y,T),C=e.winding(y,T,I,O,P,N),E==F&&C==F&&(z.length=0,B.length=0,o.push(y),o.push(T),s.push(U),w=M,D=R,M=y,R=T,L=0))}}for(h=r.length-1;h>=0;h--)0==(o=r[h]).length&&(r.splice(h,1),this.polygonPool.free(o),s=a[h],a.splice(h,1),this.polygonIndicesPool.free(s));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,a=n[t]<<1,s=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[a],i[a+1],i[s],i[s+1])},e.positiveArea=function(t,e,i,n,r,a){return t*(a-n)+i*(e-a)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,a){var s=i-t,o=n-e;return r*o-a*s+s*e-t*o>=0?1:-1},e})();t.Triangulator=e})(r||(r={})),(function(t){var e=(function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t})();t.IntSet=e;var i=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t})();t.Color=i;var n=(function(){function t(){}return t.clamp=function(t,e,i){return t<e?e:t>i?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t})();t.MathUtils=n;var r=(function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t})();t.Interpolation=r;var s=(function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return a(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e})(r);t.Pow=s;var o=(function(t){function e(e){return t.call(this,e)||this}return a(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e})(s);t.PowOut=o;var c=(function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var a=e,s=n;a<e+r;a++,s++)i[s]=t[a]},t.setArraySize=function(t,e,i){void 0===i&&(i=0);var n=t.length;if(n==e)return t;if(t.length=e,n<e)for(var r=n;r<e;r++)t[r]=i;return t},t.ensureArrayCapacity=function(e,i,n){return void 0===n&&(n=0),e.length>=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n<t;n++)i[n]=e;return i},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var i=new Array(e),n=0;n<i.length;n++)i[n]=0;return i},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var i=new Array(e),n=0;n<i.length;n++)i[n]=0;return i},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(){},t.contains=function(t,e,i){void 0===i&&(i=!0);for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t})();t.Utils=c;var l=(function(){function t(){}return t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var i=t.bones[e];console.log(i.data.name+", "+i.a+", "+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}},t})();t.DebugUtils=l;var h=(function(){function t(t){this.items=new Array,this.instantiator=t}return t.prototype.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;e<t.length;e++)t[e].reset&&t[e].reset(),this.items[e]=t[e]},t.prototype.clear=function(){this.items.length=0},t})();t.Pool=h;var u=(function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},t.prototype.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t})();t.Vector2=u;var f=(function(){function t(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return t.prototype.update=function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t})();t.TimeKeeper=f;var _=(function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0},t})();t.WindowedMean=_})(r||(r={})),Math.fround||(Math.fround=(n=new Float32Array(1),function(t){return n[0]=t,n[0]})),(function(t){var e=function(t){if(null==t)throw new Error("name cannot be null.");this.name=t};t.Attachment=e;var i=(function(e){function i(t){var n=e.call(this,t)||this;return n.id=(65535&i.nextID++)<<11,n.worldVerticesLength=0,n.deformAttachment=n,n}return a(i,e),i.prototype.computeWorldVertices=function(t,e,i,n,r,a){i=r+(i>>1)*a;var s=t.bone.skeleton,o=t.deform,c=this.vertices,l=this.bones;if(null!=l){for(var h=0,u=0,f=0;f<e;f+=2)h+=(m=l[h])+1,u+=m;var _=s.bones;if(0==o.length)for(D=r,C=3*u;D<i;D+=a){var d=0,p=0,m=l[h++];for(m+=h;h<m;h++,C+=3){T=_[l[h]],M=c[C],R=c[C+1];var v=c[C+2];d+=(M*T.a+R*T.b+T.worldX)*v,p+=(M*T.c+R*T.d+T.worldY)*v}n[D]=d,n[D+1]=p}else for(var g=o,y=(D=r,C=3*u,u<<1);D<i;D+=a){for(d=0,p=0,m=l[h++],m+=h;h<m;h++,C+=3,y+=2)T=_[l[h]],M=c[C]+g[y],R=c[C+1]+g[y+1],v=c[C+2],d+=(M*T.a+R*T.b+T.worldX)*v,p+=(M*T.c+R*T.d+T.worldY)*v;n[D]=d,n[D+1]=p}}else{o.length>0&&(c=o);for(var T,A=(T=t.bone).worldX,b=T.worldY,E=T.a,C=T.b,x=T.c,S=T.d,w=e,D=r;D<i;w+=2,D+=a){var M=c[w],R=c[w+1];n[D]=M*E+R*C+A,n[D+1]=M*x+R*S+b}}},i.prototype.copyTo=function(e){null!=this.bones?(e.bones=new Array(this.bones.length),t.Utils.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,null!=this.vertices?(e.vertices=t.Utils.newFloatArray(this.vertices.length),t.Utils.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)):e.vertices=null,e.worldVerticesLength=this.worldVerticesLength,e.deformAttachment=this.deformAttachment},i.nextID=0,i})(e);t.VertexAttachment=i})(r||(r={})),(function(t){(function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"})(t.AttachmentType||(t.AttachmentType={}))})(r||(r={})),(function(t){var e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new t.Color(1,1,1,1),n}return a(i,e),i.prototype.copy=function(){var t=new i(name);return this.copyTo(t),t.color.setFromColor(this.color),t},i})(t.VertexAttachment);t.BoundingBoxAttachment=e})(r||(r={})),(function(t){var e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new t.Color(.2275,.2275,.8078,1),n}return a(i,e),i.prototype.copy=function(){var t=new i(name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},i})(t.VertexAttachment);t.ClippingAttachment=e})(r||(r={})),(function(t){var e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new t.Color(1,1,1,1),n.tempColor=new t.Color(0,0,0,0),n}return a(i,e),i.prototype.updateUVs=function(){var e=this.regionUVs;null!=this.uvs&&this.uvs.length==e.length||(this.uvs=t.Utils.newFloatArray(e.length));var i=this.uvs,n=this.uvs.length,r=this.region.u,a=this.region.v,s=0,o=0;if(this.region instanceof t.TextureAtlasRegion){var c=this.region,l=c.texture.getImage().width,h=c.texture.getImage().height;switch(c.degrees){case 90:r-=(c.originalHeight-c.offsetY-c.height)/l,a-=(c.originalWidth-c.offsetX-c.width)/h,s=c.originalHeight/l,o=c.originalWidth/h;for(var u=0;u<n;u+=2)i[u]=r+e[u+1]*s,i[u+1]=a+(1-e[u])*o;return;case 180:for(r-=(c.originalWidth-c.offsetX-c.width)/l,a-=c.offsetY/h,s=c.originalWidth/l,o=c.originalHeight/h,u=0;u<n;u+=2)i[u]=r+(1-e[u])*s,i[u+1]=a+(1-e[u+1])*o;return;case 270:for(r-=c.offsetY/l,a-=c.offsetX/h,s=c.originalHeight/l,o=c.originalWidth/h,u=0;u<n;u+=2)i[u]=r+(1-e[u+1])*s,i[u+1]=a+e[u]*o;return}r-=c.offsetX/l,a-=(c.originalHeight-c.offsetY-c.height)/h,s=c.originalWidth/l,o=c.originalHeight/h}else null==this.region?(r=a=0,s=o=1):(s=this.region.u2-r,o=this.region.v2-a);for(u=0;u<n;u+=2)i[u]=r+e[u]*s,i[u+1]=a+e[u+1]*o},i.prototype.getParentMesh=function(){return this.parentMesh},i.prototype.setParentMesh=function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},i.prototype.copy=function(){if(null!=this.parentMesh)return this.newLinkedMesh();var e=new i(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),t.Utils.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),t.Utils.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),t.Utils.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,null!=this.edges&&(e.edges=new Array(this.edges.length),t.Utils.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e},i.prototype.newLinkedMesh=function(){var t=new i(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(null!=this.parentMesh?this.parentMesh:this),t.updateUVs(),t},i})(t.VertexAttachment);t.MeshAttachment=e})(r||(r={})),(function(t){var e=(function(e){function i(i){var n=e.call(this,i)||this;return n.closed=!1,n.constantSpeed=!1,n.color=new t.Color(1,1,1,1),n}return a(i,e),i.prototype.copy=function(){var e=new i(name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),t.Utils.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e},i})(t.VertexAttachment);t.PathAttachment=e})(r||(r={})),(function(t){var e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new t.Color(.38,.94,0,1),n}return a(i,e),i.prototype.computeWorldPosition=function(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e},i.prototype.computeWorldRotation=function(e){var i=t.MathUtils.cosDeg(this.rotation),n=t.MathUtils.sinDeg(this.rotation),r=i*e.a+n*e.b,a=i*e.c+n*e.d;return Math.atan2(a,r)*t.MathUtils.radDeg},i.prototype.copy=function(){var t=new i(name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},i})(t.VertexAttachment);t.PointAttachment=e})(r||(r={})),(function(t){var e=(function(e){function i(i){var n=e.call(this,i)||this;return n.x=0,n.y=0,n.scaleX=1,n.scaleY=1,n.rotation=0,n.width=0,n.height=0,n.color=new t.Color(1,1,1,1),n.offset=t.Utils.newFloatArray(8),n.uvs=t.Utils.newFloatArray(8),n.tempColor=new t.Color(1,1,1,1),n}return a(i,e),i.prototype.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*t,r=-this.height/2*this.scaleY+this.region.offsetY*e,a=n+this.region.width*t,s=r+this.region.height*e,o=this.rotation*Math.PI/180,c=Math.cos(o),l=Math.sin(o),h=n*c+this.x,u=n*l,f=r*c+this.y,_=r*l,d=a*c+this.x,p=a*l,m=s*c+this.y,v=s*l,g=this.offset;g[i.OX1]=h-_,g[i.OY1]=f+u,g[i.OX2]=h-v,g[i.OY2]=m+u,g[i.OX3]=d-v,g[i.OY3]=m+p,g[i.OX4]=d-_,g[i.OY4]=f+p},i.prototype.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},i.prototype.computeWorldVertices=function(t,e,n,r){var a=this.offset,s=t.worldX,o=t.worldY,c=t.a,l=t.b,h=t.c,u=t.d,f=0,_=0;f=a[i.OX1],_=a[i.OY1],e[n]=f*c+_*l+s,e[n+1]=f*h+_*u+o,n+=r,f=a[i.OX2],_=a[i.OY2],e[n]=f*c+_*l+s,e[n+1]=f*h+_*u+o,n+=r,f=a[i.OX3],_=a[i.OY3],e[n]=f*c+_*l+s,e[n+1]=f*h+_*u+o,n+=r,f=a[i.OX4],_=a[i.OY4],e[n]=f*c+_*l+s,e[n+1]=f*h+_*u+o},i.prototype.copy=function(){var e=new i(name);return e.region=this.region,e.rendererObject=this.rendererObject,e.path=this.path,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,t.Utils.arrayCopy(this.uvs,0,e.uvs,0,8),t.Utils.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e},i.OX1=0,i.OY1=1,i.OX2=2,i.OY2=3,i.OX3=4,i.OY3=5,i.OX4=6,i.OY4=7,i.X1=0,i.Y1=1,i.C1R=2,i.C1G=3,i.C1B=4,i.C1A=5,i.U1=6,i.V1=7,i.X2=8,i.Y2=9,i.C2R=10,i.C2G=11,i.C2B=12,i.C2A=13,i.U2=14,i.V2=15,i.X3=16,i.Y3=17,i.C3R=18,i.C3G=19,i.C3B=20,i.C3A=21,i.U3=22,i.V3=23,i.X4=24,i.Y4=25,i.C4R=26,i.C4G=27,i.C4B=28,i.C4A=29,i.U4=30,i.V4=31,i})(t.Attachment);t.RegionAttachment=e})(r||(r={})),(function(t){var e=(function(){function e(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}return e.prototype.begin=function(){},e.prototype.transform=function(e){e.x+=t.MathUtils.randomTriangular(-this.jitterX,this.jitterY),e.y+=t.MathUtils.randomTriangular(-this.jitterX,this.jitterY)},e.prototype.end=function(){},e})();t.JitterEffect=e})(r||(r={})),(function(t){var e=(function(){function e(t,e){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t,this.interpolation=e}return e.prototype.begin=function(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY},e.prototype.transform=function(e){var i=this.angle*t.MathUtils.degreesToRadians,n=e.x-this.worldX,r=e.y-this.worldY,a=Math.sqrt(n*n+r*r);if(a<this.radius){var s=this.interpolation.apply(0,i,(this.radius-a)/this.radius),o=Math.cos(s),c=Math.sin(s);e.x=o*n-c*r+this.worldX,e.y=c*n+o*r+this.worldY}},e.prototype.end=function(){},e.interpolation=new t.PowOut(2),e})();t.SwirlEffect=e})(r||(r={})),e.exports=r}),{}],334:[(function(t,e){"use strict";var i,n,r,a,s,o,c=t("./track-entry-listeners"),l=t("./lib/spine"),h=[],u=[],f=0,_=0,d=0,p=null,m=null,v=0,g=0,y=0,T=0,A=null,b=null,E=0,C=0,x=new l.Color(1,1,1,1),S=new l.Color(1,1,1,1),w=[0,1,2,2,3,0],D=cc.Class({ctor:function(){this._privateMode=!1,this._inited=!1,this._invalid=!0,this._enableCacheAttachedInfo=!1,this.frames=[],this.totalTime=0,this._frameIdx=-1,this.isCompleted=!1,this._skeletonInfo=null,this._animationName=null,this._tempSegments=null,this._tempColors=null,this._tempBoneInfos=null},init:function(t,e){this._inited=!0,this._animationName=e,this._skeletonInfo=t},clear:function(){this._inited=!1;for(var t=0,e=this.frames.length;t<e;t++)this.frames[t].segments.length=0;this.invalidAllFrame()},bind:function(t){var e=function(t){t&&t.animation.name===this._animationName&&(this.isCompleted=!0)}.bind(this);t.complete=e},unbind:function(t){t.complete=null},begin:function(){if(this._invalid){var t=this._skeletonInfo,e=t.curAnimationCache;e&&e!==this&&(this._privateMode?e.invalidAllFrame():e.updateToFrame());var i=t.skeleton,n=t.listener,r=t.state,a=i.data.findAnimation(this._animationName);r.setAnimationWith(0,a,!1),this.bind(n),t.curAnimationCache=this,this._frameIdx=-1,this.isCompleted=!1,this.totalTime=0,this._invalid=!1}},end:function(){this._needToUpdate()||(this._skeletonInfo.curAnimationCache=null,this.frames.length=this._frameIdx+1,this.isCompleted=!0,this.unbind(this._skeletonInfo.listener))},_needToUpdate:function(t){return!this.isCompleted&&this.totalTime<30&&(null==t||this._frameIdx<t)},updateToFrame:function(t){if(this._inited&&(this.begin(),this._needToUpdate(t))){var e=this._skeletonInfo,i=e.skeleton,n=e.clipper,r=e.state;do{i.update(1/60),r.update(1/60),r.apply(i),i.updateWorldTransform(),this._frameIdx++,this._updateFrame(i,n,this._frameIdx),this.totalTime+=1/60}while(this._needToUpdate(t));this.end()}},isInited:function(){return this._inited},isInvalid:function(){return this._invalid},invalidAllFrame:function(){this.isCompleted=!1,this._invalid=!0},updateAllFrame:function(){this.invalidAllFrame(),this.updateToFrame()},enableCacheAttachedInfo:function(){this._enableCacheAttachedInfo||(this._enableCacheAttachedInfo=!0,this.invalidAllFrame())},_updateFrame:function(t,e,i){d=0,f=0,_=0,p=null,m=null,v=0,g=0,y=0,T=0,A=null,b=null,this.frames[i]=this.frames[i]||{segments:[],colors:[],boneInfos:[],vertices:null,uintVert:null,indices:null};var n=this.frames[i],r=this._tempSegments=n.segments,a=this._tempColors=n.colors,s=this._tempBoneInfos=n.boneInfos;this._traverseSkeleton(t,e),T>0&&(a[T-1].vfOffset=d),a.length=T,s.length=f;var o=y-1;if(o>=0)if(g>0){var c=r[o];c.indexCount=g,c.vfCount=6*v,c.vertexCount=v,r.length=y}else r.length=y-1;if(0!=r.length){var l=n.vertices,E=n.uintVert;(!l||l.length<d)&&(l=n.vertices=new Float32Array(d),E=n.uintVert=new Uint32Array(l.buffer));for(var C=0,x=0;C<d;)l[C++]=h[x++],l[C++]=h[x++],l[C++]=h[x++],l[C++]=h[x++],E[C++]=h[x++],E[C++]=h[x++];var S=n.indices;(!S||S.length<_)&&(S=n.indices=new Uint16Array(_));for(var w=0;w<_;w++)S[w]=u[w];n.vertices=l,n.uintVert=E,n.indices=S}},fillVertices:function(t,e,c,l,f){if(a=c.a*e.a*t.a*255,i=e.r*t.r*255,n=e.g*t.g*255,r=e.b*t.b*255,x.r=i*c.r,x.g=n*c.g,x.b=r*c.b,x.a=a,null==f.darkColor?S.set(0,0,0,1):(S.r=f.darkColor.r*i,S.g=f.darkColor.g*n,S.b=f.darkColor.b*r),S.a=0,s=(x.a<<24>>>0)+(x.b<<16)+(x.g<<8)+x.r,o=(S.a<<24>>>0)+(S.b<<16)+(S.g<<8)+S.r,A!==s||b!==o){var p=this._tempColors;A=s,b=o,T>0&&(p[T-1].vfOffset=d),p[T++]={fr:x.r,fg:x.g,fb:x.b,fa:x.a,dr:S.r,dg:S.g,db:S.b,da:S.a,vfOffset:0}}if(l.isClipping()){l.clipTriangles(h,E,u,C,h,x,S,!0,6,_,d,d+2);var m=l.clippedVertices,v=l.clippedTriangles;C=v.length,E=m.length/12*6;for(var g=0,y=_,w=v.length;g<w;)u[y++]=v[g++];for(var D=0,M=m.length,R=d;D<M;D+=12,R+=6)h[R]=m[D],h[R+1]=m[D+1],h[R+2]=m[D+6],h[R+3]=m[D+7],h[R+4]=s,h[R+5]=o}else for(var I=d,O=d+E;I<O;I+=6)h[I+4]=s,h[I+5]=o},_traverseSkeleton:function(t,e){var i,n,r,a,s,o,c,T,A,b,x,S,D=this._tempSegments,M=this._tempBoneInfos,R=t.color,I=t.bones;if(this._enableCacheAttachedInfo)for(var O=0,P=I.length;O<P;O++,f++){var N=I[O],F=M[f];F||(F=M[f]={}),F.a=N.a,F.b=N.b,F.c=N.c,F.d=N.d,F.worldX=N.worldX,F.worldY=N.worldY}for(var L=0,B=t.drawOrder.length;L<B;L++)if((S=t.drawOrder[L]).bone.active)if(E=0,C=0,i=S.getAttachment())if(o=i instanceof l.RegionAttachment,c=i instanceof l.MeshAttachment,i instanceof l.ClippingAttachment)e.clipStart(S,i);else if(o||c)if(T=i.region.texture._texture)if(x=S.data.blendMode,p===T.nativeUrl&&m===x||(p=T.nativeUrl,m=x,(A=y-1)>=0&&(g>0?((b=D[A]).indexCount=g,b.vertexCount=v,b.vfCount=6*v):y--),D[y]={tex:T,blendMode:x,indexCount:0,vertexCount:0,vfCount:0},y++,g=0,v=0),o?(s=w,E=24,C=6,i.computeWorldVertices(S.bone,h,d,6)):c&&(s=i.triangles,E=6*(i.worldVerticesLength>>1),C=s.length,i.computeWorldVertices(S,0,i.worldVerticesLength,h,d,6)),0!=E&&0!=C){for(var k=0,V=_,U=s.length;k<U;)u[V++]=s[k++];a=i.uvs;for(var z=d,G=d+E,H=0;z<G;z+=6,H+=2)h[z+2]=a[H],h[z+3]=a[H+1];if(n=i.color,r=S.color,this.fillVertices(R,n,r,e,S),C>0){for(var W=_,j=_+C;W<j;W++)u[W]+=v;_+=C,d+=E,g+=C,v+=E/6}e.clipEndWithSlot(S)}else e.clipEndWithSlot(S);else e.clipEndWithSlot(S);else e.clipEndWithSlot(S);else e.clipEndWithSlot(S);e.clipEnd()}}),M=cc.Class({ctor:function(){this._privateMode=!1,this._animationPool={},this._skeletonCache={}},enablePrivateMode:function(){this._privateMode=!0},clear:function(){this._animationPool={},this._skeletonCache={}},removeSkeleton:function(t){var e=this._skeletonCache[t];if(e){var i=e.animationsCache;for(var n in i){var r=i[n];r&&(this._animationPool[t+"#"+n]=r,r.clear())}delete this._skeletonCache[t]}},getSkeletonCache:function(t,e){var i=this._skeletonCache[t];if(!i){var n=new l.Skeleton(e),r=new l.SkeletonClipping,a=new l.AnimationStateData(n.data),s=new l.AnimationState(a),o=new c;s.addListener(o),this._skeletonCache[t]=i={skeleton:n,clipper:r,state:s,listener:o,animationsCache:{},curAnimationCache:null}}return i},getAnimationCache:function(t,e){var i=this._skeletonCache[t];return i?i.animationsCache[e]:null},invalidAnimationCache:function(t){var e=this._skeletonCache[t];if(e&&e.skeleton){var i=e.animationsCache;for(var n in i)i[n].invalidAllFrame()}},initAnimationCache:function(t,e){if(!e)return null;var i=this._skeletonCache[t],n=i&&i.skeleton;if(!n)return null;if(!n.data.findAnimation(e))return null;var r=i.animationsCache,a=r[e];if(!a){var s=t+"#"+e;(a=this._animationPool[s])?delete this._animationPool[s]:(a=new D)._privateMode=this._privateMode,a.init(i,e),r[e]=a}return a},updateAnimationCache:function(t,e){if(e){var i=this.initAnimationCache(t,e);if(!i)return null;i.updateAllFrame()}else{var n=this._skeletonCache[t];if(!n||!n.skeleton)return;var r=n.animationsCache;for(var a in r)r[a].updateAllFrame()}}});M.FrameTime=1/60,M.sharedCache=new M,e.exports=M}),{"./lib/spine":333,"./track-entry-listeners":338}],335:[(function(t,e){"use strict";var i=t("./skeleton-cache").sharedCache,n=cc.Class({name:"sp.SkeletonData",extends:cc.Asset,ctor:function(){this.reset()},properties:{_skeletonJson:null,skeletonJsonStr:{get:function(){return this._skeletonJson?JSON.stringify(this._skeletonJson):""}},skeletonJson:{get:function(){return this._skeletonJson},set:function(t){this.reset(),this._skeletonJson="string"==typeof t?JSON.parse(t):t,!this._uuid&&t.skeleton&&(this._uuid=t.skeleton.hash)}},_atlasText:"",atlasText:{get:function(){return this._atlasText},set:function(t){this._atlasText=t,this.reset()}},textures:{default:[],type:[cc.Texture2D]},textureNames:{default:[],type:[cc.String]},scale:1,_nativeAsset:{get:function(){return this._buffer},set:function(t){this._buffer=t.buffer||t,this.reset()},override:!0}},statics:{preventDeferredLoadDependents:!0},createNode:!1,reset:function(){this._skeletonCache=null,this._atlasCache=null},ensureTexturesLoaded:function(t,e){var i=this.textures,n=i.length;if(0!=n)for(var r=0,a=function(){++r>=n&&(t&&t.call(e,!0),t=null)},s=0;s<n;s++){var o=i[s];o.loaded?a():o.once("load",a)}else t.call(e,!1)},isTexturesLoaded:function(){for(var t=this.textures,e=t.length,i=0;i<e;i++)if(!t[i].loaded)return!1;return!0},getRuntimeData:function(t){if(this._skeletonCache)return this._skeletonCache;if(!(this.textures&&this.textures.length>0)&&this.textureNames&&this.textureNames.length>0)return t||cc.errorID(7507,this.name),null;var e=this._getAtlas(t);if(!e)return null;var i=new sp.spine.AtlasAttachmentLoader(e),n=null,r=null;return this.skeletonJson?(r=new sp.spine.SkeletonJson(i),n=this.skeletonJson):(r=new sp.spine.SkeletonBinary(i),n=new Uint8Array(this._nativeAsset)),r.scale=this.scale,this._skeletonCache=r.readSkeletonData(n),e.dispose(),this._skeletonCache},getSkinsEnum:!1,getAnimsEnum:!1,_getTexture:function(t){for(var e=this.textureNames,i=0;i<e.length;i++)if(e[i]===t){var n=this.textures[i],r=new sp.SkeletonTexture({width:n.width,height:n.height});return r.setRealTexture(n),r}return cc.errorID(7506,t),null},_getAtlas:function(t){return this._atlasCache?this._atlasCache:this.atlasText?this._atlasCache=new sp.spine.TextureAtlas(this.atlasText,this._getTexture.bind(this)):(t||cc.errorID(7508,this.name),null)},destroy:function(){i.removeSkeleton(this._uuid),this._super()}});sp.SkeletonData=e.exports=n}),{"./skeleton-cache":334}],336:[(function(){"use strict";sp.SkeletonTexture=cc.Class({name:"sp.SkeletonTexture",extends:sp.spine.Texture,_texture:null,_material:null,setRealTexture:function(t){this._texture=t},getRealTexture:function(){return this._texture},setFilters:function(t,e){this._texture&&this._texture.setFilters(t,e)},setWraps:function(t,e){this._texture&&this._texture.setWrapMode(t,e)},dispose:function(){}})}),{}],337:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../../cocos2d/core/renderer/assembler"))&&n.__esModule?n:{default:n};function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s,o,c,l,h,u,f,_,d,p,m,v,g,y,T,A,b,E=t("./Skeleton"),C=t("./lib/spine"),x=t("../../cocos2d/core/renderer/render-flow"),S=t("../../cocos2d/core/renderer/webgl/vertex-format"),w=S.vfmtPosUvColor,D=S.vfmtPosUvTwoColor,M=cc.gfx,R=0,I=[0,1,2,2,3,0],O=cc.color(0,0,255,255),P=cc.color(255,0,0,255),N=cc.color(0,255,0,255),F=cc.color(255,255,0,255),L=null,B=null,k=null,V=null;L=new C.Color(1,1,1,1),B=new C.Color(1,1,1,1),k=new C.Vector2,V=new C.Vector2;var U,z,G,H,W,j,Y,X,q,Z,K,J,Q,$,tt,et,it,nt,rt,at,st,ot,ct,lt,ht,ut,ft,_t,dt,pt=0,mt=0,vt=0,gt=0,yt=0,Tt=0,At=0;function bt(t,e){var i,n;switch(e){case C.BlendMode.Additive:i=s?cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE;break;case C.BlendMode.Multiply:i=cc.macro.DST_COLOR,n=cc.macro.ONE_MINUS_SRC_ALPHA;break;case C.BlendMode.Screen:i=cc.macro.ONE,n=cc.macro.ONE_MINUS_SRC_COLOR;break;case C.BlendMode.Normal:default:i=s?cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE_MINUS_SRC_ALPHA}var r=!lt.enableBatch,a=lt._materials[0];if(!a)return null;var o=t.getId()+i+n+h+r,c=lt._materialCache,l=c[o];return l||(c.baseMaterial?l=cc.MaterialVariant.create(a):(l=a,c.baseMaterial=a),l.define("CC_USE_MODEL",r),l.define("USE_TINT",h),l.setProperty("texture",t),l.setBlend(!0,M.BLEND_FUNC_ADD,i,n,M.BLEND_FUNC_ADD,i,n),c[o]=l),l}function Et(t){at=t.fa*v,$=d*(o=s?at/255:1),tt=p*o,et=m*o,it=t.fr*$,nt=t.fg*tt,rt=t.fb*et,g=(at<<24>>>0)+(rt<<16)+(nt<<8)+it,st=t.dr*$,ot=t.dg*tt,ct=t.db*et,y=((s?255:0)<<24>>>0)+(ct<<16)+(ot<<8)+st}function Ct(t){return(t.a<<24>>>0)+(t.b<<16)+(t.g<<8)+t.r}var xt=(function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,a(e,i);var r=n.prototype;return r.updateRenderData=function(t){if(!t.isAnimationCached()){var e=t._skeleton;e&&e.updateWorldTransform()}},r.fillVertices=function(t,e,i,n,r){var a,c=ht._vData,l=ht._iData,u=ht._uintVData;if(L.a=i.a*e.a*t.a*v*255,o=s?L.a:255,U=d*e.r*t.r*o,z=p*e.g*t.g*o,G=m*e.b*t.b*o,L.r=U*i.r,L.g=z*i.g,L.b=G*i.b,null==r.darkColor?B.set(0,0,0,1):(B.r=r.darkColor.r*U,B.g=r.darkColor.g*z,B.b=r.darkColor.b*G),B.a=s?255:0,n.isClipping()){var f=c.subarray(vt+2);n.clipTriangles(c.subarray(vt),pt,l.subarray(Tt),yt,f,L,B,h,A);var _=new Float32Array(n.clippedVertices),T=n.clippedTriangles;if(yt=T.length,pt=_.length/b*A,a=ht.request(pt/A,yt),Tt=a.indiceOffset,gt=a.vertexOffset,vt=a.byteOffset>>2,c=ht._vData,l=ht._iData,u=ht._uintVData,l.set(T,Tt),dt)for(var E=0,C=_.length,x=vt;E<C;E+=b,x+=A)k.x=_[E],k.y=_[E+1],L.set(_[E+2],_[E+3],_[E+4],_[E+5]),V.x=_[E+6],V.y=_[E+7],h?B.set(_[E+8],_[E+9],_[E+10],_[E+11]):B.set(0,0,0,0),dt.transform(k,V,L,B),c[x]=k.x,c[x+1]=k.y,c[x+2]=V.x,c[x+3]=V.y,u[x+4]=Ct(L),h&&(u[x+5]=Ct(B));else for(var S=0,w=_.length,D=vt;S<w;S+=b,D+=A)c[D]=_[S],c[D+1]=_[S+1],c[D+2]=_[S+6],c[D+3]=_[S+7],g=(_[S+5]<<24>>>0)+(_[S+4]<<16)+(_[S+3]<<8)+_[S+2],u[D+4]=g,h&&(y=(_[S+11]<<24>>>0)+(_[S+10]<<16)+(_[S+9]<<8)+_[S+8],u[D+5]=y)}else if(dt)for(var M=vt,R=vt+pt;M<R;M+=A)k.x=c[M],k.y=c[M+1],V.x=c[M+2],V.y=c[M+3],dt.transform(k,V,L,B),c[M]=k.x,c[M+1]=k.y,c[M+2]=V.x,c[M+3]=V.y,u[M+4]=Ct(L),h&&(u[M+5]=Ct(B));else{g=Ct(L),y=Ct(B);for(var I=vt,O=vt+pt;I<O;I+=A)u[I+4]=g,h&&(u[I+5]=y)}},r.realTimeTraverse=function(t){var e,i,n,r,a,s,o,d,p,m,v,g,y=lt._skeleton,T=y.color,E=lt._debugRenderer,x=lt._clipper,S=null;c=lt._startSlotIndex,l=lt._endSlotIndex,H=!1,-1==c&&(H=!0),u=lt.debugSlots,f=lt.debugBones,_=lt.debugMesh,E&&(f||u||_)&&(E.clear(),E.lineWidth=2),b=h?12:8,pt=0,vt=0,gt=0,yt=0,Tt=0;for(var w=0,D=y.drawOrder.length;w<D;w++)if(null!=(v=y.drawOrder[w])&&v.bone.active)if(c>=0&&c==v.data.index&&(H=!0),H)if(l>=0&&l==v.data.index&&(H=!1),pt=0,yt=0,n=v.getAttachment())if(d=n instanceof C.RegionAttachment,p=n instanceof C.MeshAttachment,n instanceof C.ClippingAttachment)x.clipStart(v,n);else if(d||p)if(S=bt(n.region.texture._texture,v.data.blendMode)){if((W||S.getHash()!==ut.material.getHash())&&(W=!1,ut._flush(),ut.node=ft,ut.material=S),d){if(o=I,pt=4*A,yt=6,m=ht.request(4,6),Tt=m.indiceOffset,gt=m.vertexOffset,vt=m.byteOffset>>2,e=ht._vData,i=ht._iData,n.computeWorldVertices(v.bone,e,vt,A),E&&u){E.strokeColor=O,E.moveTo(e[vt],e[vt+1]);for(var M=vt+A,R=vt+pt;M<R;M+=A)E.lineTo(e[M],e[M+1]);E.close(),E.stroke()}}else if(p&&(o=n.triangles,pt=(n.worldVerticesLength>>1)*A,yt=o.length,m=ht.request(pt/A,yt),Tt=m.indiceOffset,gt=m.vertexOffset,vt=m.byteOffset>>2,e=ht._vData,i=ht._iData,n.computeWorldVertices(v,0,n.worldVerticesLength,e,vt,A),E&&_)){E.strokeColor=F;for(var L=0,B=o.length;L<B;L+=3){var k=o[L]*A+vt,V=o[L+1]*A+vt,U=o[L+2]*A+vt;E.moveTo(e[k],e[k+1]),E.lineTo(e[V],e[V+1]),E.lineTo(e[U],e[U+1]),E.close(),E.stroke()}}if(0!=pt&&0!=yt){i.set(o,Tt),s=n.uvs;for(var z=vt,G=vt+pt,$=0;z<G;z+=A,$+=2)e[z+2]=s[$],e[z+3]=s[$+1];if(r=n.color,a=v.color,this.fillVertices(T,r,a,x,v),e=ht._vData,i=ht._iData,yt>0){for(var tt=Tt,et=Tt+yt;tt<et;tt++)i[tt]+=gt;if(t){g=t.m,X=g[0],q=g[4],Z=g[12],K=g[1],J=g[5],Q=g[13];for(var it=vt,nt=vt+pt;it<nt;it+=A)j=e[it],Y=e[it+1],e[it]=j*X+Y*q+Z,e[it+1]=j*K+Y*J+Q}ht.adjust(pt/A,yt)}x.clipEndWithSlot(v)}else x.clipEndWithSlot(v)}else x.clipEndWithSlot(v);else x.clipEndWithSlot(v);else x.clipEndWithSlot(v);else x.clipEndWithSlot(v);if(x.clipEnd(),E&&f){var rt;E.strokeColor=P,E.fillColor=O;for(var at=0,st=y.bones.length;at<st;at++){var ot=(rt=y.bones[at]).data.length*rt.a+rt.worldX,ct=rt.data.length*rt.c+rt.worldY;E.moveTo(rt.worldX,rt.worldY),E.lineTo(ot,ct),E.stroke(),E.circle(rt.worldX,rt.worldY,1.5*Math.PI),E.fill(),0===at&&(E.fillColor=N)}}},r.cacheTraverse=function(t){var e=lt._curFrame;if(e){var i=e.segments;if(0!=i.length){var n,r,a,s,o,c,l=e.vertices,h=e.indices,u=0,f=0,_=0;t&&(c=t.m,X=c[0],K=c[1],q=c[4],J=c[5],Z=c[12],Q=c[13]);var d=16&R,p=d&&1===X&&0===K&&0===q&&1===J,m=0,v=e.colors,T=v[m++],A=T.vfOffset;Et(T);for(var b=0,E=i.length;b<E;b++){var C=i[b];if(s=bt(C.tex,C.blendMode)){(W||s.getHash()!==ut.material.getHash())&&(W=!1,ut._flush(),ut.node=ft,ut.material=s),mt=C.vertexCount,yt=C.indexCount,o=ht.request(mt,yt),Tt=o.indiceOffset,gt=o.vertexOffset,At=o.byteOffset>>2,n=ht._vData,r=ht._iData,a=ht._uintVData;for(var x=Tt,S=Tt+yt;x<S;x++)r[x]=gt+h[f++];if(_=C.vfCount,n.set(l.subarray(u,u+_),At),u+=_,p)for(var w=At,D=At+_;w<D;w+=6)n[w]+=Z,n[w+1]+=Q;else if(d)for(var M=At,I=At+_;M<I;M+=6)j=n[M],Y=n[M+1],n[M]=j*X+Y*q+Z,n[M+1]=j*K+Y*J+Q;if(ht.adjust(mt,yt),_t)for(var O=u-_,P=At+4,N=At+4+_;P<N;P+=6,O+=6)O>=A&&(Et(T=v[m++]),A=T.vfOffset),a[P]=g,a[P+1]=y}}}}},r.fillBuffers=function(t,e){var i=t.node;if(i._renderFlag|=x.FLAG_UPDATE_RENDER_DATA,t._skeleton){var n=i._color;d=n.r/255,p=n.g/255,m=n.b/255,v=n.a/255,h=t.useTint||t.isAnimationCached(),T=h?D:w,A=h?6:5,ft=t.node,ht=e.getBuffer("spine",T),ut=e,lt=t,W=!0,s=t.premultipliedAlpha,o=1,R=0,_t=!1,dt=t._effectDelegate&&t._effectDelegate._vertexEffect,(4294967295!==n._val||s)&&(_t=!0),h&&(R|=1);var r=void 0;lt.enableBatch&&(r=ft._worldMatrix,W=!1,R|=16),t.isAnimationCached()?this.cacheTraverse(r):(dt&&dt.begin(t._skeleton),this.realTimeTraverse(r),dt&&dt.end()),e.worldMatDirty++,t.attachUtil._syncAttachedNode(),ft=void 0,ht=void 0,ut=void 0,lt=void 0,dt=null}},r.postFillBuffers=function(t,e){e.worldMatDirty--},n})(r.default);i.default=xt,r.default.register(E,xt),e.exports=i.default}),{"../../cocos2d/core/renderer/assembler":196,"../../cocos2d/core/renderer/render-flow":200,"../../cocos2d/core/renderer/webgl/vertex-format":232,"./Skeleton":331,"./lib/spine":333}],338:[(function(t,e){"use strict";var i=function(){this.start=null,this.end=null,this.complete=null,this.event=null,this.interrupt=null,this.dispose=null};i.getListeners=function(t){return t.listener||(t.listener=new i),t.listener},e.exports=i}),{}],339:[(function(t,e){"use strict";var i=t("./lib/spine");sp.VertexEffectDelegate=cc.Class({name:"sp.VertexEffectDelegate",ctor:function(){this._vertexEffect=null,this._interpolation=null,this._effectType="none"},clear:function(){this._vertexEffect=null,this._interpolation=null,this._effectType="none"},initJitter:function(t,e){return this._effectType="jitter",this._vertexEffect=new i.JitterEffect(t,e),this._vertexEffect},initSwirlWithPow:function(t,e){return this._interpolation=new i.Pow(e),this._vertexEffect=new i.SwirlEffect(t,this._interpolation),this._vertexEffect},initSwirlWithPowOut:function(t,e){return this._interpolation=new i.PowOut(e),this._vertexEffect=new i.SwirlEffect(t,this._interpolation),this._vertexEffect},getJitterVertexEffect:function(){return this._vertexEffect},getSwirlVertexEffect:function(){return this._vertexEffect},getVertexEffect:function(){return this._vertexEffect},getEffectType:function(){return this._effectType}}),e.exports=sp.VertexEffectDelegate}),{"./lib/spine":333}],340:[(function(t,e){"use strict";var i="undefined"==typeof window?global:window;i.cc=i.cc||{},cc.internal=cc.internal||{},t("./predefine"),t("./polyfill/string"),t("./polyfill/misc"),t("./polyfill/array"),t("./polyfill/object"),t("./polyfill/array-buffer"),t("./polyfill/number"),t("./polyfill/typescript"),t("./cocos2d/core/predefine"),t("./cocos2d"),t("./extends"),e.exports=i.cc}),{"./cocos2d":270,"./cocos2d/core/predefine":193,"./extends":317,"./package":void 0,"./polyfill/array":342,"./polyfill/array-buffer":341,"./polyfill/misc":343,"./polyfill/number":344,"./polyfill/object":345,"./polyfill/string":346,"./polyfill/typescript":347,"./predefine":348}],341:[(function(){"use strict";if(!ArrayBuffer.isView){var t=Object.getPrototypeOf(Int8Array);ArrayBuffer.isView="function"==typeof t?function(e){return e instanceof t}:function(t){if("object"!=typeof t)return!1;var e=t.constructor;return e===Float64Array||e===Float32Array||e===Uint8Array||e===Uint32Array||e===Int8Array}}}),{}],342:[(function(){"use strict";Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.find||(Array.prototype.find=function(t){for(var e=this.length,i=0;i<e;i++){var n=this[i];if(t.call(this,n,i,this))return n}}),Array.prototype.includes||(Array.prototype.includes=function(t){return-1!==this.indexOf(t)})}),{}],343:[(function(){"use strict";if(Math.sign||(Math.sign=function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1}),Math.log2||(Math.log2=function(t){return Math.log(t)*Math.LOG2E}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),!console.time){var t=window.performance||Date,e=Object.create(null);console.time=function(i){e[i]=t.now()},console.timeEnd=function(i){var n=e[i],r=t.now()-n;console.log(i+": "+r+"ms")}}}),{}],344:[(function(){"use strict";Number.parseFloat=Number.parseFloat||parseFloat,Number.parseInt=Number.parseInt||parseInt}),{}],345:[(function(){"use strict";Object.assign||(Object.assign=function(t,e){return cc.js.mixin(t,e)}),Object.getOwnPropertyDescriptors||(Object.getOwnPropertyDescriptors=function(t){var e={},i=Object.getOwnPropertyNames(t);Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t)));for(var n=0;n<i.length;++n){var r=i[n];e[r]=Object.getOwnPropertyDescriptor(t,r)}return e})}),{}],346:[(function(){"use strict";String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.lastIndexOf(t,e)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){(void 0===e||e>this.length)&&(e=this.length),e-=t.length;var i=this.indexOf(t,e);return-1!==i&&i===e}),String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/,"")})}),{}],347:[(function(){"use strict";var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};window.__extends=function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)},window.__assign=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},window.__rest=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},window.__decorate=function(t,e,i,n){var r,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,i,s):r(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s},window.__param=function(t,e){return function(i,n){e(i,n,t)}},window.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},window.__awaiter=function(t,e,i,n){return new(i||(i=Promise))(function(r,a){function s(t){try{c(n.next(t))}catch(e){a(e)}}function o(t){try{c(n.throw(t))}catch(e){a(e)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,o)}c((n=n.apply(t,e||[])).next())})},window.__generator=function(t,e){var i,n,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(e){return c([t,e])}}function c(a){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(o){a=[6,o],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},window.__exportStar=function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||__createBinding(e,t,i)},window.__createBinding=Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]},window.__values=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},window.__read=function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,a=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(o){r={error:o}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},window.__spread=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(__read(arguments[e]));return t},window.__spreadArrays=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,r++)n[r]=a[s];return n},window.__await=function(t){return this instanceof __await?(this.v=t,this):new __await(t)},window.__asyncGenerator=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(t,e||[]),a=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){r[t]&&(n[t]=function(e){return new Promise(function(i,n){a.push([t,e,i,n])>1||o(t,e)})})}function o(t,e){try{(i=r[t](e)).value instanceof __await?Promise.resolve(i.value.v).then(c,l):h(a[0][2],i)}catch(n){h(a[0][3],n)}var i}function c(t){o("next",t)}function l(t){o("throw",t)}function h(t,e){t(e),a.shift(),a.length&&o(a[0][0],a[0][1])}},window.__asyncDelegator=function(t){var e,i;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,r){e[n]=t[n]?function(e){return(i=!i)?{value:__await(t[n](e)),done:"return"===n}:r?r(e):e}:r}},window.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=t[i]&&function(e){return new Promise(function(n,a){r(n,a,(e=t[i](e)).done,e.value)})}}function r(t,e,i,n){Promise.resolve(n).then((function(e){t({value:e,done:i})}),e)}},window.__makeTemplateObject=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};var e=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};window.__importStar=function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&__createBinding(i,t,n);return e(i,t),i},window.__importDefault=function(t){return t&&t.__esModule?t:{default:t}},window.__classPrivateFieldGet=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)},window.__classPrivateFieldSet=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i}}),{}],348:[(function(){"use strict";var t="undefined"==typeof window?global:window;function e(e,i){void 0===t[e]&&Object.defineProperty(t,e,{get:function(){var t;return"CC_WECHATGAMESUB"===e?t="cc.sys.platform === cc.sys.WECHAT_GAME_SUB":"CC_WECHATGAME"===e?t="cc.sys.platform === cc.sys.WECHAT_GAME":"CC_QQPLAY"===e&&(t="cc.sys.platform === cc.sys.QQ_PLAY"),cc.warnID(1400,e,t),i}})}function i(e){return"object"==typeof t[e]}(function(e,i){void 0===t[e]&&(t[e]=i)})("CC_BUILD",!1),t.CC_BUILD=!0,t.CC_DEV=!1,t.CC_DEBUG=!1,t.CC_JSB=!1,t.CC_NATIVERENDERER=!1,t.CC_SUPPORT_JIT=!1,t.CC_PHYSICS_BUILTIN=!1,t.CC_PHYSICS_CANNON=!0,t.CC_EDITOR=!1,t.CC_PREVIEW=!1,t.CC_TEST=!1,t.CC_RUNTIME=!1,t.CC_JSB=!1;var n=!(!i("wx")||!wx.getSharedCanvas),r=!(!i("wx")||!wx.getSystemInfoSync&&!wx.getSharedCanvas),a=i("bk");e("CC_WECHATGAMESUB",n),e("CC_WECHATGAME",r),e("CC_QQPLAY",a),t.CocosEngine=cc.ENGINE_VERSION="2.4.15"}),{}]},{},[340]);