cocos2d-js-min.3eab5.js 880 KB

1
  1. (function(t,e,i){function n(i){var r=e[i];if(!r){var s=t[i];if(!s)return;var a={};r=e[i]={exports:a},s[0]((function(t){return n(s[1][t]||t)}),r,a)}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":158,"../core/utils/misc":233}],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 s=this._deltaT;n=(e-s*(i=0|e/s))/s}var a,o,c,u,l,h,_,f,d,p,v,g,m,y,T,E,A=(a=t(r,i-1),o=t(r,i-0),c=t(r,i+1),u=t(r,i+2),d=(f=(1-this._tension)/2)*(2*(h=(l=n)*l)-(_=h*l)-l),p=f*(-_+h)+(2*_-3*h)+1,v=f*(_-2*h+l)+-2*_+3*h,g=f*(_-h),m=a.x*d+o.x*p+c.x*v+u.x*g,y=a.y*d+o.y*p+c.y*v+u.y*g,cc.v2(m,y));if(cc.macro.ENABLE_STACKABLE_ACTIONS&&(T=this.target.x-this._previousPosition.x,E=this.target.y-this._previousPosition.y,0!==T||0!==E)){var C=this._accumulatedDiff;T=C.x+T,E=C.y+E,C.x=T,C.y=E,A.x+=T,A.y+=E}this.updatePosition(A)},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 s=e(i);for(n=s[s.length-1],s.pop(),n.x=-n.x,n.y=-n.y,s.unshift(n),r=1;r<s.length;++r)(t=s[r]).x=-t.x,t.y=-t.y,t.x+=n.x,t.y+=n.y,s[r]=t,n=t;return cc.cardinalSplineBy(this._duration,s,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 s={easing:function(t){return 0===t||1===t?t:-.5*(Math.cos(Math.PI*t)-1)},reverse:function(){return s}};cc.easeSineInOut=function(){return s};var a={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)}}:a};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 a}};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 u={easing:function(t){return 1-c(1-t)},reverse:function(){return l}};cc.easeBounceIn=function(){return u};var l={easing:function(t){return c(t)},reverse:function(){return u}};cc.easeBounceOut=function(){return l};var h={easing:function(t){return t<.5?.5*(1-c(1-(t*=2))):.5*c(2*t-1)+.5},reverse:function(){return h}};cc.easeBounceInOut=function(){return h};var _={easing:function(t){return 0===t||1===t?t:t*t*(2.70158*t-1.70158)},reverse:function(){return f}};cc.easeBackIn=function(){return _};var f={easing:function(t){return 0===t?0:(t-=1)*t*(2.70158*t+1.70158)+1},reverse:function(){return _}};cc.easeBackOut=function(){return f};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 v={easing:function(t){return-t*(t-2)},reverse:function(){return v}};cc.easeQuadraticActionOut=function(){return v};var g={easing:function(t){return(t*=2)<1?t*t*.5:-.5*(--t*(t-2)-1)},reverse:function(){return g}};cc.easeQuadraticActionInOut=function(){return g};var m={easing:function(t){return t*t*t*t},reverse:function(){return m}};cc.easeQuarticActionIn=function(){return m};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 E={easing:function(t){return t*t*t*t*t},reverse:function(){return E}};cc.easeQuinticActionIn=function(){return E};var A={easing:function(t){return(t-=1)*t*t*t*t+1},reverse:function(){return A}};cc.easeQuinticActionOut=function(){return A};var C={easing:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},reverse:function(){return C}};cc.easeQuinticActionInOut=function(){return C};var x={easing:function(t){return-1*(Math.sqrt(1-t*t)-1)},reverse:function(){return x}};cc.easeCircleActionIn=function(){return x};var b={easing:function(t){return t-=1,Math.sqrt(1-t*t)},reverse:function(){return b}};cc.easeCircleActionOut=function(){return b};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 R={easing:function(t){return(t-=1)*t*t+1},reverse:function(){return R}};cc.easeCubicActionOut=function(){return R};var I={easing:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},reverse:function(){return I}};cc.easeCubicActionInOut=function(){return I}}),{}],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],s=1;s<i;s++)e[s]&&(n=r,r=cc.Sequence._actionOneTwo(n,e[s]));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,s=this._actions,a=this._last;(t=this._computeEaseTime(t))<r?(e=0!==r?t/r:1,0===n&&1===a&&this._reversed&&(s[1].update(0),s[1].stop())):(n=1,e=1===r?1:(t-r)/(1-r),-1===a&&(s[0].startWithTarget(this.target),s[0].update(1),s[0].stop()),0===a&&(s[0].update(1),s[0].stop())),i=s[n],a===n&&i.isDone()||(a!==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],s=1;s<i;s++)e[s]&&(n=r,r=cc.Spawn._actionOneTwo(n,e[s]));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,s=this.target.y,a=this._previousPosition;n.x=n.x+r-a.x,n.y=n.y+s-a.y,e+=n.x,i+=n.y,a.x=e,a.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 s=this.target.x,a=this.target.y,o=this._previousPosition;r.x=r.x+s-o.x,r.y=r.y+a-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,s=i[2].x,a=i[0].y,o=i[1].y,c=i[2].y,u=t(0,n,r,s,e),l=t(0,a,o,c,e),h=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var _=this.target.x,f=this.target.y,d=this._previousPosition;h.x=h.x+_-d.x,h.y=h.y+f-d.y,u+=h.x,l+=h.y,d.x=u,d.y=l,this.target.setPosition(u,l)}else this.target.setPosition(h.x+u,h.y+l)}},reverse:function(){var t=this._config,e=t[0].x,i=t[0].y,n=t[1].x,r=t[1].y,s=t[2].x,a=t[2].y,o=[cc.v2(n-s,r-a),cc.v2(e-s,i-a),cc.v2(-s,-a)],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 s=e.actions[n];if(s&&s.getTag()===t){if(i&&s.getOriginalTarget()!==i)continue;this._removeActionAtIndex(n,e);break}}},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 s=i[r];this._removeActionByTag(t,s)}},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":158,"../core/platform/js":179}],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 s in e){var a=e[s],o=void 0,c=void 0;if(void 0!==a.value&&(a.easing||a.progress)&&("string"==typeof a.easing?!(o=cc.easing[a.easing])&&cc.warnID(1031,a.easing):o=a.easing,c=a.progress,a=a.value),"number"==typeof a||a.lerp&&(!r||a.add||a.mul)&&a.clone){var u=Object.create(null);u.value=a,u.easing=o,u.progress=c,this._props[s]=u}else cc.warn("Can not animate "+s+" 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],s=i[n];"number"==typeof r?(s.start=r,s.current=r,s.end=e?r+s.value:s.value):(s.start=r.clone(),s.current=r.clone(),s.end=e?(r.add||r.mul).call(r,s.value):s.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,s=e.progress;for(var a in r){var o=r[a],c=o.easing?o.easing(t):i,u=o.current=(o.progress||s)(o.start,o.end,o.current,c);n[a]=u}var l=e.onUpdate;l&&l(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 s(t){this._actions=[],this._finalAction=null,this._target=t,this._tag=cc.Action.TAG_INVALID}s.stopAll=function(){cc.director.getActionManager().removeAllActions()},s.stopAllByTag=function(t){cc.director.getActionManager().removeActionByTag(t)},s.stopAllByTarget=function(t){cc.director.getActionManager().removeAllActionsFromTarget(t)},s.prototype.then=function(t){return t instanceof cc.Action?this._actions.push(t.clone()):this._actions.push(t._union()),this},s.prototype.target=function(t){return this._target=t,this},s.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)},s.prototype.stop=function(){return this._finalAction&&cc.director.getActionManager().removeAction(this._finalAction),this},s.prototype.tag=function(t){return this._tag=t,this},s.prototype.clone=function(t){var e=this._union();return cc.tween(t).then(e.clone())},s.prototype.union=function(){var t=this._union();return this._actions.length=0,this._actions.push(t),this},s.prototype._union=function(){var t=this._actions;return 1===t.length?t[0]:cc.sequence(t)},Object.assign(s.prototype,{bezierTo:function(t,i,n,r,s){var a=i.x,o=i.y,c=n.x,u=n.y;return(s=s||Object.create(null)).progress=function(t,i,n,r){return n.x=(0,e.bezier)(t.x,a,c,i.x,r),n.y=(0,e.bezier)(t.y,o,u,i.y,r),n},this.to(t,{position:r},s)},bezierBy:function(t,i,n,r,s){var a=i.x,o=i.y,c=n.x,u=n.y;return(s=s||Object.create(null)).progress=function(t,i,n,r){var s=t.x,l=t.y;return n.x=(0,e.bezier)(s,a+s,c+s,i.x,r),n.y=(0,e.bezier)(l,o+l,u+l,i.y,r),n},this.by(t,{position:r},s)},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 a=[];function o(t){return function(){a.length=0;for(var e=arguments.length,i=0;i<e;i++){var n=a[i]=arguments[i];n instanceof s&&(a[i]=n._union())}return t.apply(this,a)}}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)},u={repeat:cc.repeat,repeatForever:cc.repeatForever,reverseTime:cc.reverseTime},l=Object.keys(c),h=function(t){var e=l[t];s.prototype[e]=function(){var t=c[e].apply(this,arguments);return this._actions.push(t),this}},_=0;_<l.length;_++)h(_);l=Object.keys(u);for(var f=function(t){var e=l[t];s.prototype[e]=function(){var t=this._actions,i=arguments[arguments.length-1],n=arguments.length-1;i instanceof cc.Tween?i=i._union():i instanceof cc.Action||(i=t[t.length-1],t.length-=1,n+=1);for(var r=[i],s=0;s<n;s++)r.push(arguments[s]);return i=u[e].apply(this,r),t.push(i),this}},d=0;d<l.length;d++)f(d);cc.tween=function(t){return new s(t)},cc.Tween=s}),{"../animation/bezier":14}],9:[(function(t,e){"use strict";var i=cc.js,n=t("./playable"),r=t("./animation-curves"),s=r.EventAnimCurve,a=r.EventInfo,o=t("./types").WrapModeMask,c=t("../core/utils/binary-search").binarySearchEpsilon;function u(t,e){n.call(this),this.target=t,this.animation=e,this._anims=new i.array.MutableForwardIterator([])}i.extend(u,n);var l=u.prototype;function h(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 u,l=0,h=r.length;l<h;l++){u||((u=new s).target=t,n.push(u));var _=r[l],f=_.frame/e.duration,d=void 0,p=c(u.ratios,f);p>=0?d=u.events[p]:(d=new a,u.ratios.push(f),u.events.push(d)),d.add(_.func,_.params)}}l.playState=function(t,e){t.clip&&(t.curveLoaded||h(this.target,t),t.animator=this,t.play(),"number"==typeof e&&t.setTime(e),this.play())},l.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)}},l.addAnimation=function(t){-1===this._anims.array.indexOf(t)&&this._anims.push(t),t._setEventTarget(this.animation)},l.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},l.sample=function(){var t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)e[t.i].sample()},l.stopState=function(t){t&&t.stop()},l.pauseState=function(t){t&&t.pause()},l.resumeState=function(t){t&&t.resume(),this.isPaused&&this.resume()},l.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()}}},l.onStop=function(){var t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)e[t.i].stop()},l.onPause=function(){for(var t=this._anims.array,e=0;e<t.length;++e){var i=t[e];i.pause(),i.animator=null}},l.onResume=function(){for(var t=this._anims.array,e=0;e<t.length;++e){var i=t[e];i.animator=this,i.resume()}},l._reloadClip=function(t){h(this.target,t)},e.exports=u}),{"../core/utils/binary-search":226,"./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,s=n.quickFindIndex,a=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,s=0,a=t.length;s<a;s++)n[s]={frame:s*r,value:t[s]};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,u=new r;u.target=t,u.prop=e;for(var l=0,h=i.length;l<h;l++){var _=i[l],f=_.frame/this.duration;u.ratios.push(f),c&&n.push(_.motionPath);var d=_.value;u.values.push(d);var p=_.curve;if(p){if("string"==typeof p){u.types.push(p);continue}if(Array.isArray(p)){p[0]===p[1]&&p[2]===p[3]?u.types.push(r.Linear):u.types.push(r.Bezier(p));continue}}u.types.push(r.Linear)}c&&a(n,u,this.duration,this.sample,t);for(var v,g,m=u.ratios,y=!0,T=1,E=m.length;T<E;T++)if(v=m[T]-m[T-1],1===T)g=v;else if(Math.abs(v-g)>1e-6){y=!1;break}u._findFrameIndex=y?s:o;var A=u.values[0];return null==A||u._lerp||("number"==typeof A?u._lerp=r.prototype._lerpNumber:A instanceof cc.Quat?u._lerp=r.prototype._lerpQuat:A instanceof cc.Vec2?u._lerp=r.prototype._lerpVector2:A instanceof cc.Vec3?u._lerp=r.prototype._lerpVector3:A.lerp&&(u._lerp=r.prototype._lerpObject)),u},createTargetCurves:function(t,e,i){var n=e.props,r=e.comps;if(n)for(var s in n){var a=n[s],o=this.createPropCurve(t,s,a);i.push(o)}if(r)for(var c in r){var u=t.getComponent(c);if(u){var l=r[c];for(var h in l){var _=l[h],f=this.createPropCurve(u,h,_);i.push(f)}}}},createCurves:function(t,e){var i=this.curveData,n=i.paths,r=[];for(var s in this.createTargetCurves(e,i,r),n){var a=cc.find(s,e);if(a){var o=n[s];this.createTargetCurves(a,o,r)}}return r}});cc.AnimationClip=e.exports=c}),{"../core/utils/binary-search":226,"./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,s=t("./types").WrappedInfo;function a(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,u=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 s,o=!0,c=this._cachedIndex;if(c<0&&(c=~c)>0&&c<n.length){var u=n[c-1],l=n[c];e>u&&e<l&&(o=!1)}o&&(this._cachedIndex=this._findFrameIndex(n,e));var h=this._cachedIndex;if(h<0)if((h=~h)<=0)s=i[0];else if(h>=r)s=i[r-1];else{var _=i[h-1];if(this._lerp){var f=n[h-1],d=n[h],p=this.types[h-1],v=(e-f)/(d-f);p&&(v=a(v,p));var g=i[h];s=this._lerp(_,g,v)}else s=_}else s=i[h];this.target[this.prop]=s}}});u.Linear=null,u.Bezier=function(t){return t};var l=function(){this.events=[]};l.prototype.add=function(t,e){this.events.push({func:t||"",params:e||[]})};var h=cc.Class({name:"cc.EventAnimCurve",extends:o,properties:{target:null,ratios:[],events:[],_wrappedInfo:{default:function(){return new s}},_lastWrappedInfo:null,_ignoreIndex:NaN},_wrapIterations:function(t){return t-(0|t)==0&&(t-=1),0|t},sample:function(t,e,i){var a=this.ratios.length,o=i.getWrappedInfo(i.time,this._wrappedInfo),c=o.direction,u=n(this.ratios,o.ratio);if(u<0&&(u=~u-1,c<0&&(u+=1)),this._ignoreIndex!==u&&(this._ignoreIndex=NaN),o.frameIndex=u,!this._lastWrappedInfo)return this._fireEvent(u),void(this._lastWrappedInfo=new s(o));var l=i.wrapMode,h=this._wrapIterations(o.iterations),_=this._lastWrappedInfo,f=this._wrapIterations(_.iterations),d=_.frameIndex,p=_.direction,v=-1!==f&&h!==f;if(d===u&&v&&1===a)this._fireEvent(0);else if(d!==u||v){c=p;do{if(d!==u){if(-1===c&&0===d&&u>0?((l&r.PingPong)===r.PingPong?c*=-1:d=a,f++):1===c&&d===a-1&&u<a-1&&((l&r.PingPong)===r.PingPong?c*=-1:d=-1,f++),d===u)break;if(f>h)break}d+=c,cc.director.getAnimationManager().pushDelayEvent(this,"_fireEvent",[d])}while(d!==u&&d>-1&&d<a)}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],s=r.func,a=0;a<i.length;a++){var o=i[a],c=o[s];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,s=n(this.ratios,i.ratio);s<0&&(s=~s-1,r<0&&(s+=1),this._ignoreIndex=s)}});e.exports={AnimCurve:o,DynamicAnimCurve:u,EventAnimCurve:h,EventInfo:l,computeRatioByType:a,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 s=(e=(e-n)/(r-n))/(1/i),a=0|s;return s-a<1e-6?a:a+1-s<1e-6?a+1:~(a+1)}}}),{"../core/utils/binary-search":226,"./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,s=0;s<r.length;s++){var a=r[s];a.target[a.func].apply(a.target,a.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"),s=r.WrappedInfo,a=r.WrapMode,o=r.WrapModeMask;function c(t,e){n.call(this),this._currentFramePlayed=!1,this._delay=0,this._delayTime=0,this._wrappedInfo=new s,this._lastWrappedInfo=null,this._process=l,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=a.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 u=c.prototype;function l(){var t,e=this.sample();this._lastframeEventOn&&(t=this._lastWrappedInfo?this._lastWrappedInfo:this._lastWrappedInfo=new s(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 h(){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,s=n.length;r<s;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)}u._emit=function(t,e){this._target&&this._target.isValid&&this._target.emit(t,t,e)},u.on=function(t,e,i){return this._target&&this._target.isValid?("lastframe"===t&&(this._lastframeEventOn=!0),this._target.on(t,e,i)):null},u.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},u.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))},u._setEventTarget=function(t){this._target=t},u.onPlay=function(){this.setTime(0),this._delayTime=this._delay,cc.director.getAnimationManager().addAnimation(this),this.animator&&this.animator.addAnimation(this),this.emit("play",this)},u.onStop=function(){this.isPaused||cc.director.getAnimationManager().removeAnimation(this),this.animator&&this.animator.removeAnimation(this),this.emit("stop",this)},u.onResume=function(){cc.director.getAnimationManager().addAnimation(this),this.emit("resume",this)},u.onPause=function(){cc.director.getAnimationManager().removeAnimation(this),this.emit("pause",this)},u.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)}},u.update=function(t){this._delayTime>0&&(this._delayTime-=t,this._delayTime>0)||(this._currentFramePlayed?this.time+=t*this.speed:this._currentFramePlayed=!0,this._process())},u._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},u.getWrappedInfo=function(t,e){e=e||new s;var i=!1,n=this.duration,r=this.repeatCount,a=t>0?t/n:-t/n;if(a>=r){a=r,i=!0;var c=r-(0|r);0===c&&(c=1),t=c*n*(t>0?1:-1)}if(t>n){var u=t%n;t=0===u?n:u}else t<0&&0!=(t%=n)&&(t+=n);var l=!1,h=this._wrapMode&o.ShouldWrap;h&&(l=this._needRevers(a));var _=l?-1:1;return this.speed<0&&(_*=-1),h&&l&&(t=n-t),e.ratio=t/n,e.time=t,e.direction=_,e.stopped=i,e.iterations=a,e},u.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(u,"clip",(function(){return this._clip})),i.get(u,"name",(function(){return this._name})),i.obsolete(u,"AnimationState.length","duration"),i.getset(u,"curveLoaded",(function(){return this.curves.length>0}),(function(){this.curves.length=0})),i.getset(u,"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(u,"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?l:h})),i.getset(u,"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,s=2*Math.PI,a=Math.sqrt;function o(t){return t<0?-Math.pow(-t,1/3):Math.pow(t,1/3)}function c(t,e){var c,u,l,h,_=e-0,f=e-t[0],d=3*_,p=3*f,v=3*(e-t[2]),g=1/(-_+p-v+(e-1)),m=(d-6*f+v)*g,y=m*(1/3),T=(-d+p)*g,E=1/3*(3*T-m*m),A=E*(1/3),C=(2*m*m*m-9*m*T+_*g*27)/27,x=C/2,b=x*x+A*A*A;if(b<0){var S=1/3*-E,w=a(S*S*S),R=-C/(2*w),I=n(R<-1?-1:R>1?1:R),M=2*o(w);return u=M*i(I*(1/3))-y,l=M*i((I+s)*(1/3))-y,h=M*i((I+2*s)*(1/3))-y,0<=u&&u<=1?0<=l&&l<=1?0<=h&&h<=1?r(u,l,h):r(u,l):0<=h&&h<=1?r(u,h):u:0<=l&&l<=1?0<=h&&h<=1?r(l,h):l:h}if(0===b)return l=-(c=x<0?o(-x):-o(x))-y,0<=(u=2*c-y)&&u<=1?0<=l&&l<=1?r(u,l):u:l;var O=a(b);return(c=o(-x+O))-o(x+O)-y}e.exports={bezier:function(t,e,i,n,r){var s=1-r;return s*(s*(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,s=t("../core/utils/binary-search").binarySearchEpsilon,a=cc.v2;function o(t){this.points=t||[],this.beziers=[],this.ratios=[],this.progresses=[],this.length=0,this.computeBeziers()}function c(){this.start=a(),this.end=a(),this.startCtrlPoint=a(),this.endCtrlPoint=a()}function u(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 a(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),s=a(),o=0;for(n.push(0),i=1;i<=t;i++)e=this.getPoint(i/t),s.x=r.x-e.x,s.y=r.y-e.y,o+=s.mag(),n.push(o),r=e;return this.cacheArcLengths=n,n},c.prototype.getUtoTmapping=function(t,e){var i,n=this.getLengths(),r=0,s=n.length;i=e||t*n[s-1];for(var a,o=0,c=s-1;o<=c;)if((a=n[r=Math.floor(o+(c-o)/2)]-i)<0)o=r+1;else{if(!(a>0)){c=r;break}c=r-1}if(n[r=c]===i)return r/(s-1);var u=n[r];return(r+(i-u)/(n[r+1]-u))/(s-1)},e.exports={sampleMotionPaths:function(t,e,r,c,l){function h(t){return t instanceof cc.Vec2?{in:t,pos:t,out:t}:Array.isArray(t)&&6===t.length?{in:a(t[2],t[3]),pos:a(t[0],t[1]),out:a(t[4],t[5])}:{in:cc.Vec2.ZERO,pos:cc.Vec2.ZERO,out:cc.Vec2.ZERO}}var _=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!==_.length){for(var f=!1,d=0;d<t.length;d++){var p=t[d];if(p&&!u(p)&&(cc.errorID(3904,l?l.name:"","position",d),p=null),p&&p.length>0){f=!0;break}}if(f&&1!==_.length){for(var v=e.types,g=e.ratios,m=e.values=[],y=e.types=[],T=e.ratios=[],E=0,A=i.Linear,C=0,x=t.length;C<x-1;C++){var b,S=t[C],w=g[C],R=g[C+1]-w,I=_[C],M=_[C+1],O=v[C],L=[],D=E/R,P=1/(R*r*c);if(S&&S.length>0){var N=[];N.push(h(I));for(var F=0,B=S.length;F<B;F++){var z=h(S[F]);N.push(z)}N.push(h(M));var V=new o(N);V.computeBeziers();for(var U=V.progresses;1-D>1e-6;){var k,H,W,G;if((b=n(b=D,O))<0)G=(0-b)*(H=V.beziers[0]).getLength(),W=H.start.sub(H.endCtrlPoint).normalize(),k=H.start.add(W.mul(G));else if(b>1)G=(b-1)*(H=V.beziers[V.beziers.length-1]).getLength(),W=H.end.sub(H.startCtrlPoint).normalize(),k=H.end.add(W.mul(G));else{var j=s(U,b);j<0&&(j=~j),b-=j>0?U[j-1]:0,b/=V.ratios[j],k=V.beziers[j].getPointAt(b)}L.push(k),D+=P}}else for(;1-D>1e-6;)b=n(b=D,O),L.push(I.lerp(M,b)),D+=P;for(A="constant"===O?O:i.Linear,F=0,B=L.length;F<B;F++){var Y=w+E+P*F*R;X(L[F],A,Y)}E=Math.abs(D-1)>1e-6?(D-1)*R:0}g[g.length-1]!==T[T.length-1]&&X(_[_.length-1],A,g[g.length-1])}}function X(t,e,i){m.push(t),y.push(e),T.push(i)}},Curve:o,Bezier:c}}),{"../core/utils/binary-search":226,"./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 s=r.prototype;i.get(s,"isPlaying",(function(){return this._isPlaying}),!0),i.get(s,"isPaused",(function(){return this._isPaused}),!0);var a=function(){};s.onPlay=a,s.onPause=a,s.onResume=a,s.onStop=a,s.onError=a,s.play=function(){this._isPlaying?this._isPaused?(this._isPaused=!1,this.onResume()):this.onError(n.getError(3912)):(this._isPlaying=!0,this.onPlay())},s.stop=function(){this._isPlaying&&(this._isPlaying=!1,this.onStop(),this._isPaused=!1)},s.pause=function(){this._isPlaying&&!this._isPaused&&(this._isPaused=!0,this.onPause())},s.resume=function(){this._isPlaying&&this._isPaused&&(this._isPaused=!1,this.onResume())},s.step=function(){this.pause(),this._stepOnce=!0,this._isPlaying||this.play()},e.exports=r}),{"../core/CCDebug":22}],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"),s=t("../core/platform/CCSys"),a=t("../core/assets/CCAudioClip").LoadMode,o=!1,c=[],u=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(u,r),u.State={ERROR:-1,INITIALZING:0,PLAYING:1,PAUSED:2,STOPPED:3},(i=u.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=u.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 l(t,this)},i.play=function(){var t=this;this._src&&this._src._ensureLoaded((function(){t._state=u.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===a.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()===u.State.PLAYING){var t=this;this._src&&this._src._ensureLoaded((function(){t._unbindEnded(),t._element.pause(),t._state=u.State.PAUSED}))}},i.resume=function(){if(this.getState()===u.State.PAUSED){var t=this;this._src&&this._src._ensureLoaded((function(){t._bindEnded(),t._element.play(),t._state=u.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=u.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&&(u.State.PLAYING===this._state&&t.paused?this._state=u.State.STOPPED:u.State.STOPPED!==this._state||t.paused||(this._state=u.State.PLAYING))},Object.defineProperty(i,"src",{get:function(){return this._src},set:function(t){if(this._unbindEnded(),t){if(t!==this._src)if(this._src=t,t.loaded)this._onLoaded();else{var e=this;t.once("load",(function(){t===e._src&&e._onLoaded()}))}}else this._src=null,this._element instanceof l?this._element=null:this._element&&(this._element.src=""),this._state=u.State.INITIALZING;return t},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 l=function(t,e){this._audio=e,this._context=s.__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 s=this;clearTimeout(this._currentTimer),this._currentTimer=setTimeout((function(){0===s._context.currentTime&&c.push({instance:s._audio,offset:t,audio:s})}),10)}var a=cc.sys;a.os===a.OS_IOS&&a.isBrowser&&a.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){return 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;s.os===s.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){return this.paused?this.playedLength=t:(this.pause(),this.playedLength=t,this.play()),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"duration",{get:function(){return this._buffer.duration},enumerable:!0,configurable:!0})})(l.prototype),e.exports=cc._Audio=u}),{"../core/assets/CCAudioClip":59,"../core/event/event-target":131,"../core/platform/CCSys":167}],21:[(function(t,e){"use strict";var i=t("./CCAudio"),n=t("../core/assets/CCAudioClip"),r=cc.js,s=0,a=r.createMap(!0),o={},c=[],u=function(t){t._shouldRecycleOnEnded&&(t._finishCallback=null,t.off("ended"),t.off("stop"),t.src=null,c.includes(t)||(c.length<32?c.push(t):t.destroy()),t._shouldRecycleOnEnded=!1)},l=function(t){var e=s++,n=o[t];if(n||(n=o[t]=[]),f._maxAudioInstance<=n.length){var r=n.shift();h(r).stop()}var l=c.pop()||new i,_=function(){if(h(this.id)){delete a[this.id];var t=n.indexOf(this.id);cc.js.array.fastRemoveAt(n,t)}u(this)};return l.on("ended",(function(){this._finishCallback&&this._finishCallback(),this.getLoop()||_.call(this)}),l),l.on("stop",_,l),l.id=e,a[e]=l,n.push(e),l},h=function(t){return a[t]},_=function(t){return void 0===t?t=1:"string"==typeof t&&(t=Number.parseFloat(t)),t},f={AudioState:i.State,_maxAudioInstance:24,_id2audio:a,play:function(t,e,i){if(!(t instanceof n))return cc.error("Wrong type of AudioClip.");var r=t.nativeUrl,s=l(r);return s.src=t,t._ensureLoaded(),s._shouldRecycleOnEnded=!0,s.setLoop(e||!1),i=_(i),s.setVolume(i),s.play(),s.id},setLoop:function(t,e){var i=h(t);i&&i.setLoop&&i.setLoop(e)},isLoop:function(t){var e=h(t);return!(!e||!e.getLoop)&&e.getLoop()},setVolume:function(t,e){var i=h(t);i&&i.setVolume(e)},getVolume:function(t){var e=h(t);return e?e.getVolume():1},setCurrentTime:function(t,e){var i=h(t);return!!i&&(i.setCurrentTime(e),!0)},getCurrentTime:function(t){var e=h(t);return e?e.getCurrentTime():0},getDuration:function(t){var e=h(t);return e?e.getDuration():0},getState:function(t){var e=h(t);return e?e.getState():this.AudioState.ERROR},setFinishCallback:function(t,e){var i=h(t);i&&(i._finishCallback=e)},pause:function(t){var e=h(t);return!!e&&(e.pause(),!0)},_pauseIDCache:[],pauseAll:function(){for(var t in a){var e=a[t];e.getState()===i.State.PLAYING&&(this._pauseIDCache.push(t),e.pause())}},resume:function(t){var e=h(t);e&&e.resume()},resumeAll:function(){for(var t=0;t<this._pauseIDCache.length;++t){var e=this._pauseIDCache[t],i=h(e);i&&i.resume()}this._pauseIDCache.length=0},stop:function(t){var e=h(t);return!!e&&(e.stop(),!0)},stopAll:function(){for(var t in a){var e=a[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=a[n];r&&(r.stop(),delete a[n])}},uncacheAll:function(){var t;for(var e in this.stopAll(),a)(t=a[e])&&t.destroy();for(;t=c.pop();)t.destroy();a=r.createMap(!0),o={}},_breakCache:null,_break:function(){for(var t in this._breakCache=[],a){var e=a[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=h(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=_(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=_(t);var e=this._music.id;for(var i in this._effect.volume=t,a){var n=a[i];n&&n.id!==e&&f.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,a){var n=a[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=a[i];n&&n.resume()}},stopEffect:function(t){return this.stop(t)},stopAllEffects:function(){var t=this._music.id;for(var e in a){var i=a[e];i&&i.id!==t&&i.getState()===f.AudioState.PLAYING&&i.stop()}}};e.exports=cc.audioEngine=f}),{"../core/assets/CCAudioClip":59,"./CCAudio":20}],22:[(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 s(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 a=s("Log");cc.logID=function(){cc.log(a.apply(null,arguments))};var o=s("Warning");cc.warnID=function(){cc.warn(o.apply(null,arguments))};var c=s("Error");cc.errorID=function(){cc.error(c.apply(null,arguments))};var u=s("Assert");cc.assertID=function(t){t||cc.assert(!1,u.apply(null,cc.js.shiftArguments.apply(null,arguments)))};var l=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:l,_resetDebugSetting:function(t){if(cc.log=cc.warn=cc.error=cc.assert=function(){},t!==l.NONE){if(t>l.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!==l.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN : "+cc.js.formatStr.apply(null,arguments))}),t===l.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!==l.ERROR&&(console.warn.bind?cc.warn=console.warn.bind(console):cc.warn=function(){return console.warn.apply(console,arguments)}),t===l.INFO&&(console.log.bind?cc.log=console.log.bind(console):cc.log=function(){return console.log.apply(console,arguments)})}},getError:s("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":182}],23:[(function(t,e){"use strict";var i=t("./event/event-target"),n=t("./component-scheduler"),r=t("./node-activator"),s=t("./platform/CCObject"),a=t("./CCGame"),o=t("./renderer"),c=t("./event-manager"),u=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;a.on(a.EVENT_SHOW,(function(){t._lastUpdate=performance.now()})),a.once(a.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 u,cc.ActionManager?(this._actionManager=new cc.ActionManager,this._scheduler.scheduleUpdate(this._actionManager,u.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,u.PRIORITY_SYSTEM,!1)):this._animationManager=null,cc.CollisionManager?(this._collisionManager=new cc.CollisionManager,this._scheduler.scheduleUpdate(this._collisionManager,u.PRIORITY_SYSTEM,!1)):this._collisionManager=null,cc.PhysicsManager?(this._physicsManager=new cc.PhysicsManager,this._scheduler.scheduleUpdate(this._physicsManager,u.PRIORITY_SYSTEM,!1)):this._physicsManager=null,cc.Physics3DManager,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=a.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,o=i._devicePixelRatio*(t.x-r),c=i._devicePixelRatio*(s+n.height-t.y);return i._isRotated?cc.v2(i._viewportRect.width-c,o):cc.v2(o,c)},convertToUI:function(t){var e=a.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,o=cc.v2(0,0);return i._isRotated?(o.x=r+t.y/i._devicePixelRatio,o.y=s+n.height-(i._viewportRect.width-t.x)/i._devicePixelRatio):(o.x=r+t.x*i._devicePixelRatio,o.y=s+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(a._persistRootNodes).map((function(t){return a._persistRootNodes[t]})),r=0;r<n.length;r++){var o=n[r],c=t.getChildByUuid(o.uuid);if(c){var u=c.getSiblingIndex();c._destroyImmediate(),t.insertChild(o,u)}else o.parent=t}var l=this._scene;cc.assetManager._releaseManager._autoRelease(l,t,a._persistRootNodes),cc.isValid(l)&&l.destroy(),this._scene=null,s._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,s){console.timeEnd("LoadScene "+t),r._loadingScene="",n?(n="Failed to load scene: "+n,cc.error(n),e&&e(n)):r.runSceneImmediate(s,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/a.getFrameRate()},setAnimationInterval:function(t){a.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){this._purgeDirectorInNextLoop?(this._purgeDirectorInNextLoop=!1,this.purgeDirector()):(this.calculateDeltaTime(t),this._paused||(this.emit(cc.Director.EVENT_BEFORE_UPDATE),this._compScheduler.startPhase(),this._compScheduler.updatePhase(this._deltaTime),this._scheduler.update(this._deltaTime),this._compScheduler.lateUpdatePhase(this._deltaTime),this.emit(cc.Director.EVENT_AFTER_UPDATE),s._deferredDestroy()),this.emit(cc.Director.EVENT_BEFORE_DRAW),o.render(this._scene,this._deltaTime),this.emit(cc.Director.EVENT_AFTER_DRAW),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":24,"./CCScheduler":28,"./component-scheduler":89,"./event-manager":129,"./event/event-target":131,"./node-activator":157,"./platform/CCObject":164,"./renderer":189}],24:[(function(t,e){"use strict";var i=t("./event/event-target");t("../audio/CCAudioEngine");var n=t("./CCDebug"),r=t("./renderer/index.js"),s=t("../core/renderer/utils/dynamic-atlas/manager"),a={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 a._persistRootNodes)a.removePersistRootNode(a._persistRootNodes[t]);cc.director.getScene().destroy(),cc.Object._deferredDestroy(),cc.audioEngine&&cc.audioEngine.uncacheAll(),cc.director.reset(),a.pause(),cc.assetManager.builtins.init((function(){a.onStart(),a.emit(a.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(a.onStart&&a.onStart.bind(a))},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=a.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,a._frameTime-(e-a._lastTime)),n=window.setTimeout((function(){window.requestAnimationFrame(t)}),i);return a._lastTime=e+i,n},_stTime:function(t){var e=performance.now(),i=Math.max(0,a._frameTime-(e-a._lastTime)),n=window.setTimeout((function(){t()}),i);return a._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,s=!0,a=i.frameRate;n.setDisplayStats(i.showFPS),t=function(i){if(!e._paused){if(e._intervalId=window.requestAnimFrame(t),30===a&&(s=!s))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,a=this.config.id,o=a instanceof HTMLElement?a:document.querySelector(a)||document.querySelector("#"+a);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&&s&&(s.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,a.emit(a.EVENT_HIDE))}function r(t,e,n,r,s){i&&(i=!1,a.emit(a.EVENT_SHOW,t,e,n,r,s))}if(t)for(var s=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilitychange","qbrowserVisibilityChange"],o=0;o<s.length;o++)document.addEventListener(s[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(a.EVENT_HIDE,(function(){a.pause()})),this.on(a.EVENT_SHOW,(function(){a.resume()}))}};i.call(a),cc.js.addon(a,i.prototype),cc.game=e.exports=a}),{"../audio/CCAudioEngine":21,"../core/renderer/utils/dynamic-atlas/manager":192,"./CCDebug":22,"./event/event-target":131,"./renderer/index.js":189}],25:[(function(t,e){"use strict";var i=t("./value-types"),n=t("./utils/base-node"),r=t("./utils/prefab-helper"),s=t("./utils/trans-pool").NodeMemPool,a=t("./utils/affine-transform"),o=t("./event-manager"),c=t("./platform/CCMacro"),u=t("./platform/js"),l=(t("./event/event"),t("./event/event-target")),h=t("./renderer/render-flow"),_=cc.Object.Flags.Destroying,f=Math.PI/180,d=!!cc.ActionManager,p=function(){},v=new i.Vec3,g=new i.Quat,m=new i.Vec3,y=new i.Vec3,T=new i.Quat,E=new i.Quat,A=new i.Vec3,C=new i.Vec3,x=new i.Vec3,b=new i.Vec3,S=new i.Vec3,w=new i.Quat,R=new i.Quat,I=new i.Vec3,M=new i.Quat,O=new i.Vec3,L=new i.Quat,D=new i.Vec3,P=new i.Vec3,N=new i.Quat,F=new i.Quat,B=(new i.Quat,cc.mat4()),z=new i.Vec3,V=new u.Pool;V.get=function(){return this._get()||[]};var U=cc.Enum({DEBUG:31}),k=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],G=[H.MOUSE_DOWN,H.MOUSE_ENTER,H.MOUSE_MOVE,H.MOUSE_LEAVE,H.MOUSE_UP,H.MOUSE_WHEEL],j=!0,Y=function(t){if(0!==t){j&&cc.warn("`cc.Node.skewX/Y` is deprecated since v2.2.1, please use 3D node instead.",""),j=!1}},X=null,q=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)},Z=function(t,e){var i=this.owner;e.type=H.TOUCH_MOVE,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},K=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))},J=function(t){var e=t.getLocation(),i=this.owner;if(i._hitTest(e,this))this._previousIn||(X&&X._mouseListener&&(t.type=H.MOUSE_LEAVE,X.dispatchEvent(t),X._mouseListener._previousIn=!1),X=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,X=null}t.stopPropagation()},tt=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())},et=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 it(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 s={index:i,node:r};n?n.push(s):n=[s]}return n}return null}function nt(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,s=e.length;r<s;++r)if(t._capturingListeners.hasEventListener(e[r]))return!0;return!1}return!0}function rt(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 at(t){var e=st(t);t._cullingMask=1<<e;for(var i=0;i<t._children.length;i++)at(t._children[i])}function ot(){if(this._localMatDirty&k.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],s=e[4],a=e[5],o=Math.tan(this._skewX*f),c=Math.tan(this._skewY*f);o===1/0&&(o=99999999),c===1/0&&(c=99999999),e[0]=n+s*c,e[1]=r+a*c,e[4]=s+n*o,e[5]=a+r*o}this._localMatDirty&=~k.TRSS,this._worldMatDirty=!0}}function ct(){var t=this._localMatDirty;if(t&k.TRSS){var e=this._matrix.m,i=this._trs;if(t&(k.RS|k.SKEW)){var n=-this._eulerAngles.z,r=this._skewX||this._skewY,s=i[7],a=i[8];if(n||r){var o=1,c=0,u=0,l=1;if(n){var h=n*f;u=Math.sin(h),o=l=Math.cos(h),c=-u}if(e[0]=o*=s,e[1]=c*=s,e[4]=u*=a,e[5]=l*=a,r){var _=e[0],d=e[1],p=e[4],v=e[5],g=Math.tan(this._skewX*f),m=Math.tan(this._skewY*f);g===1/0&&(g=99999999),m===1/0&&(m=99999999),e[0]=_+p*m,e[1]=d+v*m,e[4]=p+_*g,e[5]=v+d*g}}else e[0]=s,e[1]=0,e[4]=0,e[5]=a}e[12]=i[0],e[13]=i[1],this._localMatDirty&=~k.TRSS,this._worldMatDirty=!0}}function ut(){if(this._localMatDirty&k.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 lt(){this._localMatDirty&k.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 ht(t,e,i){var n=e.m,r=i.m,s=t.m,a=n[0],o=n[1],c=n[4],u=n[5],l=n[12],h=n[13],_=r[0],f=r[1],d=r[4],p=r[5],v=r[12],g=r[13];0!==o||0!==c?(s[0]=_*a+f*c,s[1]=_*o+f*u,s[4]=d*a+p*c,s[5]=d*o+p*u,s[12]=a*v+c*g+l,s[13]=o*v+u*g+h):(s[0]=_*a,s[1]=f*u,s[4]=d*a,s[5]=p*u,s[12]=a*v+l,s[13]=u*g+h)}var _t=i.Mat4.mul,ft={name:"cc.Node",extends:n,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,at(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(k.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(k.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(k.ALL_POSITION),this._renderFlag|=h.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(k.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(k.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(k.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(k.ALL_ROTATION),this._renderFlag|=h.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(k.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(k.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(k.ALL_SCALE),this._renderFlag|=h.FLAG_TRANSFORM,2&this._eventMask&&this.emit(H.SCALE_CHANGED))}},skewX:{get:function(){return this._skewX},set:function(t){Y(t),this._skewX=t,this.setLocalDirty(k.SKEW)}},skewY:{get:function(){return this._skewY},set:function(t){Y(t),this._skewY=t,this.setLocalDirty(k.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|=h.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|=h.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>c.MAX_ZINDEX?(cc.warnID(1636),t=c.MAX_ZINDEX):t<c.MIN_ZINDEX&&(cc.warnID(1637),t=c.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._update3DFunction()}},up:{get:function(){return i.Vec3.transformQuat(O,i.Vec3.UP,this.getWorldRotation(L)).clone()}},right:{get:function(){return i.Vec3.transformQuat(O,i.Vec3.RIGHT,this.getWorldRotation(L)).clone()}},forward:{get:function(){return i.Vec3.transformQuat(O,i.Vec3.FORWARD,this.getWorldRotation(L)).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=h.FLAG_TRANSFORM|h.FLAG_OPACITY_COLOR},statics:{EventType:H,_LocalDirtyFlag:k,isNode:function(t){return t instanceof dt&&(t.constructor===dt||!(t instanceof cc.Scene))},BuiltinGroupIndex:U},_onSiblingIndexChanged:function(){this._parent&&this._parent._delaySort()},_onPreDestroy:function(){this._onPreDestroyBase(),d&&cc.director.getActionManager().removeAllActionsFromTarget(this),X===this&&(X=null),this._bubblingListeners&&this._bubblingListeners.clear(),this._capturingListeners&&this._capturingListeners.clear(),(this._touchListener||this._mouseListener)&&(o.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=d?cc.director.getActionManager():null;t?(this._renderFlag|=h.FLAG_WORLD_TRANSFORM,e&&e.resumeTarget(this),o.resumeTarget(this),this._checkListenerMask()):(e&&e.pauseTarget(this),o.pauseTarget(this))},_onHierarchyChanged:function(t){this._updateOrderOfArrival(),at(this),this._parent&&this._parent._delaySort(),this._renderFlag|=h.FLAG_WORLD_TRANSFORM,this._onHierarchyChangedBase(t),cc._widgetManager&&(cc._widgetManager._nodesOrderDirty=!0),t&&this._activeInHierarchy&&this._checkListenerMask()},_update3DFunction:function(){this._is3DNode?(this._updateLocalMatrix=ot,this._calculWorldMatrix=ut,this._mulMat=_t):(this._updateLocalMatrix=ct,this._calculWorldMatrix=lt,this._mulMat=ht),this._renderComponent&&this._renderComponent._on3DNodeChanged&&this._renderComponent._on3DNodeChanged(),this._renderFlag|=h.FLAG_TRANSFORM,this._localMatDirty=k.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=k.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])/f*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||(d&&cc.director.getActionManager().pauseTarget(this),o.pauseTarget(this));for(var e=this._children,i=0,n=e.length;i<n;i++){var s=e[i];if(!t){var a=s._prefab;a&&a.sync&&a.root===s&&r.syncWithPrefab(s),s._updateOrderOfArrival()}s._onBatchCreated(t)}e.length>0&&(this._renderFlag|=h.FLAG_CHILDREN)},_checkListenerMask:function(){if(this._touchListener){var t=this._touchListener.mask=it(this,cc.Mask);this._mouseListener&&(this._mouseListener.mask=t)}else this._mouseListener&&(this._mouseListener.mask=it(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:it(this,cc.Mask),onTouchBegan:q,onTouchMoved:Z,onTouchEnded:K,onTouchCancelled:Q}),o.addListener(this._touchListener,this),e=!0),i=!0):-1!==G.indexOf(t)&&(this._mouseListener||(this._mouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,_previousIn:!1,owner:this,mask:it(this,cc.Mask),onMouseDown:$,onMouseMove:J,onMouseUp:tt,onMouseScroll:et}),o.addListener(this._mouseListener,this),e=!0),i=!0),e&&!this._activeInHierarchy&&cc.director.getScheduler().schedule((function(){this._activeInHierarchy||o.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 l),this._bubblingListeners.on(t,e,i)},once:function(t,e,i,n){var r=this,s=null;(s=this._checknSetupSysEvent(t)&&n?this._capturingListeners=this._capturingListeners||new l:this._bubblingListeners=this._bubblingListeners||new l).once(t,e,i),s.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 l:this._bubblingListeners=this._bubblingListeners||new l).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),s=!r&&-1!==G.indexOf(t);if(r||s)this._offDispatch(t,e,i,n),r?this._touchListener&&!nt(this,W)&&(o.removeListener(this._touchListener),this._touchListener=null):s&&this._mouseListener&&!nt(this,G)&&(o.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&&u.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&&u.array.fastRemove(t.__eventTargets,this),this._touchListener&&!nt(this,W)&&(o.removeListener(this._touchListener),this._touchListener=null),this._mouseListener&&!nt(this,G)&&(o.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,s){this._bubblingListeners&&this._bubblingListeners.emit(t,e,i,n,r,s)},dispatchEvent:function(t){var e=V.get();rt(this,t,e),V.put(e)},pauseSystemEvents:function(t){o.pauseTarget(this,t)},resumeSystemEvents:function(t){o.resumeTarget(this,t)},_hitTest:function(t,e){var n=this._contentSize.width,r=this._contentSize.height,s=D,a=P,o=cc.Camera.findCamera(this);if(o?o.getScreenToWorldPoint(t,s):s.set(t),this._updateWorldMatrix(),!i.Mat4.invert(B,this._worldMatrix))return!1;i.Vec2.transformMat4(a,s,B),a.x+=this._anchorPoint.x*n,a.y+=this._anchorPoint.y*r;var c=!1;if(a.x>=0&&a.y>=0&&a.x<=n&&a.y<=r&&(c=!0,e&&e.mask))for(var u=e.mask,l=this,h=u?u.length:0,_=0,f=0;l&&f<h;++_,l=l.parent){var d=u[f];if(_===d.index){if(l!==d.node){u.length=f;break}var p=l.getComponent(cc.Mask);if(p&&p._enabled&&!p._hitTest(s)){c=!1;break}f++}else if(_>d.index){u.length=f;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:d?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}}:p,pauseAllActions:d?function(){cc.director.getActionManager().pauseTarget(this)}:p,resumeAllActions:d?function(){cc.director.getActionManager().resumeTarget(this)}:p,stopAllActions:d?function(){cc.director.getActionManager().removeAllActionsFromTarget(this)}:p,stopAction:d?function(t){cc.director.getActionManager().removeAction(t)}:p,stopActionByTag:d?function(t){t!==cc.Action.TAG_INVALID?cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:p,getActionByTag:d?function(t){return t===cc.Action.TAG_INVALID?(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:function(){return null},getNumberOfRunningActions:d?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(k.ALL_POSITION),this._renderFlag|=h.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(k.ALL_SCALE),this._renderFlag|=h.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 s=this._trs;s[3]===r&&s[4]===e&&s[5]===i&&s[6]===n||(s[3]=r,s[4]=e,s[5]=i,s[6]=n,this.setLocalDirty(k.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(t.width===i.width&&t.height===i.height)return;i.width=t.width,i.height=t.height}else{if(t===i.width&&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(k.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(m,n),i.Vec3.sub(t,t,m),i.Trs.toRotation(T,n),i.Quat.conjugate(E,T),i.Vec3.transformQuat(t,t,E),i.Trs.toScale(m,n),i.Vec3.inverseSafe(y,m),i.Vec3.mul(t,t,y),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(A,t):i.Vec3.copy(A,t),i.Trs.fromPosition(e,A),this.setLocalDirty(k.ALL_POSITION),1&this._eventMask&&this.emit(H.POSITION_CHANGED)},getWorldRotation:function(t){i.Trs.toRotation(N,this._trs),i.Quat.copy(t,N);for(var e=this._parent;e;)i.Trs.toRotation(N,e._trs),i.Quat.mul(t,N,t),e=e._parent;return t},setWorldRotation:function(t){this._parent?(this._parent.getWorldRotation(F),i.Quat.conjugate(F,F),i.Quat.mul(F,F,t)):i.Quat.copy(F,t),i.Trs.fromRotation(this._trs,F),this.setLocalDirty(k.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(k.ALL_SCALE)},getWorldRT:function(t){var e=b,n=w,r=this._trs;i.Trs.toPosition(e,r),i.Trs.toRotation(n,r);for(var s=this._parent;s;)r=s._trs,i.Trs.toScale(S,r),i.Vec3.mul(e,e,S),i.Trs.toRotation(R,r),i.Vec3.transformQuat(e,e,R),i.Trs.toPosition(S,r),i.Vec3.add(e,e,S),i.Quat.mul(n,R,n),s=s._parent;return i.Mat4.fromRT(t,n,e),t},lookAt:function(t,e){this.getWorldPosition(I),i.Vec3.sub(I,I,t),i.Vec3.normalize(I,I),i.Quat.fromViewUp(M,I,e),this.setWorldRotation(M)},_updateLocalMatrix:ct,_calculWorldMatrix:function(){this._localMatDirty&k.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:ht,_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===k.ALL_POSITION||t===k.POSITION?this._renderFlag|=h.FLAG_WORLD_TRANSFORM:this._renderFlag|=h.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(B,this._worldMatrix),t instanceof cc.Vec2?(e=e||new cc.Vec2,i.Vec2.transformMat4(e,t,B)):(e=e||new cc.Vec3,i.Vec3.transformMat4(e,t,B))},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(B,this._worldMatrix);var e=new cc.Vec2;return i.Vec2.transformMat4(e,t,B),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=a.identity()),this._updateLocalMatrix();var e=this._contentSize;return z.x=-this._anchorPoint.x*e.width,z.y=-this._anchorPoint.y*e.height,i.Mat4.copy(B,this._matrix),i.Mat4.transform(B,B,z),a.fromMat4(t,B)},getNodeToParentTransformAR:function(t){return t||(t=a.identity()),this._updateLocalMatrix(),a.fromMat4(t,this._matrix)},getNodeToWorldTransform:function(t){t||(t=a.identity()),this._updateWorldMatrix();var e=this._contentSize;return z.x=-this._anchorPoint.x*e.width,z.y=-this._anchorPoint.y*e.height,i.Mat4.copy(B,this._worldMatrix),i.Mat4.transform(B,B,z),a.fromMat4(t,B)},getNodeToWorldTransformAR:function(t){return t||(t=a.identity()),this._updateWorldMatrix(),a.fromMat4(t,this._worldMatrix)},getParentToNodeTransform:function(t){return t||(t=a.identity()),this._updateLocalMatrix(),i.Mat4.invert(B,this._matrix),a.fromMat4(t,B)},getWorldToNodeTransform:function(t){return t||(t=a.identity()),this._updateWorldMatrix(),i.Mat4.invert(B,this._worldMatrix),a.fromMat4(t,B)},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 s=n[r];if(s&&s.active){var a=s._getBoundingBoxTo();a&&i.union(i,a)}}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(){d&&cc.director.getActionManager().removeAllActionsFromTarget(this),o.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(o._setDirtyForNode(this),t.length>1){for(var n,r,s=1,a=t.length;s<a;s++){n=t[s];for(var c=s;c>0&&(r=t[c-1])._localZOrder>n._localZOrder;c--)t[c]=r;t[c]=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},dt=cc.Class(ft),pt=dt.prototype;u.getset(pt,"position",pt.getPosition,pt.setPosition,!1,!0),cc.Node=e.exports=dt}),{"./event-manager":129,"./event/event":132,"./event/event-target":131,"./platform/CCMacro":163,"./platform/js":179,"./renderer/render-flow":190,"./utils/affine-transform":224,"./utils/base-node":225,"./utils/prefab-helper":236,"./utils/trans-pool":242,"./value-types":248}],26:[(function(t,e){"use strict";var i=t("./CCNode"),n=t("./renderer/render-flow"),r=(cc.Object.Flags.HideInHierarchy,i._LocalDirtyFlag),s=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(){}}),a=s.prototype;cc.js.getset(a,"parent",a.getParent,a.setParent),cc.js.getset(a,"position",a.getPosition,a.setPosition),cc.PrivateNode=e.exports=s}),{"./CCNode":25,"./renderer/render-flow":190}],27:[(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":25}],28:[(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},s=[];r.get=function(t,e,i,n){var a=s.pop();return a?(a.target=t,a.priority=e,a.paused=i,a.markedForDeletion=n):a=new r(t,e,i,n),a},r.put=function(t){s.length<20&&(t.target=null,s.push(t))};var a=function(t,e,i,n){this.list=t,this.entry=e,this.target=i,this.callback=n},o=[];a.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 a(t,e,i,n),r},a.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,s){var a=this;a.timers=t,a.target=e,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged=r,a.paused=s},u=[];function l(){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,s){var a=u.pop();return a?(a.timers=t,a.target=e,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged=r,a.paused=s):a=new c(t,e,i,n,r,s),a},c.put=function(t){u.length<20&&(t.timers=t.target=t.currentTimer=null,u.push(t))};var h=l.prototype;h.initWithCallback=function(t,e,i,n,r,s){return this._lock=!1,this._scheduler=t,this._target=i,this._callback=e,this._elapsed=-1,this._interval=n,this._delay=s,this._useDelay=this._delay>0,this._repeat=r,this._runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},h.getInterval=function(){return this._interval},h.setInterval=function(t){this._interval=t},h.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()))},h.getCallback=function(){return this._callback},h.trigger=function(){this._target&&this._callback&&(this._lock=!0,this._callback.call(this._target,this._elapsed),this._lock=!1)},h.cancel=function(){this._scheduler.unschedule(this._callback,this._target)};var _=[];l.get=function(){return _.pop()||new l},l.put=function(t){_.length<20&&!t._lock&&(t._scheduler=t._target=t._callback=null,_.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,s=i.entry,o=0,c=n.length;o<c;o++)if(n[o]===s){n.splice(o,1);break}delete this._hashForUpdates[e],r.put(s),a.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 s,a=this._arrayForTimers;for(e=0;e<a.length;e++){if(s=a[e],this._currentTarget=s,this._currentTargetSalvaged=!1,!s.paused)for(s.timerIndex=0;s.timerIndex<s.timers.length;++s.timerIndex)s.currentTimer=s.timers[s.timerIndex],s.currentTimerSalvaged=!1,s.currentTimer.update(t),s.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,s){if("function"!=typeof t){var a=t;t=e,e=a}4!==arguments.length&&5!==arguments.length||(s=!!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 u,h,_=this._hashForTimers[o];if(_?_.paused!==s&&cc.warnID(1511):(_=c.get(null,e,0,null,null,s),this._arrayForTimers.push(_),this._hashForTimers[o]=_),null==_.timers)_.timers=[];else for(h=0;h<_.timers.length;++h)if((u=_.timers[h])&&t===u._callback)return cc.logID(1507,u.getInterval(),i),void(u._interval=i);(u=l.get()).initWithCallback(this,t,e,i,n,r),_.timers.push(u),this._currentTarget===_&&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 s=this._hashForUpdates[n];if(s&&s.entry){if(s.entry.priority===e)return s.entry.markedForDeletion=!1,void(s.entry.paused=i);if(this._updateHashLocked)return cc.logID(1506),s.entry.markedForDeletion=!1,void(s.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]=a.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,s=0,a=r.length;s<a;s++){var o=r[s];if(t===o._callback)return o!==n.currentTimer||n.currentTimerSalvaged||(n.currentTimerSalvaged=!0),r.splice(s,1),l.put(o),n.timerIndex>=s&&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,s=n.length;r<s;r++)l.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 s=0;if(t<0)for(e=0;e<this._updatesNegList.length;)s=this._updatesNegList.length,(n=this._updatesNegList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),s==this._updatesNegList.length&&e++;if(t<=0)for(e=0;e<this._updates0List.length;)s=this._updates0List.length,(n=this._updates0List[e])&&this.unscheduleUpdate(n.target),s==this._updates0List.length&&e++;for(e=0;e<this._updatesPosList.length;)s=this._updatesPosList.length,(n=this._updatesPosList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),s==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,s=0;s<r.length;++s)if(t===r[s]._callback)return!0;return!1},pauseAllTargets:function(){return this.pauseAllTargetsWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},pauseAllTargetsWithMinPriority:function(t){var e,i,n,r,s=[],a=this._arrayForTimers;for(i=0,n=a.length;i<n;i++)(e=a[i])&&(e.paused=!0,s.push(e.target));if(t<0)for(i=0;i<this._updatesNegList.length;i++)(r=this._updatesNegList[i])&&r.priority>=t&&(r.paused=!0,s.push(r.target));if(t<=0)for(i=0;i<this._updates0List.length;i++)(r=this._updates0List[i])&&(r.paused=!0,s.push(r.target));for(i=0;i<this._updatesPosList.length;i++)(r=this._updatesPosList[i])&&r.priority>=t&&(r.paused=!0,s.push(r.target));return s},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":175,"./platform/js":179}],29:[(function(t,e){"use strict";var i=t("./preprocess"),n=t("./fetch"),r=t("./cache"),s=t("./helper"),a=t("./releaseManager"),o=t("./depend-util"),c=t("./load"),u=t("./pipeline"),l=t("./task"),h=t("./request-item"),_=t("./downloader"),f=t("./parser"),d=t("./pack-manager"),p=t("./bundle"),v=t("./builtins"),g=t("./factory"),m=t("./urlTransformer"),y=m.parse,T=m.combine,E=t("./utilities"),A=E.parseParameters,C=E.asyncify,x=t("./shared"),b=x.assets,S=x.files,w=x.parsed,R=x.pipeline,I=x.transformPipeline,M=x.fetchPipeline,O=x.RequestType,L=x.bundles,D=x.BuiltinBundleName;function P(){this._preprocessPipe=i,this._fetchPipe=n,this._loadPipe=c,this.pipeline=R.append(i).append(c),this.fetchPipeline=M.append(i).append(n),this.transformPipeline=I.append(y).append(T),this.bundles=L,this.assets=b,this._files=S,this._parsed=w,this.generalImportBase="",this.generalNativeBase="",this.dependUtil=o,this._releaseManager=a,this.cacheAsset=!0,this.force=!1,this.utils=s,this.downloader=_,this.parser=f,this.builtins=v,this.packManager=d,this.factory=g,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}}}P.Pipeline=u,P.Task=l,P.Cache=r,P.RequestItem=h,P.Bundle=p,P.BuiltinBundleName=D,P.prototype={constructor:P,get main(){return L.get(D.MAIN)},get resources(){return L.get(D.RESOURCES)},get internal(){return L.get(D.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 L.get(t)},removeBundle:function(t){t._destroy(),L.remove(t.name)},loadAny:function(t,e,i,n){var r=A(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 s=new l({input:t,onProgress:i,onComplete:C(n),options:e});R.async(s)},preloadAny:function(t,e,i,n){var r=A(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 s=new l({input:t,onProgress:i,onComplete:C(n),options:e});M.async(s)},postLoadNative:function(t,e,i){if(!(t instanceof cc.Asset))throw new Error("input is not asset");var n=A(e,void 0,i);if(e=n.options,i=n.onComplete,!t._native||t._nativeAsset)return C(i)(null);var r=o.getNativeDep(t._uuid);if(r){if(!L.has(r.bundle)){var s=L.find((function(e){return e.getAssetInfo(t._uuid)}));s&&(r.bundle=s.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=A(e,void 0,i);if(e=n.options,i=n.onComplete,this.assets.has(t))return C(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)):g.create(t,r,e.ext||cc.path.extname(t),e,(function(t,e){i&&i(t,e)}))}))},loadScript:function(t,e,i){var n=A(e,void 0,i);e=n.options,i=n.onComplete,e.__requestType__=O.URL,e.preset=e.preset||"script",this.loadAny(t,e,i)},loadBundle:function(t,e,i){var n=A(e,void 0,i),r=(e=n.options,i=n.onComplete,cc.path.basename(t));if(this.bundles.has(r))return C(i)(null,this.getBundle(r));e.preset=e.preset||"bundle",e.ext="bundle",this.loadRemote(t,e,i)},releaseAsset:function(t){a.tryRelease(t,!0)},releaseUnusedAssets:function(){b.forEach((function(t){a.tryRelease(t)}))},releaseAll:function(){b.forEach((function(t){a.tryRelease(t,!0)}))},_transform:function(t,e){var i=l.create({input:t,options:e}),n=[];try{for(var r=I.sync(i),s=0,a=r.length;s<a;s++){var o=r[s],c=o.url;o.recycle(),n.push(c)}}catch(u){for(s=0,a=i.output.length;s<a;s++)i.output[s].recycle();cc.error(u.message,u.stack)}return i.recycle(),n.length>1?n:n[0]}},cc.AssetManager=P,cc.assetManager=new P,Object.defineProperty(cc,"resources",{get:function(){return L.get(D.RESOURCES)}}),e.exports=cc.assetManager}),{"./builtins":30,"./bundle":31,"./cache":32,"./depend-util":34,"./downloader":41,"./factory":42,"./fetch":43,"./helper":45,"./load":47,"./pack-manager":48,"./parser":49,"./pipeline":50,"./preprocess":51,"./releaseManager":52,"./request-item":53,"./shared":54,"./task":55,"./urlTransformer":56,"./utilities":57}],30:[(function(t,e){"use strict";var i=t("./cache"),n=t("./releaseManager"),r=t("./shared").BuiltinBundleName,s={_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 s=i[r];n.add(s.name,s.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=s}),{"./cache":32,"./releaseManager":52,"./shared":54}],31:[(function(t,e){"use strict";var i=t("./config"),n=t("./releaseManager"),r=t("./utilities"),s=r.parseParameters,a=r.parseLoadResArgs,o=t("./shared"),c=o.RequestType,u=o.assets,l=o.bundles;function h(){this._config=new i}h.prototype={constructor:h,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),l.add(t.name,this)},load:function(t,e,i,n){var r=a(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=a(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=a(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=a(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=s(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=s(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 u.get(i&&i.uuid)},release:function(t,e){n.tryRelease(this.get(t,e),!0)},releaseUnusedAssets:function(){var t=this;u.forEach((function(e){var i=t.getAssetInfo(e._uuid);i&&!i.redirect&&n.tryRelease(e)}))},releaseAll:function(){var t=this;u.forEach((function(e){var i=t.getAssetInfo(e._uuid);i&&!i.redirect&&n.tryRelease(e,!0)}))},_destroy:function(){this._config.destroy()}},e.exports=h}),{"./config":33,"./releaseManager":52,"./shared":54,"./utilities":57}],32:[(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":179}],33:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("./cache"),r=t("./helper").normalize,s=t("./utilities").processOptions;function a(){this.name="",this.base="",this.importBase="",this.nativeBase="",this.deps=null,this.assetInfos=new n,this.scenes=new n,this.paths=new n}a.prototype={constructor:a,init:function(t){s(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],s=r[0],a=r[1],o=3===r.length,c=this.assetInfos.get(n);c.path=s,c.ctor=i._getClassById(a),e.has(s)?o?e.get(s).push(c):e.get(s).splice(0,0,c):e.add(s,[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],s=i.get(r);s.url=n,e.add(n,s)}}},_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 s=0,a=n.length;s<a;s++){var o=n[s],c=e.get(o),u=c.packs;u?1===a?u.splice(0,0,r):u.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 s=i[n];e.get(s).ver=i[n+1]}if(i=t.native)for(n=0,r=i.length;n<r;n+=2)s=i[n],e.get(s).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 s=0,a=n.length;s<a;s++){var o=n[s];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 s=n||[];function a(t,e){return!(t.length>e.length)||47===t.charCodeAt(e.length)}return this.paths.forEach((function(n,r){if(r.startsWith(t)&&a(r,t)||!t)for(var o=0,c=n.length;o<c;o++){var u=n[o];e&&!i.isChildClassOf(u.ctor,e)||s.push(u)}})),s},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=a}),{"../platform/js":179,"./cache":32,"./helper":45,"./utilities":57}],34:[(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 s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=r?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}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"),s=t("./deserialize"),a=t("./shared"),o=a.files,c=a.parsed,u={_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 s=n[r];e[s]||(e[s]=!0,i.push(s),this._descend(s,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=s(e);(n=this._parseDepsFromAsset(r)).nativeDep&&(n.nativeDep.uuid=t),c.add(t+"@import",r)}catch(a){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 s=i[n].uuid;e.deps.push(s)}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=u}),{"../platform/deserialize-compiled":173,"./cache":32,"./deserialize":36,"./shared":54}],35:[(function(t){"use strict";var e=t("../platform/js");t("../CCDirector");var i=t("./utilities"),n=t("./depend-util"),r=t("./releaseManager"),s=t("./downloader"),a=t("./factory"),o=t("./helper"),c=[".png",".jpg",".bmp",".jpeg",".gif",".ico",".tiff",".webp",".image",".pvr",".pkm"],u=[".mp3",".ogg",".wav",".m4a"];function l(){return!0}var h={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 s=!1;if(".ttf"===cc.path.extname(t)&&(s=!0),s){var a=cc.path.dirname(t),c=cc.path.basename(t);t=a+"."+n+"/"+c}else t=t.replace(/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]{8,})/,(function(t){return t+"."+n}));return t}},_={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 s=[],o=[];cc.assetManager.loadAny(t,null,(function(t,i,n){n.content&&(c.includes(n.ext)?s.push(n.content):u.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 u=n[c];if(!(u instanceof cc.Asset)){var h=u,_=t[c].url;s.includes(h)?a.create(_,u,".png",null,(function(t,e){h=n[c]=e})):o.includes(h)&&a.create(_,u,".mp3",null,(function(t,e){h=n[c]=e})),cc.assetManager.assets.add(_,h)}}if(n.length>1){var f=Object.create(null);n.forEach((function(t){f[t._uuid]=t})),r={isCompleted:l,_map:f}}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),s=(e=r.type,r.onProgress),a=r.onComplete,o=cc.path.extname(t);o&&(t=t.slice(0,-o.length)),cc.resources.load(t,e,s,a)},loadResArray:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),s=(e=r.type,r.onProgress),a=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,s,a)},loadResDir:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),s=(e=r.type,r.onProgress),a=r.onComplete;cc.resources.loadDir(t,e,s,(function(i,n){var r=[];i||(r=cc.resources.getDirWithPath(t,e).map((function(t){return t.path}))),a&&a(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 h},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 s=i[r];this._autoReleaseSetting[s]=e}},isAutoRelease:function(t){return"object"==typeof t&&(t=t._uuid),!!this._autoReleaseSetting[t]}};s.loadSubpackage=function(t,e){cc.assetManager.loadBundle(t,null,e)};var f={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 _}},AssetLibrary:{get:function(){return f}},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||_.onProgress,n};var p=r._autoRelease;r._autoRelease=function(){p.apply(this,arguments);for(var t=_._autoReleaseSetting,e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(!0===t[n]){var s=cc.assetManager.assets.get(n);s&&r.tryRelease(s)}}}}),{"../CCDirector":23,"../platform/js":179,"./depend-util":34,"./downloader":41,"./factory":42,"./helper":45,"./releaseManager":52,"./utilities":57}],36:[(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,s=null,a=(s=cc.deserialize.Details.pool).get();try{r=cc.deserialize(t,a,{classFinder:n,customEnv:e})}catch(f){throw s.put(a),f}for(var o=a.uuidList,c=a.uuidObjList,u=a.uuidPropList,l=[],h=0;h<o.length;h++){var _=o[h];l[h]={uuid:i.decodeUuid(_),owner:c[h],prop:u[h]}}return r.__depends__=l,r._native&&(r.__nativeDepend__=!0),s.put(a),r}}),{"../platform/deserialize":174,"../platform/deserialize-compiled":173,"../platform/deserialize-editor":void 0,"./helper":45}],37:[(function(t,e){"use strict";var i=cc.sys.__audioSupport,n=t("./utilities").parseParameters;e.exports=function(t,e,r){var s=n(e,void 0,r),a=(e=s.options,r=s.onComplete,document.createElement("audio"));a.src=t;var o=function(){clearTimeout(c),a.removeEventListener("canplaythrough",u,!1),a.removeEventListener("error",l,!1),i.USE_LOADER_EVENT&&a.removeEventListener(i.USE_LOADER_EVENT,u,!1)},c=setTimeout((function(){0===a.readyState?l():u()}),8e3),u=function(){o(),r&&r(null,a)},l=function(){o();var e="load audio failure - "+t;cc.log(e),r&&r(new Error(e))};return a.addEventListener("canplaythrough",u,!1),a.addEventListener("error",l,!1),i.USE_LOADER_EVENT&&a.addEventListener(i.USE_LOADER_EVENT,u,!1),a}}),{"./utilities":57}],38:[(function(t,e){"use strict";var i=t("./utilities").parseParameters;e.exports=function(t,e,n){var r=i(e,void 0,n),s=(e=r.options,n=r.onComplete,new Image);function a(){s.removeEventListener("load",a),s.removeEventListener("error",o),n&&n(null,s)}function o(){s.removeEventListener("load",a),s.removeEventListener("error",o),n&&n(new Error(cc.debug.getError(4930,t)))}return"file:"!==window.location.protocol&&(s.crossOrigin="anonymous"),s.addEventListener("load",a),s.addEventListener("error",o),s.src=t,s}}),{"./utilities":57}],39:[(function(t,e){"use strict";var i=t("./utilities").parseParameters;e.exports=function(t,e,n,r){var s=i(e,n,r),a=(e=s.options,n=s.onProgress,r=s.onComplete,new XMLHttpRequest),o="download failed: "+t+", status: ";if(a.open("GET",t,!0),void 0!==e.responseType&&(a.responseType=e.responseType),void 0!==e.withCredentials&&(a.withCredentials=e.withCredentials),void 0!==e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),void 0!==e.timeout&&(a.timeout=e.timeout),e.header)for(var c in e.header)a.setRequestHeader(c,e.header[c]);return a.onload=function(){200===a.status||0===a.status?r&&r(null,a.response):r&&r(new Error(o+a.status+"(no response)"))},n&&(a.onprogress=function(t){t.lengthComputable&&n(t.loaded,t.total)}),a.onerror=function(){r&&r(new Error(o+a.status+"(error)"))},a.ontimeout=function(){r&&r(new Error(o+a.status+"(time out)"))},a.onabort=function(){r&&r(new Error(o+a.status+"(abort)"))},a.send(null),a}}),{"./utilities":57}],40:[(function(t,e){"use strict";var i=t("./utilities").parseParameters,n={};e.exports=function(t,e,r){var s=i(e,void 0,r);if(e=s.options,r=s.onComplete,n[t])return r&&r(null);var a=document,o=document.createElement("script");function c(){o.parentNode.removeChild(o),o.removeEventListener("load",c,!1),o.removeEventListener("error",u,!1),n[t]=!0,r&&r(null)}function u(){o.parentNode.removeChild(o),o.removeEventListener("load",c,!1),o.removeEventListener("error",u,!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",u,!1),a.body.appendChild(o)}}),{"./utilities":57}],41:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("../CCDebug"),r=t("./font-loader").loadFont,s=t("../platform/utils").callInNextTick,a=t("./download-dom-image"),o=t("./download-dom-audio"),c=t("./download-file"),u=t("./download-script.js"),l=t("./cache"),h=t("./shared").files,_=t("../platform/CCSys"),f=_.__audioSupport,d=_.capabilities,p=t("./utilities"),v=p.urlAppendTimestamp,g=p.retry,m=/^(?:\w+:\/\/|\.+\/).+/,y=function(t,e,i){e.audioLoadMode!==cc.AudioClip.LoadMode.DOM_AUDIO?C(t,e,i):o(t,e,i)},T=(y=0===(f.format||[]).length?function(t,e,i){i(new Error(n.getError(4927)))}:f.WEB_AUDIO?y:o,function(){var t=d.imageBitmap&&cc.macro.ALLOW_IMAGE_BITMAP?E:a;t.apply(this,arguments)}),E=function(t,e,i){e.responseType="blob",c(t,e,e.onFileProgress,i)},A=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)}))},C=function(t,e,i){e.responseType="arraybuffer",c(t,e,e.onFileProgress,i)},x=function(t,e,i){e.responseType="text",c(t,e,e.onFileProgress,i)},b=function(t,e,i){i(null,t)},S=new l,w=[],R=!1,I=0,M=0,O=-1,L=!1,D=function(){var t=Date.now(),e=cc.director._deltaTime>N._maxInterval?N._maxInterval:cc.director._deltaTime;t-O>1e3*e&&(M=0,O=t)},P=function t(e,i){for(L=!1,D();w.length>0&&I<e&&M<i;){R&&(w.sort((function(t,e){return t.priority-e.priority})),R=!1);var n=w.pop();if(!n)break;I++,M++,n.invoke()}w.length>0&&I<e&&(s(t,e,i),L=!0)},N={_remoteServerAddress:"",_maxInterval:1/30,get remoteServerAddress(){return this._remoteServerAddress},maxConcurrency:6,maxRequestsPerFrame:6,maxRetryCount:3,appendTimeStamp:!1,limited:!0,retryInterval:2e3,bundleVers:null,downloadDomImage:a,downloadDomAudio:o,downloadFile:c,downloadScript:u,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(F,t):F[t]=e},download:function(t,e,i,n,r){var a,o,c=F[i]||F.default,u=this;if(a=h.get(t))r(null,a);else if(o=S.get(t)){o.push(r);for(var l=0,_=w.length;l<_;l++){var f=w[l];if(f.id===t){var d=n.priority||0;return void(f.priority<d&&(f.priority=d,R=!0))}}}else{var p=void 0!==n.maxRetryCount?n.maxRetryCount:this.maxRetryCount,m=void 0!==n.maxConcurrency?n.maxConcurrency:this.maxConcurrency,y=void 0!==n.maxRequestsPerFrame?n.maxRequestsPerFrame:this.maxRequestsPerFrame;g((function(i,a){if(0===i&&S.add(t,[r]),!u.limited)return c(v(e),n,a);function o(){c(v(e),n,(function(){I--,!L&&w.length>0&&(s(P,m,y),L=!0),a.apply(this,arguments)}))}D(),I<m&&M<y?(o(),I++,M++):(w.push({id:t,priority:n.priority||0,invoke:o}),R=!0,!L&&I<m&&(s(P,m,y),L=!0))}),p,this.retryInterval,(function(e,i){e||h.add(t,i);for(var n=S.remove(t),r=0,s=n.length;r<s;r++)n[r](e,i)}))}}},F={".png":T,".jpg":T,".bmp":T,".jpeg":T,".gif":T,".ico":T,".tiff":T,".webp":T,".image":T,".pvr":C,".pkm":C,".mp3":y,".ogg":y,".wav":y,".m4a":y,".txt":x,".xml":x,".vsh":x,".fsh":x,".atlas":x,".tmx":x,".tsx":x,".json":A,".ExportJson":A,".plist":x,".fnt":x,".font":r,".eot":r,".ttf":r,".woff":r,".svg":r,".ttc":r,".mp4":b,".avi":b,".mov":b,".mpg":b,".mpeg":b,".rm":b,".rmvb":b,".binary":C,".bin":C,".dbbin":C,".skel":C,".js":u,bundle:function(t,e,i){var n=cc.path.basename(t),r=t;m.test(r)||(r="assets/"+n);var s=e.version||N.bundleVers[n],a=0,o=null,c=null;A(r+"/config."+(s?s+".":"")+"json",e,(function(t,e){t&&(c=t),(o=e)&&(o.base=r+"/"),2==++a&&i(c,o)})),u(r+"/index."+(s?s+".":"")+"js",e,(function(t){t&&(c=t),2==++a&&i(c,o)}))},default:x};N._downloaders=F,e.exports=N}),{"../CCDebug":22,"../platform/CCSys":167,"../platform/js":179,"../platform/utils":182,"./cache":32,"./download-dom-audio":37,"./download-dom-image":38,"./download-file":39,"./download-script.js":40,"./font-loader":44,"./shared":54,"./utilities":57}],42:[(function(t,e){"use strict";var i=t("./bundle"),n=t("./cache"),r=t("./shared"),s=r.assets,a=r.bundles,o=new n;function c(t,e,i,n){var r=null,s=null;try{(r=new cc.Texture2D)._nativeUrl=t,r._nativeAsset=e}catch(a){s=a}n&&n(s,r)}function u(t,e,i,n){var r=new cc.AudioClip;r._nativeUrl=t,r._nativeAsset=e,r.duration=e.duration,n&&n(null,r)}function l(t,e,i,n){var r=new cc.VideoClip;r._nativeUrl=t,r._nativeAsset=e,n&&n(null,r)}function h(t,e,i,n){var r=new cc.JsonAsset;r.json=e,n&&n(null,r)}function _(t,e,i,n){var r=new cc.TextAsset;r.text=e,n&&n(null,r)}function f(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(v,t):v[t]=e},create:function(t,e,i,n,r){var a,c,u=v[i]||v.default;(a=s.get(t))?r(null,a):(c=o.get(t))?c.push(r):(o.add(t,[r]),u(t,e,n,(function(e,i){!e&&i instanceof cc.Asset&&(i._uuid=t,s.add(t,i));for(var n=o.remove(t),r=0,a=n.length;r<a;r++)n[r](e,i)})))}},v={".png":c,".jpg":c,".bmp":c,".jpeg":c,".gif":c,".ico":c,".tiff":c,".webp":c,".image":c,".pvr":c,".pkm":c,".mp3":u,".ogg":u,".wav":u,".m4a":u,".mp4":l,".avi":l,".mov":l,".mpg":l,".mpeg":l,".rm":l,".rmvb":l,".txt":_,".xml":_,".vsh":_,".fsh":_,".atlas":_,".tmx":_,".tsx":_,".fnt":_,".json":h,".ExportJson":h,".font":f,".eot":f,".ttf":f,".woff":f,".svg":f,".ttc":f,".binary":d,".bin":d,".dbbin":d,".skel":d,bundle:function(t,e,n,r){var s=a.get(e.name);s||(s=new i,e.base=e.base||t+"/",s.init(e)),r&&r(null,s)},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":31,"./cache":32,"./shared":54}],43:[(function(t,e){"use strict";var i=t("./pack-manager"),n=t("./task"),r=t("./utilities"),s=r.getDepends,a=r.clear,o=r.forEach,c=t("./shared"),u=c.assets,l=c.fetchPipeline;function h(t){for(var e=t.output,i=0,n=e.length;i<n;i++)e[i].content&&e[i].content.decRef(!1)}function _(t,e,i,n,r,a,o){var c=e.options.__exclude__,u=e.progress;t.content=i,t.file=n,e.output.push(t),r&&(c[t.uuid]=!0,s(t.uuid,n||i,c,a,!0,!1,t.config),u.total=o+a.length),u.canInvoke&&e.dispatch("progress",++u.finish,u.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 s=t.options,c=[],f=t.progress,d=f.total;s.__exclude__=s.__exclude__||Object.create(null),t.output=[],o(t.input,(function(n,s){if(!n.isNative&&u.has(n.uuid)){var a=u.get(n.uuid);return a.addRef(),_(n,t,a,null,a.__asyncLoadAssets__,c,d),s()}i.load(n,t.options,(function(i,a){i?t.isFinish||(!cc.assetManager.force||r?(cc.error(i.message,i.stack),f.canInvoke=!1,e(i)):_(n,t,null,null,!1,c,d)):t.isFinish||_(n,t,null,a,!n.isNative,c,d),s()}))}),(function(){if(t.isFinish)return a(t,!0),t.dispatch("error");if(c.length>0){var i=n.create({name:t.name+" dependencies",input:c,progress:f,options:s,onProgress:t.onProgress,onError:n.prototype.recycle,onComplete:function(n){n||(t.output.push.apply(t.output,this.output),i.recycle()),r&&h(t),e(n)}});l.async(i)}else r&&h(t),e()}))}}),{"./pack-manager":48,"./shared":54,"./task":55,"./utilities":57}],44:[(function(t,e){"use strict";var i,n=t("../utils/text-utils"),r=null,s="BES bswy:->@123\u4e01\u3041\u1101",a=Object.create(null),o=-1,c=[],u=3e3,l=(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 h(){for(var t=!0,e=Date.now(),i=c.length-1;i>=0;i--){var a=c[i],l=a.fontFamilyName;if(e-a.startTime>u)cc.warnID(4933,l),a.onComplete(null,l),c.splice(i,1);else{var h=a.refWidth,_="40px "+l;r.font=_,h!==n.safeMeasureText(r,s,_)?(c.splice(i,1),a.onComplete(null,l)):t=!1}}t&&(clearInterval(o),o=-1)}var _={loadFont:function(t,e,i){var f=_._getFontFamily(t);if(a[f])return i(null,f);if(!r){var d=document.createElement("canvas");d.width=100,d.height=100,r=d.getContext("2d")}var p="40px "+f;r.font=p;var v=n.safeMeasureText(r,s,p),g=document.createElement("style");g.type="text/css";var m="";isNaN(f-0)?m+="@font-face { font-family:"+f+"; src:":m+="@font-face { font-family:'"+f+"'; src:",m+="url('"+t+"');",g.textContent=m+"}",document.body.appendChild(g);var y,T,E,A,C,x,b=document.createElement("div"),S=b.style;if(S.fontFamily=f,b.innerHTML=".",S.position="absolute",S.left="-100px",S.top="-100px",document.body.appendChild(b),l())y=Date.now(),T=f,E=i,A=new Promise(function(t,e){(function i(){Date.now()-y>=u?e():document.fonts.load("40px "+T).then((function(e){e.length>=1?t():setTimeout(i,100)}),(function(){e()}))})()}),C=null,x=new Promise(function(t,e){C=setTimeout(e,u)}),Promise.race([x,A]).then((function(){C&&(clearTimeout(C),C=null),E(null,T)}),(function(){cc.warnID(4933,T),E(null,T)}));else{var w={fontFamilyName:f,refWidth:v,onComplete:i,startTime:Date.now()};c.push(w),-1===o&&(o=setInterval(h,100))}a[f]=g},_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=_}),{"../utils/text-utils":240}],45:[(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":228,"./shared":54}],46:[(function(t){"use strict";t("./deprecated"),t("./CCAssetManager")}),{"./CCAssetManager":29,"./deprecated":35}],47:[(function(t,e){"use strict";var i=t("./pack-manager"),n=t("./pipeline"),r=t("./parser"),s=t("./utilities"),a=s.getDepends,o=s.cache,c=s.gatherAsset,u=s.setProperties,l=s.forEach,h=s.clear,_=s.checkCircleReference,f=t("./shared"),d=f.assets,p=f.files,v=f.parsed,g=f.pipeline,m=t("./task"),y=new n("loadOneAsset",[function(t,e){var n=t.output=t.input,r=n.options,s=n.isNative,a=n.uuid,o=n.file,c=r.reload;if(o||!c&&!s&&d.has(a))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,s=t.options.__exclude__,a=i.id,o=i.file,c=i.options;if(i.isNative)r.parse(a,o,i.ext,c,(function(r,s){if(r)return e(r);i.content=s,n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),p.remove(a),v.remove(a),e()}));else{var u=i.uuid;if(u in s){var l=s[u],h=l.finish,f=l.content,g=l.err,m=l.callbacks;n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),h||_(u,u,s)?(f&&f.addRef&&f.addRef(),i.content=f,e(g)):m.push({done:e,item:i})}else if(!c.reload&&d.has(u)){var y=d.get(u);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(a,o,"import",c,(function(i,n){if(i)return e(i);n._uuid=u,T(t,n,e,!0)}))}}]);function T(t,e,i,n){var r=t.input,s=t.progress,c=r.uuid,l=r.id,h=r.options,_=r.config,f=h.__asyncLoadAssets__,d=h.cacheAsset,y=[];e.addRef&&e.addRef(),a(c,e,Object.create(null),y,!1,f,_),s.canInvoke&&t.dispatch("progress",++s.finish,s.total+=y.length,r);var T=t.options.__exclude__[c]={content:e,finish:!1,callbacks:[{done:i,item:r}]},E=m.create({input:y,options:t.options,onProgress:t.onProgress,onError:m.prototype.recycle,progress:s,onComplete:function(t){if(e.decRef&&e.decRef(!1),e.__asyncLoadAssets__=f,T.finish=!0,T.err=t,!t){for(var i=Array.isArray(E.output)?E.output:[E.output],r=Object.create(null),s=0,a=i.length;s<a;s++){var h=i[s];h&&(r[h instanceof cc.Asset?h._uuid+"@import":c+"@native"]=h)}if(n){if(!u(c,e,r)&&!e.__onLoadInvoked__)try{e.onLoad&&e.onLoad(),e.__onLoadInvoked__=!0}catch(A){cc.error(A.message,A.stack)}p.remove(l),v.remove(l),o(c,e,void 0!==d?d:cc.assetManager.cacheAsset)}else if(e.__nativeDepend__&&!e._nativeAsset&&!u(c,e,r)&&!e.__onLoadInvoked__)try{e.onLoad&&e.onLoad(),e.__onLoadInvoked__=!0}catch(A){cc.error(A.message,A.stack)}E.recycle()}for(var _=T.callbacks,g=0,m=_.length;g<m;g++){var y=_[g];e.addRef&&e.addRef(),y.item.content=e,y.done(t)}_.length=0}});g.async(E)}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=[],l(t.input,(function(s,a){var o=m.create({input:s,onProgress:t.onProgress,options:n,progress:r,onComplete:function(n,s){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,s)),t.output.push(s),o.recycle(),a()}});y.async(o)}),(function(){if(n.__exclude__=null,t.isFinish)return h(t,!0),t.dispatch("error");c(t),h(t,!0),e()}))}}),{"./pack-manager":48,"./parser":49,"./pipeline":50,"./shared":54,"./task":55,"./utilities":57}],48:[(function(t,e){"use strict";var i=t("../platform/deserialize-compiled"),n=t("./downloader"),r=t("./cache"),s=t("../platform/js"),a=t("./shared").files,o=new r;function c(t){return o.has(t.uuid)}var u={unpackJson:function(t,e,n,r){var a=s.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++)a[t[c]+"@import"]=e[c]}else{var u=s._getClassId(cc.Texture2D);if(e.type===u){if(e.data){var l=e.data.split("|");l.length!==t.length&&cc.errorID(4915);for(var h=0;h<t.length;h++)a[t[h]+"@import"]=(0,i.packCustomObjData)(u,l[h],!0)}}else o=new Error("unmatched type pack!"),a=null}r&&r(o,a)},init:function(){o.clear()},register:function(t,e){"object"==typeof t?s.mixin(l,t):l[t]=e},unpack:function(t,e,i,n,r){e?(0,l[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(a.has(t.id))return i(null,a.get(t.id));var r=t.info.packs,s=r.find(c);if(s)return o.get(s.uuid).push({onComplete:i,id:t.id});s=r[0],o.add(s.uuid,[{onComplete:i,id:t.id}]);var l=cc.assetManager._transform(s.uuid,{ext:s.ext,bundle:t.config.name});n.download(s.uuid,l,s.ext,t.options,(function(e,i){a.remove(s.uuid),e&&cc.error(e.message,e.stack),u.unpack(s.packs,i,s.ext,t.options,(function(t,e){if(t)t.message="unpack "+l+" failed! details: "+t.message;else for(var i in e)a.add(i,e[i]);for(var n=o.remove(s.uuid),r=0,c=n.length;r<c;r++){var u=n[r];if(t)u.onComplete(t);else{var h=e[u.id];h?u.onComplete(null,h):u.onComplete(new Error("can not retrieve data from package"))}}}))}))}},l={".json":u.unpackJson};e.exports=u}),{"../platform/deserialize-compiled":173,"../platform/js":179,"./cache":32,"./downloader":41,"./shared":54}],49:[(function(t,e){"use strict";var i=t("../platform/CCSAXParser").plistParser,n=t("../platform/js"),r=t("./deserialize"),s=t("./cache"),a=t("./helper").isScene,o=t("./shared"),c=o.parsed,u=o.files,l=t("../platform/CCSys"),h=l.__audioSupport,_=l.capabilities,f=new s,d={parseImage:function(t,e,i){if(_.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?h.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 s=t instanceof ArrayBuffer?t:t.buffer,a=new Int32Array(s,0,13);if(55727696!=a[0])throw new Error("Invalid magic number in PVR header");var o=a[7],c=a[6],u=a[12]+52;r={_data:new Uint8Array(s,u),_compressed:!0,width:o,height:c}}catch(l){n=l}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,s=null;try{var a=e instanceof ArrayBuffer?e:e.buffer,o=new Uint8Array(a),c=t(o,6);if(0!==c&&1!==c&&3!==c)return new Error("Invalid magic number in ETC header");var u=t(o,12),l=t(o,14);t(o,8),t(o,10),s={_data:new Uint8Array(a,16),_compressed:!0,width:u,height:l}}catch(h){r=h}n&&n(r,s)}})(),parsePlist:function(t,e,n){var r=null,s=i.parse(t);s||(r=new Error("parse failed")),n&&n(r,s)},parseImport:function(t,e,i){if(!t)return i&&i(new Error("Json is empty"));var n,s=null;try{n=r(t,e)}catch(a){s=a}i&&i(s,n)},init:function(){f.clear()},register:function(t,e){"object"==typeof t?n.mixin(p,t):p[t]=e},parse:function(t,e,i,n,r){var s,o,l;(s=c.get(t))?r(null,s):(o=f.get(t))?o.push(r):(l=p[i])?(f.add(t,[r]),l(e,n,(function(e,i){e?u.remove(t):a(i)||c.add(t,i);for(var n=f.remove(t),r=0,s=n.length;r<s;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,".mp3":d.parseAudio,".ogg":d.parseAudio,".wav":d.parseAudio,".m4a":d.parseAudio,".plist":d.parsePlist,import:d.parseImport};e.exports=d}),{"../platform/CCSAXParser":165,"../platform/CCSys":167,"../platform/js":179,"./cache":32,"./deserialize":36,"./helper":45,"./shared":54}],50:[(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 s=(0,e[n])(t);if(s)return t._isFinish=!0,s;++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":55}],51:[(function(t,e){"use strict";var i=t("./task"),n=t("./shared"),r=n.transformPipeline,s=n.RequestType;e.exports=function(t,e){var n=t.options,a=Object.create(null),o=Object.create(null);for(var c in n)switch(c){case s.PATH:case s.UUID:case s.DIR:case s.SCENE:case s.URL:break;case"__requestType__":case"__isNative__":case"ext":case"type":case"__nativeName__":case"audioLoadMode":case"bundle":a[c]=n[c];break;case"__exclude__":case"__outputAsArray__":o[c]=n[c];break;default:a[c]=n[c],o[c]=n[c]}t.options=o;var u=i.create({input:t.input,options:a}),l=null;try{t.output=t.source=r.sync(u)}catch(f){l=f;for(var h=0,_=u.output.length;h<_;h++)u.output[h].recycle()}u.recycle(),e(l)}}),{"./shared":54,"./task":55}],52:[(function(t,e){"use strict";var i=t("./depend-util"),n=t("./cache");t("../assets/CCAsset");var r=t("./shared").assets,s=t("../platform/utils").callInNextTick;function a(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 s=t[r];if("object"==typeof s&&s)if(Array.isArray(s))for(var o=0;o<s.length;o++){var c=s[o];c instanceof cc.Asset&&a(c,e)}else if(s.constructor&&s.constructor!==Object)s instanceof cc.Asset&&a(s,e);else for(var u=Object.getOwnPropertyNames(s),l=0;l<u.length;l++){var h=s[u[l]];h instanceof cc.Asset&&a(h,e)}}}}var c=[];function u(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++)u(t._children[n],e)}function l(t,e,n,s){n.push(t._uuid);for(var a=i.getDeps(t._uuid),o=0,c=a.length;o<c;o++){var u=r.get(a[o]);if(u){var h=u._uuid;if(h in e?e[h]+=s:e[h]=u.refCount+s,n.includes(h))continue;l(u,e,n,s)}}}function h(t){var e=Object.create(null);if(e[t._uuid]=t.refCount,l(t,e,c,-1),c.length=0,0!==e[t._uuid])return e[t._uuid];for(var i in e)0!==e[i]&&l(r.get(i),e,c,1);return c.length=0,e[t._uuid]}var _=new n,f=new n,d=!1;function p(){d=!1,f.forEach((function(t){v._free(t)})),f.clear()}var v={init:function(){_.clear(),f.clear()},_addPersistNodeRef:function(t){var e=[];u(t,e);for(var i=0,n=e.length;i<n;i++){var s=r.get(e[i]);s&&s.addRef()}_.add(t.uuid,e)},_removePersistNodeRef:function(t){if(_.has(t.uuid)){for(var e=_.get(t.uuid),i=0,n=e.length;i<n;i++){var s=r.get(e[i]);s&&s.decRef()}_.remove(t.uuid)}},_autoRelease:function(t,e,n){if(t){for(var s=i.getDeps(t._id),a=0,o=s.length;a<o;a++){var c=r.get(s[a]);c&&c.decRef(t.autoReleaseAssets)}var u=i._depends.get(t._id);if(u&&u.persistDeps)for(var l=u.persistDeps,h=0,f=l.length;h<f;h++){var d=r.get(l[h]);d&&d.decRef(t.autoReleaseAssets)}t._id!==e._id&&i.remove(t._id)}var p=i._depends.get(e._id);for(var v in p&&(p.persistDeps=[]),n){for(var g=n[v],m=_.get(g.uuid),y=0,T=m.length;y<T;y++){var E=r.get(m[y]);E&&E.addRef()}p&&p.persistDeps.push.apply(p.persistDeps,m)}},_free:function(t,e){if(f.remove(t._uuid),cc.isValid(t,!0)&&!(!e&&t.refCount>0&&h(t)>0)){r.remove(t._uuid);for(var n=i.getDeps(t._uuid),s=0,a=n.length;s<a;s++){var o=r.get(n[s]);o&&(o.decRef(!1),v._free(o,!1))}t.destroy(),i.remove(t._uuid)}},tryRelease:function(t,e){t instanceof cc.Asset&&(e?v._free(t,e):(f.add(t._uuid,t),d||(d=!0,s(p))))}};e.exports=v}),{"../assets/CCAsset":58,"../platform/utils":182,"./cache":32,"./depend-util":34,"./shared":54}],53:[(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}),{}],54:[(function(t,e){"use strict";var i=t("./cache"),n=t("./pipeline"),r=new i,s=new i,a=new i,o=new i,c=new n("normal load",[]),u=new n("fetch",[]),l=new n("transform url",[]);e.exports={assets:r,files:s,parsed:a,pipeline:c,fetchPipeline:u,transformPipeline:l,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":32,"./pipeline":50}],55:[(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 s="on"+t[0].toUpperCase()+t.substr(1);"function"==typeof this[s]&&this[s](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}),{}],56:[(function(t,e){"use strict";var i=t("./helper").decodeUuid,n=t("./request-item"),r=t("./shared"),s=r.RequestType,a=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],u=n.create();if("string"==typeof c&&((c=Object.create(null))[r.__requestType__||s.UUID]=e[o]),"object"==typeof c)for(var l in cc.js.addon(c,r),c.preset&&cc.js.addon(c,cc.assetManager.presets[c.preset]),c){switch(l){case s.UUID:var h=u.uuid=i(c.uuid);if(a.has(c.bundle)){if((p=(v=a.get(c.bundle)._config).getAssetInfo(h))&&p.redirect){if(!a.has(p.redirect))throw new Error("Please load bundle "+p.redirect+" first");p=(v=a.get(p.redirect)._config).getAssetInfo(h)}u.config=v,u.info=p}u.ext=c.ext||".json";break;case"__requestType__":case"ext":case"bundle":case"preset":case"type":break;case s.DIR:if(a.has(c.bundle)){var _=[];a.get(c.bundle)._config.getDirWithPath(c.dir,c.type,_);for(var f=0,d=_.length;f<d;f++){var p=_[f];e.push({uuid:p.uuid,__isNative__:!1,ext:".json",bundle:c.bundle})}}u.recycle(),u=null;break;case s.PATH:if(a.has(c.bundle)){if((p=(v=a.get(c.bundle)._config).getInfoWithPath(c.path,c.type))&&p.redirect){if(!a.has(p.redirect))throw new Error("you need to load bundle "+p.redirect+" first");p=(v=a.get(p.redirect)._config).getAssetInfo(p.uuid)}if(!p)throw u.recycle(),new Error("Bundle "+c.bundle+" doesn't contain "+c.path);u.config=v,u.uuid=p.uuid,u.info=p}u.ext=c.ext||".json";break;case s.SCENE:if(a.has(c.bundle)){var v;if((p=(v=a.get(c.bundle)._config).getSceneInfo(c.scene))&&p.redirect){if(!a.has(p.redirect))throw new Error("you need to load bundle "+p.redirect+" first");p=(v=a.get(p.redirect)._config).getAssetInfo(p.uuid)}if(!p)throw u.recycle(),new Error("Bundle "+v.name+" doesn't contain scene "+c.scene);u.config=v,u.uuid=p.uuid,u.info=p}break;case"__isNative__":u.isNative=c.__isNative__;break;case s.URL:u.url=c.url,u.uuid=c.uuid||c.url,u.ext=c.ext||cc.path.extname(c.url),u.isNative=void 0===c.__isNative__||c.__isNative__;break;default:u.options[l]=c[l]}if(!u)break}if(u&&(t.output.push(u),!u.uuid&&!u.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,s,a=n.config;s=n.isNative?a&&a.nativeBase?a.base+a.nativeBase:cc.assetManager.generalNativeBase:a&&a.importBase?a.base+a.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?s+"/"+o.slice(0,2)+"/"+o+c+"/"+n.options.__nativeName__:s+"/"+o.slice(0,2)+"/"+o+c+n.ext,n.url=r}}return null}}}),{"./helper":45,"./request-item":53,"./shared":54}],57:[(function(t,e){"use strict";var i=t("./depend-util"),n=t("./helper"),r=n.isScene,s=n.decodeUuid,a=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,a=t.paths=Object.create(null);if(!1===t.debug){for(var o=0,c=e.length;o<c;o++)e[o]=s(e[o]);for(var u in i){var l=i[u],h=l[1];l[1]=n[h]}}else{for(var _=Object.create(null),f=0,d=e.length;f<d;f++){var p=e[f];e[f]=_[p]=s(p)}e=_}for(var v in i){var g=i[v];a[e[v]]=g}var m=t.scenes;for(var y in m){var T=m[y];m[y]=e[T]}var E=t.packs;for(var A in E)for(var C=E[A],x=0;x<C.length;++x)C[x]=e[C[x]];var b=t.versions;if(b)for(var S in b)for(var w=b[S],R=0;R<w.length;R+=2){var I=w[R];w[R]=e[I]||I}var M=t.redirect;if(M)for(var O=0;O<M.length;O+=2)M[O]=e[M[O]],M[O+1]=r[M[O+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(s,a){r++,!s||r>e?n&&n(s,a):setTimeout((function(){c.retry(t,e,i,n,r)}),i)}))},getDepends:function(t,e,n,r,s,a,o){try{var c=i.parse(t,e),u=!0;if(e instanceof cc.Asset&&(!e.__nativeDepend__||e._nativeAsset)&&(u=!1),s){for(var l=0,h=c.deps.length;l<h;l++){var _=c.deps[l];_ in n||(n[_]=!0,r.push({uuid:_,bundle:o&&o.name}))}u&&c.nativeDep&&(o&&(c.nativeDep.bundle=o.name),r.push(Object.assign({},c.nativeDep)))}else{a=!0===a||!1===a?a&&!c.preventDeferredLoadDependents:!!e.asyncLoadAssets;for(var f=0,d=c.deps.length;f<d;f++){var p=c.deps[f];p in n||(n[p]=!0,r.push({uuid:p,__asyncLoadAssets__:a,bundle:o&&o.name}))}u&&!a&&!c.preventPreloadNativeObject&&c.nativeDep&&(o&&(c.nativeDep.bundle=o.name),r.push(Object.assign({},c.nativeDep)))}}catch(v){cc.error(v.message,v.stack)}},cache:function(t,e,i){e&&(!r(e)&&i&&a.add(t,e))},setProperties:function(t,e,i){var n=!1,r=e.__depends__;if(r){for(var s=0,a=r.length;s<a;s++){var o=r[s],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 s=0,a=t.length;s<a;s++)e(t[s],(function(t){t&&r.push(t),++n===a&&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 s=!1,a=i.getDeps(e);if(a)for(var o=0,u=a.length;o<u;o++){var l=a[o];if(l===t||c.checkCircleReference(t,l,n,r)){s=!0;break}}return s},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":58,"../platform/utils":182,"./depend-util":34,"./helper":45,"./shared":54}],58:[(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":164}],59:[(function(t,e){"use strict";var i=t("./CCAsset"),n=t("../event/event-target"),r=cc.Enum({WEB_AUDIO:0,DOM_AUDIO:1}),s=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.loaded=!0,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}))}}},destroy:function(){cc.audioEngine.uncache(this),this._super()}});cc.AudioClip=s,e.exports=s}),{"../event/event-target":131,"./CCAsset":58}],60:[(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 s in r){var a=new i,o=r[s].rect;a.offsetX=r[s].xOffset,a.offsetY=r[s].yOffset,a.w=o.width,a.h=o.height,a.u=o.x,a.v=o.y,a.textureID=0,a.valid=!0,a.xAdvance=r[s].xAdvance,this._fontDefDictionary.addLetterDefinitions(s,a)}}}});cc.BitmapFont=r,cc.BitmapFont.FontLetterDefinition=i,cc.BitmapFont.FontAtlas=n,e.exports=r}),{}],61:[(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}),{}],62:[(function(t,e){"use strict";var i=cc.Class({name:"cc.Font",extends:cc.Asset});cc.Font=e.exports=i}),{}],63:[(function(t,e){"use strict";var i=cc.Class({name:"cc.JsonAsset",extends:cc.Asset,properties:{json:null}});e.exports=cc.JsonAsset=i}),{}],64:[(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}),{}],65:[(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 this.optimizationPolicy!==i.SINGLE_INSTANCE&&(this.optimizationPolicy===i.MULTI_INSTANCE||this._instantiatedTimes+1>=n.OptimizationPolicyThreshold)?(t=this._doInstantiate(),this.data._instantiate(t)):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":177}],66:[(function(t,e){"use strict";var i,n=(i=t("../../renderer/gfx"))&&i.__esModule?i:{default:i},r=t("../renderer"),s=t("./CCTexture2D"),a=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:s,statics:{DepthStencilFormat:a},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 s,a={colors:[this._texture]};this._depthStencilBuffer&&this._depthStencilBuffer.destroy(),i&&(s=new n.default.RenderBuffer(r.device,i,t,e),i===n.default.RB_FMT_D24S8?a.depthStencil=s:i===n.default.RB_FMT_S8?a.stencil=s:i===n.default.RB_FMT_D16&&(a.depth=s)),this._depthStencilBuffer=s,this._framebuffer&&this._framebuffer.destroy(),this._framebuffer=new n.default.FrameBuffer(r.device,t,e,a),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 s=n||this.width,a=r||this.height;t=t||new Uint8Array(s*a*4);var o=cc.game._renderContext,c=o.getParameter(o.FRAMEBUFFER_BINDING);return o.bindFramebuffer(o.FRAMEBUFFER,this._framebuffer.getHandle()),o.readPixels(e,i,s,a,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":275,"../renderer":189,"./CCTexture2D":73}],67:[(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}),{}],68:[(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}),{}],69:[(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}),{}],70:[(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],s=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,s)},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.setOriginalSize(cc.size(e,i)),this._offset||this.setOffset(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],s=this._capInsets[2],a=t.width-r-s,o=this._capInsets[1],c=this._capInsets[3],u=t.height-o-c,l=this.uvSliced;if(l.length=0,this._rotated){n[0].u=t.x/e,n[1].u=(t.x+c)/e,n[2].u=(t.x+c+u)/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+a)/i,n[0].v=(t.y+t.width)/i,this._flipXY(n);for(var h=0;h<4;++h)for(var _=n[h],f=0;f<4;++f){var d=n[3-f];l.push({u:_.u,v:d.v})}}else{n[0].u=t.x/e,n[1].u=(t.x+r)/e,n[2].u=(t.x+r+a)/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+u)/i,n[0].v=(t.y+t.height)/i,this._flipXY(n);for(var p=0;p<4;++p)for(var v=n[p],g=0;g<4;++g){var m=n[g];l.push({u:m.u,v:v.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 s=0===n?0:t.x/n,a=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]=s,i[1]=c,i[2]=s,i[3]=o,i[4]=a,i[5]=c,i[6]=a,i[7]=o}else{var u=0===n?0:t.x/n,l=0===n?0:(t.x+t.width)/n,h=0===r?0:(t.y+t.height)/r,_=0===r?0:t.y/r;i[0]=u,i[1]=h,i[2]=l,i[3]=h,i[4]=u,i[5]=_,i[6]=l,i[7]=_}if(this._flipX){var f=i[0];i[0]=i[2],i[2]=f,f=i[1],i[1]=i[3],i[3]=f,f=i[4],i[4]=i[6],i[6]=f,f=i[5],i[5]=i[7],i[7]=f}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 v=0;v<p.u.length;v++)p.nu[v]=p.u[v]/n,p.nv[v]=p.v[v]/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=[])}}),s=r.prototype;s.copyWithZone=s.clone,s.copy=s.clone,s.initWithTexture=s.setTexture,cc.SpriteFrame=r,e.exports=r}),{"../assets/CCAsset":58,"../event/event-target":131}],71:[(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":62}],72:[(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}),{}],73:[(function(t,e){"use strict";var i,n=(i=t("../../renderer/gfx"))&&i.__esModule?i:{default:i},r=t("../event/event-target"),s=t("../renderer");t("../platform/CCClass");var a=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}),u=cc.Enum({REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648}),l=cc.Enum({LINEAR:9729,NEAREST:9728}),h={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 f)f[t]=void 0;return _.length=0,f.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){t._compressed&&t._data?this.initWithData(t._data,this._format,t.width,t.height):this.initWithElement(t)},override:!0},_format:c.RGBA8888,_premultiplyAlpha:!1,_flipY:!1,_minFilter:l.LINEAR,_magFilter:l.LINEAR,_mipFilter:l.LINEAR,_wrapS:u.CLAMP_TO_EDGE,_wrapT:u.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:u,Filter:l,_FilterIndex:h,extnames:[".png",".jpg",".jpeg",".bmp",".webp",".pvr",".pkm"],_parseExt:function(t,e){for(var i=cc.renderer.device,n=t.split("_"),r="",s="",a=999,o=e,u=cc.macro.SUPPORT_TEXTURE_FORMATS,l=0;l<n.length;l++){var h=n[l].split("@"),_=h[0];_=p.extnames[_.charCodeAt(0)-48]||_;var f=u.indexOf(_);if(-1!==f&&f<a){var d=h[1]?parseInt(h[1]):e;if(".pvr"===_&&!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"===_&&!cc.sys.capabilities.webp)continue;a=f,s=_,o=d}else r||(r=_)}return{bestExt:s,bestFormat:o,defaultExt:r}}},ctor:function(){this._id=a.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 s.Texture2D(s.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=h[t.minFilter]),void 0!==t.magFilter&&(this._magFilter=t.magFilter,t.magFilter=h[t.magFilter]),void 0!==t.mipFilter&&(this._mipFilter=t.mipFilter,t.mipFilter=h[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||(_.length=0,t.images=_),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=h[this._minFilter],r.magFilter=h[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 s.Texture2D(s.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=h[this._minFilter],t.magFilter=h[this._magFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,this._texture?this._texture.update(t):this._texture=new s.Texture2D(s.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=h[this._minFilter],t.magFilter=h[this._magFilter],t.mipFilter=h[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 s.Texture2D(s.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===l.LINEAR?1:2,r=this._magFilter===l.LINEAR?1:2,s=this._wrapS===u.REPEAT?1:this._wrapS===u.CLAMP_TO_EDGE?2:3,a=this._wrapT===u.REPEAT?1:this._wrapT===u.CLAMP_TO_EDGE?2:3,o=this._format;return this._image,this._hash=Number(""+n+r+o+s+a+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(s){i.close&&i.close(),s.flipY=n,s.premultiplyAlpha=r,e._image=s,t()}),(function(t){cc.error(t.message)})):t()}});cc.Texture2D=e.exports=p}),{"../../renderer/gfx":275,"../assets/CCAsset":58,"../event/event-target":131,"../platform/CCClass":158,"../platform/id-generater":175,"../renderer":189}],74:[(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":131,"./CCAsset":58}],75:[(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":58,"./CCAudioClip":59,"./CCBitmapFont":60,"./CCBufferAsset":61,"./CCFont":62,"./CCJsonAsset":63,"./CCLabelAtlas":64,"./CCPrefab":65,"./CCRenderTexture":66,"./CCSceneAsset":67,"./CCScripts":68,"./CCSpriteAtlas":69,"./CCSpriteFrame":70,"./CCTTFFont":71,"./CCTextAsset":72,"./CCTexture2D":73,"./CCVideoClip":74,"./material":82}],76:[(function(t,e){"use strict";var i,n=(i=t("../CCAsset"))&&i.__esModule?i:{default:i},r=t("./effect-parser"),s=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=s}),{"../CCAsset":58,"./effect-parser":79}],77:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../CCAsset"),r=t("../CCTexture2D"),s=(r.PixelFormat,t("./CCEffectAsset")),a=(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:s,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 s=e.isAlphaAtlas(),a="CC_USE_ALPHA_ATLAS_"+t,o=this.getDefine(a,i);(s||o)&&this.define(a,s),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=a.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=a.DS_FUNC_LESS),this._effect.setDepth(t,e,i,n)},setBlend:function(t,e,i,n,r,s,o,c,u){void 0===t&&(t=!1),void 0===e&&(e=a.BLEND_FUNC_ADD),void 0===i&&(i=a.BLEND_SRC_ALPHA),void 0===n&&(n=a.BLEND_ONE_MINUS_SRC_ALPHA),void 0===r&&(r=a.BLEND_FUNC_ADD),void 0===s&&(s=a.BLEND_SRC_ALPHA),void 0===o&&(o=a.BLEND_ONE_MINUS_SRC_ALPHA),void 0===c&&(c=4294967295),this._effect.setBlend(t,e,i,n,r,s,o,c,u)},setStencilEnabled:function(t,e){void 0===t&&(t=a.STENCIL_INHERIT),this._effect.setStencilEnabled(t,e)},setStencil:function(t,e,i,n,r,s,o,c,u){void 0===t&&(t=a.STENCIL_INHERIT),void 0===e&&(e=a.DS_FUNC_ALWAYS),void 0===i&&(i=0),void 0===n&&(n=255),void 0===r&&(r=a.STENCIL_OP_KEEP),void 0===s&&(s=a.STENCIL_OP_KEEP),void 0===o&&(o=a.STENCIL_OP_KEEP),void 0===c&&(c=255),this._effect.setStencil(t,e,i,n,r,s,o,c,u)},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)}}}}}),u=c;i.default=u,cc.Material=c,e.exports=i.default}),{"../../utils/texture-util":241,"../CCAsset":58,"../CCTexture2D":73,"./CCEffectAsset":76}],78:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../../../renderer/core/pass")),r=s(t("../../../renderer/enums"));function s(t){return t&&t.__esModule?t:{default:t}}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,n.key,n)}}var o=cc.gfx,c=(function(){function t(){this._dirty=!0,this._name="",this._technique=null}var e,i,s=t.prototype;return s._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}},s._setPassProperty=function(t,e,i,s){var a=i._properties;a.hasOwnProperty(t)||this._createPassProp(t,i);var o=a[t],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,s))},s.setProperty=function(t,e,i,n){var r=!1,s=this.passes,a=0,o=s.length;void 0!==i&&(a=i,o=i+1);for(var c=a;c<o;c++)this._setPassProperty(t,e,s[c],n)&&(r=!0);r||cc.warnID(9103,this.name,t)},s.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 s=n;s<r;s++){var a=i[s].getProperty(t);if(void 0!==a)return a}}},s.define=function(t,e,i,n){var r=!1,s=this.passes,a=0,o=s.length;void 0!==i&&(a=i,o=i+1);for(var c=a;c<o;c++)s[c].define(t,e,n)&&(r=!0);r||cc.warnID(9104,this.name,t)},s.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 s=n;s<r;s++){var a=i[s].getDefine(t);if(void 0!==a)return a}}},s.setCullMode=function(t,e){void 0===t&&(t=o.CULL_BACK);var i=this.passes,n=0,r=i.length;void 0!==e&&(n=e,r=e+1);for(var s=n;s<r;s++)i[s].setCullMode(t);this._dirty=!0},s.setDepth=function(t,e,i,n){var r=this.passes,s=0,a=r.length;void 0!==n&&(s=n,a=n+1);for(var o=s;o<a;o++)r[o].setDepth(t,e,i);this._dirty=!0},s.setBlend=function(t,e,i,n,r,s,a,o,c){var u=this.passes,l=0,h=u.length;void 0!==c&&(l=c,h=c+1);for(var _=l;_<h;_++)u[_].setBlend(t,e,i,n,r,s,a,o);this._dirty=!0},s.setStencilEnabled=function(t,e){void 0===t&&(t=o.STENCIL_INHERIT);var i=this.passes,n=0,r=i.length;void 0!==e&&(n=e,r=e+1);for(var s=n;s<r;s++)i[s].setStencilEnabled(t);this._dirty=!0},s.setStencil=function(t,e,i,n,r,s,a,o,c){var u=this.passes,l=0,h=u.length;void 0!==c&&(l=c,h=c+1);for(var _=l;_<h;_++){var f=u[_];f.setStencilFront(t,e,i,n,r,s,a,o),f.setStencilBack(t,e,i,n,r,s,a,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[]}}])&&a(e.prototype,i),t})();i.default=c,cc.EffectBase=c,e.exports=i.default}),{"../../../renderer/core/pass":266,"../../../renderer/enums":270}],79:[(function(t,e,i){"use strict";i.__esModule=!0,i.parseEffect=function(t){var e=_(t);return new a.default(t.name,e,0,t)};var n=c(t("../../../renderer/core/pass")),r=t("../../../renderer/types"),s=c(t("../../../renderer/enums")),a=c(t("./effect")),o=c(t("../../../renderer/core/technique"));function c(t){return t&&t.__esModule?t:{default:t}}function u(t){return cc.renderer._forward._programLib.getTemplate(t)}function l(t,e){var i=e.properties||{},n=u(e.program),a=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)a(o);var c={};return n.uniforms.forEach((function(t){var e,n=t.name,a=c[n]=Object.assign({},t),o=i[n];void 0===(e=o?o.type===s.default.PARAM_TEXTURE_2D?null:o.type===s.default.PARAM_INT||o.type===s.default.PARAM_FLOAT?Array.isArray(o.value)?o.value[0]:o.value:new Float32Array(o.value):r.enums2default[t.type])&&(e=null),a.value=e})),c}function h(t){var e={};return u(t.program).defines.forEach((function(t){e[t.name]=r.enums2default[t.type]})),e}function _(t){for(var e=t.techniques.length,i=new Array(e),r=0;r<e;++r){for(var s=t.techniques[r],a=s.name||r,c=s.passes.length,u=new Array(c),_=0;_<c;++_){var f=s.passes[_],d=f.name||_,p=t.name+"-"+a+"-"+d,v=f.stage||"opaque",g=l(t,f),m=h(f),y=u[_]=new n.default(d,p,f.program,v,g,m);f.rasterizerState&&y.setCullMode(f.rasterizerState.cullMode);var T=f.blendState&&f.blendState.targets[0];T&&y.setBlend(T.blend,T.blendEq,T.blendSrc,T.blendDst,T.blendAlphaEq,T.blendSrcAlpha,T.blendDstAlpha,T.blendColor);var E=f.depthStencilState;E&&(y.setDepth(E.depthTest,E.depthWrite,E.depthFunc),y.setStencilFront(E.stencilTest,E.stencilFuncFront,E.stencilRefFront,E.stencilMaskFront,E.stencilFailOpFront,E.stencilZFailOpFront,E.stencilZPassOpFront,E.stencilWriteMaskFront),y.setStencilBack(E.stencilTest,E.stencilFuncBack,E.stencilRefBack,E.stencilMaskBack,E.stencilFailOpBack,E.stencilZFailOpBack,E.stencilZPassOpBack,E.stencilWriteMaskBack))}i[r]=new o.default(a,u)}return i}}),{"../../../renderer/core/pass":266,"../../../renderer/core/technique":268,"../../../renderer/enums":270,"../../../renderer/types":298,"./effect":81}],80:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../../renderer/murmurhash2_gc")),r=a(t("./utils")),s=a(t("./effect-base"));function a(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,n.key,n)}}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}cc.gfx;var u=(function(t){var e,i;function s(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=s).prototype=Object.create(i.prototype),e.prototype.constructor=e,c(e,i);var a,u,l=s.prototype;return l._onEffectChanged=function(){},l.init=function(t){if(t instanceof s&&(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 a=i[r]=Object.setPrototypeOf({},e[r]);a._properties=Object.setPrototypeOf({},e[r]._properties),a._defines=Object.setPrototypeOf({},e[r]._defines),n[a._stage]||(n[a._stage]=[]),n[a._stage].push(a)}}},l.updateHash=function(){},l.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},a=s,(u=[{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(a.prototype,u),s})(s.default);i.default=u,cc.EffectVariant=u,e.exports=i.default}),{"../../../renderer/murmurhash2_gc":293,"./effect-base":78,"./utils":85}],81:[(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,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||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(e,i,n,r){var s;return(s=t.call(this)||this)._techniques=[],s._asset=null,s.init(e,i,n,r,!0),s}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),n})(((n=t("./effect-base"))&&n.__esModule?n:{default:n}).default);i.default=a,cc.Effect=a,e.exports=i.default}),{"./effect-base":78}],82:[(function(t){"use strict";t("./CCEffectAsset"),t("./CCMaterial"),t("./material-variant")}),{"./CCEffectAsset":76,"./CCMaterial":77,"./material-variant":84}],83:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("./utils")),r=s(t("../../utils/pool"));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return(a=Object.setPrototypeOf||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,a(e,i);var s=r.prototype;return s.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 s=t.effectAsset._uuid;if(r[s]){var a=n.default.serializeDefines(t._effect._defines)+n.default.serializeTechniques(t._effect._techniques);i=r[s][a]&&r[s][a].pop()}}return i?this.count--:((i=new cc.MaterialVariant(t))._name=t._name+" (Instance)",i._uuid=t._uuid),i._owner=e,i},s.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++)}},s.clear=function(){this._pool={},this.count=0},s._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":235,"./utils":85}],84:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=o(t("./CCMaterial")),s=o(t("./effect-variant")),a=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,n.key,n)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=(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,u(e,i),l.createWithBuiltin=function(t,e){return l.create(r.default.getBuiltinMaterial(t),e)},l.create=function(t,e){return t?a.default.get(t,e):null},l.prototype.init=function(t){this._effect=new s.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),l})(r.default))||n;i.default=l,cc.MaterialVariant=l,e.exports=i.default}),{"./CCMaterial":77,"./effect-variant":80,"./material-pool":83}],85:[(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},s=[];function a(t,e){for(var i=e.length,n=0;n<i;n++){var r=e[n];s[n]=r+t[r]}return s.length=i,s.join("")}function o(t,e){for(var i=0,n=0,a=e.length;n<a;n++){var o=t[e[n]],c=o.value;c&&(o.type===r.default.PARAM_TEXTURE_2D||o.type===r.default.PARAM_TEXTURE_CUBE?s[i]=c._id:s[i]=c.toString(),i++)}return s.length=i,s.join(";")}var c={serializeDefines:a,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+=a(e._defines,e._defineNames));return n},serializeUniforms:o};i.default=c,e.exports=i.default}),{"../../../renderer/enums":270}],86:[(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 s(t,e,i,n){for(var r=t._parent.scaleX,s=t._parent.scaleY,a=0,o=0,c=t._parent;;){if(a+=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 u=c.scaleX,l=c.scaleY;a*=u,o*=l,r*=u,s*=l}n.x=0!==r?1/r:1,n.y=0!==s?1/s:1,i.x=-a,i.y=-o}var a=cc.Vec2.ZERO,o=cc.Vec2.ONE;function c(t,e){var r,c,u,l=e._target;l?s(t,r=l,c=a,u=o):r=t._parent;var h,_=(h=r)instanceof cc.Scene?cc.visibleRect:h._contentSize,f=r._anchorPoint,d=r instanceof cc.Scene,p=t.x,v=t.y,g=t._anchorPoint;if(e._alignFlags&i){var m,y,T=_.width;d?(m=cc.visibleRect.left.x,y=cc.visibleRect.right.x):y=(m=-f.x*T)+T,m+=e._isAbsLeft?e._left:e._left*T,y-=e._isAbsRight?e._right:e._right*T,l&&(m+=c.x,m*=u.x,y+=c.x,y*=u.x);var E,A=g.x,C=t.scaleX;if(C<0&&(A=1-A,C=-C),e.isStretchWidth)E=y-m,0!==C&&(t.width=E/C),p=m+A*E;else if(E=t.width*C,e.isAlignHorizontalCenter){var x=e._isAbsHorizontalCenter?e._horizontalCenter:e._horizontalCenter*T,b=(.5-f.x)*_.width;l&&(x*=u.x,b+=c.x,b*=u.x),p=b+(A-.5)*E+x}else p=e.isAlignLeft?m+A*E:y+(A-1)*E}if(e._alignFlags&n){var S,w,R=_.height;d?(w=cc.visibleRect.bottom.y,S=cc.visibleRect.top.y):S=(w=-f.y*R)+R,w+=e._isAbsBottom?e._bottom:e._bottom*R,S-=e._isAbsTop?e._top:e._top*R,l&&(w+=c.y,w*=u.y,S+=c.y,S*=u.y);var I,M=g.y,O=t.scaleY;if(O<0&&(M=1-M,O=-O),e.isStretchHeight)I=S-w,0!==O&&(t.height=I/O),v=w+M*I;else if(I=t.height*O,e.isAlignVerticalCenter){var L=e._isAbsVerticalCenter?e._verticalCenter:e._verticalCenter*R,D=(.5-f.y)*_.height;l&&(L*=u.y,D+=c.y,D*=u.y),v=D+(M-.5)*I+L}else v=e.isAlignBottom?w+M*I:S+(M-1)*I}t.setPosition(p,v)}function u(t){var e=t._widget;e&&(c(t,e),e.alignMode!==r.ALWAYS?_.remove(e):h.push(e));for(var i=t._children,n=0;n<i.length;n++){var s=i[n];s._active&&u(s)}}function l(){var t=cc.director.getScene();if(t){if(_.isAligning=!0,_._nodesOrderDirty)h.length=0,u(t),_._nodesOrderDirty=!1;else{var e,i=_._activeWidgetsIterator;for(i.i=0;i.i<h.length;++i.i)c((e=h[i.i]).node,e)}_.isAligning=!1}}var h=[],_=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(h),init:function(t){t.on(cc.Director.EVENT_AFTER_UPDATE,l);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 s=i[n];this.refreshWidgetOnResized(s)}},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":25}],87:[(function(t,e){"use strict";var i=t("../value-types"),n=t("../geom-utils"),r=t("../utils/affine-transform"),s=t("../renderer/index"),a=t("../renderer/render-flow"),o=t("../CCGame"),c=null;c=t("../../renderer/scene/camera");var u=cc.mat4(),l=cc.mat4(),h=cc.v3(),_=cc.v3(),f=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 v=null;function g(){if(v){var t=v.getNode(),e=cc.game.canvas;t.z=e.height/1.1566,t.x=e.width/2,t.y=e.height/2}}var m=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:m.DEPTH|m.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:m,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=s.scene._cameras,i=0;i<e._count;i++)if(e._data[i]._cullingMask&t._cullingMask)return e._data[i];return null},_setupDebugCamera:function(){if(!v&&o.renderType!==o.RENDER_TYPE_CANVAS){var t=new c;v=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),g(),cc.view.on("design-resolution-changed",g),s.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),s.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),s.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(u);var e=this.zoomRatio,n=u.m;n[0]*=e,n[1]*=e,n[4]*=e,n[5]*=e;var r=n[12],s=n[13],a=cc.visibleRect.center;return n[12]=a.x-(n[0]*r+n[4]*s),n[13]=a.y-(n[1]*r+n[5]*s),t!==u&&i.Mat4.copy(t,u),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(u),i.Vec2.transformMat4(e,t,u)),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(u),i.Vec2.transformMat4(e,t,u)),e},getRay:function(t){return cc.geomUtils?(i.Vec3.set(f,t.x,t.y,1),this._camera.screenToWorld(_,f,cc.visibleRect.width,cc.visibleRect.height),this.ortho?(i.Vec3.set(f,t.x,t.y,-1),this._camera.screenToWorld(h,f,cc.visibleRect.width,cc.visibleRect.height)):this.node.getWorldPosition(h),n.Ray.fromPoints(new n.Ray,h,_)):t},containsNode:function(t){return(t._cullingMask&this.cullingMask)>0},render:function(t){if(!(t=t||cc.director.getScene()))return null;this.node.getWorldMatrix(u),this.beforeDraw(),a.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(l),this.containsNode(t)&&(this.getWorldToCameraMatrix(u),i.Mat4.mul(l,l,u)),r.fromMat4(e,l),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":295,"../CCGame":24,"../geom-utils":139,"../renderer/index":189,"../renderer/render-flow":190,"../utils/affine-transform":224,"../value-types":248}],88:[(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),s=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),a=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);if(0!==a){var o=r/a,c=s/a;if(0<=o&&o<=1&&0<=c&&c<=1)return!0}return!1}function r(t,e,i){for(var r=i.length,s=0;s<r;++s)if(n(t,e,i[s],i[(s+1)%r]))return!0;return!1}function s(t,e){for(var i=!1,n=t.x,r=t.y,s=e.length,a=0,o=s-1;a<s;o=a++){var c=e[a].x,u=e[a].y,l=e[o].x,h=e[o].y;u>r!=h>r&&n<(l-c)*(r-u)/(h-u)+c&&(i=!i)}return i}function a(t,e,i,n){var r,s=i.x-e.x,a=i.y-e.y,o=s*s+a*a,c=((t.x-e.x)*s+(t.y-e.y)*a)/o;return r=n?o?c<0?e:c>1?i:cc.v2(e.x+c*s,e.y+c*a):e:cc.v2(e.x+c*s,e.y+c*a),s=t.x-r.x,a=t.y-r.y,Math.sqrt(s*s+a*a)}i.lineLine=n,i.lineRect=function(t,e,i){var r=new cc.Vec2(i.x,i.y),s=new cc.Vec2(i.x,i.yMax),a=new cc.Vec2(i.xMax,i.yMax),o=new cc.Vec2(i.xMax,i.y);return!!(n(t,e,r,s)||n(t,e,s,a)||n(t,e,a,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,s=t.y+t.height,a=e.x,o=e.y,c=e.x+e.width,u=e.y+e.height;return i<=c&&r>=a&&n<=u&&s>=o},i.rectPolygon=function(t,e){var i,n,a=new cc.Vec2(t.x,t.y),o=new cc.Vec2(t.x,t.yMax),c=new cc.Vec2(t.xMax,t.yMax),u=new cc.Vec2(t.xMax,t.y);if(r(a,o,e))return!0;if(r(o,c,e))return!0;if(r(c,u,e))return!0;if(r(u,a,e))return!0;for(i=0,n=e.length;i<n;++i)if(s(e[i],t))return!0;return!!(s(a,e)||s(o,e)||s(c,e)||s(u,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(s(e[i],t))return!0;for(i=0,n=t.length;i<n;++i)if(s(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(s(i,t))return!0;for(var n=0,r=t.length;n<r;n++)if(a(i,0===n?t[t.length-1]:t[n-1],t[n],!0)<e.radius)return!0;return!1},i.pointInPolygon=s,i.pointLineDistance=a,cc.Intersection=e.exports=i}),{}],89:[(function(t,e){"use strict";t("./platform/CCClass");var i=t("./platform/CCObject").Flags,n=t("./platform/js").array,r=i.IsStartCalled,s=i.IsOnEnableCalled;function a(t,e){for(var i=e.constructor._executionOrder,n=e._id,r=0,s=t.length-1,a=s>>>1;r<=s;a=r+s>>>1){var o=t[a],c=o.constructor._executionOrder;if(c>i)s=a-1;else if(c<i)r=a+1;else{var u=o._id;if(u>n)s=a-1;else{if(!(u<n))return a;r=a+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._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 u(t,e){return t.constructor._executionOrder-e.constructor._executionOrder}var l=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(u),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(u),this._invoke(e),e.array.length=0)}}),h=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=a(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=a(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 _(t,e,i,n){var r="var a=it.array;for(it.i=0;it.i<a.length;++it.i){var c=a[it.i];"+t+"}";return n=e?Function("it","dt",r):Function("it",r),t=Function("c","dt",t),function(e,r){try{n(e,r)}catch(a){cc._throw(a);var s=e.array;for(i&&(s[e.i]._objFlags|=i),++e.i;e.i<s.length;++e.i)try{t(s[e.i],r)}catch(a){cc._throw(a),i&&(s[e.i]._objFlags|=i)}}}}var f=_("c.start();c._objFlags|="+r,!1,r),d=_("c.update(dt)",!0),p=_("c.lateUpdate(dt)",!0);function v(){this.startInvoker=new l(f),this.updateInvoker=new h(d),this.lateUpdateInvoker=new h(p),this._deferredComps=[],this._updating=!1}var g=cc.Class({ctor:v,unscheduleAll:v,statics:{LifeCycleInvoker:c,OneOffInvoker:l,createInvokeImpl:_,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|=s,this._updating?this._deferredComps.push(t):this._scheduleImmediate(t)},_onDisabled:function(t){cc.director.getScheduler().pauseTarget(t),t._objFlags&=~s;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&s)){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&s&&(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=g}),{"./platform/CCClass":158,"./platform/CCObject":164,"./platform/js":179,"./utils/misc":233}],90:[(function(t,e){"use strict";var i=t("../../animation/animation-animator"),n=t("../../animation/animation-clip"),r=t("../event/event-target"),s=t("../platform/js"),a=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=s.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],a(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!a(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 s=this._nameToState;for(var a in s)s[a]._lastframeEventOn=!0}return r},off:function(t,e,i,n){if(this._init(),"lastframe"===t){var r=this._nameToState;for(var s in r)r[s]._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=s.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,a(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":131,"../platform/js":179,"./CCComponent":95}],91:[(function(t,e){"use strict";var i=t("../utils/misc"),n=t("./CCComponent"),r=t("../assets/CCAudioClip"),s=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=s}),{"../assets/CCAudioClip":59,"../utils/misc":233,"./CCComponent":95}],92:[(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":95}],93:[(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}),s=cc.Enum({NORMAL:0,HOVER:1,PRESSED:2,DISABLED:3}),a=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()===s.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()===s.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()===s.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()===s.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 s.NORMAL:return this.normalColor;case s.HOVER:return this.hoverColor;case s.PRESSED:return this.pressedColor;case s.DISABLED:return this.disabledColor}},_getStateSprite:function(t){switch(t){case s.NORMAL:return this.normalSprite;case s.HOVER:return this.hoverSprite;case s.PRESSED:return this.pressedSprite;case s.DISABLED:return this.disabledSprite}},_setCurrentStateColor:function(t){switch(this._getButtonState()){case s.NORMAL:this.normalColor=t;break;case s.HOVER:this.hoverColor=t;break;case s.PRESSED:this.pressedColor=t;break;case s.DISABLED:this.disabledColor=t}},_setCurrentStateSprite:function(t){switch(this._getButtonState()){case s.NORMAL:this.normalSprite=t;break;case s.HOVER:this.hoverSprite=t;break;case s.PRESSED:this.pressedSprite=t;break;case s.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()),a=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,a.setScale(o.x,o.y)):(e=n?s.PRESSED:s.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?s.PRESSED:this._hovered?s.HOVER:s.NORMAL:s.DISABLED},_updateColorTransitionImmediately:function(t){var e=this._getStateColor(t);this._setTargetColor(e),this._fromColor=e.clone(),this._toColor=e},_updateColorTransition:function(t){if(t===s.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===s.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(s.NORMAL):t===r.SPRITE&&this._updateSpriteTransition(s.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=a}),{"../utils/gray-sprite-state":230,"./CCComponent":95}],94:[(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":87,"./CCComponent":95}],95:[(function(t,e){"use strict";var i=t("../platform/CCObject"),n=t("../platform/js"),r=new(t("../platform/id-generater"))("Comp"),s=(i.Flags.IsOnEnableCalled,i.Flags.IsOnLoadCalled),a=!!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._activeInHierarchy},visible:!1},_isOnLoadCalled:{get:function(){return this._objFlags&s}}},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(){a&&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(),s=r.isTargetPaused(this);r.schedule(t,this,e,i,n,s)},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":164,"../platform/id-generater":175,"../platform/js":179}],96:[(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,s=t.length;r<s;r++){var a=t[r];a instanceof cc.Component.EventHandler&&a.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="")}})}),{}],97:[(function(t,e){"use strict";var i=t("../platform/CCMacro"),n=t("./CCRenderComponent"),r=(t("../assets/material/CCMaterial"),t("../renderer/utils/label/label-frame")),s=t("../utils/blend-func"),a=t("../renderer/utils/utils").deleteFromDynamicAtlas,o=i.TextAlignment,c=i.VerticalTextAlignment,u=cc.Enum({NONE:0,CLAMP:1,SHRINK:2,RESIZE_HEIGHT:3}),l=cc.Enum({NONE:0,BITMAP:1,CHAR:2}),h=cc.Class({name:"cc.Label",extends:n,mixins:[s],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:u.NONE,type:u,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:l.NONE,type:l,tooltip:!1,notify:function(t){this.cacheMode!==t&&(t!==l.BITMAP||this.font instanceof cc.BitmapFont||this._frame&&this._frame._resetDynamicAtlasFrame(),t===l.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:u,CacheMode:l,_shareAtlas:null,clearCharCache:function(){h._shareAtlas&&h._shareAtlas.clearAllCache()}},onLoad:function(){this._batchAsBitmap&&this.cacheMode===l.NONE&&(this.cacheMode=l.BITMAP,this._batchAsBitmap=!1),cc.game.renderType===cc.game.RENDER_TYPE_CANVAS&&(this.cacheMode=l.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()},_nodeSizeChanged:function(){this.overflow!==u.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||(a(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===l.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!==l.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),s.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=h}),{"../assets/material/CCMaterial":77,"../platform/CCMacro":163,"../renderer/utils/label/label-frame":194,"../renderer/utils/utils":197,"../utils/blend-func":227,"./CCRenderComponent":106}],98:[(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":95}],99:[(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.markForRender(!0)}});cc.LabelShadow=e.exports=i}),{"./CCComponent":95}],100:[(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}),s=cc.Enum({HORIZONTAL:0,VERTICAL:1}),a=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:s.HORIZONTAL,tooltip:!1,type:s,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:a.TOP_TO_BOTTOM,type:a,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:a,HorizontalDirection:o,ResizeMode:r,AxisDirection:s},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,s){var c=this.node.getAnchorPoint(),u=this.node.children,l=1,h=this.paddingLeft,_=-c.x*t;this.horizontalDirection===o.RIGHT_TO_LEFT&&(l=-1,_=(1-c.x)*t,h=this.paddingRight);for(var f=_+l*h-l*this.spacingX,d=0,p=0,v=0,g=0,m=0,y=0,T=0,E=0;E<u.length;++E)(C=u[E]).activeInHierarchy&&T++;var A=this.cellSize.width;for(this.type!==n.GRID&&this.resizeMode===r.CHILDREN&&(A=(t-(this.paddingLeft+this.paddingRight)-(T-1)*this.spacingX)/T),E=0;E<u.length;++E){var C=u[E],x=this._getUsedScaleValue(C.scaleX),b=this._getUsedScaleValue(C.scaleY);if(C.activeInHierarchy){this._resize===r.CHILDREN&&(C.width=A/x,this.type===n.GRID&&(C.height=this.cellSize.height/b));var S=C.anchorX,w=C.width*x,R=C.height*b;v>p&&(p=v),R>=p&&(v=p,p=R,y=C.getAnchorPoint().y),this.horizontalDirection===o.RIGHT_TO_LEFT&&(S=1-C.anchorX),f=f+l*S*w+l*this.spacingX;var I=l*(1-S)*w;if(e){var M=f+I+l*(l>0?this.paddingRight:this.paddingLeft),O=this.horizontalDirection===o.LEFT_TO_RIGHT&&M>(1-c.x)*t,L=this.horizontalDirection===o.RIGHT_TO_LEFT&&M<-c.x*t;(O||L)&&(R>=p?(0===v&&(v=p),d+=v,v=p):(d+=p,v=R,p=0),f=_+l*(h+S*w),g++)}var D=i(C,d,g);t>=w+this.paddingLeft+this.paddingRight&&s&&C.setPosition(cc.v2(f,D));var P,N=1,F=0===p?R:p;this.verticalDirection===a.TOP_TO_BOTTOM?(m=m||this.node._contentSize.height,(P=D+(N=-1)*(F*y+this.paddingBottom))<m&&(m=P)):(m=m||-this.node._contentSize.height,(P=D+N*(F*y+this.paddingTop))>m&&(m=P)),f+=I}}return m},_getVerticalBaseHeight:function(t){var e=0,i=0;if(this.resizeMode===r.CONTAINER){for(var n=0;n<t.length;++n){var s=t[n];s.activeInHierarchy&&(i++,e+=s.height*this._getUsedScaleValue(s.scaleY))}e+=(i-1)*this.spacingY+this.paddingBottom+this.paddingTop}else e=this.node.getContentSize().height;return e},_doLayoutVertically:function(t,e,i,s){var c=this.node.getAnchorPoint(),u=this.node.children,l=1,h=this.paddingBottom,_=-c.y*t;this.verticalDirection===a.TOP_TO_BOTTOM&&(l=-1,_=(1-c.y)*t,h=this.paddingTop);for(var f=_+l*h-l*this.spacingY,d=0,p=0,v=0,g=0,m=0,y=0,T=0,E=0;E<u.length;++E)(C=u[E]).activeInHierarchy&&T++;var A=this.cellSize.height;for(this.type!==n.GRID&&this.resizeMode===r.CHILDREN&&(A=(t-(this.paddingTop+this.paddingBottom)-(T-1)*this.spacingY)/T),E=0;E<u.length;++E){var C=u[E],x=this._getUsedScaleValue(C.scaleX),b=this._getUsedScaleValue(C.scaleY);if(C.activeInHierarchy){this.resizeMode===r.CHILDREN&&(C.height=A/b,this.type===n.GRID&&(C.width=this.cellSize.width/x));var S=C.anchorY,w=C.width*x,R=C.height*b;v>p&&(p=v),w>=p&&(v=p,p=w,y=C.getAnchorPoint().x),this.verticalDirection===a.TOP_TO_BOTTOM&&(S=1-C.anchorY),f=f+l*S*R+l*this.spacingY;var I=l*(1-S)*R;if(e){var M=f+I+l*(l>0?this.paddingTop:this.paddingBottom),O=this.verticalDirection===a.BOTTOM_TO_TOP&&M>(1-c.y)*t,L=this.verticalDirection===a.TOP_TO_BOTTOM&&M<-c.y*t;(O||L)&&(w>=p?(0===v&&(v=p),d+=v,v=p):(d+=p,v=w,p=0),f=_+l*(h+S*R),g++)}var D=i(C,d,g);t>=R+(this.paddingTop+this.paddingBottom)&&s&&C.setPosition(cc.v2(D,f));var P,N=1,F=0===p?w:p;this.horizontalDirection===o.RIGHT_TO_LEFT?(N=-1,m=m||this.node._contentSize.width,(P=D+N*(F*y+this.paddingLeft))<m&&(m=P)):(m=m||-this.node._contentSize.width,(P=D+N*(F*y+this.paddingRight))>m&&(m=P)),f+=I}}return m},_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 s=this.node.convertToNodeSpaceAR(cc.v2(e.xMax,e.yMax)),a=(s=cc.v2(s.x+this.paddingRight,s.y+this.paddingTop)).sub(r);if(0!==(a=cc.size(parseFloat(a.x.toFixed(2)),parseFloat(a.y.toFixed(2)))).width){var o=-r.x/a.width;this.node.anchorX=parseFloat(o.toFixed(2))}if(0!==a.height){var c=-r.y/a.height;this.node.anchorY=parseFloat(c.toFixed(2))}this.node.setContentSize(a)}},_doLayoutGridAxisHorizontal:function(t,e){var i=e.width,n=1,s=-t.y*e.height,o=this.paddingBottom;this.verticalDirection===a.TOP_TO_BOTTOM&&(n=-1,s=(1-t.y)*e.height,o=this.paddingTop);var c=function(t,e,i){return s+n*(e+t.anchorY*t.height*this._getUsedScaleValue(t.scaleY)+o+i*this.spacingY)}.bind(this),u=0;if(this.resizeMode===r.CONTAINER){var l=this._doLayoutHorizontally(i,!0,c,!1);(u=s-l)<0&&(u*=-1),s=-t.y*u,this.verticalDirection===a.TOP_TO_BOTTOM&&(n=-1,s=(1-t.y)*u)}this._doLayoutHorizontally(i,!0,c,!0),this.resizeMode===r.CONTAINER&&this.node.setContentSize(i,u)},_doLayoutGridAxisVertical:function(t,e){var i=e.height,n=1,s=-t.x*e.width,a=this.paddingLeft;this.horizontalDirection===o.RIGHT_TO_LEFT&&(n=-1,s=(1-t.x)*e.width,a=this.paddingRight);var c=function(t,e,i){return s+n*(e+t.anchorX*t.width*this._getUsedScaleValue(t.scaleX)+a+i*this.spacingX)}.bind(this),u=0;if(this.resizeMode===r.CONTAINER){var l=this._doLayoutVertically(i,!0,c,!1);(u=s-l)<0&&(u*=-1),s=-t.x*u,this.horizontalDirection===o.RIGHT_TO_LEFT&&(n=-1,s=(1-t.x)*u)}this._doLayoutVertically(i,!0,c,!0),this.resizeMode===r.CONTAINER&&this.node.setContentSize(u,i)},_doLayoutGrid:function(){var t=this.node.getAnchorPoint(),e=this.node.getContentSize();this.startAxis===s.HORIZONTAL?this._doLayoutGridAxisHorizontal(t,e):this.startAxis===s.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 s=t[n];s.activeInHierarchy&&(i++,e+=s.width*this._getUsedScaleValue(s.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._doLayout(),this._layoutDirty=!1)}});cc.Layout=e.exports=c}),{"../CCNode":25,"./CCComponent":95}],101:[(function(t,e){"use strict";var i=a(t("../../renderer/gfx")),n=a(t("../value-types/mat4")),r=a(t("../value-types/vec2")),s=a(t("../assets/material/material-variant"));function a(t){return t&&t.__esModule?t:{default:t}}var o=t("../utils/misc"),c=t("./CCRenderComponent"),u=t("../renderer/render-flow"),l=t("../graphics/graphics"),h=new r.default,_=new n.default,f=[];function d(t,e,i){f.length=0;for(var n=2*Math.PI/i,r=0;r<i;++r)f.push(cc.v2(e.x*Math.cos(n*r)+t.x,e.y*Math.sin(n*r)+t.y));return f}var p=cc.Enum({RECT:0,ELLIPSE:1,IMAGE_STENCIL:2}),v=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&=~u.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?s.default.create(t,this):s.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=s.default.createWithBuiltin("2d-sprite",this)),this._exitMaterial||(this._exitMaterial=s.default.createWithBuiltin("2d-sprite",this),this._exitMaterial.setStencilEnabled(i.default.STENCIL_DISABLE)),this._clearMaterial||(this._clearMaterial=s.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 l,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,s=-n*t._anchorPoint.y;if(this._type===p.RECT)e.rect(r,s,i,n);else if(this._type===p.ELLIPSE){for(var a=d(cc.v2(r+i/2,s+n/2),{x:i/2,y:n/2},this._segments),o=0;o<a.length;++o){var c=a[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()}},_removeGraphics:function(){this._graphics&&(this._graphics.destroy(),this._graphics._destroyImmediate(),this._graphics=null)},_hitTest:function(t){var e=this.node,i=e.getContentSize(),s=i.width,a=i.height,o=h;if(e._updateWorldMatrix(),!n.default.invert(_,e._worldMatrix))return!1;r.default.transformMat4(o,t,_),o.x+=e._anchorPoint.x*s,o.y+=e._anchorPoint.y*a;var c=!1;if(this.type===p.RECT||this.type===p.IMAGE_STENCIL)c=o.x>=0&&o.y>=0&&o.x<=s&&o.y<=a;else if(this.type===p.ELLIPSE){var u=s/2,l=a/2,f=o.x-.5*s,d=o.y-.5*a;c=f*f/(u*u)+d*d/(l*l)<1}return this.inverted&&(c=!c),c},markForRender:function(t){var e=u.FLAG_RENDER|u.FLAG_UPDATE_RENDER_DATA|u.FLAG_POST_RENDER;t?(this.node._renderFlag|=e,this.markForValidate()):t||(this.node._renderFlag&=~e)},disableRender:function(){this.node._renderFlag&=~(u.FLAG_RENDER|u.FLAG_UPDATE_RENDER_DATA|u.FLAG_POST_RENDER)}});cc.Mask=e.exports=v}),{"../../renderer/gfx":275,"../assets/material/material-variant":84,"../graphics/graphics":147,"../renderer/render-flow":190,"../utils/misc":233,"../value-types/mat4":250,"../value-types/vec2":257,"./CCRenderComponent":106}],102:[(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=[]},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()},lateUpdate:function(t){this._assembler&&this._assembler.update(this,t)}});cc.MotionStreak=e.exports=r}),{"../../core/utils/blend-func":227,"../components/CCRenderComponent":106}],103:[(function(t,e){"use strict";var i=cc.Enum({Unified:0,Free:1}),n=cc.Enum({Horizontal:0,Vertical:1}),r=cc.Enum({PAGE_TURNING:0}),s=cc.Class({name:"cc.PageView",extends:cc.ScrollView,editor:!1,ctor:function(){this._curPageIdx=0,this._lastPageIdx=0,this._pages=[],this._initContentPos=cc.v2(),this._scrollCenterOffsetX=[],this._scrollCenterOffsetY=[]},properties:{sizeMode:{default:i.Unified,type:i,tooltip:!1,notify:function(){this._syncSizeMode()}},direction:{default:n.Horizontal,type:n,tooltip:!1,notify:function(){this._syncScrollDirection()}},scrollThreshold:{default:.5,type:cc.Float,slide:!0,range:[0,1,.01],tooltip:!1},autoPageTurningThreshold:{default:100,type:cc.Float,tooltip:!1},pageTurningEventTiming:{default:.1,type:cc.Float,range:[0,1,.01],tooltip:!1},indicator:{default:null,type:cc.PageViewIndicator,tooltip:!1,notify:function(){this.indicator&&this.indicator.setPageView(this)}},pageTurningSpeed:{default:.3,type:cc.Float,tooltip:!1},pageEvents:{default:[],type:cc.Component.EventHandler,tooltip:!1}},statics:{SizeMode:i,Direction:n,EventType:r},onEnable:function(){this._super(),this.node.on(cc.Node.EventType.SIZE_CHANGED,this._updateAllPagesSize,this),this.node.on("scroll-ended-with-threshold",this._dispatchPageTurningEvent,this)},onDisable:function(){this._super(),this.node.off(cc.Node.EventType.SIZE_CHANGED,this._updateAllPagesSize,this),this.node.off("scroll-ended-with-threshold",this._dispatchPageTurningEvent,this)},onLoad:function(){this._initPages(),this.indicator&&this.indicator.setPageView(this)},getCurrentPageIndex:function(){return this._curPageIdx},setCurrentPageIndex:function(t){this.scrollToPage(t,!0)},getPages:function(){return this._pages},addPage:function(t){t&&-1===this._pages.indexOf(t)&&this.content&&(this.content.addChild(t),this._pages.push(t),this._updatePageView())},insertPage:function(t,e){e<0||!t||-1!==this._pages.indexOf(t)||!this.content||(e>=this._pages.length?this.addPage(t):(this._pages.splice(e,0,t),this.content.addChild(t),this._updatePageView()))},removePage:function(t){if(t&&this.content){var e=this._pages.indexOf(t);-1!==e?this.removePageAtIndex(e):cc.warnID(4300,t.name)}},removePageAtIndex:function(t){var e=this._pages;if(!(t<0||t>=e.length)){var i=e[t];i&&(this.content.removeChild(i),e.splice(t,1),this._updatePageView())}},removeAllPages:function(){if(this.content){for(var t=this._pages,e=0,i=t.length;e<i;e++)this.content.removeChild(t[e]);this._pages.length=0,this._updatePageView()}},scrollToPage:function(t,e){t<0||t>=this._pages.length||(e=void 0!==e?e:.3,this._curPageIdx=t,this.scrollToOffset(this._moveOffsetValue(t),e,!0),this.indicator&&this.indicator._changedState())},getScrollEndedEventTiming:function(){return this.pageTurningEventTiming},_syncScrollDirection:function(){this.horizontal=this.direction===n.Horizontal,this.vertical=this.direction===n.Vertical},_syncSizeMode:function(){if(this.content){var t=this.content.getComponent(cc.Layout);if(t){if(this.sizeMode===i.Free&&this._pages.length>0){var e=this._pages[this._pages.length-1];this.direction===n.Horizontal?(t.paddingLeft=(this._view.width-this._pages[0].width)/2,t.paddingRight=(this._view.width-e.width)/2):this.direction===n.Vertical&&(t.paddingTop=(this._view.height-this._pages[0].height)/2,t.paddingBottom=(this._view.height-e.height)/2)}t.updateLayout()}}},_updatePageView:function(){var t=this.content.getComponent(cc.Layout);t&&t.enabled&&t.updateLayout();var e=this._pages.length;this._curPageIdx>=e&&(this._curPageIdx=0===e?0:e-1,this._lastPageIdx=this._curPageIdx);for(var i=this._initContentPos,r=0;r<e;++r){var s=this._pages[r];s.setSiblingIndex(r),this.direction===n.Horizontal?this._scrollCenterOffsetX[r]=Math.abs(i.x+s.x):this._scrollCenterOffsetY[r]=Math.abs(i.y+s.y)}this.indicator&&this.indicator._refresh()},_updateAllPagesSize:function(){if(this.sizeMode===i.Unified&&this._view)for(var t=this._pages,e=this._view.getContentSize(),n=0,r=t.length;n<r;n++)t[n].setContentSize(e)},_initPages:function(){if(this.content){this._initContentPos=this.content.position;for(var t=this.content.children,e=0;e<t.length;++e){var i=t[e];this._pages.indexOf(i)>=0||this._pages.push(i)}this._syncScrollDirection(),this._syncSizeMode(),this._updatePageView()}},_dispatchPageTurningEvent:function(){this._lastPageIdx!==this._curPageIdx&&(this._lastPageIdx=this._curPageIdx,cc.Component.EventHandler.emitEvents(this.pageEvents,this,r.PAGE_TURNING),this.node.emit("page-turning",this))},_isScrollable:function(t,e,r){if(this.sizeMode===i.Free){var s,a;if(this.direction===n.Horizontal)return s=this._scrollCenterOffsetX[e],a=this._scrollCenterOffsetX[r],Math.abs(t.x)>=Math.abs(s-a)*this.scrollThreshold;if(this.direction===n.Vertical)return s=this._scrollCenterOffsetY[e],a=this._scrollCenterOffsetY[r],Math.abs(t.y)>=Math.abs(s-a)*this.scrollThreshold}else{if(this.direction===n.Horizontal)return Math.abs(t.x)>=this._view.width*this.scrollThreshold;if(this.direction===n.Vertical)return Math.abs(t.y)>=this._view.height*this.scrollThreshold}},_isQuicklyScrollable:function(t){if(this.direction===n.Horizontal){if(Math.abs(t.x)>this.autoPageTurningThreshold)return!0}else if(this.direction===n.Vertical&&Math.abs(t.y)>this.autoPageTurningThreshold)return!0;return!1},_moveOffsetValue:function(t){var e=cc.v2(0,0);return this.sizeMode===i.Free?this.direction===n.Horizontal?e.x=this._scrollCenterOffsetX[t]:this.direction===n.Vertical&&(e.y=this._scrollCenterOffsetY[t]):this.direction===n.Horizontal?e.x=t*this._view.width:this.direction===n.Vertical&&(e.y=t*this._view.height),e},_getDragDirection:function(t){return this.direction===n.Horizontal?0===t.x?0:t.x>0?1:-1:this.direction===n.Vertical?0===t.y?0:t.y<0?1:-1:void 0},_handleReleaseLogic:function(){this._autoScrollToPage(),this._scrolling&&(this._scrolling=!1,this._autoScrolling||this._dispatchEvent("scroll-ended"))},_autoScrollToPage:function(){if(this._startBounceBackIfNeeded()){var t=this._getHowMuchOutOfBoundary();((t=this._clampDelta(t)).x>0||t.y<0)&&(this._curPageIdx=0===this._pages.length?0:this._pages.length-1),(t.x<0||t.y>0)&&(this._curPageIdx=0),this.indicator&&this.indicator._changedState()}else{var e=this._touchBeganPosition.sub(this._touchEndPosition),i=this._curPageIdx,n=i+this._getDragDirection(e),r=this.pageTurningSpeed*Math.abs(i-n);if(n<this._pages.length){if(this._isScrollable(e,i,n))return void this.scrollToPage(n,r);var s=this._calculateTouchMoveVelocity();if(this._isQuicklyScrollable(s))return void this.scrollToPage(n,r)}this.scrollToPage(i,r)}},_onTouchBegan:function(t,e){this._touchBeganPosition=t.touch.getLocation(),this._super(t,e)},_onTouchMoved:function(t,e){this._super(t,e)},_onTouchEnded:function(t,e){this._touchEndPosition=t.touch.getLocation(),this._super(t,e)},_onTouchCancelled:function(t,e){this._touchEndPosition=t.touch.getLocation(),this._super(t,e)},_onMouseWheel:function(){}});cc.PageView=e.exports=s}),{}],104:[(function(t,e){"use strict";var i=cc.Enum({HORIZONTAL:0,VERTICAL:1}),n=cc.Class({name:"cc.PageViewIndicator",extends:t("./CCComponent"),editor:!1,properties:{_layout:null,_pageView:null,_indicators:[],spriteFrame:{default:null,type:cc.SpriteFrame,tooltip:!1},direction:{default:i.HORIZONTAL,type:i,tooltip:!1},cellSize:{default:cc.size(20,20),tooltip:!1},spacing:{default:0,tooltip:!1}},statics:{Direction:i},onLoad:function(){this._updateLayout()},setPageView:function(t){this._pageView=t,this._refresh()},_updateLayout:function(){this._layout=this.getComponent(cc.Layout),this._layout||(this._layout=this.addComponent(cc.Layout)),this.direction===i.HORIZONTAL?(this._layout.type=cc.Layout.Type.HORIZONTAL,this._layout.spacingX=this.spacing):this.direction===i.VERTICAL&&(this._layout.type=cc.Layout.Type.VERTICAL,this._layout.spacingY=this.spacing),this._layout.resizeMode=cc.Layout.ResizeMode.CONTAINER},_createIndicator:function(){var t=new cc.Node,e=t.addComponent(cc.Sprite);return e.spriteFrame=this.spriteFrame,e.sizeMode=cc.Sprite.SizeMode.CUSTOM,t.parent=this.node,t.width=this.cellSize.width,t.height=this.cellSize.height,t},_changedState:function(){var t=this._indicators;if(0!==t.length){var e=this._pageView._curPageIdx;if(!(e>=t.length)){for(var i=0;i<t.length;++i)t[i].opacity=127.5;t[e].opacity=255}}},_refresh:function(){if(this._pageView){var t=this._indicators,e=this._pageView.getPages();if(e.length!==t.length){var i=0;if(e.length>t.length)for(i=0;i<e.length;++i)t[i]||(t[i]=this._createIndicator());else for(i=t.length-e.length;i>0;--i){var n=t[i-1];this.node.removeChild(n),t.splice(i-1,1)}this._layout&&this._layout.enabledInHierarchy&&this._layout.updateLayout(),this._changedState()}}}});cc.PageViewIndicator=e.exports=n}),{"./CCComponent":95}],105:[(function(t,e){"use strict";var i=t("../utils/misc"),n=t("./CCComponent"),r=cc.Enum({HORIZONTAL:0,VERTICAL:1,FILLED:2}),s=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 s=t.getContentSize();if(this.mode===r.HORIZONTAL?this.totalLength=s.width:this.mode===r.VERTICAL?this.totalLength=s.height:this.totalLength=this.barSprite.fillRange,t.parent===this.node){var a=-e.width*i.x;t.setPosition(cc.v2(a,0))}}},_updateBarStatus:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e,n,s,a=t.getAnchorPoint(),o=t.getContentSize(),c=t.getPosition(),u=cc.v2(0,.5),l=i.clamp01(this.progress),h=this.totalLength*l;switch(this.mode){case r.HORIZONTAL:this.reverse&&(u=cc.v2(1,.5)),e=cc.size(h,o.height),n=this.totalLength,s=o.height;break;case r.VERTICAL:u=this.reverse?cc.v2(.5,1):cc.v2(.5,0),e=cc.size(o.width,h),n=o.width,s=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&&(h*=-1),this.barSprite.fillRange=h);else if(this.barSprite.type!==cc.Sprite.Type.FILLED){var _=u.x-a.x,f=u.y-a.y,d=cc.v2(n*_,s*f);t.setPosition(c.x+d.x,c.y+d.y),t.setAnchorPoint(u),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=s}),{"../utils/misc":233,"./CCComponent":95}],106:[(function(t,e){"use strict";var i=s(t("../renderer/assembler")),n=s(t("../assets/material/material-variant")),r=t("../value-types");function s(t){return t&&t.__esModule?t:{default:t}}var a=t("./CCComponent"),o=t("../renderer/render-flow"),c=t("../assets/material/CCMaterial"),u=new r.Color,l=cc.Class({name:"RenderComponent",extends:a,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)},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(u,this.node._color);var e=t?u._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=l}),{"../assets/material/CCMaterial":77,"../assets/material/material-variant":84,"../renderer/assembler":186,"../renderer/render-flow":190,"../value-types":248,"./CCComponent":95}],107:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("../platform/CCMacro"),r=t("../utils/text-utils"),s=new(t("../utils/html-text-parser")),a=n.TextAlignment,o=n.VerticalTextAlignment,c=cc.Label.CacheMode,u=new i.Pool(function(t){if(!cc.isValid(t))return!1;var e=t.getComponent(cc.LabelOutline);return e&&(e.width=0),!0},20);u.get=function(){var t=this._get();t||((t=new cc.PrivateNode("RICHTEXT_CHILD"))._objFlags|=cc.Object.Flags.DontSave),t.setPosition(0,0),t.setAnchorPoint(.5,.5),t.skewX=0;var e=t.getComponent(cc.Label);return e||(e=t.addComponent(cc.Label)),e.string="",e.horizontalAlign=a.LEFT,e.verticalAlign=o.CENTER,e._forceUseCanvas=!0,t};var l=cc.Class({name:"cc.RichText",extends:cc.Component,ctor:function(){this._textArray=null,this._labelSegments=[],this._labelSegmentsCache=[],this._linesWidth=[],this._updateRichTextStatus=this._updateRichText},editor:!1,properties:{string:{default:"<color=#00ff00>Rich</c><color=#0fffff>Text</color>",multiline:!0,tooltip:!1,notify:function(){this._updateRichTextStatus()}},horizontalAlign:{default:a.LEFT,type:a,tooltip:!1,animatable:!1,notify:function(t){this.horizontalAlign!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},fontSize:{default:40,tooltip:!1,notify:function(t){this.fontSize!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},_fontFamily:"Arial",fontFamily:{tooltip:!1,get:function(){return this._fontFamily},set:function(t){this._fontFamily!==t&&(this._fontFamily=t,this._layoutDirty=!0,this._updateRichTextStatus())},animatable:!1},font:{default:null,type:cc.TTFFont,tooltip:!1,notify:function(t){this.font!==t&&(this._layoutDirty=!0,this.font?(this.useSystemFont=!1,this._onTTFLoaded()):this.useSystemFont=!0,this._updateRichTextStatus())}},_isSystemFontUsed:!0,useSystemFont:{get:function(){return this._isSystemFontUsed},set:function(t){this._isSystemFontUsed!==t&&(this._isSystemFontUsed=t,this._layoutDirty=!0,this._updateRichTextStatus())},animatable:!1,tooltip:!1},cacheMode:{default:c.NONE,type:c,tooltip:!1,notify:function(t){this.cacheMode!==t&&this._updateRichTextStatus()},animatable:!1},maxWidth:{default:0,tooltip:!1,notify:function(t){this.maxWidth!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},lineHeight:{default:40,tooltip:!1,notify:function(t){this.lineHeight!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},imageAtlas:{default:null,type:cc.SpriteAtlas,tooltip:!1,notify:function(t){this.imageAtlas!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},handleTouchEvent:{default:!0,tooltip:!1,notify:function(t){this.handleTouchEvent!==t&&this.enabledInHierarchy&&(this.handleTouchEvent?this._addEventListeners():this._removeEventListeners())}}},statics:{HorizontalAlign:a,VerticalAlign:o},onEnable:function(){this.handleTouchEvent&&this._addEventListeners(),this._updateRichText(),this._activateChildren(!0)},onDisable:function(){this.handleTouchEvent&&this._removeEventListeners(),this._activateChildren(!1)},start:function(){this._onTTFLoaded()},_onColorChanged:function(t){this.node.children.forEach((function(e){e.color=t}))},_addEventListeners:function(){this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.COLOR_CHANGED,this._onColorChanged,this)},_removeEventListeners:function(){this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.COLOR_CHANGED,this._onColorChanged,this)},_updateLabelSegmentTextAttributes:function(){this._labelSegments.forEach(function(t){this._applyTextAttribute(t,null,!0)}.bind(this))},_createFontLabel:function(t){return u.get(t,this)},_onTTFLoaded:function(){if(this.font instanceof cc.TTFFont)if(this.font._nativeAsset)this._layoutDirty=!0,this._updateRichText();else{var t=this;cc.assetManager.postLoadNative(this.font,(function(){t._layoutDirty=!0,t._updateRichText()}))}else this._layoutDirty=!0,this._updateRichText()},_measureText:function(t,e){var i=this,n=function(e){var n;return 0===i._labelSegmentsCache.length?(n=i._createFontLabel(e),i._labelSegmentsCache.push(n)):n=i._labelSegmentsCache[0],n._styleIndex=t,i._applyTextAttribute(n,e,!0),n.getContentSize().width};return e?n(e):n},_onTouchEnded:function(t){for(var e=this,i=this.node.getComponents(cc.Component),n=function(n){var r=e._labelSegments[n],s=r._clickHandler,a=r._clickParam;s&&e._containsTouchLocation(r,t.touch.getLocation())&&(i.forEach((function(e){e.enabledInHierarchy&&e[s]&&e[s](t,a)})),t.stopPropagation())},r=0;r<this._labelSegments.length;++r)n(r)},_containsTouchLocation:function(t,e){return t.getBoundingBoxToWorld().contains(e)},_resetState:function(){for(var t=this.node.children,e=t.length-1;e>=0;e--){var i=t[e];"RICHTEXT_CHILD"!==i.name&&"RICHTEXT_Image_CHILD"!==i.name||(i.parent===this.node?i.parent=null:t.splice(e,1),"RICHTEXT_CHILD"===i.name&&u.put(i))}this._labelSegments.length=0,this._labelSegmentsCache.length=0,this._linesWidth.length=0,this._lineOffsetX=0,this._lineCount=1,this._labelWidth=0,this._labelHeight=0,this._layoutDirty=!0},onRestore:!1,_activateChildren:function(t){for(var e=this.node.children.length-1;e>=0;e--){var i=this.node.children[e];"RICHTEXT_CHILD"!==i.name&&"RICHTEXT_Image_CHILD"!==i.name||(i.active=t)}},_addLabelSegment:function(t,e){var i;return(i=0===this._labelSegmentsCache.length?this._createFontLabel(t):this._labelSegmentsCache.pop())._styleIndex=e,i._lineCount=this._lineCount,i.active=this.node.active,i.setAnchorPoint(0,0),this._applyTextAttribute(i,t),this.node.addChild(i),this._labelSegments.push(i),i},_updateRichTextWithMaxWidth:function(t,e,i){var n=e;if(this._lineOffsetX>0&&n+this._lineOffsetX>this.maxWidth)for(var s=0;this._lineOffsetX<=this.maxWidth;){var a=this._getFirstWordLen(t,s,t.length),o=t.substr(s,a),c=this._measureText(i,o);if(!(this._lineOffsetX+c<=this.maxWidth)){if(s>0){var u=t.substr(0,s);this._addLabelSegment(u,i),t=t.substr(s,t.length),n=this._measureText(i,t)}this._updateLineInfo();break}this._lineOffsetX+=c,s+=a}if(n>this.maxWidth)for(var l=r.fragmentText(t,n,this.maxWidth,this._measureText(i)),h=0;h<l.length;++h){var _=l[h],f=this._addLabelSegment(_,i).getContentSize();this._lineOffsetX+=f.width,l.length>1&&h<l.length-1&&this._updateLineInfo()}else this._lineOffsetX+=n,this._addLabelSegment(t,i)},_isLastComponentCR:function(t){return t.length-1===t.lastIndexOf("\n")},_updateLineInfo:function(){this._linesWidth.push(this._lineOffsetX),this._lineOffsetX=0,this._lineCount++},_needsUpdateTextLayout:function(t){if(this._layoutDirty||!this._textArray||!t)return!0;if(this._textArray.length!==t.length)return!0;for(var e=0;e<this._textArray.length;++e){var i=this._textArray[e],n=t[e];if(i.text!==n.text)return!0;var r=i.style,s=n.style;if(r){if(s){if(!r.outline!=!s.outline)return!0;if(r.size!==s.size||!r.italic!=!s.italic||r.isImage!==s.isImage)return!0;if(r.src!==s.src||r.imageAlign!==s.imageAlign||r.imageHeight!==s.imageHeight||r.imageWidth!==s.imageWidth||r.imageOffset!==s.imageOffset)return!0}else if(r.size||r.italic||r.isImage||r.outline)return!0}else if(s&&(s.size||s.italic||s.isImage||s.outline))return!0}return!1},_addRichTextImageElement:function(t){var e=t.style.src,i=this.imageAtlas.getSpriteFrame(e);if(i){var n=new cc.PrivateNode("RICHTEXT_Image_CHILD");n._objFlags|=cc.Object.Flags.DontSave;var r=n.addComponent(cc.Sprite);switch(t.style.imageAlign){case"top":n.setAnchorPoint(0,1);break;case"center":n.setAnchorPoint(0,.5);break;default:n.setAnchorPoint(0,0)}t.style.imageOffset&&(n._imageOffset=t.style.imageOffset),r.type=cc.Sprite.Type.SLICED,r.sizeMode=cc.Sprite.SizeMode.CUSTOM,this.node.addChild(n),this._labelSegments.push(n);var s=i.getRect(),a=1,o=s.width,c=s.height,u=t.style.imageWidth,l=t.style.imageHeight;l>0?(o*=a=l/c,c*=a):(o*=a=this.lineHeight/c,c*=a),u>0&&(o=u),this.maxWidth>0?(this._lineOffsetX+o>this.maxWidth&&this._updateLineInfo(),this._lineOffsetX+=o):(this._lineOffsetX+=o,this._lineOffsetX>this._labelWidth&&(this._labelWidth=this._lineOffsetX)),r.spriteFrame=i,n.setContentSize(o,c),n._lineCount=this._lineCount,t.style.event?(t.style.event.click&&(n._clickHandler=t.style.event.click),t.style.event.param?n._clickParam=t.style.event.param:n._clickParam=""):n._clickHandler=null}else cc.warnID(4400)},_updateRichText:function(){if(this.enabledInHierarchy){var t=s.parse(this.string);if(!this._needsUpdateTextLayout(t))return this._textArray=t,void this._updateLabelSegmentTextAttributes();this._textArray=t,this._resetState();for(var e,i=!1,n=0;n<this._textArray.length;++n){var a=this._textArray[n],o=a.text;if(""===o){if(a.style&&a.style.newline){this._updateLineInfo();continue}if(a.style&&a.style.isImage&&this.imageAtlas){this._addRichTextImageElement(a);continue}}for(var c=o.split("\n"),u=0;u<c.length;++u){var l=c[u];if(""!==l)if(i=!1,this.maxWidth>0){var h=this._measureText(n,l);this._updateRichTextWithMaxWidth(l,h,n),c.length>1&&u<c.length-1&&this._updateLineInfo()}else e=this._addLabelSegment(l,n).getContentSize(),this._lineOffsetX+=e.width,this._lineOffsetX>this._labelWidth&&(this._labelWidth=this._lineOffsetX),c.length>1&&u<c.length-1&&this._updateLineInfo();else{if(this._isLastComponentCR(o)&&u===c.length-1)continue;this._updateLineInfo(),i=!0}}}i||this._linesWidth.push(this._lineOffsetX),this.maxWidth>0&&(this._labelWidth=this.maxWidth),this._labelHeight=(this._lineCount+r.BASELINE_RATIO)*this.lineHeight,this.node.setContentSize(this._labelWidth,this._labelHeight),this._updateRichTextPosition(),this._layoutDirty=!1}},_getFirstWordLen:function(t,e,i){var n=t.charAt(e);if(r.isUnicodeCJK(n)||r.isUnicodeSpace(n))return 1;for(var s=1,a=e+1;a<i&&(n=t.charAt(a),!r.isUnicodeSpace(n)&&!r.isUnicodeCJK(n));++a)s++;return s},_updateRichTextPosition:function(){for(var t=0,e=1,i=this._lineCount,n=0;n<this._labelSegments.length;++n){var s=this._labelSegments[n],o=s._lineCount;o>e&&(t=0,e=o);var c=0;switch(this.horizontalAlign){case a.LEFT:c=-this._labelWidth/2;break;case a.CENTER:c=-this._linesWidth[o-1]/2;break;case a.RIGHT:c=this._labelWidth/2-this._linesWidth[o-1]}s.x=t+c;var u=s.getContentSize();if(s.y=this.lineHeight*(i-o)-this._labelHeight/2,o===e&&(t+=u.width),s.getComponent(cc.Sprite)){var l=this.lineHeight,h=this.lineHeight*(1+r.BASELINE_RATIO);switch(s.anchorY){case 1:s.y+=l+(h-l)/2;break;case.5:s.y+=h/2;break;default:s.y+=(h-l)/2}if(s._imageOffset){var _=s._imageOffset.split(",");if(1===_.length&&_[0]){var f=parseFloat(_[0]);Number.isInteger(f)&&(s.y+=f)}else if(2===_.length){var d=parseFloat(_[0]),p=parseFloat(_[1]);Number.isInteger(d)&&(s.x+=d),Number.isInteger(p)&&(s.y+=p)}}}var v=s.getComponent(cc.LabelOutline);v&&v.width&&(s.y=s.y-v.width)}},_convertLiteralColorValue:function(t){var e=t.toUpperCase();return cc.Color[e]?cc.Color[e]:cc.color().fromHEX(t)},_applyTextAttribute:function(t,e,i){var n=t.getComponent(cc.Label);if(n){var r=t._styleIndex,s=null;if(this._textArray[r]&&(s=this._textArray[r].style),s&&s.color?t.color=this._convertLiteralColorValue(s.color):t.color=this.node.color,n.cacheMode=this.cacheMode,this.font instanceof cc.Font&&!this._isSystemFontUsed?n.font=this.font:n.fontFamily=this.fontFamily,n.useSystemFont=this._isSystemFontUsed,n.lineHeight=this.lineHeight,n.enableBold=s&&s.bold,n.enableItalics=s&&s.italic,s&&s.italic&&(t.skewX=12),n.enableUnderline=s&&s.underline,s&&s.outline){var a=t.getComponent(cc.LabelOutline);a||(a=t.addComponent(cc.LabelOutline)),a.color=this._convertLiteralColorValue(s.outline.color),a.width=s.outline.width}s&&s.size?n.fontSize=s.size:n.fontSize=this.fontSize,null!==e&&("string"!=typeof e&&(e=""+e),n.string=e),i&&n._forceUpdateRenderData(),s&&s.event?(s.event.click&&(t._clickHandler=s.event.click),s.event.param?t._clickParam=s.event.param:t._clickParam=""):t._clickHandler=null}},onDestroy:function(){for(var t=0;t<this._labelSegments.length;++t)this._labelSegments[t].removeFromParent(),u.put(this._labelSegments[t])}});cc.RichText=e.exports=l}),{"../platform/CCMacro":163,"../platform/js":179,"../utils/html-text-parser":231,"../utils/text-utils":240}],108:[(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=this.node.getComponent(i);if(t){t.updateAlignment();var e=this.node.position,r=this.node.getAnchorPoint();t.isAlignTop=t.isAlignBottom=t.isAlignLeft=t.isAlignRight=!0;var s=cc.winSize.width,a=cc.winSize.height,o=cc.sys.getSafeAreaRect();t.top=a-o.y-o.height,t.bottom=o.y,t.left=o.x,t.right=s-o.x-o.width,t.updateAlignment();var c=this.node.position,u=r.x-(c.x-e.x)/this.node.width,l=r.y-(c.y-e.y)/this.node.height;this.node.setAnchorPoint(u,l),n.add(t)}}});cc.SafeArea=e.exports=r}),{"../base-ui/CCWidgetManager":86,"./CCComponent":95,"./CCWidget":117}],109:[(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(),s=this.node.getContentSize();if(this._conditionalDisableScrollBar(i,r))return;this.enableAutoHide&&(this._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity));var a=0,o=0,c=0,u=0,l=0;this.direction===n.HORIZONTAL?(a=i.width,o=r.width,l=s.width,c=t.x,u=-this._convertToScrollViewSpace(e).x):this.direction===n.VERTICAL&&(a=i.height,o=r.height,l=s.height,c=t.y,u=-this._convertToScrollViewSpace(e).y);var h=this._calculateLength(a,o,l,c),_=this._calculatePosition(a,o,l,u,c,h);this._updateLength(h),this._updateHanlderPosition(_)}}},_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,s=this.node.convertToWorldSpaceAR(cc.v2(-t.width*e.x,-t.height*e.y)),a=r.convertToNodeSpaceAR(s);return this.direction===n.HORIZONTAL?a=cc.v2(a.x,a.y+(t.height-i.height)/2):this.direction===n.VERTICAL&&(a=cc.v2(a.x+(t.width-i.width)/2,a.y)),this.handle.node.setPosition(a),a},_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,s,a,o){var c=t-e;a&&(c+=Math.abs(a));var u=0;c&&(u=s/c,u=i.clamp01(u));var l=(r-o)*u;return this.direction===n.VERTICAL?cc.v2(0,l):cc.v2(l,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":233,"./CCComponent":95}],110:[(function(t,e){"use strict";var i=t("../CCNode").EventType,n=cc.v2(),r=cc.v2(),s=function(){return(new Date).getMilliseconds()},a=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":a.SCROLL_TO_TOP,"scroll-to-bottom":a.SCROLL_TO_BOTTOM,"scroll-to-left":a.SCROLL_TO_LEFT,"scroll-to-right":a.SCROLL_TO_RIGHT,scrolling:a.SCROLLING,"bounce-bottom":a.BOUNCE_BOTTOM,"bounce-left":a.BOUNCE_LEFT,"bounce-right":a.BOUNCE_RIGHT,"bounce-top":a.BOUNCE_TOP,"scroll-ended":a.SCROLL_ENDED,"touch-up":a.TOUCH_UP,"scroll-ended-with-threshold":a.AUTOSCROLL_ENDED_WITH_THRESHOLD,"scroll-began":a.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:a},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(),s=this.content.getContentSize(),a=this._getContentBottomBoundary()-this._bottomBoundary;a=-a;var o=this._getContentLeftBoundary()-this._leftBoundary;o=-o;var c=cc.v2(0,0),u=0;return i&&(u=s.width-r.width,c.x=o-u*e.x),n&&(u=s.height-r.height,c.y=a-u*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,s=this._getContentLeftBoundary()-this._leftBoundary;s=-s,e.height<t.height&&(r=e.height-t.height,n.y=i-r),e.width<t.width&&(r=e.width-t.width,n.x=s),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=-1;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"),i.x<0?this.content.x-this.content.anchorX*this.content.width+this.content.width+i.x<=this._rightBoundary&&(n="scroll-to-right"):i.x>0&&this.content.x-this.content.anchorX*this.content.width+i.x>=this._leftBoundary&&(n="scroll-to-left"),this._moveContent(i,!1),0===i.x&&0===i.y||(this._scrolling||(this._scrolling=!0,this._dispatchEvent("scroll-began")),this._dispatchEvent("scrolling")),-1!==n&&this._dispatchEvent(n)},_handlePressLogic:function(){this._autoScrolling&&this._dispatchEvent("scroll-ended"),this._autoScrolling=!1,this._isBouncing=!1,this._touchMovePreviousTimestamp=s(),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=s();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 s=this._autoScrollStartPosition.add(this._autoScrollTargetDelta.mul(r)),a=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=s.sub(this._autoScrollBrakingStartPosition);e&&(o=o.mul(i)),s=this._autoScrollBrakingStartPosition.add(o)}else{var c=s.sub(this.getContentPosition()),u=this._getHowMuchOutOfBoundary(c);u.fuzzyEquals(cc.v2(0,0),1e-4)||(s=s.add(u),a=!0)}a&&(this._autoScrolling=!1);var l=s.sub(this.getContentPosition());this._moveContent(this._clampDelta(l),a),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(),s=this._view.getContentSize(),a=r.width-s.width,o=r.height-s.height,c=this._calculateAttenuatedFactor(a),u=this._calculateAttenuatedFactor(o);n=cc.v2(n.x*a*(1-this.brake)*c,n.y*o*u*(1-this.brake));var l=t.mag(),h=n.mag()/l;n=n.add(t),this.brake>0&&h>7&&(h=Math.sqrt(h),n=t.mul(h).add(t)),this.brake>0&&h>3&&(i*=h=3),0===this.brake&&h>1&&(i*=h),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":25,"./CCViewGroup":116}],111:[(function(t,e){"use strict";var i=t("../utils/misc"),n=t("./CCComponent"),r=cc.Enum({Horizontal:0,Vertical:1}),s=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=s}),{"../utils/misc":233,"./CCComponent":95}],112:[(function(t,e){"use strict";var i=t("../utils/misc"),n=(t("../CCNode").EventType,t("./CCRenderComponent")),r=t("../utils/blend-func"),s=cc.Enum({SIMPLE:0,SLICED:1,TILED:2,FILLED:3,MESH:4}),a=cc.Enum({HORIZONTAL:0,VERTICAL:1,RADIAL:2}),o=cc.Enum({CUSTOM:0,TRIMMED:1,RAW:2}),c=cc.Enum({NORMAL:0,GRAY:1}),u=cc.Class({name:"cc.Sprite",extends:n,mixins:[r],editor:!1,properties:{_spriteFrame:{default:null,type:cc.SpriteFrame},_type:s.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:s,animatable:!1,tooltip:!1},fillType:{get:function(){return this._fillType},set:function(t){t!==this._fillType&&(this._fillType=t,this.setVertsDirty(),this._resetAssembler())},type:a,tooltip:!1},fillCenter:{get:function(){return this._fillCenter},set:function(t){this._fillCenter.x=t.x,this._fillCenter.y=t.y,this._type===s.FILLED&&this.setVertsDirty()},tooltip:!1},fillStart:{get:function(){return this._fillStart},set:function(t){this._fillStart=i.clampf(t,-1,1),this._type===s.FILLED&&this.setVertsDirty()},tooltip:!1},fillRange:{get:function(){return this._fillRange},set:function(t){this._fillRange=i.clampf(t,-1,1),this._type===s.FILLED&&this.setVertsDirty()},tooltip:!1},trim:{get:function(){return this._isTrimmedMode},set:function(t){this._isTrimmedMode!==t&&(this._isTrimmedMode=t,this._type!==s.SIMPLE&&this._type!==s.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:a,Type:s,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._spriteFrame&&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)},_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)}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._spriteFrame&&this.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.getTexture();e&&!e.loaded&&t.off("load",this._applySpriteSize,this);var i=this._spriteFrame,n=i&&i.getTexture();e!==n&&this._updateMaterial(),n&&n.loaded?this._applySpriteSize():(this.disableRender(),i&&i.once("load",this._applySpriteSize,this))}}});cc.Sprite=e.exports=u}),{"../CCNode":25,"../utils/blend-func":227,"../utils/misc":233,"./CCRenderComponent":106}],113:[(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":179,"../utils/gray-sprite-state":230,"./CCButton":93,"./CCToggleGroup":115}],114:[(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":179}],115:[(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":179}],116:[(function(t,e){"use strict";var i=cc.Class({name:"cc.ViewGroup",extends:t("./CCComponent")});cc.ViewGroup=e.exports=i}),{"./CCComponent":95}],117:[(function(t,e){"use strict";var i=t("../base-ui/CCWidgetManager"),n=i.AlignMode,r=i._AlignFlags,s=r.TOP,a=r.MID,o=r.BOT,c=r.LEFT,u=r.CENTER,l=r.RIGHT,h=s|o,_=c|l,f=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&s)>0},set:function(t){this._setAlign(s,t)},animatable:!1,tooltip:!1},isAlignVerticalCenter:{get:function(){return(this._alignFlags&a)>0},set:function(t){t?(this.isAlignTop=!1,this.isAlignBottom=!1,this._alignFlags|=a):this._alignFlags&=~a},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&u)>0},set:function(t){t?(this.isAlignLeft=!1,this.isAlignRight=!1,this._alignFlags|=u):this._alignFlags&=~u},animatable:!1,tooltip:!1},isAlignRight:{get:function(){return(this._alignFlags&l)>0},set:function(t){this._setAlign(l,t)},animatable:!1,tooltip:!1},isStretchWidth:{get:function(){return(this._alignFlags&_)===_},visible:!1},isStretchHeight:{get:function(){return(this._alignFlags&h)===h},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&_)>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(f.prototype,"isAlignOnce",{get:function(){return this.alignMode===n.ONCE},set:function(t){this.alignMode=t?n.ONCE:n.ALWAYS}}),cc.Widget=e.exports=f}),{"../base-ui/CCWidgetManager":86,"./CCComponent":95}],118:[(function(t,e){"use strict";var i=t("../../platform/CCMacro"),n=t("../editbox/EditBoxImplBase"),r=t("../CCLabel"),s=t("./types"),a=s.InputMode,o=s.InputFlag,c=s.KeyboardReturnType;function u(t){return t.charAt(0).toUpperCase()+t.slice(1)}var l=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:a.ANY,type:a,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:a},_init:function(){this._upgradeComp(),this._isLabelVisible=!0,this.node.on(cc.Node.EventType.SIZE_CHANGED,this._syncSize,this),(this._impl=new l._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===a.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===a.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=u(t));else{for(var n="",r=t.length,s=0;s<r;++s)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=l,cc.sys.isBrowser&&t("./WebEditBoxImpl")}),{"../../platform/CCMacro":163,"../CCLabel":97,"../editbox/EditBoxImplBase":119,"./WebEditBoxImpl":120,"./types":122}],119:[(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}),{}],120:[(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"),s=t("./types"),a=t("../CCLabel"),o=t("./tabIndexUtil"),c=cc.EditBox,u=cc.js,l=s.InputMode,h=s.InputFlag,_=s.KeyboardReturnType,f={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||(f.zoomInvalid=!0);var d=0,p=cc.v3(),v=null,g=!1,m=!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}u.extend(T,y),c._ImplClass=T,Object.assign(T.prototype,{init:function(t){t&&(this._delegate=t,t.inputMode===l.ANY?this._createTextArea():this._createInput(),o.add(this),this.setTabIndex(t.tabIndex),this._initStyleSheet(),this._registerEventListeners(),this._addDomToGameContainer(),g=cc.view.isAutoFullScreenEnabled(),m=cc.view._resizeWithBrowserSize)},clear:function(){this._removeEventListeners(),this._removeDomFromGameContainer(),o.remove(this),v===this&&(v=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(){v&&v!==this&&v.setFocus(!1),this._editing=!0,v=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&&(g&&(cc.view.enableAutoFullScreen(!1),cc.screen.exitFullScreen()),m&&cc.view.resizeWithBrowserSize(!1),this._adjustWindowScroll())},_hideDomOnMobile:function(){cc.sys.os===cc.sys.OS_ANDROID&&(m&&cc.view.resizeWithBrowserSize(!0),setTimeout((function(){v||g&&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 s=cc.Camera.findCamera(t);return!!s&&(s.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,s=i._viewportRect,a=i._devicePixelRatio;n/=a,r/=a;var o=cc.game.container,c=t[0]*n,u=t[1],l=t[4],h=t[5]*r,_=o&&o.style.paddingLeft&&parseInt(o.style.paddingLeft);_+=s.x/a;var d=o&&o.style.paddingBottom&&parseInt(o.style.paddingBottom);d+=s.y/a;var p=t[12]*n+_,v=t[13]*r+d;f.zoomInvalid&&(this.setSize(e.width*c,e.height*h),c=1,h=1);var g=this._elem,m="matrix("+c+","+-u+","+-l+","+h+","+p+","+-v+")";g.style.transform=m,g.style["-webkit-transform"]=m,g.style["transform-origin"]="0px 100% 0px",g.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 s="none";return i===h.INITIAL_CAPS_ALL_CHARACTERS?s="uppercase":i===h.INITIAL_CAPS_WORD&&(s="capitalize"),void(r.style.textTransform=s)}if(i===h.PASSWORD)return r.type="password",void(r.style.textTransform="none");var a=r.type;e===l.EMAIL_ADDR?a="email":e===l.NUMERIC||e===l.DECIMAL?a="number":e===l.PHONE_NUMBER?(a="number",r.pattern="[0-9]*"):e===l.URL?a="url":(a="text",n===_.SEARCH&&(a="search")),r.type=a;var o="none";i===h.INITIAL_CAPS_ALL_CHARACTERS?o="uppercase":i===h.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 a.HorizontalAlign.LEFT:n.style.textAlign="left";break;case a.HorizontalAlign.CENTER:n.style.textAlign="center";break;case a.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,s=t.node.color.toCSS(),o=t.fontSize;switch(t.horizontalAlign){case a.HorizontalAlign.LEFT:n="left";break;case a.HorizontalAlign.CENTER:n="center";break;case a.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: "+s+"; 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,v=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":163,"../../platform/utils":182,"../../value-types/mat4":250,"../CCLabel":97,"./tabIndexUtil":121,"./types":122}],121:[(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)}}}}),{}],122:[(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}}),{}],123:[(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":90,"./CCAudioSource":91,"./CCBlockInputEvents":92,"./CCButton":93,"./CCCanvas":94,"./CCComponent":95,"./CCComponentEventHandler":96,"./CCLabel":97,"./CCLabelOutline":98,"./CCLabelShadow":99,"./CCLayout":100,"./CCMask":101,"./CCMotionStreak":102,"./CCPageView":103,"./CCPageViewIndicator":104,"./CCProgressBar":105,"./CCRichText":107,"./CCSafeArea":108,"./CCScrollBar":109,"./CCScrollView":110,"./CCSlider":111,"./CCSprite":112,"./CCToggle":113,"./CCToggleContainer":114,"./CCToggleGroup":115,"./CCWidget":117,"./SubContextView":void 0,"./editbox/CCEditBox":118,"./missing-script":124}],124:[(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}),{}],125:[(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 s=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(s,cc.Event),(r=s.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},s.MAX_TOUCHES=5,s.BEGAN=0,s.MOVED=1,s.ENDED=2,s.CANCELED=3;var a=function(t,e){cc.Event.call(this,cc.Event.ACCELERATION,e),this.acc=t};i.extend(a,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=s,cc.Event.EventAcceleration=a,cc.Event.EventKeyboard=o,e.exports=cc.Event}),{"../event/event":132}],126:[(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 s=function(){cc.EventListener.call(this,cc.EventListener.MOUSE,n.MOUSE,this._callback)};i.extend(s,cc.EventListener),i.mixin(s.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 s;return t.onMouseDown=this.onMouseDown,t.onMouseUp=this.onMouseUp,t.onMouseMove=this.onMouseMove,t.onMouseScroll=this.onMouseScroll,t},checkAvailable:function(){return!0}});var a=function(){cc.EventListener.call(this,cc.EventListener.TOUCH_ONE_BY_ONE,n.TOUCH_ONE_BY_ONE,null),this._claimedTouches=[]};i.extend(a,cc.EventListener),i.mixin(a.prototype,{constructor:a,_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 a;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 u=function(){cc.EventListener.call(this,cc.EventListener.KEYBOARD,n.KEYBOARD,this._callback)};i.extend(u,cc.EventListener),i.mixin(u.prototype,{constructor:u,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 u;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 a:e===cc.EventListener.TOUCH_ALL_AT_ONCE?i=new o:e===cc.EventListener.MOUSE?i=new s:e===cc.EventListener.CUSTOM?(i=new r(t.eventName,t.callback),delete t.eventName,delete t.callback):e===cc.EventListener.KEYBOARD?i=new u: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":179}],127:[(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 s=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),"")},a={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(void 0!==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 s=t._children,a=0,o=s.length;a<o;a++)this._setDirtyForNode(s[a])},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 s=r[i];s._setPaused(!0),s._claimedTouches&&s._claimedTouches.includes(this._currentTouch)&&this._clearCurTouch()}if(!0===e){var a=t._children;for(i=0,n=a?a.length:0;i<n;i++)this.pauseTarget(a[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 s=t._children;for(i=0,n=s?s.length:0;i<n;i++)this.resumeTarget(s[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 s,a=this._toAddedListeners;for(e=a.length-1;e>=0;e--)(s=a[e])&&s._getListenerID()===t&&cc.js.array.removeAt(a,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,s=n,a=!1;r._parent._id!==s._parent._id;)r=null===r._parent._parent?(a=!0)&&n:r._parent,s=null===s._parent._parent?(a=!0)&&i:s._parent;if(r._id===s._id){if(r._id===n._id)return-1;if(r._id===i._id)return 1}return a?r._localZOrder-s._localZOrder:s._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(),s=t.getSceneGraphPriorityListeners(),a=this._toRemovedListeners;if(s)for(e=s.length-1;e>=0;e--)(i=s[e])._isRegistered()||(cc.js.array.removeAt(s,e),-1!==(n=a.indexOf(i))&&a.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=a.indexOf(i))&&a.splice(n,1));s&&0===s.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,s=n.length;r<s;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,s=i.length;r<s;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,s=n.getFixedPriorityListeners(),a=n.getSceneGraphPriorityListeners();a&&-1!==(r=a.indexOf(i))&&a.splice(r,1),s&&-1!==(r=s.indexOf(i))&&s.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,s=!1,o=i.getEventCode(),c=cc.Event.EventTouch;if(o===c.BEGAN){if(!cc.macro.ENABLE_MULTI_TOUCH&&a._currentTouch){var u=a._currentTouchListener._node;if(u&&u.activeInHierarchy)return!1}t.onTouchBegan&&(s=t.onTouchBegan(n,i))&&t._registered&&(t._claimedTouches.push(n),a._currentTouchListener=t,a._currentTouch=n)}else if(t._claimedTouches.length>0&&-1!==(r=t._claimedTouches.indexOf(n))){if(s=!0,!cc.macro.ENABLE_MULTI_TOUCH&&a._currentTouch&&a._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),a._clearCurTouch()):o===c.CANCELED&&(t.onTouchCancelled&&t.onTouchCancelled(n,i),t._registered&&t._claimedTouches.splice(r,1),a._clearCurTouch())}return i.isStopped()?(a._updateTouchListeners(i),!0):!(!s||!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(),s=cc.js.array.copy(r),a={event:t,needsMutableSet:e&&i,touches:s,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,a);i&&s.length>0&&(this._dispatchEventToListeners(i,this._onTouchesEventCallback,{event:t,touches:s}),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,s=n.getEventCode();return n.currentTarget=t._node,s===i.BEGAN&&t.onTouchesBegan?t.onTouchesBegan(r,n):s===i.MOVED&&t.onTouchesMoved?t.onTouchesMoved(r,n):s===i.ENDED&&t.onTouchesEnded?t.onTouchesEnded(r,n):s===i.CANCELED&&t.onTouchesCancelled&&t.onTouchesCancelled(r,n),!!n.isStopped()&&(a._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,s=!1,a=t.getFixedPriorityListeners(),o=t.getSceneGraphPriorityListeners(),c=0;if(a&&0!==a.length)for(;c<t.gt0Index;++c)if((r=a[c]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){s=!0;break}if(o&&!s)for(n=0;n<o.length;n++)if((r=o[n]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){s=!0;break}if(a&&!s)for(;c<a.length;++c)if((r=a[c]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){s=!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],s=r.getFixedPriorityListeners(),a=r.getSceneGraphPriorityListeners();if((e=this._removeListenerInVector(a,t))?this._setDirty(t._getListenerID(),this.DIRTY_SCENE_GRAPH_PRIORITY):(e=this._removeListenerInVector(s,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 u=o[c];if(u===t){cc.js.array.removeAt(o,c),u._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,s=i._nodeListenersMap[t._id];if(s){var a=cc.js.array.copy(s);for(r=0;r<a.length;r++)i.removeListener(a[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 u,l=t.children;for(r=0,u=l.length;r<u;r++)i.removeListeners(l[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=s(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"),a})),e.exports=cc.internal.eventManager=a}),{"../platform/js":179,"./CCEventListener":126}],128:[(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)}}}),{}],129:[(function(t,e){"use strict";t("./CCEvent"),t("./CCTouch"),t("./CCEventListener");var i=t("./CCEventManager");e.exports=i}),{"./CCEvent":125,"./CCEventListener":126,"./CCEventManager":127,"./CCTouch":128}],130:[(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 s=n.callbackInfos,a=0,o=s.length;a<o;++a){var c=s[a];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":171}],131:[(function(t,e){"use strict";var i=t("../platform/js"),n=t("../platform/callbacks-invoker"),r=i.array.fastRemove;function s(){n.call(this)}i.extend(s,n);var a=s.prototype;a.__on=a.on,a.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)},a.__off=a.off,a.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 s=n.callbackInfos,a=0;a<s.length;++a){var o=s[a]&&s[a].target;o&&o.__eventTargets&&r(o.__eventTargets,this)}this.removeAll(t)}},a.targetOff=function(t){this.removeAll(t),t&&t.__eventTargets&&r(t.__eventTargets,this)},a.once=function(t,e,i){this.on(t,e,i,!0)},a.dispatchEvent=function(t){this.emit(t.type,t)},a.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=s}),{"../platform/callbacks-invoker":171,"../platform/js":179}],132:[(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":179}],133:[(function(t){"use strict";t("./event"),t("./event-listeners"),t("./event-target"),t("./system-event")}),{"./event":132,"./event-listeners":130,"./event-target":131,"./system-event":134}],134:[(function(t,e){"use strict";var i=t("../event/event-target"),n=t("../event-manager"),r=t("../platform/CCInputManager"),s=cc.Enum({KEY_DOWN:"keydown",KEY_UP:"keyup",DEVICEMOTION:"devicemotion"}),a=null,o=null,c=cc.Class({name:"SystemEvent",extends:i,statics:{EventType:s},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!==s.KEY_DOWN&&t!==s.KEY_UP||(a||(a=cc.EventListener.create({event:cc.EventListener.KEYBOARD,onKeyPressed:function(t,e){e.type=s.KEY_DOWN,cc.systemEvent.dispatchEvent(e)},onKeyReleased:function(t,e){e.type=s.KEY_UP,cc.systemEvent.dispatchEvent(e)}})),n.hasEventListener(cc.EventListener.ListenerID.KEYBOARD)||n.addListener(a,1)),t===s.DEVICEMOTION&&(o||(o=cc.EventListener.create({event:cc.EventListener.ACCELERATION,callback:function(t,e){e.type=s.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),a&&(t===s.KEY_DOWN||t===s.KEY_UP)){var r=this.hasEventListener(s.KEY_DOWN),c=this.hasEventListener(s.KEY_UP);r||c||n.removeListener(a)}o&&t===s.DEVICEMOTION&&n.removeListener(o)}});cc.SystemEvent=e.exports=c,cc.systemEvent=new cc.SystemEvent}),{"../event-manager":129,"../event/event-target":131,"../platform/CCInputManager":162}],135:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../value-types/vec3")),r=a(t("../value-types/mat3")),s=a(t("./enums"));function a(t){return t&&t.__esModule?t:{default:t}}var o=new n.default,c=new n.default,u=new r.default,l=function(t,e,i){var r=u.m,s=i.m;r[0]=Math.abs(s[0]),r[1]=Math.abs(s[1]),r[2]=Math.abs(s[2]),r[3]=Math.abs(s[4]),r[4]=Math.abs(s[5]),r[5]=Math.abs(s[6]),r[6]=Math.abs(s[8]),r[7]=Math.abs(s[9]),r[8]=Math.abs(s[10]),n.default.transformMat3(t,e,u)},h=(function(){function t(t,e,i,r,a,o){this.center=void 0,this.halfExtents=void 0,this._type=void 0,this._type=s.default.SHAPE_AABB,this.center=new n.default(t,e,i),this.halfExtents=new n.default(r,a,o)}t.create=function(e,i,n,r,s,a){return new t(e,i,n,r,s,a)},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,s,a,o){return n.default.set(t.center,e,i,r),n.default.set(t.halfExtents,s,a,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,s){s||(s=this),n.default.transformMat4(s.center,this.center,t),l(s.halfExtents,this.halfExtents,t)},t})();i.default=h,e.exports=i.default}),{"../value-types/mat3":249,"../value-types/vec3":258,"./enums":137}],136:[(function(t,e,i){"use strict";i.__esModule=!0,i.point_plane=_,i.pt_point_plane=function(t,e,i){var r=_(e,i);return n.Vec3.subtract(t,e,n.Vec3.multiplyScalar(t,i.n,r))},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(u,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>u.x?u.x:t.x,t.y=t.y>u.x?u.y:t.y,t.z=t.z>u.x?u.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(s,c[3],c[4],c[5]),n.Vec3.set(a,c[6],c[7],c[8]),l[0]=r,l[1]=s,l[2]=a,h[0]=i.halfExtents.x,h[1]=i.halfExtents.y,h[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 u=0;u<3;u++){var _=n.Vec3.dot(o,l[u]);_>h[u]&&(_=h[u]),_<-h[u]&&(_=-h[u]),t.x+=_*l[u].x,t.y+=_*l[u].y,t.z+=_*l[u].z}return t};var n=t("../value-types"),r=new n.Vec3,s=new n.Vec3,a=new n.Vec3,o=new n.Vec3,c=new n.Vec3,u=new n.Vec3,l=new Array(3),h=new Array(3);function _(t,e){return n.Vec3.dot(e.n,t)-e.d}}),{"../value-types":248}],137:[(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}),{}],138:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../value-types"),r=a(t("./enums")),s=a(t("./plane"));function a(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,n.key,n)}}var c=new Array(8);c[0]=new n.Vec3(1,1,1),c[1]=new n.Vec3(-1,1,1),c[2]=new n.Vec3(-1,-1,1),c[3]=new n.Vec3(1,-1,1),c[4]=new n.Vec3(1,1,-1),c[5]=new n.Vec3(-1,1,-1),c[6]=new n.Vec3(-1,-1,-1),c[7]=new n.Vec3(1,-1,-1);var u,l=(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]=s.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)s.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,a=t.prototype;return a.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 s=0;s<6;s++){var a=this.planes[s],o=1/a.n.length();n.Vec3.multiplyScalar(a.n,a.n,o),a.d*=o}for(var u=0;u<8;u++)n.Vec3.transformMat4(this.vertices[u],c[u],e)}},a.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);s.default.fromPoints(this.planes[0],this.vertices[1],this.vertices[5],this.vertices[6]),s.default.fromPoints(this.planes[1],this.vertices[3],this.vertices[7],this.vertices[4]),s.default.fromPoints(this.planes[2],this.vertices[6],this.vertices[7],this.vertices[3]),s.default.fromPoints(this.planes[3],this.vertices[0],this.vertices[4],this.vertices[5]),s.default.fromPoints(this.planes[4],this.vertices[2],this.vertices[3],this.vertices[0]),s.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),t})();i.default=l,l.createOrtho=(u=new n.Vec3,function(t,e,i,r,a,o){var c=e/2,l=i/2;n.Vec3.set(u,c,l,r),n.Vec3.transformMat4(t.vertices[0],u,o),n.Vec3.set(u,-c,l,r),n.Vec3.transformMat4(t.vertices[1],u,o),n.Vec3.set(u,-c,-l,r),n.Vec3.transformMat4(t.vertices[2],u,o),n.Vec3.set(u,c,-l,r),n.Vec3.transformMat4(t.vertices[3],u,o),n.Vec3.set(u,c,l,a),n.Vec3.transformMat4(t.vertices[4],u,o),n.Vec3.set(u,-c,l,a),n.Vec3.transformMat4(t.vertices[5],u,o),n.Vec3.set(u,-c,-l,a),n.Vec3.transformMat4(t.vertices[6],u,o),n.Vec3.set(u,c,-l,a),n.Vec3.transformMat4(t.vertices[7],u,o),s.default.fromPoints(t.planes[0],t.vertices[1],t.vertices[6],t.vertices[5]),s.default.fromPoints(t.planes[1],t.vertices[3],t.vertices[4],t.vertices[7]),s.default.fromPoints(t.planes[2],t.vertices[6],t.vertices[3],t.vertices[7]),s.default.fromPoints(t.planes[3],t.vertices[0],t.vertices[5],t.vertices[4]),s.default.fromPoints(t.planes[4],t.vertices[2],t.vertices[0],t.vertices[3]),s.default.fromPoints(t.planes[0],t.vertices[7],t.vertices[5],t.vertices[6])}),e.exports=i.default}),{"../value-types":248,"./enums":137,"./plane":143}],139:[(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.Plane=i.Line=i.Frustum=i.Obb=i.Sphere=i.intersect=i.Ray=i.Aabb=i.Triangle=i.enums=void 0;var r=p(t("./enums"));i.enums=r.default;var s=p(t("./triangle"));i.Triangle=s.default;var a=p(t("./aabb"));i.Aabb=a.default;var o=p(t("./ray"));i.Ray=o.default;var c=p(t("./intersect"));i.intersect=c.default;var u=p(t("./sphere"));i.Sphere=u.default;var l=p(t("./obb"));i.Obb=l.default;var h=p(t("./frustum"));i.Frustum=h.default;var _=p(t("./line"));i.Line=_.default;var f=p(t("./plane"));i.Plane=f.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":135,"./distance":136,"./enums":137,"./frustum":138,"./intersect":140,"./line":141,"./obb":142,"./plane":143,"./ray":144,"./sphere":145,"./triangle":146}],140:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=_(t("../../renderer/gfx")),r=_(t("../../renderer/memop/recycle-pool")),s=t("../value-types"),a=_(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=h(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 s=n?Object.getOwnPropertyDescriptor(t,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=t[r]}return i.default=t,e&&e.set(t,i),i})(t("./distance")),c=_(t("./enums")),u=_(t("./ray")),l=_(t("./triangle"));function h(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(h=function(t){return t?i:e})(t)}function _(t){return t&&t.__esModule?t:{default:t}}var f,d,p,v,g,m,y,T,E,A,C,x,b,S,w,R=(function(){var t=l.default.create(),e=1/0;function i(t,e,i,n){s.Vec3.set(t,e[i*n],e[i*n+1],e[i*n+2])}return function(r,s){e=1/0;for(var a=s._subMeshes,o=0;o<a.length;o++)if(a[o]._primitiveType===n.default.PT_TRIANGLES)for(var c=s._subDatas[o]||s._subDatas[0],u=s._getAttrMeshData(o,n.default.ATTR_POSITION),l=c.getIData(Uint16Array),h=c.vfm.element(n.default.ATTR_POSITION).num,_=0;_<l.length;_+=3){i(t.a,u,l[_],h),i(t.b,u,l[_+1],h),i(t.c,u,l[_+2],h);var f=L(r,t);f>0&&f<e&&(e=f)}return e}})(),I=(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,s=e.y,a=e.z,o=n[3]*r+n[7]*s+n[11]*a;return o=o?1/o:1,t.x=(n[0]*r+n[4]*s+n[8]*a)*o,t.y=(n[1]*r+n[5]*s+n[9]*a)*o,t.z=(n[2]*r+n[6]*s+n[10]*a)*o,t}var n=new r.default(function(){return{distance:0,node:null}},1),o=[],c=a.default.create(),l=new s.Vec3,h=new s.Vec3,_=new u.default,f=cc.mat4(),d=cc.mat4(),p=new s.Vec3;function v(t){return t>0&&t<1/0}return function(r,u,g,m){return n.reset(),o.length=0,t(r=r||cc.director.getScene(),(function(t){if(!m||m(t)){s.Mat4.invert(d,t.getWorldMatrix(f)),s.Vec3.transformMat4(_.o,u.o,d),s.Vec3.normalize(_.d,i(_.d,u.d,d));var e=1/0,r=t._renderComponent;if(r instanceof cc.MeshRenderer?e=B(_,r._boundingBox):t.width&&t.height&&(s.Vec3.set(l,-t.width*t.anchorX,-t.height*t.anchorY,t.z),s.Vec3.set(h,t.width*(1-t.anchorX),t.height*(1-t.anchorY),t.z),a.default.fromPoints(c,l,h),e=B(_,c)),v(e)&&(g&&(e=g(_,t,e)),v(e))){s.Vec3.scale(p,_.d,e),i(p,p,f);var y=n.add();y.node=t,y.distance=s.Vec3.mag(p),o.push(y)}}})),o.sort(e),o}})(),M=(f=new s.Vec3(0,0,0),function(t,e){var i=s.Vec3.dot(t.d,e.n);if(Math.abs(i)<Number.EPSILON)return 0;s.Vec3.multiplyScalar(f,e.n,e.d);var n=s.Vec3.dot(s.Vec3.subtract(f,f,t.o),e.n)/i;return n<0?0:n}),O=(d=new s.Vec3(0,0,0),function(t,e){s.Vec3.subtract(d,t.e,t.s);var i=(e.d-s.Vec3.dot(t.s,e.n))/s.Vec3.dot(d,e.n);return i<0||i>1?0:i}),L=(function(){var t=new s.Vec3(0,0,0),e=new s.Vec3(0,0,0),i=new s.Vec3(0,0,0),n=new s.Vec3(0,0,0),r=new s.Vec3(0,0,0);return function(a,o,c){s.Vec3.subtract(t,o.b,o.a),s.Vec3.subtract(e,o.c,o.a),s.Vec3.cross(i,a.d,e);var u=s.Vec3.dot(t,i);if(u<Number.EPSILON&&(!c||u>-Number.EPSILON))return 0;var l=1/u;s.Vec3.subtract(n,a.o,o.a);var h=s.Vec3.dot(n,i)*l;if(h<0||h>1)return 0;s.Vec3.cross(r,n,t);var _=s.Vec3.dot(a.d,r)*l;if(_<0||h+_>1)return 0;var f=s.Vec3.dot(e,r)*l;return f<0?0:f}})(),D=L,P=(function(){var t=new s.Vec3(0,0,0),e=new s.Vec3(0,0,0),i=new s.Vec3(0,0,0),n=new s.Vec3(0,0,0),r=new s.Vec3(0,0,0),a=new s.Vec3(0,0,0);return function(o,c,u){s.Vec3.subtract(t,c.b,c.a),s.Vec3.subtract(e,c.c,c.a),s.Vec3.subtract(i,o.s,o.e),s.Vec3.cross(r,t,e);var l=s.Vec3.dot(i,r);if(l<=0)return 0;s.Vec3.subtract(n,o.s,c.a);var h=s.Vec3.dot(n,r);if(h<0||h>l)return 0;s.Vec3.cross(a,i,n);var _=s.Vec3.dot(e,a);if(_<0||_>l)return 0;var f=-s.Vec3.dot(t,a);if(f<0||_+f>l)return 0;if(u){var d=1/l,p=1-(_*=d)-(f*=d);s.Vec3.set(u,c.a.x*p+c.b.x*_+c.c.x*f,c.a.y*p+c.b.y*_+c.c.y*f,c.a.z*p+c.b.z*_+c.c.z*f)}return 1}})(),N=(p=new s.Vec3(0,0,0),v=new s.Vec3(0,0,0),g=new s.Vec3(0,0,0),m=new s.Vec3(0,0,0),y=new s.Vec3(0,0,0),T=new s.Vec3(0,0,0),E=new s.Vec3(0,0,0),function(t,e,i,n,r,a,o){s.Vec3.subtract(p,e,t),s.Vec3.subtract(v,i,t),s.Vec3.subtract(g,n,t),s.Vec3.subtract(m,r,t),s.Vec3.cross(T,m,p);var c=s.Vec3.dot(v,T);if(c>=0){var u=-s.Vec3.dot(g,T);if(u<0)return 0;var l=s.Vec3.dot(s.Vec3.cross(E,p,g),v);if(l<0)return 0;if(o){var h=1/(u+c+l);u*=h,c*=h,l*=h,s.Vec3.set(o,i.x*u+n.x*c+r.x*l,i.y*u+n.y*c+r.y*l,i.z*u+n.z*c+r.z*l)}}else{s.Vec3.subtract(y,a,t);var _=s.Vec3.dot(y,T);if(_<0)return 0;var f=s.Vec3.dot(s.Vec3.cross(E,p,v),y);if(f<0)return 0;if(o){var d=1/(_+(c=-c)+f);_*=d,c*=d,f*=d,s.Vec3.set(o,i.x*_+a.x*c+r.x*f,i.y*_+a.y*c+r.y*f,i.z*_+a.z*c+r.z*f)}}return 1}),F=(function(){var t=new s.Vec3(0,0,0);return function(e,i){var n=i.radius,r=i.center,a=e.o,o=e.d,c=n*n;s.Vec3.subtract(t,r,a);var u=t.lengthSqr(),l=s.Vec3.dot(t,o),h=c-(u-l*l);if(h<0)return 0;var _=Math.sqrt(h),f=u<c?l+_:l-_;return f<0?0:f}})(),B=(A=new s.Vec3,C=new s.Vec3,function(t,e){var i=t.o,n=t.d,r=1/n.x,a=1/n.y,o=1/n.z;s.Vec3.subtract(A,e.center,e.halfExtents),s.Vec3.add(C,e.center,e.halfExtents);var c=(A.x-i.x)*r,u=(C.x-i.x)*r,l=(A.y-i.y)*a,h=(C.y-i.y)*a,_=(A.z-i.z)*o,f=(C.z-i.z)*o,d=Math.max(Math.max(Math.min(c,u),Math.min(l,h)),Math.min(_,f)),p=Math.min(Math.min(Math.max(c,u),Math.max(l,h)),Math.max(_,f));return p<0||d>p?0:d}),z=B,V=(function(){var t=new s.Vec3,e=new s.Vec3,i=new s.Vec3,n=new s.Vec3,r=new s.Vec3,a=new s.Vec3,o=new s.Vec3,c=new Array(3),u=new Array(3),l=new Array(3),h=new Array(6);return function(_,f){c[0]=f.halfExtents.x,c[1]=f.halfExtents.y,c[2]=f.halfExtents.z,t=f.center,e=_.o,i=_.d;var d=f.orientation.m;s.Vec3.set(n,d[0],d[1],d[2]),s.Vec3.set(r,d[3],d[4],d[5]),s.Vec3.set(a,d[6],d[7],d[8]),s.Vec3.subtract(o,t,e),u[0]=s.Vec3.dot(n,i),u[1]=s.Vec3.dot(r,i),u[2]=s.Vec3.dot(a,i),l[0]=s.Vec3.dot(n,o),l[1]=s.Vec3.dot(r,o),l[2]=s.Vec3.dot(a,o);for(var p=0;p<3;++p){if(0===u[p]){if(-l[p]-c[p]>0||-l[p]+c[p]<0)return 0;u[p]=1e-7}h[2*p+0]=(l[p]+c[p])/u[p],h[2*p+1]=(l[p]-c[p])/u[p]}var v=Math.max(Math.max(Math.min(h[0],h[1]),Math.min(h[2],h[3])),Math.min(h[4],h[5])),g=Math.min(Math.min(Math.max(h[0],h[1]),Math.max(h[2],h[3])),Math.max(h[4],h[5]));return g<0||v>g||v<0?0:v}})(),U=(x=new s.Vec3,b=new s.Vec3,S=new s.Vec3,w=new s.Vec3,function(t,e){return s.Vec3.subtract(x,t.center,t.halfExtents),s.Vec3.add(b,t.center,t.halfExtents),s.Vec3.subtract(S,e.center,e.halfExtents),s.Vec3.add(w,e.center,e.halfExtents),x.x<=w.x&&b.x>=S.x&&x.y<=w.y&&b.y>=S.y&&x.z<=w.z&&b.z>=S.z});function k(t,e,i){s.Vec3.set(i[0],t.x,e.y,e.z),s.Vec3.set(i[1],t.x,e.y,t.z),s.Vec3.set(i[2],t.x,t.y,e.z),s.Vec3.set(i[3],t.x,t.y,t.z),s.Vec3.set(i[4],e.x,e.y,e.z),s.Vec3.set(i[5],e.x,e.y,t.z),s.Vec3.set(i[6],e.x,t.y,e.z),s.Vec3.set(i[7],e.x,t.y,t.z)}function H(t,e,i,n,r,a){s.Vec3.set(a[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),s.Vec3.set(a[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),s.Vec3.set(a[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),s.Vec3.set(a[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),s.Vec3.set(a[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),s.Vec3.set(a[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),s.Vec3.set(a[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),s.Vec3.set(a[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 W(t,e){for(var i=s.Vec3.dot(e,t[0]),n=i,r=1;r<8;++r){var a=s.Vec3.dot(e,t[r]);i=a<i?a:i,n=a>n?a:n}return[i,n]}var G,j=(function(){for(var t=new Array(15),e=0;e<15;e++)t[e]=new s.Vec3(0,0,0);for(var i=new Array(8),n=new Array(8),r=0;r<8;r++)i[r]=new s.Vec3(0,0,0),n[r]=new s.Vec3(0,0,0);var a=new s.Vec3,o=new s.Vec3;return function(e,r){var c=r.orientation.m;s.Vec3.set(t[0],1,0,0),s.Vec3.set(t[1],0,1,0),s.Vec3.set(t[2],0,0,1),s.Vec3.set(t[3],c[0],c[1],c[2]),s.Vec3.set(t[4],c[3],c[4],c[5]),s.Vec3.set(t[5],c[6],c[7],c[8]);for(var u=0;u<3;++u)s.Vec3.cross(t[6+3*u],t[u],t[0]),s.Vec3.cross(t[7+3*u],t[u],t[1]),s.Vec3.cross(t[7+3*u],t[u],t[2]);s.Vec3.subtract(a,e.center,e.halfExtents),s.Vec3.add(o,e.center,e.halfExtents),k(a,o,i),H(r.center,r.halfExtents,t[3],t[4],t[5],n);for(var l=0;l<15;++l){var h=W(i,t[l]),_=W(n,t[l]);if(_[0]>h[1]||h[0]>_[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=s.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 s.Vec3(0,0,0);return function(n,r){for(var a=0,o=!1,c=0;c<r.planes.length;c++){if(-1===(a=Y(n,r.planes[c])))return 0;1===a&&(o=!0)}if(!o)return 1;for(var u=0;u<r.vertices.length;u++)s.Vec3.subtract(t[u],r.vertices[u],n.center);e=0,i=0;for(var l=0;l<r.vertices.length;l++)t[l].x>n.halfExtents.x?e++:t[l].x<-n.halfExtents.x&&i++;if(e===r.vertices.length||i===r.vertices.length)return 0;e=0,i=0;for(var h=0;h<r.vertices.length;h++)t[h].y>n.halfExtents.y?e++:t[h].y<-n.halfExtents.y&&i++;if(e===r.vertices.length||i===r.vertices.length)return 0;e=0,i=0;for(var _=0;_<r.vertices.length;_++)t[_].z>n.halfExtents.z?e++:t[_].z<-n.halfExtents.z&&i++;return e===r.vertices.length||i===r.vertices.length?0:1}})(),Z=(function(){var t=new s.Vec3(0,0,0),e=new s.Mat3;return function(i,n){return s.Vec3.subtract(t,n,i.center),s.Vec3.transformMat3(t,t,s.Mat3.transpose(e,i.orientation)),r=t,a=i.halfExtents,Math.abs(r.x)<a.x&&Math.abs(r.y)<a.y&&Math.abs(r.z)<a.z;var r,a}})(),K=(G=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*G(e.n,i[0],i[1],i[2])+t.halfExtents.y*G(e.n,i[3],i[4],i[5])+t.halfExtents.z*G(e.n,i[6],i[7],i[8]),r=s.Vec3.dot(e.n,t.center);return r+n<e.d?-1:r-n>e.d?0:1}),Q=function(t,e){for(var i=0;i<e.planes.length;i++)if(-1===K(t,e.planes[i]))return 0;return 1},$=(function(){for(var t=new Array(8),e=0,i=0,n=0,r=0;r<t.length;r++)t[r]=new s.Vec3(0,0,0);var a=function(t,e,i,n){return t.x*e+t.y*i+t.z*n};return function(r,o){for(var c=0,u=!1,l=0;l<o.planes.length;l++){if(-1===(c=K(r,o.planes[l])))return 0;1===c&&(u=!0)}if(!u)return 1;for(var h=0;h<o.vertices.length;h++)s.Vec3.subtract(t[h],o.vertices[h],r.center);i=0,n=0;for(var _=r.orientation.m,f=0;f<o.vertices.length;f++)(e=a(t[f],_[0],_[1],_[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=a(t[d],_[3],_[4],_[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=a(t[p],_[6],_[7],_[8]))>r.halfExtents.z?i++:e<-r.halfExtents.z&&n++;return i===o.vertices.length||n===o.vertices.length?0:1}})(),J=(function(){for(var t=new Array(15),e=0;e<15;e++)t[e]=new s.Vec3(0,0,0);for(var i=new Array(8),n=new Array(8),r=0;r<8;r++)i[r]=new s.Vec3(0,0,0),n[r]=new s.Vec3(0,0,0);return function(e,r){var a=e.orientation.m,o=r.orientation.m;s.Vec3.set(t[0],a[0],a[1],a[2]),s.Vec3.set(t[1],a[3],a[4],a[5]),s.Vec3.set(t[2],a[6],a[7],a[8]),s.Vec3.set(t[3],o[0],o[1],o[2]),s.Vec3.set(t[4],o[3],o[4],o[5]),s.Vec3.set(t[5],o[6],o[7],o[8]);for(var c=0;c<3;++c)s.Vec3.cross(t[6+3*c],t[c],t[0]),s.Vec3.cross(t[7+3*c],t[c],t[1]),s.Vec3.cross(t[7+3*c],t[c],t[2]);H(e.center,e.halfExtents,t[0],t[1],t[2],i),H(r.center,r.halfExtents,t[3],t[4],t[5],n);for(var u=0;u<15;++u){var l=W(i,t[u]),h=W(n,t[u]);if(h[0]>l[1]||l[0]>h[1])return 0}return 1}})(),tt=function(t,e){var i=s.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 s.Vec3(0,0,0),e=[1,-1,1,-1,1,-1];return function(i,n){for(var r=0;r<6;r++){var a=n.planes[r],o=i.radius,c=i.center,u=a.n,l=a.d,h=s.Vec3.dot(u,c);if(h+o<l)return 0;if(!(h-o>l)){s.Vec3.add(t,c,s.Vec3.multiplyScalar(t,u,o));for(var _=0;_<6;_++)if(_!==r&&_!==r+e[r]){var f=n.planes[_];if(s.Vec3.dot(f.n,t)<f.d)return 0}}}return 1}})(),nt=function(t,e){var i=t.radius+e.radius;return s.Vec3.squaredDistance(t.center,e.center)<i*i},rt=(function(){var t=new s.Vec3;return function(e,i){return o.pt_point_aabb(t,e.center,i),s.Vec3.squaredDistance(e.center,t)<e.radius*e.radius}})(),st=(function(){var t=new s.Vec3;return function(e,i){return o.pt_point_obb(t,e.center,i),s.Vec3.squaredDistance(e.center,t)<e.radius*e.radius}})(),at={rayAabb:z,rayMesh:R,raycast:I,rayTriangle:D,ray_sphere:F,ray_aabb:B,ray_obb:V,ray_plane:M,ray_triangle:L,line_plane:O,line_triangle:P,line_quad:N,sphere_sphere:nt,sphere_aabb:rt,sphere_obb:st,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:J,obb_plane:K,obb_frustum:Q,obb_frustum_accurate:$,obb_point:Z,resolve:function(t,e,i){void 0===i&&(i=null);var n=t._type,r=e._type,s=this[n|r];return n<r?s(t,e,i):s(e,t,i)}};at[c.default.SHAPE_RAY|c.default.SHAPE_SPHERE]=F,at[c.default.SHAPE_RAY|c.default.SHAPE_AABB]=B,at[c.default.SHAPE_RAY|c.default.SHAPE_OBB]=V,at[c.default.SHAPE_RAY|c.default.SHAPE_PLANE]=M,at[c.default.SHAPE_RAY|c.default.SHAPE_TRIANGLE]=L,at[c.default.SHAPE_LINE|c.default.SHAPE_PLANE]=O,at[c.default.SHAPE_LINE|c.default.SHAPE_TRIANGLE]=P,at[c.default.SHAPE_SPHERE]=nt,at[c.default.SHAPE_SPHERE|c.default.SHAPE_AABB]=rt,at[c.default.SHAPE_SPHERE|c.default.SHAPE_OBB]=st,at[c.default.SHAPE_SPHERE|c.default.SHAPE_PLANE]=tt,at[c.default.SHAPE_SPHERE|c.default.SHAPE_FRUSTUM]=et,at[c.default.SHAPE_SPHERE|c.default.SHAPE_FRUSTUM_ACCURATE]=it,at[c.default.SHAPE_AABB]=U,at[c.default.SHAPE_AABB|c.default.SHAPE_OBB]=j,at[c.default.SHAPE_AABB|c.default.SHAPE_PLANE]=Y,at[c.default.SHAPE_AABB|c.default.SHAPE_FRUSTUM]=X,at[c.default.SHAPE_AABB|c.default.SHAPE_FRUSTUM_ACCURATE]=q,at[c.default.SHAPE_OBB]=J,at[c.default.SHAPE_OBB|c.default.SHAPE_PLANE]=K,at[c.default.SHAPE_OBB|c.default.SHAPE_FRUSTUM]=Q,at[c.default.SHAPE_OBB|c.default.SHAPE_FRUSTUM_ACCURATE]=$;var ot=at;i.default=ot,e.exports=i.default}),{"../../renderer/gfx":275,"../../renderer/memop/recycle-pool":290,"../value-types":248,"./aabb":135,"./distance":136,"./enums":137,"./ray":144,"./triangle":146}],141:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),s=(n=t("./enums"))&&n.__esModule?n:{default:n},a=(function(){function t(t,e,i,n,a,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=-1),this.s=void 0,this.e=void 0,this._type=void 0,this._type=s.default.SHAPE_LINE,this.s=new r.Vec3(t,e,i),this.e=new r.Vec3(n,a,o)}return t.create=function(e,i,n,r,s,a){return new t(e,i,n,r,s,a)},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,s,a){return t.s.x=e,t.s.y=i,t.s.z=n,t.e.x=r,t.e.y=s,t.e.z=a,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=a,e.exports=i.default}),{"../value-types":248,"./enums":137}],142:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),s=(n=t("./enums"))&&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,n.key,n)}}var o=new r.Vec3,c=new r.Vec3,u=new r.Mat3,l=(function(){function t(t,e,i,n,a,o,c,u,l,h,_,f,d,p,v){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===c&&(c=1),void 0===u&&(u=0),void 0===l&&(l=0),void 0===h&&(h=0),void 0===_&&(_=1),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===v&&(v=1),this.center=void 0,this.halfExtents=void 0,this.orientation=void 0,this._type=void 0,this._type=s.default.SHAPE_OBB,this.center=new r.Vec3(t,e,i),this.halfExtents=new r.Vec3(n,a,o),this.orientation=new r.Mat3(c,u,l,h,_,f,d,p,v)}t.create=function(e,i,n,r,s,a,o,c,u,l,h,_,f,d,p){return new t(e,i,n,r,s,a,o,c,u,l,h,_,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(o,e,i),.5),r.Vec3.multiplyScalar(t.halfExtents,r.Vec3.subtract(c,i,e),.5),r.Mat3.identity(t.orientation),t},t.set=function(t,e,i,n,s,a,o,c,u,l,h,_,f,d,p,v){return r.Vec3.set(t.center,e,i,n),r.Vec3.set(t.halfExtents,s,a,o),r.Mat3.set(t.orientation,c,u,l,h,_,f,d,p,v),t};var e,i,n=t.prototype;return n.getBoundary=function(t,e){var i,n,s,a,c;i=o,n=this.halfExtents,s=this.orientation,a=u.m,c=s.m,a[0]=Math.abs(c[0]),a[1]=Math.abs(c[1]),a[2]=Math.abs(c[2]),a[3]=Math.abs(c[3]),a[4]=Math.abs(c[4]),a[5]=Math.abs(c[5]),a[6]=Math.abs(c[6]),a[7]=Math.abs(c[7]),a[8]=Math.abs(c[8]),r.Vec3.transformMat3(i,n,u),r.Vec3.subtract(t,this.center,o),r.Vec3.add(e,this.center,o)},n.transform=function(t,e,i,n,s){r.Vec3.transformMat4(s.center,this.center,t),r.Mat3.fromQuat(s.orientation,i),r.Vec3.multiply(s.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}}])&&a(e.prototype,i),t})();i.default=l,e.exports=i.default}),{"../value-types":248,"./enums":137}],143:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),s=(n=t("./enums"))&&n.__esModule?n:{default:n},a=new r.Vec3(0,0,0),o=new r.Vec3(0,0,0),c=cc.mat4(),u=cc.v4(),l=(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=s.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(a,i,e),r.Vec3.subtract(o,n,e),r.Vec3.normalize(t.n,r.Vec3.cross(t.n,a,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(u,this.n.x,this.n.y,this.n.z,this.d),r.Vec4.transformMat4(u,u,c),r.Vec3.set(this.n,u.x,u.y,u.z),this.d=u.w},t})();i.default=l,e.exports=i.default}),{"../value-types":248,"./enums":137}],144:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),s=(n=t("./enums"))&&n.__esModule?n:{default:n},a=(function(){function t(t,e,i,n,a,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=-1),this.o=void 0,this.d=void 0,this._type=void 0,this._type=s.default.SHAPE_RAY,this.o=new r.Vec3(t,e,i),this.d=new r.Vec3(n,a,o)}return t.create=function(e,i,n,r,s,a){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=1),new t(e,i,n,r,s,a)},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,s,a){return t.o.x=e,t.o.y=i,t.o.z=n,t.d.x=r,t.d.y=s,t.d.z=a,t},t.prototype.computeHit=function(t,e){r.Vec3.normalize(t,this.d),r.Vec3.scaleAndAdd(t,this.o,t,e)},t})();i.default=a,e.exports=i.default}),{"../value-types":248,"./enums":137}],145:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types"),s=(n=t("./enums"))&&n.__esModule?n:{default:n},a=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=s.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(a,e,i),.5),t.radius=.5*r.Vec3.subtract(a,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,s){r.Vec3.transformMat4(s.center,this.center,t),s.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":248,"./enums":137}],146:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../value-types/vec3")),r=s(t("./enums"));function s(t){return t&&t.__esModule?t:{default:t}}var a=(function(){function t(t,e,i,s,a,o,c,u,l){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(s,a,o),this.c=new n.default(c,u,l),this._type=r.default.SHAPE_TRIANGLE}return t.create=function(e,i,n,r,s,a,o,c,u){return new t(e,i,n,r,s,a,o,c,u)},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,s,a,o,c,u){return t.a.x=e,t.a.y=i,t.a.z=n,t.b.x=r,t.b.y=s,t.b.z=a,t.c.x=o,t.c.y=c,t.c.z=u,t},t})();i.default=a,e.exports=i.default}),{"../value-types/vec3":258,"./enums":137}],147:[(function(t,e){"use strict";var i=t("../components/CCRenderComponent"),n=t("../assets/material/CCMaterial"),r=t("./types"),s=r.LineCap,a=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:a.MITER,_lineCap:s.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:a},lineCap:{get:function(){return this._lineCap},set:function(t){this._lineCap=t,this._impl.lineCap=t},type:s},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:a,LineCap:s},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,s){this._impl.bezierCurveTo(t,e,i,n,r,s)},quadraticCurveTo:function(t,e,i,n){this._impl.quadraticCurveTo(t,e,i,n)},arc:function(t,e,i,n,r,s){this._impl.arc(t,e,i,n,r,s)},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":77,"../components/CCRenderComponent":106,"./helper":148,"./types":150}],148:[(function(t,e){"use strict";var i=t("./types").PointFlags,n=Math.PI,r=Math.min,s=Math.max,a=Math.cos,o=Math.sin,c=Math.abs,u=Math.sign,l=.5522847493;e.exports={arc:function(t,e,i,u,l,h,_){var f,d,p,v=0,g=0,m=0,y=0,T=0,E=0,A=0,C=0,x=0,b=0,S=0,w=0,R=0;if(g=h-l,_=_||!1)if(c(g)>=2*n)g=2*n;else for(;g<0;)g+=2*n;else if(c(g)>=2*n)g=2*-n;else for(;g>0;)g-=2*n;for(p=0|s(1,r(c(g)/(.5*n)+.5,5)),m=c(4/3*(1-a(f=g/p/2))/o(f)),_||(m=-m),d=0;d<=p;d++)E=e+(y=a(v=l+g*(d/p)))*u,A=i+(T=o(v))*u,C=-T*u*m,x=y*u*m,0===d?t.moveTo(E,A):t.bezierCurveTo(b+w,S+R,E-C,A-x,E,A),b=E,S=A,w=C,R=x},ellipse:function(t,e,i,n,r){t.moveTo(e-n,i),t.bezierCurveTo(e-n,i+r*l,e-n*l,i+r,e,i+r),t.bezierCurveTo(e+n*l,i+r,e+n,i+r*l,e+n,i),t.bezierCurveTo(e+n,i-r*l,e+n*l,i-r,e,i-r),t.bezierCurveTo(e-n*l,i-r,e-n,i-r*l,e-n,i),t.close()},roundRect:function(t,e,i,n,s,a){if(a<.1)t.rect(e,i,n,s);else{var o=r(a,.5*c(n))*u(n),h=r(a,.5*c(s))*u(s);t.moveTo(e,i+h),t.lineTo(e,i+s-h),t.bezierCurveTo(e,i+s-h*(1-l),e+o*(1-l),i+s,e+o,i+s),t.lineTo(e+n-o,i+s),t.bezierCurveTo(e+n-o*(1-l),i+s,e+n,i+s-h*(1-l),e+n,i+s-h),t.lineTo(e+n,i+h),t.bezierCurveTo(e+n,i+h*(1-l),e+n-o*(1-l),i,e+n-o,i),t.lineTo(e+o,i),t.bezierCurveTo(e+o*(1-l),i,e,i+h*(1-l),e,i+h),t.close()}},tesselateBezier:function t(e,n,r,s,a,o,u,l,h,_,f){var d,p,v,g,m,y,T,E,A,C,x,b,S,w,R,I;_>10||(m=.5*(o+l),y=.5*(u+h),T=.5*((d=.5*(n+s))+(v=.5*(s+o))),E=.5*((p=.5*(r+a))+(g=.5*(a+u))),((R=c((s-l)*(w=h-r)-(a-h)*(S=l-n)))+(I=c((o-l)*w-(u-h)*S)))*(R+I)<e._tessTol*(S*S+w*w)?e._addPoint(l,h,0===f?f|i.PT_BEVEL:f):(t(e,n,r,d,p,T,E,x=.5*(T+(A=.5*(v+m))),b=.5*(E+(C=.5*(g+y))),_+1,0),t(e,x,b,A,C,m,y,l,h,_+1,f)))}}}),{"./types":150}],149:[(function(t){"use strict";t("./graphics")}),{"./graphics":147}],150:[(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}}),{}],151:[(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":25,"./CCPrivateNode":26,"./CCScene":27,"./assets":75,"./base-ui/CCWidgetManager":86,"./camera/CCCamera":87,"./collider":void 0,"./collider/CCIntersection":88,"./components":123,"./geom-utils":139,"./graphics":149,"./mesh":154,"./physics":void 0,"./platform":176}],152:[(function(t,e){"use strict";var i=s(t("../../renderer/core/input-assembler")),n=s(t("../../renderer/gfx")),r=t("./mesh-data");function s(t){return t&&t.__esModule?t:{default:t}}var a=t("../renderer"),o=t("../event/event-target");function c(t,e,i){t[e]=i._val}function u(t,e,i){t[e]=i.x,t[e+1]=i.y}function l(t,e,i){t[e]=i.x,t[e+1]=i.y,t[e+2]=i.z}var h,_={5120:"getInt8",5121:"getUint8",5122:"getInt16",5123:"getUint16",5124:"getInt32",5125:"getUint32",5126:"getFloat32"},f={5120:"setInt8",5121:"setUint8",5122:"setInt16",5123:"setUint16",5124:"setInt32",5125:"setUint32",5126:"setFloat32"},d=(h=new ArrayBuffer(2),new DataView(h).setInt16(0,256,!0),256===new Int16Array(h)[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 s=t[e],o=s.data,c=new Uint8Array(this._buffer,o.offset,o.length),u=this._vertexBundles[s.vertexBundleIndices[0]],l=u.data,h=new n.default.VertexFormat(u.formats),_=new Uint8Array(this._buffer,l.offset,l.length),f=this._canVertexFormatBatch(h),d=new r.MeshData;d.vData=_,d.iData=c,d.vfm=h,d.offset=l.offset,d.canBatch=f,this._subDatas.push(d);var p=new n.default.VertexBuffer(a.device,h,n.default.USAGE_STATIC,_),v=new n.default.IndexBuffer(a.device,s.indexUnit,n.default.USAGE_STATIC,c);this._subMeshes.push(new i.default(p,v))}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,s,o){void 0===s&&(s=!1),void 0===o&&(o=0);var c=new Uint8Array(t._bytes*e),u=new r.MeshData;u.vData=c,u.vfm=t,u.vDirty=!0,u.canBatch=this._canVertexFormatBatch(t);var l=new n.default.VertexBuffer(a.device,t,s?n.default.USAGE_DYNAMIC:n.default.USAGE_STATIC,c);u.vb=l,this._subMeshes[o]=new i.default(u.vb);var h=this._subDatas[o];h&&(h.vb&&h.vb.destroy(),h.ib&&h.ib.destroy()),this._subDatas[o]=u,this.loaded=!0,this.emit("load"),this.emit("init-format")},setVertices:function(t,e,i){i=i||0;var r=this._subDatas[i],s=r.vfm.element(t);if(!s)return cc.warn("Cannot find "+t+" attribute in vertex defines.");var a,o="number"==typeof e[0],h=s.num,_=o?e.length/h|0:e.length;r.vData.byteLength<_*s.stride&&r.setVData(new Uint8Array(_*r.vfm._bytes));var f=4;t===n.default.ATTR_COLOR?o?(a=r.getVData(),f=1):a=r.getVData(Uint32Array):a=r.getVData(Float32Array);var d=s.stride/f,p=s.offset/f;if(o)for(var v=0,g=e.length/h;v<g;v++)for(var m=v*h,y=v*d+p,T=0;T<h;T++)a[y+T]=e[m+T];else{var E;E=t===n.default.ATTR_COLOR?c:2===h?u:l;for(var A=0,C=e.length;A<C;A++)E(a,A*d+p,e[A])}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 s=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(a.device,n.default.INDEX_FMT_UINT16,s,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,s=n.vData;r.update(0,s),n.vDirty=!1}if(n.iDirty){var a=n.ib,o=n.iData;a.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 s=i.attrDatas,a=s[e];if(a)return a;a=s[e]=[];for(var o=i.vData,c=new DataView(o.buffer,o.byteOffset,o.byteLength),u=r.stride,l=r.offset,h=r.num,f=r.bytes/h,p=_[r.type],v=o.byteLength/n._bytes,g=0;g<v;g++)for(var m=g*u+l,y=0;y<h;y++){var T=c[p](m+y*f,d);a.push(T)}return a},copyAttribute:function(t,e,i,n,r){var s=!1,a=this._subDatas[t];if(!a)return s;var o=a.vfm,c=o.element(e);if(!c)return s;var u=f[c.type];if(!u)return s;var l=this._getAttrMeshData(t,e),h=a.vData.byteLength/o._bytes,_=c.bytes/c.num;if(l.length>0){for(var p=new DataView(i,r),v=n,g=c.num,m=0;m<h;++m)for(var y=m*g,T=0;T<g;++T){var E=y+T,A=v*m+_*T;p[u](A,l[E],d)}s=!0}return s},copyIndices:function(t,e){var i=this._subDatas[t];if(!i)return!1;for(var r=i.iData,s=r.length/2,a=new DataView(r.buffer,r.byteOffset,r.byteLength),o=_[n.default.INDEX_FMT_UINT8],c=0;c<s;++c)e[c]=a[o](2*c);return!0}});cc.Mesh=e.exports=p}),{"../../renderer/core/input-assembler":265,"../../renderer/gfx":275,"../event/event-target":131,"../renderer":189,"./mesh-data":155}],153:[(function(t,e){"use strict";var i=s(t("../../renderer/gfx")),n=(s(t("../../renderer/core/input-assembler")),s(t("../geom-utils/aabb"))),r=(s(t("../value-types/vec3")),s(t("../value-types/mat4")),s(t("../assets/material/material-variant")));function s(t){return t&&t.__esModule?t:{default:t}}var a=t("../components/CCRenderComponent"),o=t("./CCMesh"),c=t("../renderer/render-flow"),u=(t("../renderer"),t("../assets/material/CCMaterial")),l=cc.Enum({OFF:0,ON:1}),h=cc.Class({name:"cc.MeshRenderer",extends:a,editor:!1,properties:{_mesh:{default:null,type:o},_receiveShadows:!1,_shadowCastingMode:l.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:l,animatable:!1},enableAutoBatch:{get:function(){return this._enableAutoBatch},set:function(t){this._enableAutoBatch=t}}},statics:{ShadowCastingMode:l},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 u.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===l.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,s=e[n];s.define("CC_USE_ATTRIBUTE_COLOR",!!r.element(i.default.ATTR_COLOR),void 0,!0),s.define("CC_USE_ATTRIBUTE_UV0",!!r.element(i.default.ATTR_UV0),void 0,!0),s.define("CC_USE_ATTRIBUTE_NORMAL",!!r.element(i.default.ATTR_NORMAL),void 0,!0),s.define("CC_USE_ATTRIBUTE_TANGENT",!!r.element(i.default.ATTR_TANGENT),void 0,!0)}},_checkBacth:function(){}});cc.MeshRenderer=e.exports=h}),{"../../renderer/core/input-assembler":265,"../../renderer/gfx":275,"../assets/material/CCMaterial":77,"../assets/material/material-variant":84,"../components/CCRenderComponent":106,"../geom-utils/aabb":135,"../renderer":189,"../renderer/render-flow":190,"../value-types/mat4":250,"../value-types/vec3":258,"./CCMesh":152}],154:[(function(t){"use strict";t("./CCMesh"),t("./CCMeshRenderer"),t("./mesh-renderer")}),{"./CCMesh":152,"./CCMeshRenderer":153,"./mesh-renderer":156}],155:[(function(t,e,i){"use strict";i.__esModule=!0,i.MeshData=u,i.Primitive=i.VertexBundle=i.VertexFormat=i.BufferRange=void 0;var n,r=(n=t("../../renderer/gfx"))&&n.__esModule?n:{default:n},s=cc.Class({name:"cc.BufferRange",properties:{offset:0,length:0}});i.BufferRange=s;var a=cc.Class({name:"cc.mesh.VertexFormat",properties:{name:"",type:-1,num:-1,normalize:!1}});i.VertexFormat=a;var o=cc.Class({name:"cc.mesh.VertexBundle",properties:{data:{default:null,type:s},formats:{default:[],type:a},verticesCount:0}});i.VertexBundle=o;var c=cc.Class({name:"cc.mesh.Primitive",properties:{vertexBundleIndices:{default:[],type:cc.Float},data:{default:null,type:s},indexUnit:r.default.INDEX_FMT_UINT16,topology:r.default.PT_TRIANGLES}});function u(){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,u.prototype.setVData=function(t){this.vData=t,this.float32VData=null,this.uint32VData=null},u.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},u.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":275}],156:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../renderer/assembler")),r=a(t("../../renderer/gfx")),s=a(t("../value-types/vec3"));function a(t){return t&&t.__esModule?t:{default:t}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=t("./CCMeshRenderer"),u=new s.default,l=(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 a=n.prototype;return a.init=function(e){t.prototype.init.call(this,e),this._worldDatas={},this._renderNode=null},a.setRenderNode=function(t){this._renderNode=t},a.fillBuffers=function(t,e){if(t.mesh){t.mesh._uploadData();for(var i=e.cullingMask===t.node._cullingMask,n=t.enableAutoBatch,s=t._materials,a=t.mesh._subMeshes,o=t.mesh.subDatas,c=0;c<a.length;c++){var u=a[c],l=o[c],h=s[c]||s[0];n&&l.canBatch&&u._primitiveType===r.default.PT_TRIANGLES?(i&&h.getHash()===e.material.getHash()||e._flush(),e.material=h,e.cullingMask=t.node._cullingMask,e.node=e._dummyNode,this._fillBuffer(t,l,e,c)):(e._flush(),e.material=h,e.cullingMask=t.node._cullingMask,e.node=this._renderNode,e._flushIA(u))}}},a._fillBuffer=function(t,e,i,n){var r=e.getVData(Float32Array),s=e.vfm,a=r.byteLength/s._bytes|0,o=e.getIData(Uint16Array),c=o.length,u=i.getBuffer("mesh",s),l=u.request(a,c),h=l.indiceOffset,_=l.byteOffset>>2,f=l.vertexOffset,d=u._vData,p=u._iData;!i.worldMatDirty&&this._worldDatas[n]||this._updateWorldVertices(n,a,r,s,t.node._worldMatrix),d.set(this._worldDatas[n],_);for(var v=0;v<c;v++)p[h+v]=f+o[v]},a._updateWorldVertices=function(t,e,i,n,a){var o=this._worldDatas[t];o||(o=this._worldDatas[t]=new Float32Array(i.length)).set(i);for(var c=n._bytes/4,l=n._elements,h=0,_=l.length;h<_;h++){var f=l[h],d=f.offset/4;if(f.name===r.default.ATTR_POSITION||f.name===r.default.ATTR_NORMAL)for(var p=f.name===r.default.ATTR_NORMAL?s.default.transformMat4Normal:s.default.transformMat4,v=0;v<e;v++){var g=v*c+d;u.x=i[g],u.y=i[g+1],u.z=i[g+2],p(u,u,a),o[g]=u.x,o[g+1]=u.y,o[g+2]=u.z}}},a._drawDebugDatas=function(t,e,i){var n=t._debugDatas[i];if(n)for(var r=0;r<n.length;r++){var s=n[r];if(s){var a=s.material;e.material=a,e._flushIA(s.ia)}}},n})(n.default);i.default=l,n.default.register(c,l),e.exports=i.default}),{"../../renderer/gfx":275,"../renderer/assembler":186,"../value-types/vec3":258,"./CCMeshRenderer":153}],157:[(function(t,e){"use strict";var i=t("./component-scheduler"),n=t("./platform/CCObject").Flags,r=t("./platform/js"),s=n.IsPreloadStarted,a=n.IsOnLoadStarted,o=n.IsOnLoadCalled,c=n.Deactivating,u=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}}),l=i.createInvokeImpl("c.__preload();"),h=i.createInvokeImpl("c.onLoad();c._objFlags|="+o,!1,o),_=new r.Pool(4);function f(t,e,i){e?t._removeComponent(e):r.array.removeAt(t._components,i)}function d(){this._activatingStack=[]}_.get=function(){var t=this._get()||{preload:new u(l),onLoad:new i.OneOffInvoker(h),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,s=0;s<r;++s){var a=t._components[s];a instanceof cc.Component?this.activateComp(a,e,i,n):(f(t,a,s),--s,--r)}t._childArrivalOrder=t._children.length;for(var o=0,u=t._children.length;o<u;++o){var l=t._children[o];l._localZOrder=4294901760&l._localZOrder|o+1,l._active&&this._activateNodeRecursively(l,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,s=t._children.length;r<s;++r){var a=t._children[r];if(a._activeInHierarchy&&(this._deactivateNodeRecursively(a),t._activeInHierarchy))return void(t._objFlags&=~c)}t._onPostActivated(!1),t._objFlags&=~c},activateNode:function(t,e){if(e){var i=_.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(),_.put(i)}else{this._deactivateNodeRecursively(t);for(var n=this._activatingStack,r=0;r<n.length;r++){var o=n[r];o.preload.cancelInactive(s),o.onLoad.cancelInactive(a),o.onEnable.cancelInactive()}}t.emit("active-in-hierarchy-changed",t)},activateComp:function(t,e,i,n){if(cc.isValid(t,!0)&&(t._objFlags&s||(t._objFlags|=s,t.__preload&&(e?e.add(t):t.__preload())),t._objFlags&a||(t._objFlags|=a,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":89,"./platform/CCObject":164,"./platform/js":179,"./utils/misc":233}],158:[(function(t,e){"use strict";var i=t("./js"),n=t("./CCEnum"),r=t("./utils"),s=(r.isPlainEmptyObj_DEV,r.cloneable_DEV,t("./attribute")),a=s.DELIMETER,o=t("./preprocess-class");t("./requiring-frame");var c=["name","extends","mixins","ctor","__ctor__","properties","statics","editor","__ES6__"];function u(t,e){t.indexOf(e)<0&&t.push(e)}var l={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,s=n.props;"function"==typeof s&&(s=s());var a=i.getClassName(r);s?w(r,a,s,r.$super,n.mixins):cc.errorID(3633,a)}this.datas=null}}};function h(t,e){u(t.__props__,e)}function _(t,e,i,n){var r=n.default;s.setClassAttr(t,i,"default",r),h(t,i),M(t,n,0,i)}function f(t,e,n,r,a){var o=r.get,c=r.set,u=t.prototype,l=!Object.getOwnPropertyDescriptor(u,n);o&&(M(t,r,0,n),s.setClassAttr(t,n,"serializable",!1),a||i.get(u,n,o,l,l)),c&&(a||i.set(u,n,c,l,l))}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 v(t,e,n,r){var a,o,c=r.__ctor__,u=r.ctor,l=r.__ES6__;l?(a=[u],o=u):(a=c?[c]:x(e,n,r),o=C(a,e,t,r),i.value(o,"extend",(function(t){return t.extends=this,R(t)}),!0)),i.value(o,"__ctors__",a.length>0?a:null,!0);var h=o.prototype;if(e&&(l||(i.extend(o,e),h=o.prototype),o.$super=e),n){for(var _=n.length-1;_>=0;_--){var f=n[_];p(h,f.prototype),p(o,f,(function(t){return f.hasOwnProperty(t)&&!0})),R._isCCClass(f)&&p(s.getClassAttrs(o),s.getClassAttrs(f))}h.constructor=o}return l||(h.__initProps__=A),i.setClassName(t,o),o}function g(t,e,n,r){var s=cc.Component,a=cc._RF.peek();if(a&&i.isChildClassOf(e,s)){if(i.isChildClassOf(a.cls,s))return cc.errorID(3615),null;t=t||a.script}var o=v(t,e,n,r);if(a)if(i.isChildClassOf(e,s)){var c=a.uuid;c&&i._setClassId(c,o),a.cls=o}else i.isChildClassOf(a.cls,s)||(a.cls=o);return o}function m(t){for(var e=i.getClassName(t),n=t.constructor,r="new "+e+"(",s=0;s<n.__props__.length;s++){r+=t[n.__props__[s]],s<n.__props__.length-1&&(r+=",")}return r+")"}function y(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function T(t,e){for(var i=[],n="",r=0;r<e.length;r++){var s=e[r],o=s+a+"default";if(o in t){var c,u;c=E.test(s)?"this."+s+"=":"this["+y(s)+"]=";var l=t[o];if("object"==typeof l&&l)u=l instanceof cc.ValueType?m(l):Array.isArray(l)?"[]":"{}";else if("function"==typeof l){var h=i.length;i.push(l),u="F["+h+"]()"}else u="string"==typeof l?y(l):l;n+=c=c+u+";\n"}}return 0===i.length?Function(n):Function("F","return (function(){\n"+n+"})")(i)}var E=/^[A-Za-z_$][0-9A-Za-z_$]*$/;function A(t){var e=s.getClassAttrs(t),i=t.__props__;null===i&&(l.init(),i=t.__props__);var n=T(e,i);t.prototype.__initProps__=n,n.call(this)}var C=function(t,e,i,n){var r="return function CCClass(){\n";e&&S(e,n)&&(r+="this._super=null;\n"),r+="this.__initProps__(CCClass);\n";var s=t.length;if(s>0){var a="].apply(this,arguments);\n";if(1===s)r+="CCClass.__ctors__[0"+a;else{r+="var cs=CCClass.__ctors__;\n";for(var o=0;o<s;o++)r+="cs["+o+a}}return r+="}",Function(r)()};function x(t,e,i){for(var n,r=[],s=[t].concat(e),a=0;a<s.length;a++){var o=s[a];if(o)for(var c=(n=o,R._isCCClass(n)?n.__ctors__||[]:[n]),l=0;l<c.length;l++)u(r,c[l])}var h=i.ctor;return h&&r.push(h),r}var b=/xyz/.test((function(){xyz}))?/\b\._super\b/:/.*/;function S(t,e){var n=!1;for(var r in e)if(!(c.indexOf(r)>=0)){var s=e[r];if("function"==typeof s){var a=i.getPropertyDescriptor(t.prototype,r);if(a){var o=a.value;if("function"==typeof o){b.test(s)&&(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,s));continue}}}}return n}function w(t,e,i,n,r,c){if(t.__props__=[],n&&n.__props__&&(t.__props__=n.__props__.slice()),r)for(var u=0;u<r.length;++u){var l=r[u];l.__props__&&(t.__props__=t.__props__.concat(l.__props__.filter((function(e){return t.__props__.indexOf(e)<0}))))}if(i)for(var h in o.preprocessAttrs(i,e,t,c),i){var d=i[h];"default"in d?_(t,0,h,d):f(t,0,h,d,c)}var p=s.getClassAttrs(t);t.__values__=t.__props__.filter((function(t){return!1!==p[t+a+"serializable"]}))}function R(t){var e=(t=t||{}).name,n=t.extends,r=t.mixins,s=g(e,n,r,t);e||(e=cc.js.getClassName(s)),s._sealed=!0,n&&(n._sealed=!1);var a=t.properties;"function"==typeof a||n&&null===n.__props__||r&&r.some((function(t){return null===t.__props__}))?(l.push({cls:s,props:a,mixins:r}),s.__props__=s.__values__=null):w(s,e,a,n,t.mixins,t.__ES6__);var u,h=t.statics;if(h)for(u in h)s[u]=h[u];for(var _ in t)if(!(c.indexOf(_)>=0)){var f=t[_];o.validateMethodWithProps(f,_,e,s,n)&&i.value(s.prototype,_,f,!0,!0)}var d=t.editor;return d&&cc.Component._registerEditorProps(s,d),s}/xyz/.test((function(){xyz})),R._isCCClass=function(t){return t&&t.hasOwnProperty("__ctors__")},R._fastDefine=function(t,e,n){i.setClassName(t,e);for(var r=e.__props__=e.__values__=Object.keys(n),o=s.getClassAttrs(e),c=0;c<r.length;c++){var u=r[c];o[u+a+"visible"]=!1,o[u+a+"default"]=n[u]}},R.Attr=s,R.attr=s.attr,R.getInheritanceChain=function(t){for(var e=[];t=i.getSuper(t);)t!==Object&&e.push(t);return e};var I={Integer:"Number",Float:"Number",Boolean:"Boolean",String:"String"};function M(t,e,i,r){var o=null,c="";function u(){return c=r+a,o=s.getClassAttrs(t)}var l=e.type;l&&(I[l]?(o||u())[c+"type"]=l:"Object"===l||(l===s.ScriptUuid?((o||u())[c+"type"]="Script",o[c+"ctor"]=cc.ScriptAsset):"object"==typeof l?n.isEnum(l)&&((o||u())[c+"type"]="Enum",o[c+"enumList"]=n.getList(l)):"function"==typeof l&&((o||u())[c+"type"]="Object",o[c+"ctor"]=l)));function h(t,i){if(t in e){var n=e[t];typeof n===i&&((o||u())[c+t]=n)}}e.editorOnly&&((o||u())[c+"editorOnly"]=!0),!1===e.serializable&&((o||u())[c+"serializable"]=!1),h("formerlySerializedAs","string");var _=e.range;_&&Array.isArray(_)&&_.length>=2&&((o||u())[c+"min"]=_[0],o[c+"max"]=_[1],_.length>2&&(o[c+"step"]=_[2])),h("min","number"),h("max","number"),h("step","number"),h("userData","object")}cc.Class=R,e.exports={isArray:function(t){return t=d(t),Array.isArray(t)},fastDefine:R._fastDefine,getNewValueTypeCode:m,IDENTIFIER_RE:E,escapeForJS:y,getDefault:d}}),{"./CCEnum":160,"./attribute":170,"./js":179,"./preprocess-class":180,"./requiring-frame":181,"./utils":182}],159:[(function(t,e){"use strict";t("./CCClass");var i=t("./preprocess-class"),n=t("./js"),r="__ccclassCache__";function s(t){return t}function a(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 u=c.bind(null,!1);function l(){return c.bind(null,!1)}var h=l(),_=l();function f(t){return a(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 v(t,e,r,s,a,o){var c,u=a&&(a.get||a.set);s&&(c=i.getFullFormOfProperty(s,u));var l=e[r],h=n.mixin(l||{},c||s||{});if(u)a.get&&(h.get=a.get),a.set&&(h.set=a.set);else{var _=void 0;if(a)a.initializer&&(_=d(a.initializer));else{var f=o.default||(o.default=p(t));f.hasOwnProperty(r)&&(_=f[r])}h.default=_}e[r]=h}var g=o((function(t,e){var i=n.getSuper(t);i===Object&&(i=null);var s={name:e,extends:i,ctor:t,__ES6__:!0},a=t[r];if(a){var o=a.proto;o&&n.mixin(s,o),t[r]=void 0}return cc.Class(s)}));function m(t,e,i){return t((function(t,n){var r=f(t);if(r){var s=void 0!==i?i:n,o=a(r,"proto");a(o,"editor")[e]=s}}),e)}function y(t){return t(s)}var T=y(o),E=m(u,"requireComponent"),A=y(h),C=m(_,"executionOrder"),x=y(o),b=y(o),S=y(h),w=y(h),R=y(h);cc._decorator=e.exports={ccclass:g,property:function(t,e,i){var n=null;function r(t,e,i){var r=f(t.constructor);if(r){var s=a(r,"proto"),o=a(s,"properties");v(t.constructor,o,e,n,i,r)}}if(void 0===e)return n=t,r;r(t,e,i)},executeInEditMode:T,requireComponent:E,menu:A,executionOrder:C,disallowMultiple:x,playOnFocus:b,inspector:S,icon:w,help:R,mixins:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var i=f(e);i&&(a(i,"proto").mixins=t)}}}}),{"./CCClass":158,"./js":179,"./preprocess-class":180,"./utils":182}],160:[(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 s=n[r],a=t[s];if(-1===a)a=++e,t[s]=a;else if("number"==typeof a)e=a;else if("string"==typeof a&&Number.isInteger(parseFloat(s)))continue;var o=""+a;s!==o&&i.value(t,o,s)}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":179}],161:[(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,s,a=e._acceleration;if(e._accelDeviceEvent===window.DeviceMotionEvent){var o=t.accelerationIncludingGravity;n=e._accelMinus*o.x*.1,r=e._accelMinus*o.y*.1,s=.1*o.z}else n=t.gamma/90*.981,r=-t.beta/90*.981,s=t.alpha/90*.981;if(cc.view._isRotated){var c=n;n=-r,r=c}a.x=n,a.y=r,a.z=s,a.timestamp=t.timeStamp||Date.now();var u=a.x;90===i.orientation?(a.x=-a.y,a.y=u):-90===i.orientation?(a.x=a.y,a.y=-u):180===i.orientation&&(a.x=-a.x,a.y=-a.y),cc.sys.os===cc.sys.OS_ANDROID&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_MOBILE_QQ&&(a.x=-a.x,a.y=-a.y)}}}),{"../event-manager":129,"./CCInputManager":162}],162:[(function(t,e){"use strict";var i=t("./CCMacro"),n=t("./CCSys"),r=t("../event-manager"),s=i.TOUCH_TIMEOUT,a=cc.v2(),o={_mousePressed:!1,_isRegisterEvent:!1,_preTouchPoint:cc.v2(0,0),_prevMousePoint:cc.v2(0,0),_preTouchPool:[],_preTouchPoolPointer:0,_touches:[],_touchesIntegerDict:{},_indexBitsUsed:0,_maxTouches:8,_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=this._indexBitsUsed,e=cc.sys.now(),i=0;i<this._maxTouches;i++){if(!(1&t))return this._indexBitsUsed|=1<<i,i;var n=this._touches[i];if(e-n._lastModified>s)return this._removeUsedIndexBit(i),delete this._touchesIntegerDict[n.getID()],i;t>>=1}return-1},_removeUsedIndexBit:function(t){if(!(t<0||t>=this._maxTouches)){var e=1<<t;e=~e,this._indexBitsUsed&=e}},_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 s=t.getBoundingClientRect();e.left=s.left+n,e.top=s.top+r,e.width=s.width,e.height=s.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,s,a=[],o=this._touchesIntegerDict,c=n.now(),u=0,l=t.length;u<l;u++)if(null==o[s=(e=t[u]).getID()]){var h=this._getUnUsedIndex();if(-1===h){cc.logID(2300,h);continue}(i=this._touches[h]=new cc.Touch(e._point.x,e._point.y,e.getID()))._lastModified=c,i._setPrevPoint(e._prevPoint),o[s]=h,a.push(i)}if(a.length>0){this._glView._convertTouchesWithScale(a);var _=new cc.Event.EventTouch(a);_._eventCode=cc.Event.EventTouch.BEGAN,r.dispatchEvent(_)}},handleTouchesMove:function(t){for(var e,i,s,a=[],o=this._touches,c=n.now(),u=0,l=t.length;u<l;u++)s=(e=t[u]).getID(),null!=(i=this._touchesIntegerDict[s])&&o[i]&&(o[i]._setPoint(e._point),o[i]._setPrevPoint(e._prevPoint),o[i]._lastModified=c,a.push(o[i]));if(a.length>0){this._glView._convertTouchesWithScale(a);var h=new cc.Event.EventTouch(a);h._eventCode=cc.Event.EventTouch.MOVED,r.dispatchEvent(h)}},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=[],s=this._touches,a=this._touchesIntegerDict,o=0,c=t.length;o<c;o++)null!=(i=a[n=(e=t[o]).getID()])&&s[i]&&(s[i]._setPoint(e._point),s[i]._setPrevPoint(e._prevPoint),r.push(s[i]),this._removeUsedIndexBit(i),delete a[n]);return r},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),s=new cc.Touch(r.x,r.y,0);return s._setPrevPoint(n.x,n.y),n.x=r.x,n.y=r.y,s},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,u=this._preTouchPoint,l=t.changedTouches.length,h=0;h<l;h++)if(i=t.changedTouches[h]){var _;_=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(_.x,_.y,i.identifier),s=this.getPreTouch(r).getLocation(),r._setPrevPoint(s.x,s.y),this.setPreTouch(r)):(r=new cc.Touch(_.x,_.y))._setPrevPoint(u.x,u.y),u.x=_.x,u.y=_.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 s=n.isMobile,a="mouse"in n.capabilities,o="touches"in n.capabilities;if(a){s||(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 s=e.getMouseEvent(n,i,cc.Event.EventMouse.UP);s.setButton(t.button),r.dispatchEvent(s)}}}),!1));for(var c=cc.Event.EventMouse,u=[!s&&["mousedown",c.DOWN,function(i,n,r,s){e._mousePressed=!0,e.handleTouchesBegin([e.getTouchByXY(r.x,r.y,s)]),t.focus()}],!s&&["mouseup",c.UP,function(t,i,n,r){e._mousePressed=!1,e.handleTouchesEnd([e.getTouchByXY(n.x,n.y,r)])}],!s&&["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)}]],l=0;l<u.length;++l){var h=u[l];h&&(function(){var n=h[0],s=h[1],a=h[2];t.addEventListener(n,(function(t){var n=e.getPointByEvent(t,i),o=e.getMouseEvent(n,i,s);o.setButton(t.button),a(t,o,n,i),r.dispatchEvent(o),t.stopPropagation(),t.preventDefault()}),!1)})()}}if(window.navigator.msPointerEnabled){var _={MSPointerDown:e.handleTouchesBegin,MSPointerMove:e.handleTouchesMove,MSPointerUp:e.handleTouchesEnd,MSPointerCancel:e.handleTouchesCancel},f=function(n){var r=_[n];t.addEventListener(n,(function(t){var n=document.documentElement;i.adjustedLeft=i.left-n.scrollLeft,i.adjustedTop=i.top-n.scrollTop,r.call(e,[e.getTouchByXY(t.clientX,t.clientY,i)]),t.stopPropagation()}),!1)};for(var d in _)f(d)}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)}},v=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 g in p)v(g)}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=o}),{"../event-manager":129,"./CCMacro":163,"./CCSys":167}],163:[(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=[".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}),{}],164:[(function(t,e){"use strict";var i=t("./js"),n=t("./CCClass"),r=1;function s(){this._name="",this._objFlags=0}n.fastDefine("cc.Object",s,{_name:"",_objFlags:0}),i.value(s,"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 a=[];i.value(s,"_deferredDestroy",(function(){for(var t=a.length,e=0;e<t;++e){var i=a[e];i._objFlags&r||i._destroyImmediate()}t===a.length?a.length=0:a.splice(0,t)}));var o=s.prototype;function c(t,e){var i,r=t instanceof cc._BaseNode||t instanceof cc.Component,s=r?"_id":null,a={};for(i in t)if(t.hasOwnProperty(i)){if(i===s)continue;switch(typeof t[i]){case"string":a[i]="";break;case"object":case"function":a[i]=null}}if(cc.Class._isCCClass(e))for(var o=cc.Class.Attr.getClassAttrs(e),c=e.__props__,u=0;u<c.length;u++){var l=(i=c[u])+cc.Class.Attr.DELIMETER+"default";if(l in o){if(r&&"_id"===i)continue;switch(typeof o[l]){case"string":a[i]="";break;case"object":case"function":a[i]=null;break;case"undefined":a[i]=void 0}}}var h="";for(i in a){var _;_=n.IDENTIFIER_RE.test(i)?"o."+i+"=":"o["+n.escapeForJS(i)+"]=";var f=a[i];""===f&&(f='""'),h+=_+f+";\n"}return Function("o",h)}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,a.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=s}),{"./CCClass":158,"./js":179}],165:[(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,s=i.childNodes.length;r<s&&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 s=t.childNodes[n];1===s.nodeType&&("key"===s.tagName?i=s.firstChild.nodeValue:e[i]=this._parseNode(s))}return e}}),cc.saxParser=new cc.SAXParser,cc.plistParser=new cc.PlistParser,e.exports={saxParser:cc.saxParser,plistParser:cc.plistParser}}),{"../platform/js":179}],166:[(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 s=t[this._fn.requestFullscreen]();void 0===document[this._fn.fullscreenerror]&&window.Promise&&s instanceof Promise&&s.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,s=this._touchEvent;function a(){i._preOnFullScreenError=null,i._preOnTouch&&n.removeEventListener(s,i._preOnTouch),i._preOnTouch=function(){i._preOnTouch=null,i.requestFullScreen(t,e)},n.addEventListener(s,i._preOnTouch,{once:!0})}this._preOnFullScreenError&&t.removeEventListener(r,this._preOnFullScreenError),this._preOnFullScreenError=a,t.addEventListener(r,a,{once:!0})}},cc.screen.init()}),{}],167:[(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_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.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.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,s=r.navigator,a=document,o=a.documentElement,c=s.userAgent.toLowerCase();n.isMobile=/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;var u=s.language;u=u||s.browserLanguage,n.languageCode=u.toLowerCase(),u=u?u.split("-")[0]:n.LANGUAGE_ENGLISH,n.language=u;var l=!1,h=!1,_="",f=0,d=/android\s*(\d+(?:\.\d+)*)/i.exec(c)||/android\s*(\d+(?:\.\d+)*)/i.exec(s.platform);d&&(l=!0,_=d[1]||"",f=parseInt(_)||0),(d=/(iPad|iPhone|iPod).*OS ((\d+_?){2,3})/i.exec(c))?(h=!0,_=d[2]||"",f=parseInt(_)||0):(/(iPhone|iPad|iPod)/.exec(s.platform)||"MacIntel"===s.platform&&s.maxTouchPoints&&s.maxTouchPoints>1)&&(h=!0,_="",f=0);var p=n.OS_UNKNOWN;-1!==s.appVersion.indexOf("Win")?p=n.OS_WINDOWS:h?p=n.OS_IOS:-1!==s.appVersion.indexOf("Mac")?p=n.OS_OSX:-1!==s.appVersion.indexOf("X11")&&-1===s.appVersion.indexOf("Linux")?p=n.OS_UNIX:l?p=n.OS_ANDROID:-1===s.appVersion.indexOf("Linux")&&-1===c.indexOf("ubuntu")||(p=n.OS_LINUX),n.os=p,n.osVersion=_,n.osMainVersion=f,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&&l?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 v=window.innerWidth||document.documentElement.clientWidth,g=window.innerHeight||document.documentElement.clientHeight,m=window.devicePixelRatio||1;n.windowPixelResolution={width:m*v,height:m*g},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(R){var E=function(){cc.warnID(5200)};n.localStorage={getItem:E,setItem:E,removeItem:E,clear:E}}var A=y.toDataURL("image/webp").startsWith("data:image/webp"),C=!!y.getContext("2d"),x=!1;r.WebGLRenderingContext&&(x=!0);var b,S=n.capabilities={canvas:C,opengl:x,webp:A,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!==a.ontouchstart||s.msPointerEnabled)&&(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);b={ONLY_ONE:!1,WEB_AUDIO:t,DELAY_CREATE_CTX:!1},n.os===n.OS_IOS&&(b.USE_LOADER_EVENT="loadedmetadata"),n.browserType===n.BROWSER_TYPE_FIREFOX&&(b.DELAY_CREATE_CTX=!0,b.USE_LOADER_EVENT="canplay"),n.os===n.OS_ANDROID&&n.browserType===n.BROWSER_TYPE_UC&&(b.ONE_SOURCE=!0)})();try{b.WEB_AUDIO&&(b.context=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext),b.DELAY_CREATE_CTX&&setTimeout((function(){b.context=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext)}),0))}catch(I){b.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")),b.format=w,n.__audioSupport=b}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}),{}],168:[(function(t,e){"use strict";var i=t("../event/event-target"),n=t("../platform/js"),r=t("../renderer");t("../platform/CCClass");var s={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&&(s.adaptationType=cc.sys.BROWSER_TYPE_SAFARI),s.adaptationType){case cc.sys.BROWSER_TYPE_SAFARI:case cc.sys.BROWSER_TYPE_SOUGOU:case cc.sys.BROWSER_TYPE_UC:s.meta["minimal-ui"]="true",s.availWidth=function(t){return t.clientWidth},s.availHeight=function(t){return t.clientHeight}}var a=null,o=function(){i.call(this);var t=this,e=cc.ContainerStrategy,n=cc.ContentStrategy;s.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,s=e._isRotated;if(cc.sys.isMobile){var a=cc.game.container.style,o=a.margin;a.margin="0",a.display="none",e._initFrameSize(),a.margin=o,a.display="block"}else e._initFrameSize();if(!0===t||e._isRotated!==s||e._frameSize.width!==n||e._frameSize.height!==r){var c=e._originalDesignResolutionSize.width,u=e._originalDesignResolutionSize.height;e._resizing=!0,c>0&&e.setDesignResolutionSize(c,u,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(),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=s.availWidth(cc.game.frame),i=s.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,s,a=document.getElementsByName("viewport"),o=a?a[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&&(s=new RegExp(r+"s*=s*[^,]+"),n=n.replace(s,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(s.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 s=n.apply(this,this._designResolutionSize);if(s.scale&&2===s.scale.length&&(this._scaleX=s.scale[0],this._scaleY=s.scale[1]),s.viewport){var a=this._viewportRect,o=this._visibleRect,c=s.viewport;a.x=c.x,a.y=c.y,a.width=c.width,a.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,s=this._scaleY;cc.game._renderContext.viewport(t*r+this._viewportRect.x,e*s+this._viewportRect.y,i*r,n*s)},setScissorInPoints:function(t,e,i,n){var r=this._scaleX,s=this._scaleY,o=Math.ceil(t*r+this._viewportRect.x),c=Math.ceil(e*s+this._viewportRect.y),u=Math.ceil(i*r),l=Math.ceil(n*s),h=cc.game._renderContext;if(!a){var _=h.getParameter(h.SCISSOR_BOX);a=cc.rect(_[0],_[1],_[2],_[3])}a.x===o&&a.y===c&&a.width===u&&a.height===l||(a.x=o,a.y=c,a.width=u,a.height=l,h.scissor(o,c,u,l))},isScissorEnabled:function(){return cc.game._renderContext.isEnabled(gl.SCISSOR_TEST)},getScissorRect:function(){if(!a){var t=gl.getParameter(gl.SCISSOR_BOX);a=cc.rect(t[0],t[1],t[2],t[3])}var e=1/this._scaleX,i=1/this._scaleY;return cc.rect((a.x-this._viewportRect.x)*e,(a.y-this._viewportRect.y)*i,a.width*e,a.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(),s=i.adjustedLeft?i.adjustedLeft:i.left,a=i.adjustedTop?i.adjustedTop:i.top,o=this._devicePixelRatio*(t-s),c=this._devicePixelRatio*(a+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,s=this._scaleX,a=this._scaleY,o=0;o<t.length;o++)i=(e=t[o])._point,n=e._prevPoint,i.x=(i.x-r.x)/s,i.y=(i.y-r.y)/a,n.x=(n.x-r.x)/s,n.y=(n.y-r.y)/a}}),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,s){Math.abs(t-i)<2&&(i=t),Math.abs(e-n)<2&&(n=e);var a=cc.rect((t-i)/2,(e-n)/2,i,n);return cc.game.renderType,cc.game.RENDER_TYPE_CANVAS,this._result.scale=[r,s],this._result.viewport=a,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,s=t._frameSize.height,a=cc.game.container.style,o=e.width,c=e.height,u=r/o,l=s/c;u<l?(i=r,n=c*u):(i=o*l,n=s);var h=Math.round((r-i)/2),_=Math.round((s-n)/2);i=r-2*h,n=s-2*_,this._setupContainer(t,i,n),t._isRotated?a.margin="0 0 0 "+s+"px":a.margin="0px",a.paddingLeft=h+"px",a.paddingRight=h+"px",a.paddingTop=_+"px",a.paddingBottom=_+"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,s=n/e.height;return this._buildResult(i,n,i,n,r,s)}}),s=cc.Class({name:"ShowAll",extends:cc.ContentStrategy,apply:function(t,e){var i,n,r=cc.game.canvas.width,s=cc.game.canvas.height,a=e.width,o=e.height,c=r/a,u=s/o,l=0;return c<u?(i=r,n=o*(l=c)):(i=a*(l=u),n=s),this._buildResult(r,s,i,n,l,l)}}),a=cc.Class({name:"NoBorder",extends:cc.ContentStrategy,apply:function(t,e){var i,n,r,s=cc.game.canvas.width,a=cc.game.canvas.height,o=e.width,c=e.height,u=s/o,l=a/c;return u<l?(n=o*(i=l),r=a):(n=s,r=c*(i=u)),this._buildResult(s,a,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,s=i,a=n;return this._buildResult(i,n,s,a,r,r)}}),u=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,s=i,a=n;return this._buildResult(i,n,s,a,r,r)}});cc.ContentStrategy.EXACT_FIT=new r,cc.ContentStrategy.SHOW_ALL=new s,cc.ContentStrategy.NO_BORDER=new a,cc.ContentStrategy.FIXED_HEIGHT=new c,cc.ContentStrategy.FIXED_WIDTH=new u})(),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":131,"../platform/CCClass":158,"../platform/js":179,"../renderer":189}],169:[(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,s=r+i,a=n+e;this.topLeft.x=n,this.topLeft.y=s,this.topRight.x=a,this.topRight.y=s,this.top.x=n+e/2,this.top.y=s,this.bottomLeft.x=n,this.bottomLeft.y=r,this.bottomRight.x=a,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=a,this.right.y=r+i/2}}}),{}],170:[(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 s(t){if("function"!=typeof t)return r(t,a(t.constructor));for(var e,i=cc.Class.getInheritanceChain(t),n=i.length-1;n>=0;n--){var s=i[n];s.hasOwnProperty("__attrs__")&&s.__attrs__||r(s,(e=i[n+1])&&e.__attrs__)}return r(t,(e=i[0])&&e.__attrs__),t.__attrs__}function a(t){return t.hasOwnProperty("__attrs__")&&t.__attrs__||s(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=a(t),r=e+n,s={};for(var o in i)o.startsWith(r)&&(s[o.slice(r.length)]=i[o]);return s},getClassAttrs:a,setClassAttr:function(t,e,i,r){a(t)[e+n+i]=r},DELIMETER:n,getTypeChecker_ET:!1,getObjTypeChecker_ET:!1,ScriptUuid:{}}}),{"./CCClass":158,"./js":179,"./utils":182}],171:[(function(t,e){"use strict";var i=t("./js"),n=i.array.fastRemoveAt;function r(){}function s(){this.callback=r,this.target=void 0,this.once=!1}s.prototype.set=function(t,e,i){this.callback=t,this.target=e,this.once=!!i};var a=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}a.get=function(){return this._get()||new s};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&&(a.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&&(a.put(i),n(this.callbackInfos,e),--e)}},c.cancel=function(t){var e=this.callbackInfos[t];e&&(a.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&&(a.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 u=new i.Pool(function(t){return t.callbackInfos=[],t.isInvoking=!1,t.containCanceled=!1,!0},16);function l(){this._callbackTable=i.createMap(!0)}u.get=function(){return this._get()||new o},(c=l.prototype).on=function(t,e,i,n){var r=this._callbackTable[t];r||(r=this._callbackTable[t]=u.get());var s=a.get();s.set(e,i,n),r.callbackInfos.push(s)},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 s=0;s<r.length;++s)if(r[s])return!0;return!1}return r.length>0}for(var a=0;a<r.length;++a){var o=r[a];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(),u.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,s=0;s<r.length;++s){var a=r[s];a&&a.target===t&&n.cancel(s)}else n.removeByTarget(t)}},c.off=function(t,e,i){var r=this._callbackTable[t];if(r)for(var s=r.callbackInfos,o=0;o<s.length;++o){var c=s[o];if(c&&c.callback===e&&c.target===i){r.isInvoking?r.cancel(o):(n(s,o),a.put(c));break}}},c.emit=function(t,e,i,n,r,s){var a=this._callbackTable[t];if(a){var o=!a.isInvoking;a.isInvoking=!0;for(var c=a.callbackInfos,u=0,l=c.length;u<l;++u){var h=c[u];if(h){var _=h.target,f=h.callback;h.once&&this.off(t,f,_),_?f.call(_,e,i,n,r,s):f(e,i,n,r,s)}}o&&(a.isInvoking=!1,a.containCanceled&&a.purgeCanceled())}},e.exports=l}),{"./js":179}],172:[(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("")}}}),{}],173:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=P,i.unpackJSONs=function(t,e){if(t[0]<1)throw new Error(cc.debug.getError(5304,t[0]));O(t,!0,e),L(t);for(var i=new N(t[0]),n=t[1],r=t[2],s=t[3],a=t[4],o=t[m],c=0;c<o.length;++c)o[c].unshift(i,n,r,s,a);return o},i.packCustomObjData=function(t,e,i){return[1,f,f,[t],f,i?[e,-1]:[e],[0],f,[],[],[]]},i.hasNativeDep=function(t){var e=t[5],i=e[e.length-1];return"number"==typeof i&&i<0},i.getDependUuidList=function(t){var e=t[1];return t[10].map((function(t){return e[t]}))};var n=_(t("./js")),r=_(t("../value-types/vec2")),s=_(t("../value-types/vec3")),a=_(t("../value-types/vec4")),o=_(t("../value-types/color")),c=_(t("../value-types/size")),u=_(t("../value-types/rect")),l=_(t("../value-types/quat")),h=_(t("../value-types/mat4"));function _(t){return t&&t.__esModule?t:{default:t}}var f=0,d=[r.default,s.default,a.default,l.default,o.default,c.default,u.default,h.default];function p(t,e){t.x=e[1],t.y=e[2],t.z=e[3],t.w=e[4]}var v=[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){h.default.fromArray(t,e,1)}],g=0,m=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,s=3*t[n];r<s;r+=3){var a=t[r],o=e[t[r+2]],c=t[r+1];c>=0?a[i[c]]=o:a[~c]=o}for(;r<n;r+=3){var u=e[t[r]],l=e[t[r+2]],h=t[r+1];h>=0?u[i[h]]=l:u[~h]=l}}function E(t,e){for(var i=t[4][e[0]],n=i[0],r=new(0,n[0]),s=n[1],a=n[2],o=i[i.length-1],c=1;c<o;++c)r[s[i[c]]]=e[c];for(;c<e.length;++c){var u=s[i[c]],l=n[i[c]+a];(0,w[l])(t,r,u,e[c])}return r}function A(t,e,i){var r=new e;return r._deserialize?r._deserialize(i,t[0]):cc.errorID(5303,n.default.getClassName(e)),r}function C(t,e,i,n){n>=0?e[i]=t[5][n]:t[7][3*~n]=e}function x(t){return function(e,i,n,r){i[n]=r;for(var s=0;s<r.length;++s)t(e,r,s,r[s])}}function b(t,e,i,n){e[i]=null,t[8][n]=e}function S(t,e,i,n){e[i]=E(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 R(t){var e=t[5],i=t[6],n=0===i?0:i.length,r=e[e.length-1],s=e.length-n;"number"!=typeof r?r=0:(r<0&&(r=~r),--s);for(var a=0;a<s;++a)e[a]=E(t,e[a]);for(var o=t[3],c=0;c<n;++c,++a){var u=i[c],l=e[a];if(u>=0){var h=o[u];e[a]=A(t,h,l)}else(0,w[u=~u])(t,e,a,l)}return r}function I(t,e){return t||P.reportMissingClass(e),Object}function M(t,e,i,n,r,s){var a=t(e);if(!a){if(r)return void(i[n]=(function(e,i,n){return function(){var r=t(n)||I(s,n);return e[i]=r,new r}})(i,n,e));a=I(s,e)}i[n]=a}function O(t,e,i){for(var r=i||n.default._getClassById,s=t[3],a=0;a<s.length;++a){var o=s[a];"string"!=typeof o?M(r,o[0],o,g,e,i):M(r,o,s,a,e,i)}}function L(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 D(t){for(var e=t[5],i=t[2],n=t[1],r=t[8],s=t[9],a=t[10],o=0;o<r.length;++o){var c=r[o];"number"==typeof c&&(r[o]=e[c]);var u=s[o];"number"==typeof u&&(u=u>=0?i[u]:~u,s[o]=u);var l=a[o];"number"==typeof l&&(a[o]=n[l])}}function P(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],s=!1;if("object"==typeof r&&(s=r.preprocessed,r=r.version),r<1)throw new Error(cc.debug.getError(5304,r));i._version=r,i.result=e,t[0]=i,s||(O(t,!1,i.classFinder),L(t)),cc.game._isCloning=!0;var a=t[5],o=R(t);return cc.game._isCloning=!1,t[7]&&T(t[7],a,t[2]),D(t),n&&y.pool.put(e),a[o]}w[0]=function(t,e,i,n){e[i]=n},w[1]=C,w[2]=x(C),w[3]=x(b),w[4]=S,w[5]=function(t,e,i,n){v[n[0]](e[i],n)},w[6]=b,w[7]=function(t,e,i,n){e[i].set(n)},w[8]=function(t,e,i,n){var r=new d[n[0]];v[n[0]](r,n),e[i]=r},w[9]=x(S),w[10]=function(t,e,i,n){var r=t[3][n[0]];e[i]=A(t,r,n[1])},w[11]=function(t,e,i,n){var r=n[0];e[i]=r;for(var s=1;s<n.length;s+=3){var a=n[s],o=n[s+1],c=n[s+2];(0,w[o])(t,r,a,c)}},w[12]=function(t,e,i,n){var r=n[0];e[i]=r;for(var s=0;s<r.length;++s){var a=r[s],o=n[s+1];0!==o&&(0,w[o])(t,r,s,a)}},P.Details=y;var N=function(t){this.preprocessed=!0,this.version=t}}),{"../value-types/color":247,"../value-types/mat4":250,"../value-types/quat":251,"../value-types/rect":252,"../value-types/size":253,"../value-types/vec2":257,"../value-types/vec3":258,"../value-types/vec4":259,"./js":179}],174:[(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":173,"./deserialize-editor":void 0}],175:[(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}),{}],176:[(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":158,"./CCClassDecorator":159,"./CCEnum":160,"./CCMacro":163,"./CCObject":164,"./CCSys":167,"./CCVisibleRect":169,"./callbacks-invoker":171,"./deserialize":174,"./instantiate":178,"./instantiate-jit":177,"./js":179,"./requiring-frame":181}],177:[(function(t,e){"use strict";var i=t("./CCObject"),n=i.Flags.Destroyed,r=i.Flags.PersistentMask,s=t("./attribute"),a=t("./js"),o=t("./CCClass"),c=t("./compiler"),u=s.DELIMETER+"default",l=o.IDENTIFIER_RE,h=o.escapeForJS,_="var ",f="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(b){}function v(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 g(t,e){this.varName=t,this.expression=e}function m(t,e){return e instanceof g?new g(e.varName,t+e.expression):t+e}function y(t,e,i){Array.isArray(i)?(i[0]=m(e,i[0]),t.push(i)):t.push(m(e,i)+";")}function T(t){this._exps=[],this._targetExp=t}function E(t,e){if("function"==typeof t)try{t=t()}catch(b){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 a.isEmptyObject(t)&&a.isEmptyObject(e)}return!1}function A(t){return l.test(t)?"."+t:"["+h(t)+"]"}function C(t,e){var i;this.parent=e,this.objsToClear_iN$t=[],this.codeArray=[],this.objs=[],this.funcs=[],this.funcModuleCache=a.createMap(),a.mixin(this.funcModuleCache,p),this.globalVariables=[],this.globalVariableId=0,this.localVariableId=0,this.codeArray.push(_+f+","+d+";","if(R){",f+"=R;","}else{",f+"=R=new "+this.getFuncModule(t.constructor,!0)+"();","}"),a.value(t,"_iN$t",{globalVar:"R"},!0),this.objsToClear_iN$t.push(t),this.enumerateObject(this.codeArray,t),this.globalVariables.length>0&&(i=_+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,s=this.objsToClear_iN$t.length;r<s;++r)this.objsToClear_iN$t[r]._iN$t=null;this.objsToClear_iN$t.length=0}g.prototype.toString=function(){return _+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+A(n[0])+"=",n[1])}},T.pool=new a.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 x=C.prototype;x.getFuncModule=function(t,e){var i=a.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(b){}}}var s=this.funcs.indexOf(t);s<0&&(s=this.funcs.length,this.funcs.push(t));var o="F["+s+"]";return e&&(o="("+o+")"),this.funcModuleCache[i]=o,o},x.getObjRef=function(t){var e=this.objs.indexOf(t);return e<0&&(e=this.objs.length,this.objs.push(t)),"O["+e+"]"},x.setValueType=function(t,e,i,n){var r=T.pool.get(n),s=e.constructor.__props__;s||(s=Object.keys(e));for(var a=0;a<s.length;a++){var o=s[a],c=i[o];if(e[o]!==c){var u=this.enumerateField(i,o,c);r.append(o,u)}}r.writeCode(t),T.pool.put(r)},x.enumerateCCClass=function(t,e,i){for(var n=i.__values__,r=s.getClassAttrs(i),a=0;a<n.length;a++){var c=n[a],l=e[c],h=r[c+u];if(!E(h,l))if("object"==typeof l&&l instanceof cc.ValueType&&(h=o.getDefault(h))&&h.constructor===l.constructor){var _=f+A(c);this.setValueType(t,h,l,_)}else this.setObjProp(t,e,c,l)}},x.instantiateArray=function(t){if(0===t.length)return"[]";var e="a"+ ++this.localVariableId,i=[new g(e,"new Array("+t.length+")")];a.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},x.instantiateTypedArray=function(t){var e=t.constructor.name||v(t.constructor);if(0===t.length)return"new "+e;var i="a"+ ++this.localVariableId,n=[new g(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},x.enumerateField=function(t,e,n){if("object"==typeof n&&n){var s=n._iN$t;if(s){var a=s.globalVar;if(!a){a=s.globalVar="v"+ ++this.globalVariableId,this.globalVariables.push(a);var o=s.source[0];s.source[0]=m(a+"=",o)}return a}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?h(n):("_objFlags"===e&&t instanceof i&&(n&=r),n)},x.setObjProp=function(t,e,i,n){y(t,f+A(i)+"=",this.enumerateField(e,i,n))},x.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)}},x.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&&!t.node.isChildOf(this.parent))return this.getObjRef(t);e=new g(f,"new "+this.getFuncModule(i,!0)+"()")}else if(i===Object)e=new g(f,"{}");else{if(i)return this.getObjRef(t);e=new g(f,"Object.create(null)")}var r=[e];return a.value(t,"_iN$t",{globalVar:"",source:r},!0),this.objsToClear_iN$t.push(t),this.enumerateObject(r,t),["(function(){",r,"return o;})();"]},e.exports={compile:function(t){return new C(t,t instanceof cc._BaseNode&&t).result},equalsToDefault:E}}),{"./CCClass":158,"./CCObject":164,"./attribute":170,"./compiler":172,"./js":179}],178:[(function(t,e){"use strict";var i=t("./CCObject"),n=t("../value-types/value-type"),r=i.Flags.Destroyed,s=i.Flags.PersistentMask,a=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=l(t),cc.game._isCloning=!1,n}var u=[];function l(t,e){if(Array.isArray(t))return null;if(a&&a(t))return null;var i;_(t,i=t._iN$t?t._iN$t:t.constructor?new(0,t.constructor):Object.create(null),e);for(var n=0,r=u.length;n<r;++n)u[n]._iN$t=null;return u.length=0,i}function h(t,e,i,r){for(var s=t.__values__,a=0;a<s.length;a++){var o=s[a],c=e[o];if("object"==typeof c&&c){var u=i[o];u instanceof n&&u.constructor===c.constructor?u.set(c):i[o]=c._iN$t||f(c,r)}else i[o]=c}}function _(t,e,n){o.value(t,"_iN$t",e,!0),u.push(t);var r=t.constructor;if(cc.Class._isCCClass(r))h(r,t,e,n);else for(var a in t)if(t.hasOwnProperty(a)&&(95!==a.charCodeAt(0)||95!==a.charCodeAt(1)||"__type__"===a)){var c=t[a];if("object"==typeof c&&c){if(c===e)continue;e[a]=c._iN$t||f(c,n)}else e[a]=c}t instanceof i&&(e._objFlags&=s)}function f(t,e){if(t instanceof n)return t.clone();if(t instanceof cc.Asset)return t;var i;if(ArrayBuffer.isView(t)){var s=t.length;i=new t.constructor(s),t._iN$t=i,u.push(t);for(var a=0;a<s;++a)i[a]=t[a];return i}if(Array.isArray(t)){var c=t.length;i=new Array(c),o.value(t,"_iN$t",i,!0),u.push(t);for(var l=0;l<c;++l){var h=t[l];i[l]="object"==typeof h&&h?h._iN$t||f(h,e):h}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&&!t.node.isChildOf(e))return t;i=new d}else if(d===Object)i={};else{if(d)return t;i=Object.create(null)}return _(t,i,e),i}c._clone=l,cc.instantiate=c,e.exports=c}),{"../value-types/value-type":256,"./CCObject":164,"./js":179,"./utils":182}],179:[(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 s={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 s in n)s in t||r(s,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 s in n)r(s,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=s.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},a={value:void 0,enumerable:!1,writable:!1,configurable:!0};s.value=function(t,e,i,n,r){a.value=i,a.writable=n,a.enumerable=r,Object.defineProperty(t,e,a),a.value=void 0};var o={get:null,set:null,enumerable:!1};s.getset=function(t,e,i,n,r,s){"function"!=typeof n&&(r=n,n=void 0),o.get=i,o.set=n,o.enumerable=r,o.configurable=s,Object.defineProperty(t,e,o),o.get=null,o.set=null};var c={get:null,enumerable:!1,configurable:!1};s.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 u={set:null,enumerable:!1,configurable:!1};s.set=function(t,e,i,n,r){u.set=i,u.enumerable=n,u.configurable=r,Object.defineProperty(t,e,u),u.set=null},s.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?s.getClassName(t.constructor):""},(function(){var t={},e={};function n(t,e,i){return s.getset(s,e,(function(){return Object.assign({},i)}),(function(t){s.clear(i),Object.assign(i,t)})),function(e,n){if(n.prototype.hasOwnProperty(t)&&delete i[n.prototype[t]],s.value(n.prototype,t,e),e){var r=i[e];if(r&&r!==n){var a="A Class already exists with the same "+t+' : "'+e+'".';cc.error(a)}else i[e]=n}}}s._setClassId=n("__cid__","_registeredClassIds",t);var r=n("__classname__","_registeredClassNames",e);s.setClassName=function(t,e){if(r(t,e),!e.prototype.hasOwnProperty("__cid__")){var n=t||i.getNewId();n&&s._setClassId(n,e)}},s.unregisterClass=function(){for(var i=0;i<arguments.length;i++){var n=arguments[i].prototype,r=n.__cid__;r&&delete t[r];var s=n.__classname__;s&&delete e[s]}},s._getClassById=function(e){return t[e]},s.getClassByName=function(t){return e[t]},s._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""}})(),s.obsolete=function(t,e,i,n){var r=/([^.]+)$/,a=r.exec(e)[0],o=r.exec(i)[0];function c(){return this[o]}n?s.getset(t,a,c,(function(t){this[o]=t})):s.get(t,a,c)},s.obsoletes=function(t,e,i,n){for(var r in i){var a=i[r];s.obsolete(t,e+"."+r,a,n)}};var l=/(%d)|(%s)/,h=/%s/;function _(t,e){t.splice(e,1)}function f(t,e){var i=t.indexOf(e);return i>=0&&(_(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}s.formatStr=function(){var t=arguments.length;if(0===t)return"";var e=arguments[0];if(1===t)return""+e;var i="string"==typeof e&&l.test(e);if(i)for(var n=1;n<t;++n){var r=arguments[n],s="number"==typeof r?l:h;if(s.test(e)){var a=""+r;e=e.replace(s,a)}else e+=" "+r}else for(var o=1;o<t;++o)e+=" "+arguments[o];return e},s.shiftArguments=function(){for(var t=arguments.length-1,e=new Array(t),i=0;i<t;++i)e[i]=arguments[i+1];return e},s.createMap=function(t){var e=Object.create(null);return t&&(e["."]=!0,e["/"]=!0,delete e["."],delete e["/"]),e},s.array={remove:f,fastRemove:function(t,e){var i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],--t.length)},removeAt:_,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++)f(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))},s.Pool=d,cc.js=s,e.exports=s}),{"../utils/mutable-forward-iterator":234,"./id-generater":175}],180:[(function(t,e,i){"use strict";var n=t("./js"),r=t("./attribute"),s={default:{},serializable:{},editorOnly:{},formerlySerializedAs:{}};function a(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 a={};for(var o in n[r]=a,s){var c=s[o];t.hasOwnProperty(o)&&(a[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],s=i.getFullFormOfProperty(r,!1);if(s&&(r=t[n]=s),r){var c=r.notify;c&&a(r,n,c,t),"type"in r&&o(r,r.type,e,n)}}},i.validateMethodWithProps=function(t){return"function"==typeof t||null===t}}),{"./CCClass":158,"./attribute":170,"./js":179}],181:[(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]}}}),{}],182:[(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":179}],183:[(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":23,"./CCScheduler":28,"./asset-manager":46,"./event":133,"./event-manager":129,"./platform/CCInputExtension":161,"./platform/CCInputManager":162,"./platform/CCMacro":163,"./platform/CCScreen":166,"./platform/CCSys":167,"./platform/CCView":168,"./platform/js":179,"./renderer":189,"./utils":232,"./value-types":248}],184:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("./assembler")),r=a(t("./utils/dynamic-atlas/manager")),s=a(t("./webgl/render-data"));function a(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,n.key,n)}}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=(function(t){var e,i;function n(){var e;return(e=t.call(this)||this)._renderData=new s.default,e._renderData.init(c(e)),e.initData(),e.initLocal(),e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,u(e,i);var a,l,h=n.prototype;return h.initData=function(){this._renderData.createQuadData(0,this.verticesFloats,this.indicesCount)},h.initLocal=function(){this._local=[],this._local.length=4},h.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,s=i.length;r<s;r+=n)i[r]=e}},h.getBuffer=function(){return cc.renderer._handle._meshBuffer},h.updateWorldVerts=function(t){var e=this._local,i=this._renderData.vDatas[0],n=t.node._worldMatrix.m,r=n[0],s=n[1],a=n[4],o=n[5],c=n[12],u=n[13],l=e[0],h=e[2],_=e[1],f=e[3],d=this.floatsPerVert,p=0;if(1===r&&0===s&&0===a&&1===o)i[p]=l+c,i[p+1]=_+u,i[p+=d]=h+c,i[p+1]=_+u,i[p+=d]=l+c,i[p+1]=f+u,i[p+=d]=h+c,i[p+1]=f+u;else{var v=r*l,g=r*h,m=s*l,y=s*h,T=a*_,E=a*f,A=o*_,C=o*f;i[p]=v+T+c,i[p+1]=m+A+u,i[p+=d]=g+T+c,i[p+1]=y+A+u,i[p+=d]=v+E+c,i[p+1]=m+C+u,i[p+=d]=g+E+c,i[p+1]=y+C+u}},h.fillBuffers=function(t,e){e.worldMatDirty&&this.updateWorldVerts(t);var i=this._renderData,n=i.vDatas[0],r=i.iDatas[0],s=this.getBuffer(e),a=s.request(this.verticesCount,this.indicesCount),o=a.byteOffset>>2,c=s._vData;n.length+o>c.length?c.set(n.subarray(0,c.length-o),o):c.set(n,o);for(var u=s._iData,l=a.indiceOffset,h=a.vertexOffset,_=0,f=r.length;_<f;_++)u[l++]=h+r[_]},h.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())},a=n,(l=[{key:"verticesFloats",get:function(){return this.verticesCount*this.floatsPerVert}}])&&o(a.prototype,l),n})(n.default);i.default=l,cc.js.addon(l.prototype,{floatsPerVert:5,verticesCount:4,indicesCount:6,uvOffset:2,colorOffset:4}),cc.Assembler2D=l,e.exports=i.default}),{"./assembler":186,"./utils/dynamic-atlas/manager":192,"./webgl/render-data":220}],185:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=0;function o(t){return Object.getOwnPropertyDescriptor(t,"__assemblerId__")||(t.__assemblerId__=++a),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,s(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 u=c;i.default=u,e.exports=i.default}),{"../utils/pool":235}],186:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./webgl/vertex-format"),s=(n=t("./assembler-pool"))&&n.__esModule?n:{default:n},a=(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=a,a.register=function(t,e){t.__assembler__=e},a.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=s.default.get(i);n.init(t),t._assembler=n}},cc.Assembler=a,e.exports=i.default}),{"./assembler-pool":185,"./webgl/vertex-format":222}],187:[(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}),{}],188:[(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}),{}],189:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../renderer/gfx")),r=a(t("../../renderer/core/input-assembler")),s=a(t("../../renderer/core/pass"));function a(t){return t&&t.__esModule?t:{default:t}}var o=cc.renderer={Texture2D:null,InputAssembler:r.default,Pass:s.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 s=t("../../renderer/scene/scene"),a=t("../../renderer/renderers/forward-renderer");this.device=new n.default.Device(e,i),this.scene=new s;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 a(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":265,"../../renderer/core/pass":266,"../../renderer/gfx":275,"../../renderer/renderers/forward-renderer":294,"../../renderer/scene/scene":297,"./canvas":void 0,"./canvas/Device":187,"./canvas/Texture2D":188,"./webgl/assemblers":201,"./webgl/model-batcher":218}],190:[(function(t,e){"use strict";var i,n,r=0,s=1<<r++,a=1<<r++,o=1<<r++,c=1<<r++,u=o|c,l=1<<r++,h=1<<r++,_=1<<r++,f=h|_,d=1<<r++,p=1<<r++,v=1<<r++,g=1<<r++,m=0;function y(){this._func=b,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._opacity=function(t){i.parentOpacityDirty++,this._next._func(t),t._renderFlag&=~h,i.parentOpacityDirty--},T._color=function(t){var e=t._renderComponent;e&&e._updateColor(),t._renderFlag&=~_,this._next._func(t)},T._updateRenderData=function(t){var e=t._renderComponent;e._assembler.updateRenderData(e),t._renderFlag&=~l,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=m,n=i,r=n.parentOpacity,s=n.parentOpacity*=t._opacity/255,a=(n.worldMatDirty?c:0)|(n.parentOpacityDirty?f:0),o=t._children,u=0,l=o.length;u<l;u++){var h=o[u];if(h._renderFlag|=a,h._activeInHierarchy&&0!==h._opacity){m=h._cullingMask=0===h.groupIndex?e:1<<h.groupIndex;var _=h._color._val;h._color._fastSetA(h._opacity*s),A[h._renderFlag]._func(h),h._color._val=_}}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 E=new y;E._func=E._doNothing,E._next=E;var A={};function C(t,e){var i=new y;switch(i._next=e||E,t){case s:case a:i._func=i._doNothing;break;case o:i._func=i._localTransform;break;case c:i._func=i._worldTransform;break;case h:i._func=i._opacity;break;case _:i._func=i._color;break;case l:i._func=i._updateRenderData;break;case d:i._func=i._render;break;case p:i._func=i._children;break;case v:i._func=i._postRender}return i}function x(t){for(var e=null,i=g;i>0;)i&t&&(e=C(i,e)),i>>=1;return e}function b(t){var e=t._renderFlag;(A[e]=x(e))._func(t)}y.flows=A,y.createFlow=C;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=m;m=t._cullingMask,t._renderFlag&c?(i.worldMatDirty++,t._calculWorldMatrix(),t._renderFlag&=~c,A[t._renderFlag]._func(t),i.worldMatDirty--):A[t._renderFlag]._func(t),m=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,A[0]=E;for(var r=1;r<g;r++)A[r]=new y},y.getBachther=function(){return i},y.FLAG_DONOTHING=s,y.FLAG_BREAK_FLOW=a,y.FLAG_LOCAL_TRANSFORM=o,y.FLAG_WORLD_TRANSFORM=c,y.FLAG_TRANSFORM=u,y.FLAG_OPACITY=h,y.FLAG_COLOR=_,y.FLAG_OPACITY_COLOR=f,y.FLAG_UPDATE_RENDER_DATA=l,y.FLAG_RENDER=d,y.FLAG_CHILDREN=p,y.FLAG_POST_RENDER=v,y.FLAG_FINAL=g,e.exports=cc.RenderFlow=y}),{}],191:[(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],s=e.x,a=e.y;if(r)s+=r.x,a+=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++,s+=this._x,a+=this._y,this._x+=o+n,this._dirty=!0}var u={x:s,y:a,texture:this._texture};return this._innerSpriteFrames.push(t),u},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":66}],192:[(function(t,e){"use strict";var i=t("./atlas"),n=[],r=-1,s=5,a=2048,o=512,c=!0,u=null;function l(){var t=n[++r];return t||(t=new i(a,a),n.push(t)),t}function h(){f.reset()}var _=!1,f={Atlas:i,get enabled(){return _},set enabled(t){_!==t&&(t?(this.reset(),cc.director.on(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,h)):cc.director.off(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,h),_=t)},get maxAtlasCount(){return s},set maxAtlasCount(t){s=t},get atlasCount(){return n.length},get textureBleeding(){return c},set textureBleeding(t){c=t},get textureSize(){return a},set textureSize(t){a=t},get maxFrameSize(){return o},set maxFrameSize(t){o=t},insertSpriteFrame:function(t){if(!_||r===s||!t||t._original)return null;if(!t._texture.packable)return null;var e=n[r];e||(e=l());var i=e.insertSpriteFrame(t);return i||r===s?i:(e=l()).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(!u||!u.isValid){var e=cc.visibleRect.width,i=cc.visibleRect.height;(u=new cc.Node("DYNAMIC_ATLAS_DEBUG_NODE")).width=e,u.height=i,u.x=e/2,u.y=i/2,u.zIndex=cc.macro.MAX_ZINDEX,u.parent=cc.director.getScene(),u.groupIndex=cc.Node.BuiltinGroupIndex.DEBUG,cc.Camera._setupDebugCamera();var s=u.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=u,o.width=a,o.anchorY=1,o.x=a,s.content=o;for(var l=0;l<=r;l++){var h=new cc.Node("ATLAS"),_=(n[l]._texture,new cc.SpriteFrame);_.setTexture(n[l]._texture),h.addComponent(cc.Sprite).spriteFrame=_,h.parent=o}}return u}u&&(u.parent=null,u=null)},update:function(){if(this.enabled)for(var t=0;t<=r;t++)n[t].update()}};e.exports=cc.dynamicAtlasManager=f}),{"./atlas":191}],193:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=t("../../../utils/text-utils"),o=t("../../../platform/CCMacro"),c=t("../../../components/CCLabel").Overflow,u=t("../utils").shareLabelInfo,l=function(){this.char="",this.valid=!0,this.x=0,this.y=0,this.line=0,this.hash=""},h=cc.rect(),_=null,f=[],d=[],p=[],v=[],g=null,m=0,y=0,T=0,E=0,A=0,C=1,x=null,b=cc.size(),S="",w=0,R=0,I=0,M=0,O=0,L=0,D=0,P=!1,N=0,F=0,B=0,z=(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 r=n.prototype;return r.updateRenderData=function(t){t._vertsDirty&&_!==t&&(_=t,this._reserveQuads(t,t.string.toString().length),this._updateFontFamily(t),this._updateProperties(t),this._updateLabelInfo(t),this._updateContent(),this.updateWorldVerts(t),_._actualFontSize=w,_.node.setContentSize(b),_._vertsDirty=!1,_=null,this._resetProperties())},r._updateFontScale=function(){C=w/R},r._updateFontFamily=function(t){var e=t.font;x=e.spriteFrame,g=e._fntConfig,u.fontAtlas=e._fontDefDictionary,this.packToDynamicAtlas(t,x)},r._updateLabelInfo=function(){u.hash="",u.margin=0},r._updateProperties=function(t){S=t.string.toString(),w=t.fontSize,R=g?g.fontSize:t.fontSize,I=t.horizontalAlign,M=t.verticalAlign,O=t.spacingX,D=t.overflow,L=t._lineHeight,b.width=t.node.width,b.height=t.node.height,D===c.NONE?(P=!1,b.width+=2*u.margin,b.height+=2*u.margin):D===c.RESIZE_HEIGHT?(P=!0,b.height+=2*u.margin):P=t.enableWrapText,u.lineHeight=L,u.fontSize=w,this._setupBMFontOverflowMetrics()},r._resetProperties=function(){g=null,x=null,u.hash="",u.margin=0},r._updateContent=function(){this._updateFontScale(),this._computeHorizontalKerningForText(),this._alignText()},r._computeHorizontalKerningForText=function(){var t,e=S,i=e.length,n=f;if(g&&(t=g.kerningDict),t&&!cc.js.isEmptyObject(t))for(var r=-1,s=0;s<i;++s){var a=e.charCodeAt(s),o=t[r<<16|65535&a]||0;n[s]=s<i-1?o:0,r=a}else n.length=0},r._multilineTextWrap=function(t){for(var e=S.length,i=0,n=0,r=0,s=0,o=0,l=0,h=0,_=null,d=cc.v2(0,0),v=0;v<e;){var T=S.charAt(v);if("\n"!==T){for(var x=t(S,v,e),w=l,R=h,I=o,M=n,z=!1,V=0;V<x;++V){var U=v+V;if("\r"!==(T=S.charAt(U)))if(_=u.fontAtlas.getLetterDefinitionForChar(T,u)){var k=M+_.offsetX*C-u.margin;if(P&&B>0&&n>0&&k+_.w*C>B&&!a.isUnicodeSpace(T)){p.push(o),o=0,i++,n=0,r-=L*this._getFontScale()+0,z=!0;break}d.x=k,d.y=r-_.offsetY*C+u.margin,this._recordLetterInfo(d,T,U,i),U+1<f.length&&U<e-1&&(M+=f[U+1]),M+=_.xAdvance*C+O-2*u.margin,I=d.x+_.w*C-u.margin,w<d.y&&(w=d.y),R>d.y-_.h*C&&(R=d.y-_.h*C)}else{this._recordPlaceholderInfo(U,T);var H="";g&&(H=g.atlasName),console.log("Can't find letter definition in texture atlas "+H+" for letter:"+T)}else this._recordPlaceholderInfo(U,T)}z||(n=M,l<w&&(l=w),h>R&&(h=R),s<(o=I)&&(s=o),v+=x)}else p.push(o),o=0,i++,n=0,r-=L*this._getFontScale()+0,this._recordPlaceholderInfo(v,T),v++}return p.push(o),y=(m=i+1)*L*this._getFontScale(),m>1&&(y+=0*(m-1)),b.width=N,b.height=F,N<=0&&(b.width=parseFloat(s.toFixed(2))+2*u.margin),F<=0&&(b.height=parseFloat(y.toFixed(2))+2*u.margin),E=b.height,A=0,D!==c.CLAMP&&(l>0&&(E=b.height+l),h<-y&&(A=y+h)),!0},r._getFirstCharLen=function(){return 1},r._getFontScale=function(){return D===c.SHRINK?C:1},r._getFirstWordLen=function(t,e,i){var n=t.charAt(e);if(a.isUnicodeCJK(n)||"\n"===n||a.isUnicodeSpace(n))return 1;var r=1,s=u.fontAtlas.getLetterDefinitionForChar(n,u);if(!s)return r;for(var o=s.xAdvance*C+O,c=e+1;c<i&&(n=t.charAt(c),s=u.fontAtlas.getLetterDefinitionForChar(n,u));++c){if(o+s.offsetX*C+s.w*C>B&&!a.isUnicodeSpace(n)&&B>0)return r;if(o+=s.xAdvance*C+O,"\n"===n||a.isUnicodeSpace(n)||a.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 l;d.push(i)}d[t].char=e,d[t].hash=e.charCodeAt(0)+u.hash,d[t].valid=!1},r._recordLetterInfo=function(t,e,i,n){if(i>=d.length){var r=new l;d.push(r)}var s=e.charCodeAt(0)+u.hash;d[i].line=n,d[i].char=e,d[i].hash=s,d[i].valid=u.fontAtlas.getLetter(s).valid,d[i].x=t.x,d[i].y=t.y},r._alignText=function(){y=0,p.length=0,this._multilineTextWrapByWord(),this._computeAlignmentOffset(),D===c.SHRINK&&w>0&&this._isVerticalClamp()&&this._shrinkLabelToContentSize(this._isVerticalClamp),this._updateQuads()||D===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;C=r/R,this._multilineTextWrapByWord(),this._computeAlignmentOffset(),t()?i=n-1:e=n}var s=e;s>=0&&this._scaleFontSizeDown(s)},r._isVerticalClamp=function(){return y>b.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=u.fontAtlas.getLetter(n.hash),s=n.x+r.w*C,a=n.line;if(N>0)if(P){if(p[a]>b.width&&(s>b.width||s<0)){t=!0;break}}else if(s>b.width){t=!0;break}}}return t},r._isHorizontalClamped=function(t,e){var i=p[e],n=t>b.width||t<0;return P?i>b.width&&n:n},r._updateQuads=function(){var t=x?x._texture:u.fontAtlas.getTexture(),e=_.node;this.verticesCount=this.indicesCount=0,this._renderData&&(this._renderData.dataLength=0);for(var i=b,n=e._anchorPoint.x*i.width,r=e._anchorPoint.y*i.height,s=!0,a=0,o=S.length;a<o;++a){var l=d[a];if(l.valid){var f=u.fontAtlas.getLetter(l.hash);h.height=f.h,h.width=f.w,h.x=f.u,h.y=f.v;var p=l.y+T;if(F>0){if(p>E){var g=p-E;h.y+=g,h.height-=g,p-=g}p-f.h*C<A&&D===c.CLAMP&&(h.height=p<A?0:(p-A)/C)}var m=l.line,y=l.x+f.w/2*C+v[m];if(N>0&&this._isHorizontalClamped(y,m))if(D===c.CLAMP)h.width=0;else if(D===c.SHRINK){if(b.width>f.w){s=!1;break}h.width=0}if(h.height>0&&h.width>0){var w=this._determineRect(h),R=l.x+v[l.line];this.appendQuad(_,t,h,w,R-n,p-r,C)}}}return this._quadsUpdated(_),s},r._determineRect=function(t){var e=x.isRotated(),i=x._originalSize,n=x._rect,r=x._offset,s=r.x+(i.width-n.width)/2,a=r.y-(i.height-n.height)/2;if(e){var o=t.x;t.x=n.x+n.height-t.y-t.height-a,t.y=o+n.y-s,t.y<0&&(t.height=t.height+a)}else t.x+=n.x-s,t.y+=n.y+a;return e},r._computeAlignmentOffset=function(){switch(v.length=0,I){case o.TextAlignment.LEFT:for(var t=0;t<m;++t)v.push(0);break;case o.TextAlignment.CENTER:for(var e=0,i=p.length;e<i;e++)v.push((b.width-p[e])/2);break;case o.TextAlignment.RIGHT:for(var n=0,r=p.length;n<r;n++)v.push(b.width-p[n])}if(T=b.height,M!==o.VerticalTextAlignment.TOP){var s=b.height-y+L*this._getFontScale()-R*C;M===o.VerticalTextAlignment.BOTTOM?T-=s:T-=s/2}},r._setupBMFontOverflowMetrics=function(){var t=b.width,e=b.height;D===c.RESIZE_HEIGHT&&(e=0),D===c.NONE&&(t=0,e=0),N=t,F=e,B=t},r.updateWorldVerts=function(){},r.appendQuad=function(){},r._quadsUpdated=function(){},r._reserveQuads=function(){},n})(r.default);i.default=z,e.exports=i.default}),{"../../../components/CCLabel":97,"../../../platform/CCMacro":163,"../../../utils/text-utils":240,"../../assembler-2d":184,"../utils":197}],194:[(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,s=0===n?0:t.x/n,a=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]=s,i[1]=o,i[2]=a,i[3]=o,i[4]=s,i[5]=c,i[6]=a,i[7]=c}},e.exports=i}),{}],195:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=t("../../../components/CCLabel"),o=t("../../../components/CCLabelOutline"),c=t("../../../utils/text-utils"),u=t("../../../components/CCComponent"),l=t("../../../assets/CCRenderTexture"),h=cc.js.isChildClassOf(o,u),_=t("../utils").getFontFamily,f=t("../utils").shareLabelInfo,d=cc.BitmapFont.FontLetterDefinition,p=cc.BitmapFont.FontAtlas,v=cc.Color.WHITE,g=0,m=(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 l;i.initWithSize(t,e),i.update(),this._fontDefDictionary=new p(i),this._x=g,this._y=g,this._nexty=g,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=a._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,s=i/2,a=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+", "+m+")",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 u=e.out||v;t.strokeStyle="rgba("+u.r+", "+u.g+", "+u.b+", "+u.a/255+")",t.lineWidth=2*e.margin,t.strokeText(this._char,s,a)}t.fillText(this._char,s,a),this._texture.handleLoadedTexture()},destroy:function(){this._texture.destroy(),this._texture=null,a._canvasPool.put(this._data)}},cc.js.mixin(T.prototype,{insertLetterTexture:function(t){var e=t._texture,i=e.width,n=e.height;if(this._x+i+g>this._width&&(this._x=g,this._y=this._nexty),this._y+n>this._nexty&&(this._nexty=this._y+n+g),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+g,this._fontDefDictionary.addLetterDefinitions(t._hash,r),r},update:function(){this._dirty&&(this._fontDefDictionary._texture.update(),this._dirty=!1)},reset:function(){this._x=g,this._y=g,this._nexty=g;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 l;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 E=null,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,s(e,i);var r=n.prototype;return r._getAssemblerData=function(){return E||(E=new T(2048,2048),cc.Label._shareAtlas=E),E.getTexture()},r._updateFontFamily=function(t){f.fontAtlas=E,f.fontFamily=_(t);var e=h&&t.getComponent(o);e&&e.enabled?(f.isOutlined=!0,f.margin=e.width,f.out=e.color.clone(),f.out.a=e.color.a*t.node.color.a/255):(f.isOutlined=!1,f.margin=0)},r._updateLabelInfo=function(t){var e,i,n;f.fontDesc=this._getFontDesc(),f.color=t.node.color,f.hash=(i=(e=f).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 f.fontSize.toString()+"px "+f.fontFamily},r._computeHorizontalKerningForText=function(){},r._determineRect=function(){return!1},n})(r.default);i.default=A,e.exports=i.default}),{"../../../assets/CCRenderTexture":66,"../../../components/CCComponent":95,"../../../components/CCLabel":97,"../../../components/CCLabelOutline":98,"../../../utils/text-utils":240,"../../webgl/assemblers/label/2d/bmfont":202,"../utils":197}],196:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a,o=t("../../../utils/text-utils"),c=t("../../../platform/CCMacro"),u=t("../../../components/CCLabel"),l=t("../../../components/CCLabelOutline"),h=t("../../../components/CCLabelShadow"),_=u.Overflow,f=t("../utils").deleteFromDynamicAtlas,d=t("../utils").getFontFamily,p=(1/255).toFixed(3),v=null,g=null,m=null,y="",T="",E=0,A=0,C=[],x=cc.Size.ZERO,b=0,S=0,w=0,R=null,I="",M=_.NONE,O=!1,L=!1,D=null,P=cc.Color.WHITE,N=null,F=cc.Color.BLACK,B=cc.rect(),z=cc.Size.ZERO,V=cc.Size.ZERO,U=!1,k=!1,H=!1,W=0,G=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,s(e,i);var r=n.prototype;return r._getAssemblerData=function(){return(a=u._canvasPool.get()).canvas.width=a.canvas.height=1,a},r._resetAssemblerData=function(t){t&&u._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=E,e.node.setContentSize(V),this.updateVerts(e),e._vertsDirty=!1,v=null,g=null,m=null)},r.updateVerts=function(){},r._updatePaddingRect=function(){var t=0,e=0,i=0,n=0,r=0;if(z.width=z.height=0,D&&(t=e=i=n=r=D.width,z.width=z.height=2*r),N){var s=N.blur+r;i=Math.max(i,-N._offset.x+s),n=Math.max(n,N._offset.x+s),t=Math.max(t,N._offset.y+s),e=Math.max(e,-N._offset.y+s)}if(k){var a=A*Math.tan(.20943951);n+=a,z.width+=a}B.x=i,B.y=t,B.width=i+n,B.height=t+e},r._updateProperties=function(t){var e=t._assemblerData;v=e.context,g=e.canvas,m=t._frame._original?t._frame._original._texture:t._frame._texture,T=t.string.toString(),E=t._fontSize,A=E,W=t.underlineHeight||A/8,M=t.overflow,x.width=t.node.width,x.height=t.node.height,V=t.node.getContentSize(),b=t._lineHeight,S=t.horizontalAlign,w=t.verticalAlign,R=t.node.color,U=t.enableBold,k=t.enableItalic,H=t.enableUnderline,I=d(t),L=t.srcBlendFactor===cc.macro.BlendFactor.ONE,O=M!==_.NONE&&(M===_.RESIZE_HEIGHT||t.enableWrapText),(D=(D=l&&t.getComponent(l))&&D.enabled&&D.width>0?D:null)&&P.set(D.color),(N=(N=h&&t.getComponent(h))&&N.enabled?N:null)&&(F.set(N.color),F.a=F.a*t.node.color.a/255),this._updatePaddingRect()},r._calculateFillTextStartPosition=function(){var t=0;S===c.TextAlignment.RIGHT?t=x.width-B.width:S===c.TextAlignment.CENTER&&(t=(x.width-B.width)/2);var e=this._getLineHeight()*(C.length-1),i=E*(1-o.BASELINE_RATIO/2);if(w!==c.VerticalTextAlignment.TOP){var n=e+B.height+E-x.height;w===c.VerticalTextAlignment.BOTTOM?i-=n+=o.BASELINE_RATIO/2*E:i-=n/2}return i+=o.BASELINE_OFFSET*E,cc.v2(t+B.x,i+B.y)},r._setupOutline=function(){v.strokeStyle="rgba("+P.r+", "+P.g+", "+P.b+", "+P.a/255+")",v.lineWidth=2*D.width},r._setupShadow=function(){v.shadowColor="rgba("+F.r+", "+F.g+", "+F.b+", "+F.a/255+")",v.shadowBlur=N.blur,v.shadowOffsetX=N.offset.x,v.shadowOffsetY=-N.offset.y},r._drawTextEffect=function(t,e){if(N||D||H){var i=C.length>1&&N,n=this._measureText(v,y),r=0,s=0;N&&this._setupShadow(),D&&this._setupOutline();for(var a=0;a<C.length;++a)r=t.x,s=t.y+a*e,i&&(D&&v.strokeText(C[a],r,s),v.fillText(C[a],r,s)),H&&(j=n(C[a]),S===c.TextAlignment.RIGHT?G.x=t.x-j:S===c.TextAlignment.CENTER?G.x=t.x-j/2:G.x=t.x,G.y=s+A/8,v.fillRect(G.x,G.y,j,W));i&&(v.shadowColor="transparent")}},r._updateTexture=function(){if(v.clearRect(0,0,g.width,g.height),v.lineJoin="round",L)v.fillStyle="rgba("+R.r+", "+R.g+", "+R.b+", "+R.a/255+")";else{var t=D?P:R;v.fillStyle="rgba("+t.r+", "+t.g+", "+t.b+", "+p+")",v.fillRect(0,0,g.width,g.height),v.fillStyle="rgba("+R.r+", "+R.g+", "+R.b+", 1)"}var e=this._calculateFillTextStartPosition(),i=this._getLineHeight(),n=e.x,r=0;this._drawTextEffect(e,i);for(var s=0;s<C.length;++s)r=e.y+s*i,D&&v.strokeText(C[s],n,r),v.fillText(C[s],n,r);N&&(v.shadowColor="transparent"),m.handleLoadedTexture()},r._calDynamicAtlas=function(t){if(t.cacheMode===u.CacheMode.BITMAP){var e=t._frame;f(t,e),e._original||e.setRect(cc.rect(0,0,g.width,g.height)),this.packToDynamicAtlas(t,e)}},r._updateLabelDimensions=function(){var t=cc.renderer.device.caps?cc.renderer.device.caps.maxTextureSize:2048;(x.width>t||x.height>t)&&cc.warn("The maximum texture size supported by the device is "+t),x.width=Math.min(x.width,t),x.height=Math.min(x.height,t);var e=!1;g.width!==x.width&&(g.width=x.width,e=!0),g.height!==x.height&&(g.height=x.height,e=!0),e&&(v.font=y),v.textAlign=Y[S]},r._getFontDesc=function(){var t=E.toString()+"px ";return t+=I,U&&(t="bold "+t),k&&(t="italic "+t),t},r._getLineHeight=function(){return 0|(0===b?E:b*E/A)},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,v),i=0,n=0,r=0;if(O){var s=V.width,a=V.height;if(s<0||a<0)return;n=a+1;for(var c=0,u=0|E+1,l=0;c<u;){if((l=c+u+1>>1)<=0){cc.logID(4003);break}E=l,y=this._getFontDesc(),v.font=y;var h=this._getLineHeight();for(n=0,i=0;i<t.length;++i){var _=o.safeMeasureText(v,t[i],y);n+=o.fragmentText(t[i],_,s,this._measureText(v,y)).length*h}n>a?u=l-1:c=l}0===c?cc.logID(4003):(E=c,y=this._getFontDesc(),v.font=y)}else{for(n=t.length*this._getLineHeight(),i=0;i<t.length;++i)r<e[i]&&(r=e[i]);var f=(x.width-B.width)/r,d=x.height/n;E=A*Math.min(1,f,d)|0,y=this._getFontDesc(),v.font=y}},r._calculateWrapText=function(t){if(O){C=[];for(var e=V.width,i=0;i<t.length;++i){var n=o.safeMeasureText(v,t[i],y),r=o.fragmentText(t[i],n,e,this._measureText(v,y));C=C.concat(r)}}},r._calculateLabelFont=function(){var t=T.split("\n");switch(C=t,y=this._getFontDesc(),v.font=y,M){case _.NONE:for(var e=0,i=0,n=0;n<t.length;++n){var r=o.safeMeasureText(v,t[n],y);e=e>r?e:r}i=(C.length+o.BASELINE_RATIO)*this._getLineHeight();var s=parseFloat(e.toFixed(2)),a=parseFloat(i.toFixed(2));x.width=s+B.width,x.height=a+B.height,V.width=s+z.width,V.height=a+z.height;break;case _.SHRINK:this._calculateShrinkFont(t),this._calculateWrapText(t);break;case _.CLAMP:this._calculateWrapText(t);break;case _.RESIZE_HEIGHT:this._calculateWrapText(t);var c=(C.length+o.BASELINE_RATIO)*this._getLineHeight();x.height=c+B.height,V.height=c+z.height}},n})(r.default);i.default=X,e.exports=i.default}),{"../../../components/CCLabel":97,"../../../components/CCLabelOutline":98,"../../../components/CCLabelShadow":99,"../../../platform/CCMacro":163,"../../../utils/text-utils":240,"../../assembler-2d":184,"../utils":197}],197:[(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":192}],198:[(function(t,e){"use strict";function i(t,e,i){i=i||2;var r,a,o,c,u,h,_,f=e&&e.length,d=f?e[0]*i:t.length,p=n(t,0,d,i,!0),v=[];if(!p)return v;if(f&&(p=l(t,e,p,i)),t.length>80*i){r=o=t[0],a=c=t[1];for(var g=i;g<d;g+=i)(u=t[g])<r&&(r=u),(h=t[g+1])<a&&(a=h),u>o&&(o=u),h>c&&(c=h);_=Math.max(o-r,c-a)}return s(p,v,i,r,a,_),v}function n(t,e,i,n,r){var s,a;if(r===M(t,e,i,n)>0)for(s=e;s<i;s+=n)a=w(s,t[s],t[s+1],a);else for(s=i-n;s>=e;s-=n)a=w(s,t[s],t[s+1],a);return a&&E(a,a.next)&&(R(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!E(n,n.next)&&0!==T(n.prev,n,n.next))n=n.next;else{if(R(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function s(t,e,i,n,l,h,_){if(t){!_&&h&&d(t,n,l,h);for(var f,p,v=t;t.prev!==t.next;)if(f=t.prev,p=t.next,h?o(t,n,l,h):a(t))e.push(f.i/i),e.push(t.i/i),e.push(p.i/i),R(t),t=p.next,v=p.next;else if((t=p)===v){_?1===_?s(t=c(t,e,i),e,i,n,l,h,2):2===_&&u(t,e,i,n,l,h):s(r(t),e,i,n,l,h,1);break}}}function a(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(m(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,s=t,a=t.next;if(T(r,s,a)>=0)return!1;for(var o=r.x<s.x?r.x<a.x?r.x:a.x:s.x<a.x?s.x:a.x,c=r.y<s.y?r.y<a.y?r.y:a.y:s.y<a.y?s.y:a.y,u=r.x>s.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,l=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,h=v(o,c,e,i,n),_=v(u,l,e,i,n),f=t.nextZ;f&&f.z<=_;){if(f!==t.prev&&f!==t.next&&m(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&m(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function c(t,e,i){var n=t;do{var r=n.prev,s=n.next.next;!E(r,s)&&A(r,n,n.next,s)&&x(r,s)&&x(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),R(n),R(n.next),n=t=s),n=n.next}while(n!==t);return n}function u(t,e,i,n,a,o){var c=t;do{for(var u=c.next.next;u!==c.prev;){if(c.i!==u.i&&y(c,u)){var l=S(c,u);return c=r(c,c.next),l=r(l,l.next),s(c,e,i,n,a,o),void s(l,e,i,n,a,o)}u=u.next}c=c.next}while(c!==t)}function l(t,e,i,s){var a,o,c,u=[];for(a=0,o=e.length;a<o;a++)(c=n(t,e[a]*s,a<o-1?e[a+1]*s:t.length,s,!1))===c.next&&(c.steiner=!0),u.push(g(c));for(u.sort(h),a=0;a<u.length;a++)_(u[a],i),i=r(i,i.next);return i}function h(t,e){return t.x-e.x}function _(t,e){if(e=f(t,e)){var i=S(e,t);r(i,i.next)}}function f(t,e){var i,n=e,r=t.x,s=t.y,a=-1/0;do{if(s<=n.y&&s>=n.next.y){var o=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=r&&o>a){if(a=o,o===r){if(s===n.y)return n;if(s===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===a)return i.prev;var c,u=i,l=i.x,h=i.y,_=1/0;for(n=i.next;n!==u;)r>=n.x&&n.x>=l&&m(s<h?r:a,s,l,h,s<h?a:r,s,n.x,n.y)&&((c=Math.abs(s-n.y)/(r-n.x))<_||c===_&&n.x>i.x)&&x(n,t)&&(i=n,_=c),n=n.next;return i}function d(t,e,i,n){var r=t;do{null===r.z&&(r.z=v(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,s,a,o,c,u=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,o=0,e=0;e<u&&(o++,n=n.nextZ);e++);for(c=u;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--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,u*=2}while(a>1);return t}function v(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 g(t){var e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i}function m(t,e,i,n,r,s,a,o){return(r-a)*(e-o)-(t-a)*(s-o)>=0&&(t-a)*(n-o)-(i-a)*(e-o)>=0&&(i-a)*(s-o)-(r-a)*(n-o)>=0}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!C(t,e)&&x(t,e)&&x(e,t)&&b(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 E(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,n){return!!(E(t,e)&&E(i,n)||E(t,n)&&E(i,e))||T(t,e,i)>0!=T(t,e,n)>0&&T(i,n,t)>0!=T(i,n,e)>0}function C(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function x(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 b(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&r<(i.next.x-i.x)*(s-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 I(t.i,t.x,t.y),n=new I(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function w(t,e,i,n){var r=new I(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 R(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 I(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 M(t,e,i,n){for(var r=0,s=e,a=i-n;s<i;s+=n)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return r}cc.Graphics.earcut=e.exports=i,i.deviation=function(t,e,i,n){var r=e&&e.length,s=r?e[0]*i:t.length,a=Math.abs(M(t,0,s,i));if(r)for(var o=0,c=e.length;o<c;o++){var u=e[o]*i,l=o<c-1?e[o+1]*i:t.length;a-=Math.abs(M(t,u,l,i))}var h=0;for(o=0;o<n.length;o+=3){var _=n[o]*i,f=n[o+1]*i,d=n[o+2]*i;h+=Math.abs((t[_]-t[d])*(t[f+1]-t[_+1])-(t[_]-t[f])*(t[d+1]-t[_+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},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 s=0;s<t[r].length;s++)for(var a=0;a<e;a++)i.vertices.push(t[r][s][a]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i}}),{}],199:[(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 s(){this.reset()}function a(){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(s.prototype,{reset:function(){this.closed=!1,this.nbevel=0,this.complex=!0,this.points?this.points.length=0:this.points=[]}}),cc.js.mixin(a.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,s,a,o){var c=this._curPath,u=c.points[c.points.length-1];u.x!==t||u.y!==e||r!==a||s!==o?(i.tesselateBezier(this,u.x,u.y,t,e,r,s,a,o,0,n.PT_CORNER),this._commandx=a,this._commandy=o):this.lineTo(a,o)},quadraticCurveTo:function(t,e,i,n){var r=this._commandx,s=this._commandy;this.bezierCurveTo(r+2/3*(t-r),s+2/3*(e-s),i+2/3*(t-i),n+2/3*(e-n),i,n)},arc:function(t,e,n,r,s,a){i.arc(this,t,e,n,r,s,a)},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,s){i.roundRect(this,t,e,n,r,s),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 s,this._paths.push(e)),this._pathLength++,this._curPath=e,e},_addPoint:function(t,e,i){var n=this._curPath;if(n){var s,a=this._points,o=n.points;(s=a[this._pointsOffset++])?(s.x=t,s.y=e):(s=new r(t,e),a.push(s)),s.flags=i,o.push(s)}}}),cc.Graphics._Impl=a,e.exports=a}),{"../../../../graphics/helper":148,"../../../../graphics/types":150}],200:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("../../../assembler")),r=s(t("../../../../../renderer/core/input-assembler"));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var o=t("../../mesh-buffer"),c=t("../../../index"),u=t("../../../../graphics/graphics"),l=t("../../../../graphics/types").PointFlags,h=u.LineJoin,_=u.LineCap,f=t("./earcut");t("./impl");var d=Math.PI,p=Math.min,v=Math.max,g=Math.ceil,m=Math.acos,y=Math.cos,T=Math.sin,E=Math.atan2;function A(t,e,i){return t<e?e:t>i?i:t}var C=cc.gfx,x=new C.VertexFormat([{name:C.ATTR_POSITION,type:C.ATTR_TYPE_FLOAT32,num:2},{name:C.ATTR_COLOR,type:C.ATTR_TYPE_UINT8,num:4,normalize:!0},{name:"a_dist",type:C.ATTR_TYPE_FLOAT32,num:1}]);x.name="vfmtPosColorSdf";var b=(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,a(e,i);var s=n.prototype;return s.getVfmt=function(){return x},s.getVfmtFloatCount=function(){return 4},s.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},s.getBuffers=function(){return 0===this._buffers.length&&this.requestBuffer(),this._buffers},s.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 s=0,a=e.length;s<a;s++){var o=e[s];o.indiceStart=0,o.vertexStart=0,o.meshbuffer.reset()}},s.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 s=i[n],a=s.meshbuffer;s.ia._count=s.indiceStart,e._flushIA(s.ia),a.uploadData()}},s.genBuffer=function(t,e){var i=this.getBuffers(),n=i[this._bufferOffset],r=n.meshbuffer,s=n.vertexStart+e;return(s>65535||3*s>131070)&&(++this._bufferOffset,s=e,this._bufferOffset<i.length?n=i[this._bufferOffset]:(n=this.requestBuffer(t),i[this._bufferOffset]=n),r=n.meshbuffer),s>r.vertexOffset&&r.requestStatic(e,3*e),this._buffer=n,n},s.stroke=function(t){this._curColor=t._strokeColor._val,this._flattenPaths(t._impl),this._expandStroke(t),t._impl._updatePathOffset=!0},s.fill=function(t){this._curColor=t._fillColor._val,this._expandFill(t),t._impl._updatePathOffset=!0},s._expandStroke=function(t){var e,i,n,r,s=.5*t.lineWidth,a=t.lineCap,o=t.lineJoin,c=t.miterLimit,u=t._impl,f=(e=s,i=d,n=u._tessTol,r=2*m(e/(e+n)),v(2,g(i/r)));this._calculateJoins(u,s,o,c);for(var p=u._paths,y=0,T=u._pathOffset,E=u._pathLength;T<E;T++){var A=p[T],C=A.points.length;o===h.ROUND?y+=2*(C+A.nbevel*(f+2)+1):y+=2*(C+5*A.nbevel+1),A.closed||(a===_.ROUND?y+=2*(2*f+2):y+=12)}for(var x=this.genBuffer(t,y),b=x.meshbuffer,S=b._vData,w=b._iData,R=u._pathOffset,I=u._pathLength;R<I;R++){var M,O=p[R],L=O.points,D=L.length,P=x.vertexStart,N=void 0,F=void 0,B=void 0,z=void 0;if((M=O.closed)?(N=L[D-1],F=L[0],B=0,z=D):(N=L[0],F=L[1],B=1,z=D-1),F=F||N,!M){var V=F.sub(N);V.normalizeSelf();var U=V.x,k=V.y;a===_.BUTT?this._buttCapStart(N,U,k,s,0):a===_.SQUARE?this._buttCapStart(N,U,k,s,s):a===_.ROUND&&this._roundCapStart(N,U,k,s,f)}for(var H=B;H<z;++H)o===h.ROUND?this._roundJoin(N,F,s,s,f):0!=(F.flags&(l.PT_BEVEL|l.PT_INNERBEVEL))?this._bevelJoin(N,F,s,s):(this._vset(F.x+F.dmx*s,F.y+F.dmy*s,1),this._vset(F.x-F.dmx*s,F.y-F.dmy*s,-1)),N=F,F=L[H+1];if(M){var W=this.getVfmtFloatCount(),G=P*W;this._vset(S[G],S[G+1],1),this._vset(S[G+W],S[G+W+1],-1)}else{var j=F.sub(N);j.normalizeSelf();var Y=j.x,X=j.y;a===_.BUTT?this._buttCapEnd(F,Y,X,s,0):a===_.SQUARE?this._buttCapEnd(F,Y,X,s,s):a===_.ROUND&&this._roundCapEnd(F,Y,X,s,f)}for(var q=x.indiceStart,Z=P+2,K=x.vertexStart;Z<K;Z++)w[q++]=Z-2,w[q++]=Z-1,w[q++]=Z;x.indiceStart=q}},s._expandFill=function(t){for(var e=t._impl,i=e._paths,n=0,r=e._pathOffset,s=e._pathLength;r<s;r++)n+=i[r].points.length;for(var a=this.genBuffer(t,n),o=a.meshbuffer,c=o._vData,u=o._iData,l=e._pathOffset,h=e._pathLength;l<h;l++){var _=i[l],d=_.points,p=d.length;if(0!==p){for(var v=a.vertexStart,g=0;g<p;++g)this._vset(d[g].x,d[g].y);var m=a.indiceStart;if(_.complex){for(var y=[],T=this.getVfmtFloatCount(),E=v,A=a.vertexStart;E<A;E++){var C=E*T;y.push(c[C]),y.push(c[C+1])}var x=f(y,null,2);if(!x||0===x.length)continue;for(var b=0,S=x.length;b<S;b++)u[m++]=x[b]+v}else for(var w=v,R=v+2,I=a.vertexStart;R<I;R++)u[m++]=w,u[m++]=R-1,u[m++]=R;a.indiceStart=m}}},s._calculateJoins=function(t,e,i,n){var r=0;e>0&&(r=1/e);for(var s=t._paths,a=t._pathOffset,o=t._pathLength;a<o;a++){var c=s[a],u=c.points,_=u.length,f=u[_-1],d=u[0];c.nbevel=0;for(var g=0;g<_;g++){var m,y,T=f.dy,E=-f.dx,A=d.dy,C=-d.dx;if(d.dmx=.5*(T+A),d.dmy=.5*(E+C),(m=d.dmx*d.dmx+d.dmy*d.dmy)>1e-6){var x=1/m;x>600&&(x=600),d.dmx*=x,d.dmy*=x}d.dx*f.dy-f.dx*d.dy>0&&(d.flags|=l.PT_LEFT),m*(y=v(11,p(f.len,d.len)*r))*y<1&&(d.flags|=l.PT_INNERBEVEL);var b=d.dmx*e,S=d.dmy*e,w=b*b+S*S;(w>d.len*d.len||w>f.len*f.len)&&(d.flags|=l.PT_INNERBEVEL),d.flags&l.PT_CORNER&&(m*n*n<1||i===h.BEVEL||i===h.ROUND)&&(d.flags|=l.PT_BEVEL),0!=(d.flags&(l.PT_BEVEL|l.PT_INNERBEVEL))&&c.nbevel++,f=d,d=u[g+1]}}},s._flattenPaths=function(t){for(var e=t._paths,i=t._pathOffset,n=t._pathLength;i<n;i++){var r=e[i],s=r.points,a=s[s.length-1],o=s[0];s.length>2&&a.equals(o)&&(r.closed=!0,s.pop(),a=s[s.length-1]);for(var c=0,u=s.length;c<u;c++){var l=o.sub(a);a.len=l.mag(),(l.x||l.y)&&l.normalizeSelf(),a.dx=l.x,a.dy=l.y,a=o,o=s[c+1]}}},s._chooseBevel=function(t,e,i,n){var r,s,a,o,c=i.x,u=i.y;return 0!==t?(r=c+e.dy*n,s=u-e.dx*n,a=c+i.dy*n,o=u-i.dx*n):(r=a=c+i.dmx*n,s=o=u+i.dmy*n),[r,s,a,o]},s._buttCapStart=function(t,e,i,n,r){var s=t.x-e*r,a=t.y-i*r,o=i,c=-e;this._vset(s+o*n,a+c*n,1),this._vset(s-o*n,a-c*n,-1)},s._buttCapEnd=function(t,e,i,n,r){var s=t.x+e*r,a=t.y+i*r,o=i,c=-e;this._vset(s+o*n,a+c*n,1),this._vset(s-o*n,a-c*n,-1)},s._roundCapStart=function(t,e,i,n,r){for(var s=t.x,a=t.y,o=i,c=-e,u=0;u<r;u++){var l=u/(r-1)*d,h=y(l)*n,_=T(l)*n;this._vset(s-o*h-e*_,a-c*h-i*_,1),this._vset(s,a,0)}this._vset(s+o*n,a+c*n,1),this._vset(s-o*n,a-c*n,-1)},s._roundCapEnd=function(t,e,i,n,r){var s=t.x,a=t.y,o=i,c=-e;this._vset(s+o*n,a+c*n,1),this._vset(s-o*n,a-c*n,-1);for(var u=0;u<r;u++){var l=u/(r-1)*d,h=y(l)*n,_=T(l)*n;this._vset(s,a,0),this._vset(s-o*h+e*_,a-c*h+i*_,1)}},s._roundJoin=function(t,e,i,n,r){var s=t.dy,a=-t.dx,o=e.dy,c=-e.dx,u=e.x,h=e.y;if(0!=(e.flags&l.PT_LEFT)){var _=this._chooseBevel(e.flags&l.PT_INNERBEVEL,t,e,i),f=_[0],p=_[1],v=_[2],m=_[3],C=E(-a,-s),x=E(-c,-o);x>C&&(x-=2*d),this._vset(f,p,1),this._vset(u-s*n,e.y-a*n,-1);for(var b=A(g((C-x)/d)*r,2,r),S=0;S<b;S++){var w=C+S/(b-1)*(x-C),R=u+y(w)*n,I=h+T(w)*n;this._vset(u,h,0),this._vset(R,I,-1)}this._vset(v,m,1),this._vset(u-o*n,h-c*n,-1)}else{var M=this._chooseBevel(e.flags&l.PT_INNERBEVEL,t,e,-n),O=M[0],L=M[1],D=M[2],P=M[3],N=E(a,s),F=E(c,o);F<N&&(F+=2*d),this._vset(u+s*n,h+a*n,1),this._vset(O,L,-1);for(var B=A(g((F-N)/d)*r,2,r),z=0;z<B;z++){var V=N+z/(B-1)*(F-N),U=u+y(V)*i,k=h+T(V)*i;this._vset(U,k,1),this._vset(u,h,0)}this._vset(u+o*n,h+c*n,1),this._vset(D,P,-1)}},s._bevelJoin=function(t,e,i,n){var r,s,a,o,c,u,h,_,f=t.dy,d=-t.dx,p=e.dy,v=-e.dx;if(e.flags&l.PT_LEFT){var g=this._chooseBevel(e.flags&l.PT_INNERBEVEL,t,e,i);c=g[0],u=g[1],h=g[2],_=g[3],this._vset(c,u,1),this._vset(e.x-f*n,e.y-d*n,-1),this._vset(h,_,1),this._vset(e.x-p*n,e.y-v*n,-1)}else{var m=this._chooseBevel(e.flags&l.PT_INNERBEVEL,t,e,-n);r=m[0],s=m[1],a=m[2],o=m[3],this._vset(e.x+f*i,e.y+d*i,1),this._vset(r,s,-1),this._vset(e.x+p*i,e.y+v*i,1),this._vset(a,o,-1)}},s._vset=function(t,e,i){void 0===i&&(i=0);var n=this._buffer,r=n.meshbuffer,s=n.vertexStart*this.getVfmtFloatCount(),a=r._vData,o=r._uintVData;a[s]=t,a[s+1]=e,o[s+2]=this._curColor,a[s+3]=i,n.vertexStart++,r._dirty=!0},n})(n.default);i.default=b,n.default.register(cc.Graphics,b),e.exports=i.default}),{"../../../../../renderer/core/input-assembler":265,"../../../../graphics/graphics":147,"../../../../graphics/types":150,"../../../assembler":186,"../../../index":189,"../../mesh-buffer":217,"./earcut":198,"./impl":199}],201:[(function(t){"use strict";cc.assemblers={},t("./sprite"),t("./mask-assembler"),t("./graphics"),t("./label"),t("./motion-streak")}),{"./graphics":200,"./label":206,"./mask-assembler":207,"./motion-streak":208,"./sprite":215}],202:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=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,s(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 s=this._renderData.iDatas[0],o=0,c=0,u=n;o<u;o+=6,c+=4)s[o]=c,s[o+1]=c+1,s[o+2]=c+2,s[o+3]=c+1,s[o+4]=c+3,s[o+5]=c+2;a=0},r._quadsUpdated=function(){a=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,s,o){var c=this._renderData,u=c.vDatas[0],l=c.uintVDatas[0];this.verticesCount+=4,this.indicesCount=this.verticesCount/2*3;var h,_,f,d,p=e.width,v=e.height,g=i.width,m=i.height,y=this._getColor(t),T=this.floatsPerVert,E=a+this.uvOffset;n?(h=i.x/p,f=(i.x+m)/p,_=(i.y+g)/v,d=i.y/v,u[E]=h,u[E+1]=d,u[E+=T]=h,u[E+1]=_,u[E+=T]=f,u[E+1]=d,u[E+=T]=f,u[E+1]=_):(h=i.x/p,f=(i.x+g)/p,_=(i.y+m)/v,d=i.y/v,u[E]=h,u[E+1]=_,u[E+=T]=f,u[E+1]=_,u[E+=T]=h,u[E+1]=d,u[E+=T]=f,u[E+1]=d),h=r,f=r+g*o,_=s-m*o,d=s,this.appendVerts(t,a,h,f,_,d);for(var A=a+this.colorOffset,C=0;C<4;C++)l[A]=y,A+=T;a+=4*this.floatsPerVert},r.appendVerts=function(t,e,i,n,r,s){var a=this._local,o=this.floatsPerVert;a[e]=i,a[e+1]=r,a[e+=o]=n,a[e+1]=r,a[e+=o]=i,a[e+1]=s,a[e+=o]=n,a[e+1]=s},r.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],s=e[5],a=e[12],o=e[13],c=this._local,u=this._renderData.vDatas[0],l=this.floatsPerVert,h=0;h<c.length;h+=l){var _=c[h],f=c[h+1];u[h]=_*i+f*r+a,u[h+1]=_*n+f*s+o}},n})(r.default);i.default=o,e.exports=i.default}),{"../../../../utils/label/bmfont":193}],203:[(function(t,e,i){"use strict";function n(t,e){return(n=Object.setPrototypeOf||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"),s=cc.color(255,255,255,255),a=(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 a=r.prototype;return a.createData=function(t){return t.requestRenderData()},a._getColor=function(t){return s._fastSetA(t.node._color.a),s._val},a.updateColor=function(e){var i=this._getColor(e);t.prototype.updateColor.call(this,e,i)},r})(r);i.default=a,e.exports=i.default}),{"../../../../../platform/js":179,"../../../../utils/label/letter-font":195,"./bmfont":202}],204:[(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 s=(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=jsb.LabelRenderer._cfgFields,this._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 s=t.getInt8(e);t.setInt8(e,r|s)}else if("int32"==n&&4==i){var a=t.getInt32(e,jsb.__isLittleEndian__);t.setInt32(e,r|a,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"),s=this._getLayoutValue("shadowY");n>0!=i>0&&this._updateCfgFlag_Font();var a=!1;n!=i&&(this._setLayoutValue("shadowBlur",i),a=!0),r!=t&&(this._setLayoutValue("shadowX",t),a=!0),s!=e&&(this._setLayoutValue("shadowY",e),a=!0),a&&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 s=n.getComponent(cc.LabelShadow);if(s&&s.enabled){var a=s.color;this.setShadow(s.offset.x,s.offset.y,s.blur),this.setShadowColor(this._colorToObj(a.getR(),a.getG(),a.getB(),Math.ceil(a.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),s=0;if(r&&r.enabled&&r.width>0){s=Math.max(Math.min(r.width/10,.4),.1);var a=r.color;this.setOutlineColor(this._colorToObj(a.getR(),a.getG(),a.getB(),Math.ceil(a.getA()*i.opacity/255)))}this.setOutline(s),e.define("CC_USE_MODEL",!0),e.define("USE_TEXTURE_ALPHAONLY",!0),e.define("USE_SDF",s>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=s,e.exports=i.default}),{"../../../../../assets/material/CCMaterial":77,"../../../../../assets/material/material-variant":84,"../../../../../components/CCLabel":97,"../../../../../components/CCLabelOutline":98,"../../../../../components/CCLabelShadow":99}],205:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=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,s(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,s=0;s<4;s++){var a=2*s,o=r*s+n;e[o]=i[a],e[o+1]=i[a+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,s=e.anchorY*e.height,o=a&&t.getComponent(a);if(o&&o._enabled){var c=(i-e.width)/2,u=(n-e.height)/2,l=o.offset;-l.x>c?r+=i-e.width:c>l.x&&(r+=c-l.x),-l.y>u?s+=n-e.height:u>l.y&&(s+=u-l.y)}var h=this._local;h[0]=-r,h[1]=-s,h[2]=i-r,h[3]=n-s,this.updateUVs(t),this.updateWorldVerts(t)},n})(r.default);i.default=c,e.exports=i.default}),{"../../../../../components/CCLabelShadow":99,"../../../../utils/label/ttf":196}],206:[(function(t){"use strict";var e=u(t("../../../assembler")),i=u(t("../../../../components/CCLabel")),n=u(t("./2d/ttf")),r=u(t("./2d/bmfont")),s=u(t("./2d/letter")),a=u(t("./3d/ttf")),o=u(t("./3d/bmfont")),c=u(t("./3d/letter"));function u(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,u=e?a.default:n.default;return t.font instanceof cc.BitmapFont?u=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!"):u=e?c.default:s.default),u},TTF:n.default,Bmfont:r.default,Letter:s.default,TTF3D:a.default,Bmfont3D:o.default,Letter3D:c.default,NativeTTF:void 0})}),{"../../../../components/CCLabel":97,"../../../assembler":186,"./2d/bmfont":202,"./2d/letter":203,"./2d/nativeTTF":204,"./2d/ttf":205,"./3d/bmfont":void 0,"./3d/letter":void 0,"./3d/ttf":void 0}],207:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=t("../../../components/CCMask"),o=t("../../render-flow"),c=t("./sprite/2d/simple"),u=t("./graphics"),l=t("../../../../renderer/gfx"),h=t("../vertex-format").vfmtPos,_=8,f=[];function d(){return 1<<f.length-1}function p(){for(var t=0,e=0;e<f.length;++e)t+=1<<e;return t}function v(t,e,i,n,r,s){var a=t.effect,o=l.STENCIL_OP_KEEP,c=l.STENCIL_OP_KEEP;a.setStencil(l.STENCIL_ENABLE,e,n,r,i,o,c,s)}function g(t){f.length+1>_&&cc.errorID(9e3,_),f.push(t)}function m(t,e){0===f.length&&cc.errorID(9001),f.pop(),0===f.length?e._flushMaterial(t._exitMaterial):E(e)}function y(t,e){var i=l.DS_FUNC_NEVER,n=d(),r=n,s=n,a=t.inverted?l.STENCIL_OP_REPLACE:l.STENCIL_OP_ZERO;v(t._clearMaterial,i,a,n,r,s);var o=e.getBuffer("mesh",h),c=o.request(4,6),u=c.indiceOffset,_=c.byteOffset>>2,f=c.vertexOffset,p=o._vData,g=o._iData;p[_++]=-1,p[_++]=-1,p[_++]=-1,p[_++]=1,p[_++]=1,p[_++]=1,p[_++]=1,p[_++]=-1,g[u++]=f,g[u++]=f+3,g[u++]=f+1,g[u++]=f+1,g[u++]=f+3,g[u++]=f+2,e.node=e._dummyNode,e.material=t._clearMaterial,e._flush()}function T(t,e){var i=l.DS_FUNC_NEVER,n=d(),r=n,s=n,o=t.inverted?l.STENCIL_OP_ZERO:l.STENCIL_OP_REPLACE;v(t._materials[0],i,o,n,r,s),e.material=t._materials[0],t._type===a.Type.IMAGE_STENCIL?(e.node=e._dummyNode,c.prototype.fillBuffers.call(t._assembler,t,e),e._flush()):(e.node=t.node,u.prototype.fillBuffers.call(t._graphics._assembler,t._graphics,e))}function E(t){var e=l.DS_FUNC_EQUAL,i=l.STENCIL_OP_KEEP,n=p(),r=n,s=d(),a=f[f.length-1];v(a._enableMaterial,e,i,n,r,s),t._flushMaterial(a._enableMaterial)}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,s(e,i);var r=n.prototype;return r.updateRenderData=function(t){t._type===a.Type.IMAGE_STENCIL?t.spriteFrame?c.prototype.updateRenderData.call(this,t):t.setMaterial(0,null):(t._graphics.setMaterial(0,t._materials[0]),u.prototype.updateRenderData.call(t._graphics._assembler,t._graphics,t._graphics))},r.fillBuffers=function(t,e){(t._type!==a.Type.IMAGE_STENCIL||t.spriteFrame)&&(g(t),y(t,e),T(t,e),E(e)),t.node._renderFlag|=o.FLAG_UPDATE_RENDER_DATA},r.postFillBuffers=function(t,e){(t._type!==a.Type.IMAGE_STENCIL||t.spriteFrame)&&m(t,e),t.node._renderFlag|=o.FLAG_UPDATE_RENDER_DATA},n})(c);i.MaskAssembler=A,r.default.register(a,A)}),{"../../../../renderer/gfx":275,"../../../components/CCMask":101,"../../assembler":186,"../../render-flow":190,"../vertex-format":222,"./graphics":200,"./sprite/2d/simple":212}],208:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=t("../../../components/CCMotionStreak"),o=t("../../render-flow");function c(t,e){this.point=t||cc.v2(),this.dir=e||cc.v2(),this.distance=0,this.time=0}c.prototype.setPoint=function(t,e){this.point.x=t,this.point.y=e},c.prototype.setDir=function(t,e){this.dir.x=t,this.dir.y=e},cc.v2(),cc.v2();var u=cc.v2(),l=cc.v2();function h(t,e){return t.x=-e.y,t.y=e.x,t}var _=(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 r=n.prototype;return r.initData=function(){this._renderData.createFlexData(0,16,42)},r.update=function(t,e){var i,n=t._stroke/2,r=t.node._worldMatrix.m,s=r[12],a=r[13],o=t._points;if(o.length>1){var _=o[0].point.x-s,f=o[0].point.y-a;_*_+f*f<t.minSeg&&(i=o[0])}i||(i=new c,o.splice(0,0,i)),i.setPoint(s,a),i.time=t._fadeTime+e;var d,p=0;if(!(o.length<2)){var v=t._color,g=v.r,m=v.g,y=v.b,T=v.a,E=o[1];E.distance=i.point.sub(E.point,l).mag(),l.normalizeSelf(),E.setDir(l.x,l.y),i.setDir(l.x,l.y);var A=this._renderData._flexBuffer;A.reserve(2*o.length,6*(o.length-1));for(var C=A.vData,x=A.uintVData,b=t._fadeTime,S=!1,w=o.length-1;w>=0;w--){var R=o[w],I=R.point,M=R.dir;if(R.time-=e,R.time<0)o.splice(w,1);else{var O=R.time/b,L=o[w-1];if(!S){if(!L){o.splice(w,1);continue}I.x=L.point.x-M.x*O,I.y=L.point.y-M.y*O}S=!0,h(u,M);var D=(O*T<<24>>>0)+(y<<16)+(m<<8)+g,P=5*p;C[P]=I.x+u.x*n,C[P+1]=I.y+u.y*n,C[P+2]=1,C[P+3]=O,x[P+4]=D,C[P+=5]=I.x-u.x*n,C[P+1]=I.y-u.y*n,C[P+2]=0,C[P+3]=O,x[P+4]=D,p+=2}}d=p<=2?0:3*(p-2),A.used(p,d)}},r.fillBuffers=function(t,e){var i=this._renderData._flexBuffer,n=i.vData,r=i.usedVertices,s=i.usedIndices,a=i.usedVerticesFloats,c=e._meshBuffer,u=c.request(r,s),l=u.byteOffset>>2,h=c._vData;n.length+l>h.length?h.set(n.subarray(0,a),l):h.set(n,l);for(var _=c._iData,f=u.indiceOffset,d=u.vertexOffset,p=0,v=r;p<v;p+=2){var g=d+p;_[f++]=g,_[f++]=g+2,_[f++]=g+1,_[f++]=g+1,_[f++]=g+2,_[f++]=g+3}t.node._renderFlag|=o.FLAG_UPDATE_RENDER_DATA},n})(r.default);i.default=_,_.register(a,_),e.exports=i.default}),{"../../../components/CCMotionStreak":102,"../../assembler-2d":184,"../../render-flow":190}],209:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=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,s(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,s,o,c,u,l,h,_,f,d=t._spriteFrame,p=d._texture.width,v=d._texture.height,g=d._rect;d._rotated?(n=g.x/p,r=(g.y+g.width)/v,s=c=n,l=_=(g.x+g.height)/p,u=f=r,o=h=g.y/v):(n=g.x/p,r=(g.y+g.height)/v,s=l=n,c=_=(g.x+g.width)/p,o=u=r,h=f=g.y/v);var m=this._renderData.vDatas[0],y=this.uvOffset,T=this.floatsPerVert;switch(t._fillType){case a.HORIZONTAL:m[y]=s+(c-s)*e,m[y+1]=o+(u-o)*e,m[y+T]=s+(c-s)*i,m[y+T+1]=o+(u-o)*i,m[y+2*T]=l+(_-l)*e,m[y+2*T+1]=h+(f-h)*e,m[y+3*T]=l+(_-l)*i,m[y+3*T+1]=h+(f-h)*i;break;case a.VERTICAL:m[y]=s+(l-s)*e,m[y+1]=o+(h-o)*e,m[y+T]=c+(_-c)*e,m[y+T+1]=u+(f-u)*e,m[y+2*T]=s+(l-s)*i,m[y+2*T+1]=o+(h-o)*i,m[y+3*T]=c+(_-c)*i,m[y+3*T+1]=u+(f-u)*i;break;default:cc.errorID(2626)}},r.updateVerts=function(t,e,i){var n,r=t.node,s=r.width,o=r.height,c=r.anchorX*s,u=r.anchorY*o,l=-c,h=-u,_=s-c,f=o-u;switch(t._fillType){case a.HORIZONTAL:n=l+(_-l)*i,l+=(_-l)*e,_=n;break;case a.VERTICAL:n=h+(f-h)*i,h+=(f-h)*e,f=n;break;default:cc.errorID(2626)}var d=this._local;d[0]=l,d[1]=h,d[2]=_,d[3]=f,this.updateWorldVerts(t)},n})(r.default);i.default=o,e.exports=i.default}),{"../../../../../components/CCSprite":112,"../../../../assembler-2d":184}],210:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var s=(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 s=n.prototype;return s.initData=function(){this._renderData.createFlexData(0,4,6,this.getVfmt())},s.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)}}},s.updateIndices=function(t){this._renderData.iDatas[0].set(t)},s.updateUVs=function(t){for(var e=t.spriteFrame.vertices,i=e.nu,n=e.nv,r=this.uvOffset,s=this.floatsPerVert,a=this._renderData.vDatas[0],o=0;o<i.length;o++){var c=s*o+r;a[c]=i[o],a[c+1]=n[o]}},s.updateVerts=function(t){var e=t.node,i=Math.abs(e.width),n=Math.abs(e.height),r=e.anchorX*i,s=e.anchorY*n,a=t.spriteFrame,o=a.vertices,c=o.x,u=o.y,l=a._originalSize.width,h=a._originalSize.height,_=a._rect.width,f=a._rect.height,d=a._offset.x+(l-_)/2,p=a._offset.y+(h-f)/2,v=i/(t.trim?_:l),g=n/(t.trim?f:h),m=this._local;if(t.trim)for(var y=0,T=c.length;y<T;y++){var E=2*y;m[E]=(c[y]-d)*v-r,m[E+1]=(h-u[y]-p)*g-s}else for(var A=0,C=c.length;A<C;A++){var x=2*A;m[x]=c[A]*v-r,m[x+1]=(h-u[A])*g-s}if(a._flipX)for(var b=0,S=this.verticesCount;b<S;b++)m[2*b]=i-m[2*b]-2*r;if(a._flipY)for(var w=0,R=this.verticesCount;w<R;w++)m[2*w+1]=n-m[2*w+1]-2*s},s.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],s=e[5],a=e[12],o=e[13],c=this._local,u=this._renderData.vDatas[0],l=this.floatsPerVert,h=0,_=this.verticesCount;h<_;h++){var f=c[2*h],d=c[2*h+1];u[l*h]=f*i+d*r+a,u[l*h+1]=f*n+d*s+o}},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=s,e.exports=i.default}),{"../../../../assembler-2d":184}],211:[(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=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],u=[0,0,0,0,0,0,0,0],l=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],h=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],_=cc.v2(0,0),f=[];function d(t,e,i,n,r,s,a){var o,c,u=Math.sin(s),l=Math.cos(s);if(0!==Math.cos(s)){if(o=u/l,(t-r.x)*l>0){var h=r.y+o*(t-r.x);a[0].x=t,a[0].y=h}if((e-r.x)*l>0){var _=r.y+o*(e-r.x);a[2].x=e,a[2].y=_}}if(0!==Math.sin(s)){if(c=l/u,(n-r.y)*u>0){var f=r.x+c*(n-r.y);a[3].x=f,a[3].y=n}if((i-r.y)*u>0){var d=r.x+c*(i-r.y);a[1].x=d,a[1].y=i}}}function p(t){var e=t.node,i=e.width,n=e.height,r=e.anchorX*i,s=e.anchorY*n,a=-r,u=-s,l=i-r,h=n-s,d=c;d[0]=a,d[1]=u,d[2]=l,d[3]=h;var p=t._fillCenter,v=_.x=Math.min(Math.max(0,p.x),1)*(l-a)+a,g=_.y=Math.min(Math.max(0,p.y),1)*(h-u)+u;o[0].x=o[3].x=a,o[1].x=o[2].x=l,o[0].y=o[1].y=u,o[2].y=o[3].y=h,f.length=0,v!==d[0]&&(f[0]=[3,0]),v!==d[2]&&(f[2]=[1,2]),g!==d[1]&&(f[1]=[0,1]),g!==d[3]&&(f[3]=[2,3])}function v(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 g=(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 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,s,o,f,v,g,m,y=e.spriteFrame;if(this.packToDynamicAtlas(e,y),e._vertsDirty){var T=e._fillStart,E=e._fillRange;for(E<0&&(T+=E,E=-E);T>=1;)T-=1;for(;T<0;)T+=1;T*=a,E*=a,p(e),f=(i=y)._texture.width,v=i._texture.height,g=i._rect,m=u,i._rotated?(n=g.x/f,r=(g.x+g.height)/f,s=g.y/v,o=(g.y+g.width)/v,m[0]=m[2]=n,m[4]=m[6]=r,m[3]=m[7]=o,m[1]=m[5]=s):(n=g.x/f,r=(g.x+g.width)/f,s=g.y/v,o=(g.y+g.height)/v,m[0]=m[4]=n,m[2]=m[6]=r,m[1]=m[3]=o,m[5]=m[7]=s),d(c[0],c[2],c[1],c[3],_,T,l),d(c[0],c[2],c[1],c[3],_,T+E,h),this.updateVerts(e,T,E),e._vertsDirty=!1}},r.updateVerts=function(t,e,i){var n=e+i,r=this._local;r.length=0;for(var s=0,c=3*this.floatsPerVert,u=0;u<4;++u){var d=f[u];if(d)if(i>=a)r.length=s+c,this._generateTriangle(r,s,_,o[d[0]],o[d[1]]),s+=c;else{var p=v(_,o[d[0]]),g=v(_,o[d[1]]);g<p&&(g+=a),p-=a,g-=a;for(var m=0;m<3;++m)p>=n||(p>=e?(r.length=s+c,g>=n?this._generateTriangle(r,s,_,o[d[0]],h[u]):this._generateTriangle(r,s,_,o[d[0]],o[d[1]]),s+=c):g<=e||(g<=n?(r.length=s+c,this._generateTriangle(r,s,_,l[u],o[d[1]]),s+=c):(r.length=s+c,this._generateTriangle(r,s,_,l[u],h[u]),s+=c))),p+=a,g+=a}}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,s=r.length/n;this.verticesCount=this.indicesCount=s;var a=i._flexBuffer;a.reserve(s,s)&&this.updateIndices(),a.used(this.verticesCount,this.indicesCount);for(var o=i.vDatas[0],c=i.uintVDatas[0],u=this.uvOffset,l=0;l<r.length;l+=n){var h=l+u;o[h]=r[h],o[h+1]=r[h+1],c[h+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],s=e[5],a=e[12],o=e[13],c=this._local,u=this._renderData.vDatas[0],l=this.floatsPerVert,h=0;h<c.length;h+=l){var _=c[h],f=c[h+1];u[h]=_*i+f*r+a,u[h+1]=_*n+f*s+o}},r._generateTriangle=function(t,e,i,n,r){var s=c,a=s[0],o=s[1],u=s[2],l=s[3],h=this.floatsPerVert;t[e]=i.x,t[e+1]=i.y,t[e+h]=n.x,t[e+h+1]=n.y,t[e+2*h]=r.x,t[e+2*h+1]=r.y;var _,f,d=this.uvOffset;_=(i.x-a)/(u-a),f=(i.y-o)/(l-o),this._generateUV(_,f,t,e+d),_=(n.x-a)/(u-a),f=(n.y-o)/(l-o),this._generateUV(_,f,t,e+h+d),_=(r.x-a)/(u-a),f=(r.y-o)/(l-o),this._generateUV(_,f,t,e+2*h+d)},r._generateUV=function(t,e,i,n){var r=u[0]+(u[2]-u[0])*t,s=u[4]+(u[6]-u[4])*t,a=u[1]+(u[3]-u[1])*t,o=u[5]+(u[7]-u[5])*t;i[n]=r+(s-r)*e,i[n+1]=a+(o-a)*e},n})(r.default);i.default=g,e.exports=i.default}),{"../../../../assembler-2d":184}],212:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var s=(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 s=n.prototype;return s.updateRenderData=function(t){this.packToDynamicAtlas(t,t._spriteFrame),t._vertsDirty&&(this.updateUVs(t),this.updateVerts(t),t._vertsDirty=!1)},s.updateUVs=function(t){for(var e=t._spriteFrame.uv,i=this.uvOffset,n=this.floatsPerVert,r=this._renderData.vDatas[0],s=0;s<4;s++){var a=2*s,o=n*s+i;r[o]=e[a],r[o+1]=e[a+1]}},s.updateVerts=function(t){var e,i,n,r,s=t.node,a=s.width,o=s.height,c=s.anchorX*a,u=s.anchorY*o;if(t.trim)e=-c,i=-u,n=a-c,r=o-u;else{var l=t.spriteFrame,h=l._originalSize.width,_=l._originalSize.height,f=l._rect.width,d=l._rect.height,p=l._offset,v=a/h,g=o/_,m=p.x+(h-f)/2,y=p.x-(h-f)/2;e=m*v-c,i=(p.y+(_-d)/2)*g-u,n=a+y*v-c,r=o+(p.y-(_-d)/2)*g-u}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=s,e.exports=i.default}),{"../../../../assembler-2d":184}],213:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var s=(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 s=n.prototype;return s.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}}},s.initLocal=function(){this._local=[],this._local.length=8},s.updateRenderData=function(t){var e=t._spriteFrame;this.packToDynamicAtlas(t,e),t._vertsDirty&&(this.updateUVs(t),this.updateVerts(t),t._vertsDirty=!1)},s.updateVerts=function(t){var e=t.node,i=e.width,n=e.height,r=e.anchorX*i,s=e.anchorY*n,a=t.spriteFrame,o=a.insetLeft,c=a.insetRight,u=a.insetTop,l=a.insetBottom,h=i-o-c,_=n-u-l,f=i/(o+c),d=n/(u+l);f=isNaN(f)||f>1?1:f,d=isNaN(d)||d>1?1:d,h=h<0?0:h,_=_<0?0:_;var p=this._local;p[0]=-r,p[1]=-s,p[2]=o*f-r,p[3]=l*d-s,p[4]=p[2]+h,p[5]=p[3]+_,p[6]=i-r,p[7]=n-s,this.updateWorldVerts(t)},s.updateUVs=function(t){for(var e=this._renderData.vDatas[0],i=t.spriteFrame.uvSliced,n=this.uvOffset,r=this.floatsPerVert,s=0;s<4;++s)for(var a=0;a<4;++a){var o=4*s+a,c=i[o],u=o*r;e[u+n]=c.u,e[u+n+1]=c.v}},s.updateWorldVerts=function(t){for(var e=t.node._worldMatrix.m,i=e[0],n=e[1],r=e[4],s=e[5],a=e[12],o=e[13],c=this._local,u=this._renderData.vDatas[0],l=this.floatsPerVert,h=0;h<4;++h)for(var _=c[2*h+1],f=0;f<4;++f){var d=c[2*f],p=(4*h+f)*l;u[p]=d*i+_*r+a,u[p+1]=d*n+_*s+o}},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=s,Object.assign(s.prototype,{verticesCount:16,indicesCount:54}),e.exports=i.default}),{"../../../../assembler-2d":184}],214:[(function(t,e,i){"use strict";var n;function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}i.__esModule=!0,i.default=void 0;var s=(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 s=n.prototype;return s.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()},s.initLocal=function(){this._local={x:[],y:[]}},s._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},s.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),s=e._rect,a=e.insetLeft,o=e.insetRight,c=s.width-a-o,u=e.insetTop,l=e.insetBottom,h=s.height-u-l;this.sizableWidth=n-a-o,this.sizableHeight=r-u-l,this.sizableWidth=this.sizableWidth>0?this.sizableWidth:0,this.sizableHeight=this.sizableHeight>0?this.sizableHeight:0;var _=this.hRepeat=0===c?this.sizableWidth:this.sizableWidth/c,f=this.vRepeat=0===h?this.sizableHeight:this.sizableHeight/h,d=(this.row=Math.ceil(f+2))*(this.col=Math.ceil(_+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)},s.updateVerts=function(t){var e=t._spriteFrame,i=e._rect,n=t.node,r=n.anchorX*n.width,s=n.anchorY*n.height,a=this.row,o=this.col,c=this.contentWidth,u=this.contentHeight,l=this._local,h=l.x,_=l.y;h.length=_.length=0;var f,d,p=e.insetLeft,v=e.insetRight,g=i.width-p-v,m=e.insetTop,y=e.insetBottom,T=i.height-m-y,E=n.width/(p+v)>1?1:n.width/(p+v),A=n.height/(m+y)>1?1:n.height/(m+y);f=g>0?Math.floor(1e3*this.sizableWidth)/1e3%g==0?g:this.sizableWidth%g:this.sizableWidth,d=T>0?Math.floor(1e3*this.sizableHeight)/1e3%T==0?T:this.sizableHeight%T:this.sizableHeight;for(var C=0;C<=o;C++)0===C?h[C]=-r:C>0&&C<o?h[C]=1===C?p*E+Math.min(g,this.sizableWidth)-r:g>0?C===o-1?p+f+g*(C-2)-r:p+Math.min(g,this.sizableWidth)+g*(C-2)-r:p+this.sizableWidth-r:C===o&&(h[C]=Math.min(p+this.sizableWidth+v,c)-r);for(var x=0;x<=a;x++)0===x?_[x]=-s:x>0&&x<a?_[x]=1===x?y*A+Math.min(T,this.sizableHeight)-s:T>0?x===a-1?y+d+(x-2)*T-s:y+Math.min(T,this.sizableHeight)+(x-2)*T-s:y+this.sizableHeight-s:x===a&&(_[x]=Math.min(y+this.sizableHeight+m,u)-s);this.updateWorldVerts(t)},s.updateWorldVerts=function(t){for(var e,i,n,r,s=this._renderData,a=this._local,o=a.x,c=a.y,u=s.vDatas[0],l=this.row,h=this.col,_=t.node._worldMatrix.m,f=_[0],d=_[1],p=_[4],v=_[5],g=_[12],m=_[13],y=this.floatsPerVert,T=0,E=0,A=l;E<A;++E){n=c[E],r=c[E+1];for(var C=0,x=h;C<x;++C)e=o[C],i=o[C+1],u[T]=e*f+n*p+g,u[T+1]=e*d+n*v+m,u[T+=y]=i*f+n*p+g,u[T+1]=i*d+n*v+m,u[T+=y]=e*f+r*p+g,u[T+1]=e*d+r*v+m,u[T+=y]=i*f+r*p+g,u[T+1]=i*d+r*v+m,T+=y}},s.updateUVs=function(t){var e=this._renderData.vDatas[0];if(e)for(var i=t._spriteFrame,n=i._rect,r=i.insetLeft,s=i.insetRight,a=n.width-r-s,o=i.insetTop,c=i.insetBottom,u=n.height-o-c,l=this.row,h=this.col,_=this.hRepeat,f=this.vRepeat,d=0,p=0,v=t.spriteFrame.uv,g=t.spriteFrame.uvSliced,m=t.spriteFrame._rotated,y=this.floatsPerVert,T=this.uvOffset,E=[],A=[],C=0,x=l;C<x;++C){p=this.sizableHeight>u?this.sizableHeight>=C*u?1:f%1:f;for(var b=0,S=h;b<S;++b)d=this.sizableWidth>a?this.sizableWidth>=b*a?1:_%1:_,m?(0===C?(E[0]=g[0].u,E[1]=g[0].u,E[2]=g[4].u+(g[8].u-g[4].u)*p):C<l-1?(E[0]=g[4].u,E[1]=g[4].u,E[2]=g[4].u+(g[8].u-g[4].u)*p):C===l-1&&(E[0]=g[8].u,E[1]=g[8].u,E[2]=g[12].u),0===b?(A[0]=g[0].v,A[1]=g[1].v+(g[2].v-g[1].v)*d,A[2]=g[0].v):b<h-1?(A[0]=g[1].v,A[1]=g[1].v+(g[2].v-g[1].v)*d,A[2]=g[1].v):b===h-1&&(A[0]=g[2].v,A[1]=g[3].v,A[2]=g[2].v),E[3]=E[2],A[3]=A[1]):(0===b?(E[0]=g[0].u,E[1]=g[1].u+(g[2].u-g[1].u)*d,E[2]=v[0]):b<h-1?(E[0]=g[1].u,E[1]=g[1].u+(g[2].u-g[1].u)*d,E[2]=g[1].u):b===h-1&&(E[0]=g[2].u,E[1]=g[3].u,E[2]=g[2].u),0===C?(A[0]=g[0].v,A[1]=g[0].v,A[2]=g[4].v+(g[8].v-g[4].v)*p):C<l-1?(A[0]=g[4].v,A[1]=g[4].v,A[2]=g[4].v+(g[8].v-g[4].v)*p):C===l-1&&(A[0]=g[8].v,A[1]=g[8].v,A[2]=g[12].v),E[3]=E[1],A[3]=A[2]),e[T]=E[0],e[T+1]=A[0],e[T+=y]=E[1],e[T+1]=A[1],e[T+=y]=E[2],e[T+1]=A[2],e[T+=y]=E[3],e[T+1]=A[3],T+=y}},n})(((n=t("../../../../assembler-2d"))&&n.__esModule?n:{default:n}).default);i.default=s,e.exports=i.default}),{"../../../../assembler-2d":184}],215:[(function(t){"use strict";var e=p(t("../../../assembler")),i=t("../../../../components/CCSprite"),n=p(t("./2d/simple")),r=p(t("./2d/sliced")),s=p(t("./2d/tiled")),a=p(t("./2d/radial-filled")),o=p(t("./2d/bar-filled")),c=p(t("./2d/mesh")),u=p(t("./3d/simple")),l=p(t("./3d/sliced")),h=p(t("./3d/tiled")),_=p(t("./3d/radial-filled")),f=p(t("./3d/bar-filled")),d=p(t("./3d/mesh"));function p(t){return t&&t.__esModule?t:{default:t}}var v={getConstructor:function(t){var e=t.node.is3DNode,p=e?u.default:n.default;switch(t.type){case i.Type.SLICED:p=e?l.default:r.default;break;case i.Type.TILED:p=e?h.default:s.default;break;case i.Type.FILLED:p=t._fillType===i.FillType.RADIAL?e?_.default:a.default:e?f.default:o.default;break;case i.Type.MESH:p=e?d.default:c.default}return p},Simple:n.default,Sliced:r.default,Tiled:s.default,RadialFilled:a.default,BarFilled:o.default,Mesh:c.default,Simple3D:u.default,Sliced3D:l.default,Tiled3D:h.default,RadialFilled3D:_.default,BarFilled3D:f.default,Mesh3D:d.default};e.default.register(cc.Sprite,v)}),{"../../../../components/CCSprite":112,"../../../assembler":186,"./2d/bar-filled":209,"./2d/mesh":210,"./2d/radial-filled":211,"./2d/simple":212,"./2d/sliced":213,"./2d/tiled":214,"./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}],216:[(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 s=this.iData.length;if(e>s){for(;s<e;)s*=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}),{}],217:[(function(t,e){"use strict";var i,n=(i=t("../../../renderer/gfx"))&&i.__esModule?i:{default:i},r=(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),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 n.default.VertexBuffer(t._device,e,n.default.USAGE_DYNAMIC,new ArrayBuffer,0),this._vbArr[0]=this._vb,this._ibArr=[],this._ib=new n.default.IndexBuffer(t._device,n.default.INDEX_FMT_UINT16,n.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 n.default.VertexBuffer(this._batcher._device,this._vertexFormat,n.default.USAGE_DYNAMIC,new ArrayBuffer,0),this._vbArr[t]=this._vb,this._ib=new n.default.IndexBuffer(this._batcher._device,n.default.INDEX_FMT_UINT16,n.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,s=this._iData.length;if(i>r||n>s){for(;r<i||s<n;)this._initVDataCount*=2,this._initIDataCount*=2,r=4*this._initVDataCount,s=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}});r&&(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":275}],218:[(function(t,e){"use strict";var i=s(t("../../../renderer/core/input-assembler")),n=s(t("../../../renderer/memop/recycle-pool")),r=s(t("../../../renderer/scene/model"));function s(t){return t&&t.__esModule?t:{default:t}}var a=t("./vertex-format"),o=a.vfmtPosUvColor,c=a.vfmt3D,u=t("./quad-buffer"),l=t("./mesh-buffer"),h=t("./spine-buffer"),_=t("../../assets/material/CCMaterial"),f=(new(t("../../platform/id-generater"))("VertextFormat"),{}),d=new _,p=new i.default;p._count=0;var v=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};v.prototype={constructor:v,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,f)f[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 s=this._modelPool.add();this._batchedModels.push(s),s.sortKey=this._sortKey++,s._cullingMask=this.cullingMask,s.setNode(this.node),s.setEffect(n),s.setInputAssembler(r),this._renderScene.addModel(s),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(),f)f[t].uploadData();this.walking=!1},getBuffer:function(t,e){var i=t+e.getHash(),n=f[i];if(!n){if("mesh"===t)n=new l(this,e);else if("quad"===t)n=new u(this,e);else{if("spine"!==t)return cc.error("Not support buffer type ["+t+"]"),null;n=new h(this,e)}f[i]=n}return n}},e.exports=v}),{"../../../renderer/core/input-assembler":265,"../../../renderer/memop/recycle-pool":290,"../../../renderer/scene/model":296,"../../assets/material/CCMaterial":77,"../../platform/id-generater":175,"./mesh-buffer":217,"./quad-buffer":219,"./spine-buffer":221,"./vertex-format":222}],219:[(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 s=new Uint16Array(this._iData.buffer,0,6*t);this._ib.update(0,s)},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":217}],220:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=a;var n,r=(n=t("./flex-buffer"))&&n.__esModule?n:{default:n},s=t("./vertex-format");function a(){this.vDatas=[],this.uintVDatas=[],this.iDatas=[],this.meshCount=0,this._infos=null,this._flexBuffer=null}cc.js.mixin(a.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||s.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=a,e.exports=i.default}),{"./flex-buffer":216,"./vertex-format":222}],221:[(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,s=this._iData.length;if(i>r||n>s){for(;r<i||s<n;)this._initVDataCount*=2,this._initIDataCount*=2,r=4*this._initVDataCount,s=this._initIDataCount;this._reallocBuffer()}var a=this._offsetInfo;a.vertexOffset=this.vertexOffset,a.indiceOffset=this.indiceOffset,a.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":217}],222:[(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 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}]);s.name="vfmtPosUvColor",n.default.VertexFormat.XY_UV_Color=s;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},{name:n.default.ATTR_COLOR0,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0}]);a.name="vfmtPosUvTwoColor",n.default.VertexFormat.XY_UV_Two_Color=a;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 u=new n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOAT32,num:2}]);u.name="vfmtPos",n.default.VertexFormat.XY=u,e.exports={vfmt3D:r,vfmtPosUvColor:s,vfmtPosUvTwoColor:a,vfmtPosUv:o,vfmtPosColor:c,vfmtPos:u}}),{"../../../renderer/gfx":275}],223:[(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="",s=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+s+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":167}],224:[(function(t,e){"use strict";var i=function(t,e,i,n,r,s){this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s};i.create=function(t,e,i,n,r,s){return{a:t,b:e,c:i,d:n,tx:r,ty:s}},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,s=e.c,a=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=s*i.a+a*i.c,t.d=s*i.b+a*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,s=e.d,a=1/(i*s-n*r),o=e.tx,c=e.ty;return t.a=a*s,t.b=-a*n,t.c=-a*r,t.d=a*i,t.tx=a*(r*c-s*o),t.ty=a*(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,s;return void 0===n?(n=i,r=e.x,s=e.y):(r=e,s=i),t.x=n.a*r+n.c*s+n.tx,t.y=n.b*r+n.d*s+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,s=n+e.width,a=r+e.height,o=i.a*n+i.c*r+i.tx,c=i.b*n+i.d*r+i.ty,u=i.a*s+i.c*r+i.tx,l=i.b*s+i.d*r+i.ty,h=i.a*n+i.c*a+i.tx,_=i.b*n+i.d*a+i.ty,f=i.a*s+i.c*a+i.tx,d=i.b*s+i.d*a+i.ty,p=Math.min(o,u,h,f),v=Math.max(o,u,h,f),g=Math.min(c,l,_,d),m=Math.max(c,l,_,d);return t.x=p,t.y=g,t.width=v-p,t.height=m-g,t},i.transformObb=function(t,e,i,n,r,s){var a=r.x,o=r.y,c=r.width,u=r.height,l=s.a*a+s.c*o+s.tx,h=s.b*a+s.d*o+s.ty,_=s.a*c,f=s.b*c,d=s.c*u,p=s.d*u;e.x=l,e.y=h,i.x=_+l,i.y=f+h,t.x=d+l,t.y=p+h,n.x=_+d+l,n.y=f+p+h},cc.AffineTransform=e.exports=i}),{}],225:[(function(t,e){"use strict";var i=t("../platform/CCObject").Flags,n=t("./misc"),r=t("../platform/js"),s=t("../platform/id-generater"),a=t("../event-manager"),o=t("../renderer/render-flow"),c=i.Destroying,u=i.DontDestroy,l=i.Deactivating,h=new s("Node");function _(t){return t?"string"==typeof t?r.getClassByName(t):t:(cc.errorID(3804),null)}function f(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 s=t._components[r];if(s instanceof e)return s}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 s=0;s<t._components.length;++s){var a=t._components[s];a instanceof e&&i.push(a)}}function p(t,e){for(var i=0;i<t.length;++i){var n=t[i],r=f(n,e);if(r)return r;if(n._children.length>0&&(r=p(n._children,e)))return r}return null}function v(t,e,i){for(var n=0;n<t.length;++n){var r=t[n];d(r,e,i),r._children.length>0&&v(r._children,e,i)}}var g=cc.Class({name:"cc._BaseNode",extends:cc.Object,properties:{_parent:null,_children:[],_active:!0,_components:[],_prefab:null,_persistNode:{get:function(){return(this._objFlags&u)>0},set:function(t){t?this._objFlags|=u:this._objFlags&=~u}},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=h.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&&(a._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&l)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,s,a=cc._BaseNode,o=1,c=a._stacks[a._stackId];c||(c=[],a._stacks.push(c)),a._stackId++,c.length=0,c[0]=this;var u=null;for(s=!1;o;)if(n=c[--o])if(!s&&t?t(n):s&&e&&e(n),c[o]=null,s){if(u===this._parent)break;if(s=!1,i)if(i[++r])c[o]=i[r],o++;else if(u&&(c[o]=u,o++,s=!0,u._parent?(r=(i=u._parent._children).indexOf(u),u=u._parent):(u=null,i=null),r<0))break}else n._children.length>0?(u=n,i=n._children,r=0,c[o]=i[r],o++):(c[o]=n,o++,s=!0);c.length=0,a._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=_(t);return e?f(this,e):null},getComponents:function(t){var e=_(t),i=[];return e&&d(this,e,i),i},getComponentInChildren:function(t){var e=_(t);return e?p(this._children,e):null},getComponentsInChildren:function(t){var e=_(t),i=[];return e&&(d(this,e,i),v(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 s=this.__eventTargets;for(t=0,e=s.length;t<e;++t){var a=s[t];a&&a.targetOff(this)}if(s.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});g.idGenerater=h,g._stacks=[[]],g._stackId=0,g.prototype._onPreDestroyBase=g.prototype._onPreDestroy,g.prototype._onHierarchyChangedBase=g.prototype._onHierarchyChanged,n.propertyDefine(g,["parent","name","children","childrenCount"],{}),cc._BaseNode=e.exports=g}),{"../event-manager":129,"../platform/CCObject":164,"../platform/id-generater":175,"../platform/js":179,"../renderer/render-flow":190,"./misc":233}],226:[(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 s=t[r];if(s>e+1e-6)n=r-1;else{if(!(s<e-1e-6))return r;i=r+1}}return~i}}}),{}],227:[(function(t,e){"use strict";var i=t("../components/CCRenderComponent"),n=t("../platform/CCMacro").BlendFactor,r=t("../../renderer/gfx"),s=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=s}),{"../../renderer/gfx":275,"../components/CCRenderComponent":106,"../platform/CCMacro":163}],228:[(function(t,e){"use strict";var i=t("./misc").BASE64_VALUES,n="0123456789abcdef".split(""),r=["","","",""],s=r.concat(r,"-",r,"-",r,"-",r,"-",r,r,r),a=s.map((function(t,e){return"-"===t?NaN:e})).filter(isFinite);e.exports=function(t){if(22!==t.length)return t;s[0]=t[0],s[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)];s[a[r++]]=n[o>>2],s[a[r++]]=n[(3&o)<<2|c>>4],s[a[r++]]=n[15&c]}return s.join("")}}),{"./misc":233}],229:[(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,s=t.split("/"),a=r;a<s.length;a++){var o=s[a],c=n._children;n=null;for(var u=0,l=c.length;u<l;++u){var h=c[u];if(h.name===o){n=h;break}}if(!n)return null}return n}}),{}],230:[(function(t,e){"use strict";var i,n=(i=t("../assets/material/material-variant"))&&i.__esModule?i:{default:i},r=t("../assets/material/CCMaterial"),s=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=s}),{"../assets/material/CCMaterial":77,"../assets/material/material-variant":84}],231:[(function(t,e){"use strict";var i=/^(click)(\s)*=|(param)(\s)*=/,n=/(\s)*src(\s)*=|(\s)*height(\s)*=|(\s)*width(\s)*=|(\s)*align(\s)*=|(\s)*offset(\s)*=|(\s)*click(\s)*=|(\s)*param(\s)*=/,r=function(){this._parsedObject={},this._specialSymbolArray=[],this._specialSymbolArray.push([/&lt;/g,"<"]),this._specialSymbolArray.push([/&gt;/g,">"]),this._specialSymbolArray.push([/&amp;/g,"&"]),this._specialSymbolArray.push([/&quot;/g,'"']),this._specialSymbolArray.push([/&apos;/g,"'"]),this._specialSymbolArray.push([/&nbsp;/g," "])};r.prototype={constructor:r,parse:function(t){this._resultObjectArray=[],this._stack=[];for(var e=0,i=t.length;e<i;){var n=t.indexOf(">",e),r=-1;if(n>=0&&(r=t.lastIndexOf("<",n))<e-1&&(r=t.indexOf("<",n+1),n=t.indexOf(">",r+1)),r<0)this._stack.pop(),this._processResult(t.substring(e)),e=i;else{var s=t.substring(e,r),a=t.substring(r+1,n);""===a&&(s=t.substring(e,n+1)),this._processResult(s),-1===n?n=r:"/"===t.charAt(r+1)?this._stack.pop():this._addToStack(a),e=n+1}}return this._resultObjectArray},_attributeToObject:function(t){var e,i,r,s,a={},o=(t=t.trim()).match(/^(color|size)(\s)*=/);if(o){if(e=o[0],""===(t=t.substring(e.length).trim()))return a;switch(i=t.indexOf(" "),e[0]){case"c":a.color=i>-1?t.substring(0,i).trim():t;break;case"s":a.size=parseInt(t)}return i>-1&&(s=t.substring(i+1).trim(),r=this._processEventHandler(s),a.event=r),a}if((o=t.match(/^(br(\s)*\/)/))&&o[0].length>0&&(e=o[0].trim()).startsWith("br")&&"/"===e[e.length-1])return a.isNewLine=!0,this._resultObjectArray.push({text:"",style:{newline:!0}}),a;if((o=t.match(/^(img(\s)*src(\s)*=[^>]+\/)/))&&o[0].length>0&&(e=o[0].trim()).startsWith("img")&&"/"===e[e.length-1]){var c;o=t.match(n);for(var u=!1;o;){if(e=(t=t.substring(t.indexOf(o[0]))).substr(0,o[0].length),h=(i=(c=t.substring(e.length).trim()).indexOf(" "))>-1?c.substr(0,i):c,e=(e=e.replace(/[^a-zA-Z]/g,"").trim()).toLocaleLowerCase(),t=c.substring(i).trim(),h.endsWith("/")&&(h=h.slice(0,-1)),"src"===e){switch(h.charCodeAt(0)){case 34:case 39:u=!0,h=h.slice(1,-1)}a.isImage=!0,a.src=h}else if("height"===e)a.imageHeight=parseInt(h);else if("width"===e)a.imageWidth=parseInt(h);else if("align"===e){switch(h.charCodeAt(0)){case 34:case 39:h=h.slice(1,-1)}a.imageAlign=h.toLocaleLowerCase()}else"offset"===e?a.imageOffset=h:"click"===e&&(a.event=this._processEventHandler(e+"="+h));a.event&&"param"===e&&(a.event.param=h.replace(/^\"|\"$/g,"")),o=t.match(n)}return u&&a.isImage&&this._resultObjectArray.push({text:"",style:a}),{}}if(o=t.match(/^(outline(\s)*[^>]*)/)){var l={color:"#ffffff",width:1};if(t=o[0].substring("outline".length).trim()){var h,_=/(\s)*color(\s)*=|(\s)*width(\s)*=|(\s)*click(\s)*=|(\s)*param(\s)*=/;for(o=t.match(_);o;)e=(t=t.substring(t.indexOf(o[0]))).substr(0,o[0].length),h=(i=(c=t.substring(e.length).trim()).indexOf(" "))>-1?c.substr(0,i):c,e=(e=e.replace(/[^a-zA-Z]/g,"").trim()).toLocaleLowerCase(),t=c.substring(i).trim(),"click"===e?a.event=this._processEventHandler(e+"="+h):"color"===e?l.color=h:"width"===e&&(l.width=parseInt(h)),a.event&&"param"===e&&(a.event.param=h.replace(/^\"|\"$/g,"")),o=t.match(_)}a.outline=l}if((o=t.match(/^(on|u|b|i)(\s)*/))&&o[0].length>0){switch(e=o[0],t=t.substring(e.length).trim(),e[0]){case"u":a.underline=!0;break;case"i":a.italic=!0;break;case"b":a.bold=!0}if(""===t)return a;r=this._processEventHandler(t),a.event=r}return a},_processEventHandler:function(t){for(var e=0,n={},r=t.match(i),s=!1;r;){var a=r[0],o="";if(s=!1,'"'===(t=t.substring(a.length).trim()).charAt(0))(e=t.indexOf('"',1))>-1&&(o=t.substring(1,e).trim(),s=!0),e++;else if("'"===t.charAt(0))(e=t.indexOf("'",1))>-1&&(o=t.substring(1,e).trim(),s=!0),e++;else{var c=t.match(/(\S)+/);e=(o=c?c[0]:"").length}s&&(n[a=a.substring(0,a.length-1).trim()]=o),r=(t=t.substring(e).trim()).match(i)}return n},_addToStack:function(t){var e=this._attributeToObject(t);if(0===this._stack.length)this._stack.push(e);else{if(e.isNewLine||e.isImage)return;var i=this._stack[this._stack.length-1];for(var n in i)e[n]||(e[n]=i[n]);this._stack.push(e)}},_processResult:function(t){""!==t&&(t=this._escapeSpecialSymbol(t),this._stack.length>0?this._resultObjectArray.push({text:t,style:this._stack[this._stack.length-1]}):this._resultObjectArray.push({text:t}))},_escapeSpecialSymbol:function(t){for(var e=0;e<this._specialSymbolArray.length;++e){var i=this._specialSymbolArray[e][0],n=this._specialSymbolArray[e][1];t=t.replace(i,n)}return t}},e.exports=r}),{}],232:[(function(t){"use strict";t("./CCPath"),t("./profiler/CCProfiler"),t("./find"),t("./mutable-forward-iterator")}),{"./CCPath":223,"./find":229,"./mutable-forward-iterator":234,"./profiler/CCProfiler":237}],233:[(function(t,e){"use strict";for(var i=t("../platform/js"),n={propertyDefine:function(t,e,n){function r(t,e,n,r){var s=Object.getOwnPropertyDescriptor(t,e);if(s)s.get&&(t[n]=s.get),s.set&&r&&(t[r]=s.set);else{var a=t[n];i.getset(t,e,a,t[r])}}for(var s,a=t.prototype,o=0;o<e.length;o++){var c=(s=e[o])[0].toUpperCase()+s.slice(1);r(a,s,"get"+c,"set"+c)}for(s in n){var u=n[s];r(a,s,u[0],u[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),s=0;s<123;++s)r[s]=64;for(var a=0;a<64;++a)r["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charCodeAt(a)]=a;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":179}],234:[(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}),{}],235:[(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}),{}],236:[(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,s=t._name,a=t._active,o=t._eulerAngles.x,c=t._eulerAngles.y,u=t._eulerAngles.z,l=t._localZOrder,h=t._trs,_=h[0],f=h[1],d=h[2];cc.game._isCloning=!0,e.asset._doInstantiate(t),cc.game._isCloning=!1,t._objFlags=i,t._parent=n,t._id=r,t._prefab=e,t._name=s,t._active=a,t._localZOrder=l,(h=t._trs)[0]=_,h[1]=f,h[2]=d,t._eulerAngles.x=o,t._eulerAngles.y=c,t._eulerAngles.z=u}}}),{}],237:[(function(t,e){"use strict";var i=t("../../platform/CCMacro"),n=t("./perf-counter"),r=!1,s=15,a=null,o=null,c=null;function u(){if(!a){a={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 a)a[e]._counter=new n(e,a[e],t)}}function l(){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=s,e.lineHeight=s,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=s,r.lineHeight=s,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 h(){l();var t=cc.director._lastUpdate;a.frame._counter.start(t),a.logic._counter.start(t)}function _(){var t=performance.now();cc.director.isPaused()?a.frame._counter.start(t):a.logic._counter.end(t),a.render._counter.start(t)}function f(){var t=performance.now();a.render._counter.end(t),a.draws._counter.value=cc.renderer.drawCalls,a.frame._counter.end(t),a.fps._counter.frame(t);var e="",i="";for(var n in a){var r=a[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,h),cc.director.off(cc.Director.EVENT_AFTER_UPDATE,_),cc.director.off(cc.Director.EVENT_AFTER_DRAW,f),r=!1)},showStats:function(){r||(u(),o&&(o.active=!0),cc.director.on(cc.Director.EVENT_BEFORE_UPDATE,h),cc.director.on(cc.Director.EVENT_AFTER_UPDATE,_),cc.director.on(cc.Director.EVENT_AFTER_DRAW,f),r=!0)}}}),{"../../platform/CCMacro":163,"./perf-counter":239}],238:[(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}),{}],239:[(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":238}],240:[(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 s=new r(100),a={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]+|\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]+|\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]+$/,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]/,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=s.get(n);if(null!==r)return r;var a=t.measureText(e),o=a&&a.width||0;return s.put(n,o),o},_safeSubstring:function(t,e,i){var n=e,r=i,s=t[e];if(this.lowSurrogateRex.test(s)&&n--,void 0!==i)if(i-1!==e){var a=t[i-1];this.highSurrogateRex.test(a)&&r--}else this.highSurrogateRex.test(s)&&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 s=t;e>i&&s.length>1;){for(var a=s.length*(i/e)|0,o=this._safeSubstring(s,a),c=e-n(o),u=o,l=0,h=0;c>i&&h++<10;)a*=i/c,a|=0,c=e-n(o=this._safeSubstring(s,a));for(h=0;c<=i&&h++<10;){if(o){var _=this.label_wordRex.exec(o);l=_?_[0].length:1,u=o}a+=l,c=e-n(o=this._safeSubstring(s,a))}0==(a-=l)?(a=1,u=this._safeSubstring(s,1)):1===a&&this.highSurrogateRex.test(s[0])&&(a=2,u=this._safeSubstring(s,2));var f,d=this._safeSubstring(s,0,a);this.label_wrapinspection&&this.label_symbolRex.test(u||o)&&(0==(a-=(f=this.label_lastWordRex.exec(d))?f[0].length:0)&&(a=1),u=this._safeSubstring(s,a),d=this._safeSubstring(s,0,a)),this.label_firstEnglish.test(u)&&(f=this.label_lastEnglish.exec(d))&&d!==f[0]&&(a-=f[0].length,u=this._safeSubstring(s,a),d=this._safeSubstring(s,0,a)),0===r.length?r.push(d):(d=d.trimLeft()).length>0&&r.push(d),e=n(s=u||o)}return 0===r.length?r.push(s):(s=s.trimLeft()).length>0&&r.push(s),r}};cc.textUtils=e.exports=a}),{"../platform/js":179}],241:[(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":73}],242:[(function(t,e){"use strict";var i=t("./node-unit"),n=t("./node-mem-pool");e.exports={NodeMemPool:new n(i)}}),{"./node-mem-pool":244,"./node-unit":245}],243:[(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 s=i[e];if(s&&s.hasSpace()){t=s;break}}if(!t){var a=this._findUnitID();t=this._buildUnit(a),n[a]=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}),{}],244:[(function(t,e){"use strict";var i,n=t("./mem-pool"),r=function(t){n.call(this,t)};(i=function(){}).prototype=n.prototype;var s=r.prototype=new i;s._initNative=function(){this._nativeMemPool=new renderer.NodeMemPool},s._destroyUnit=function(t){n.prototype._destroyUnit.call(this,t)},e.exports=r}),{"./mem-pool":243}],245:[(function(t,e){"use strict";var i,n=t("../../value-types/utils"),r=(Uint32Array,10*n.FLOAT_BYTES),s=16*n.FLOAT_BYTES,a=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 u=this._spacesData[c];u.trs=new n.FLOAT_ARRAY_TYPE(this.trsList.buffer,c*r,10),u.localMat=new n.FLOAT_ARRAY_TYPE(this.localMatList.buffer,c*s,16),u.worldMat=new n.FLOAT_ARRAY_TYPE(this.worldMatList.buffer,c*a,16)}};(i=function(){}).prototype=o.prototype,c.prototype=new i,e.exports=c}),{"../../value-types/utils":255,"./unit-base":246}],246:[(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="",s=this._contentNum,a=0;a<s;a++)1==this._signData[2*a+1]&&(n++,r+=a+"->");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}),{}],247:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("./value-type")),r=a(t("../platform/CCClass")),s=a(t("../utils/misc"));function a(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,n.key,n)}}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=(function(t){var e,i;function n(e,i,n,r){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=255),(s=t.call(this)||this)._val=0,"object"==typeof e&&(i=e.g,n=e.b,r=e.a,e=e.r),s._val=(r<<24>>>0)+(n<<16)+(i<<8)+(0|e),s}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,c(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,s=255&e;return t.r=i,t.g=n,t.b=r,t.a=s,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,s=e.g,a=e.b,o=e.a;return t.r=r+n*(i.r-r),t.g=s+n*(i.g-s),t.b=a+n*(i.b-a),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,a,u,l=n.prototype;return l.clone=function(){var t=new n;return t._val=this._val,t},l.equals=function(t){return t&&this._val===t._val},l.lerp=function(t,e,i){i=i||new n;var r=this.r,s=this.g,a=this.b,o=this.a;return i.r=r+(t.r-r)*e,i.g=s+(t.g-s)*e,i.b=a+(t.b-a)*e,i.a=o+(t.a-o)*e,i},l.toString=function(){return"rgba("+this.r.toFixed()+", "+this.g.toFixed()+", "+this.b.toFixed()+", "+this.a.toFixed()+")"},l.getR=function(){return 255&this._val},l.setR=function(t){return t=~~s.default.clampf(t,0,255),this._val=(4294967040&this._val|t)>>>0,this},l.getG=function(){return(65280&this._val)>>8},l.setG=function(t){return t=~~s.default.clampf(t,0,255),this._val=(4294902015&this._val|t<<8)>>>0,this},l.getB=function(){return(16711680&this._val)>>16},l.setB=function(t){return t=~~s.default.clampf(t,0,255),this._val=(4278255615&this._val|t<<16)>>>0,this},l.getA=function(){return(4278190080&this._val)>>>24},l.setA=function(t){return t=~~s.default.clampf(t,0,255),this._val=(16777215&this._val|t<<24)>>>0,this},l.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)+")"},l.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},l.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("")},l.toRGBValue=function(){return 16777215&this._val},l.fromHSV=function(t,e,i){var n,r,s;if(0===e)n=r=s=i;else if(0===i)n=r=s=0;else{1===t&&(t=0),t*=6;var a=Math.floor(t),o=t-a,c=i*(1-e),u=i*(1-e*o),l=i*(1-e*(1-o));switch(a){case 0:n=i,r=l,s=c;break;case 1:n=u,r=i,s=c;break;case 2:n=c,r=i,s=l;break;case 3:n=c,r=u,s=i;break;case 4:n=l,r=c,s=i;break;case 5:n=i,r=c,s=u}}return n*=255,r*=255,s*=255,this._val=(this.a<<24>>>0)+(s<<16)+(r<<8)+(0|n),this},l.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),s=Math.min(t,e,i),a=0;return n.v=r,n.s=r?(r-s)/r:0,n.s?(a=r-s,n.h=t===r?(e-i)/a:e===r?2+(i-t)/a:4+(t-e)/a,n.h/=6,n.h<0&&(n.h+=1)):n.h=0,n},l.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},l._fastSetA=function(t){this._val=(16777215&this._val|t<<24)>>>0},l.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,u=[{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)}}],(a=[{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,a),u&&o(r,u),n})(n.default);i.default=u,u.div=u.divide,u.sub=u.subtract,u.mul=u.multiply,u.WHITE_R=u.WHITE,u.BLACK_R=u.BLACK,u.TRANSPARENT_R=u.TRANSPARENT,u.GRAY_R=u.GRAY,u.RED_R=u.RED,u.GREEN_R=u.GREEN,u.BLUE_R=u.BLUE,u.YELLOW_R=u.YELLOW,u.ORANGE_R=u.ORANGE,u.CYAN_R=u.CYAN,u.MAGENTA_R=u.MAGENTA,r.default.fastDefine("cc.Color",u,{r:0,g:0,b:0,a:255}),cc.Color=u,cc.color=function(t,e,i,n){return"string"==typeof t?(new u).fromHEX(t):"object"==typeof t?new u(t.r,t.g,t.b,t.a):new u(t,e,i,n)},e.exports=i.default}),{"../platform/CCClass":158,"../utils/misc":233,"./value-type":256}],248:[(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.Trs=i.Quat=i.Color=i.Size=i.Rect=i.Mat3=i.Mat4=i.Vec4=i.Vec3=i.Vec2=void 0;var r=p(t("./vec2"));i.Vec2=r.default;var s=p(t("./vec3"));i.Vec3=s.default;var a=p(t("./vec4"));i.Vec4=a.default;var o=p(t("./mat4"));i.Mat4=o.default;var c=p(t("./mat3"));i.Mat3=c.default;var u=p(t("./rect"));i.Rect=u.default;var l=p(t("./size"));i.Size=l.default;var h=p(t("./color"));i.Color=h.default;var _=p(t("./quat"));i.Quat=_.default;var f=p(t("./trs"));i.Trs=f.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":247,"./mat3":249,"./mat4":250,"./quat":251,"./rect":252,"./size":253,"./trs":254,"./utils":255,"./vec2":257,"./vec3":258,"./vec4":259}],249:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../value-types/utils"),s=(n=t("./vec3"))&&n.__esModule?n:{default:n},a=(function(){function t(t,e,i,n,s,a,o,c,u){if(void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===c&&(c=0),void 0===u&&(u=1),this.m=void 0,t instanceof r.FLOAT_ARRAY_TYPE)this.m=t;else{this.m=new r.FLOAT_ARRAY_TYPE(9);var l=this.m;l[0]=t,l[1]=e,l[2]=i,l[3]=n,l[4]=s,l[5]=a,l[6]=o,l[7]=c,l[8]=u}}return t.create=function(e,i,n,r,s,a,o,c,u){return void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===c&&(c=0),void 0===u&&(u=1),new t(e,i,n,r,s,a,o,c,u)},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,s,a,o,c,u){var l=t.m;return l[0]=e,l[1]=i,l[2]=n,l[3]=r,l[4]=s,l[5]=a,l[6]=o,l[7]=c,l[8]=u,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],s=i[2],a=i[5];n[1]=i[3],n[2]=i[6],n[3]=r,n[5]=i[7],n[6]=s,n[7]=a}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],s=i[1],a=i[2],o=i[3],c=i[4],u=i[5],l=i[6],h=i[7],_=i[8],f=_*c-u*h,d=-_*o+u*l,p=h*o-c*l,v=r*f+s*d+a*p;return v?(v=1/v,n[0]=f*v,n[1]=(-_*s+a*h)*v,n[2]=(u*s-a*c)*v,n[3]=d*v,n[4]=(_*r-a*l)*v,n[5]=(-u*r+a*o)*v,n[6]=p*v,n[7]=(-h*r+s*l)*v,n[8]=(c*r-s*o)*v,t):t},t.adjoint=function(t,e){var i=e.m,n=t.m,r=i[0],s=i[1],a=i[2],o=i[3],c=i[4],u=i[5],l=i[6],h=i[7],_=i[8];return n[0]=c*_-u*h,n[1]=a*h-s*_,n[2]=s*u-a*c,n[3]=u*l-o*_,n[4]=r*_-a*l,n[5]=a*o-r*u,n[6]=o*h-c*l,n[7]=s*l-r*h,n[8]=r*c-s*o,t},t.determinant=function(t){var e=t.m,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],c=e[6],u=e[7],l=e[8];return i*(l*a-o*u)+n*(-l*s+o*c)+r*(u*s-a*c)},t.multiply=function(t,e,i){var n=e.m,r=i.m,s=t.m,a=n[0],o=n[1],c=n[2],u=n[3],l=n[4],h=n[5],_=n[6],f=n[7],d=n[8],p=r[0],v=r[1],g=r[2],m=r[3],y=r[4],T=r[5],E=r[6],A=r[7],C=r[8];return s[0]=p*a+v*u+g*_,s[1]=p*o+v*l+g*f,s[2]=p*c+v*h+g*d,s[3]=m*a+y*u+T*_,s[4]=m*o+y*l+T*f,s[5]=m*c+y*h+T*d,s[6]=E*a+A*u+C*_,s[7]=E*o+A*l+C*f,s[8]=E*c+A*h+C*d,t},t.multiplyMat4=function(t,e,i){var n=e.m,r=i.m,s=t.m,a=n[0],o=n[1],c=n[2],u=n[3],l=n[4],h=n[5],_=n[6],f=n[7],d=n[8],p=r[0],v=r[1],g=r[2],m=r[4],y=r[5],T=r[6],E=r[8],A=r[9],C=r[10];return s[0]=p*a+v*u+g*_,s[1]=p*o+v*l+g*f,s[2]=p*c+v*h+g*d,s[3]=m*a+y*u+T*_,s[4]=m*o+y*l+T*f,s[5]=m*c+y*h+T*d,s[6]=E*a+A*u+C*_,s[7]=E*o+A*l+C*f,s[8]=E*c+A*h+C*d,t},t.translate=function(t,e,i){var n=e.m,r=t.m,s=n[0],a=n[1],o=n[2],c=n[3],u=n[4],l=n[5],h=n[6],_=n[7],f=n[8],d=i.x,p=i.y;return r[0]=s,r[1]=a,r[2]=o,r[3]=c,r[4]=u,r[5]=l,r[6]=d*s+p*c+h,r[7]=d*a+p*u+_,r[8]=d*o+p*l+f,t},t.rotate=function(t,e,i){var n=e.m,r=t.m,s=n[0],a=n[1],o=n[2],c=n[3],u=n[4],l=n[5],h=n[6],_=n[7],f=n[8],d=Math.sin(i),p=Math.cos(i);return r[0]=p*s+d*c,r[1]=p*a+d*u,r[2]=p*o+d*l,r[3]=p*c-d*s,r[4]=p*u-d*a,r[5]=p*l-d*o,r[6]=h,r[7]=_,r[8]=f,t},t.scale=function(t,e,i){var n=i.x,r=i.y,s=e.m,a=t.m;return a[0]=n*s[0],a[1]=n*s[1],a[2]=n*s[2],a[3]=r*s[3],a[4]=r*s[4],a[5]=r*s[5],a[6]=s[6],a[7]=s[7],a[8]=s[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,s=e.z,a=e.w,o=n+n,c=r+r,u=s+s,l=n*o,h=r*o,_=r*c,f=s*o,d=s*c,p=s*u,v=a*o,g=a*c,m=a*u;return i[0]=1-_-p,i[3]=h-m,i[6]=f+g,i[1]=h+m,i[4]=1-l-p,i[7]=d-v,i[2]=f-g,i[5]=d+v,i[8]=1-l-_,t},t.fromViewUp=function(e,i,n){var a,o,c;return(a=new s.default(0,1,0),o=new s.default,c=new s.default,function(e,i,n){return s.default.lengthSqr(i)<r.EPSILON*r.EPSILON?(t.identity(e),e):(n=n||a,s.default.normalize(o,s.default.cross(o,n,i)),s.default.lengthSqr(o)<r.EPSILON*r.EPSILON?(t.identity(e),e):(s.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],s=i[1],a=i[2],o=i[3],c=i[4],u=i[5],l=i[6],h=i[7],_=i[8],f=i[9],d=i[10],p=i[11],v=i[12],g=i[13],m=i[14],y=i[15],T=r*u-s*c,E=r*l-a*c,A=r*h-o*c,C=s*l-a*u,x=s*h-o*u,b=a*h-o*l,S=_*g-f*v,w=_*m-d*v,R=_*y-p*v,I=f*m-d*g,M=f*y-p*g,O=d*y-p*m,L=T*O-E*M+A*I+C*R-x*w+b*S;return L?(L=1/L,n[0]=(u*O-l*M+h*I)*L,n[1]=(l*R-c*O-h*w)*L,n[2]=(c*M-u*R+h*S)*L,n[3]=(a*M-s*O-o*I)*L,n[4]=(r*O-a*R+o*w)*L,n[5]=(s*R-r*M-o*S)*L,n[6]=(g*b-m*x+y*C)*L,n[7]=(m*A-v*b-y*E)*L,n[8]=(v*x-g*A+y*T)*L,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,s=t.m;return s[0]=n[0]+r[0],s[1]=n[1]+r[1],s[2]=n[2]+r[2],s[3]=n[3]+r[3],s[4]=n[4]+r[4],s[5]=n[5]+r[5],s[6]=n[6]+r[6],s[7]=n[7]+r[7],s[8]=n[8]+r[8],t},t.subtract=function(t,e,i){var n=e.m,r=i.m,s=t.m;return s[0]=n[0]-r[0],s[1]=n[1]-r[1],s[2]=n[2]-r[2],s[3]=n[3]-r[3],s[4]=n[4]-r[4],s[5]=n[5]-r[5],s[6]=n[6]-r[6],s[7]=n[7]-r[7],s[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,s=i.m,a=t.m;return a[0]=r[0]+s[0]*n,a[1]=r[1]+s[1]*n,a[2]=r[2]+s[2]*n,a[3]=r[3]+s[3]*n,a[4]=r[4]+s[4]*n,a[5]=r[5]+s[5]*n,a[6]=r[6]+s[6]*n,a[7]=r[7]+s[7]*n,a[8]=r[8]+s[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,s=i[0],a=i[1],o=i[2],c=i[3],u=i[4],l=i[5],h=i[6],_=i[7],f=i[8],d=n[0],p=n[1],v=n[2],g=n[3],m=n[4],y=n[5],T=n[6],E=n[7],A=n[8];return Math.abs(s-d)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-v)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-g)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(l-y)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(h-T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(_-E)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(E))&&Math.abs(f-A)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(A))},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=a,a.sub=a.subtract,a.mul=a.multiply,a.IDENTITY=Object.freeze(new a),cc.Mat3=a,e.exports=i.default}),{"../value-types/utils":255,"./vec3":258}],250:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=u(t("./value-type")),r=u(t("../platform/CCClass")),s=u(t("./vec3")),a=u(t("./quat")),o=t("./utils"),c=u(t("./mat3"));function u(t){return t&&t.__esModule?t:{default:t}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var h=0,_=0,f=0,d=0,p=0,v=0,g=0,m=0,y=0,T=0,E=0,A=0,C=0,x=0,b=0,S=0,w=(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,s,a,c,u,l,h,_,f,d,p,v,g){var m;if(void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=1),void 0===c&&(c=0),void 0===u&&(u=0),void 0===l&&(l=0),void 0===h&&(h=0),void 0===_&&(_=1),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===v&&(v=0),void 0===g&&(g=1),(m=t.call(this)||this).m=void 0,e instanceof o.FLOAT_ARRAY_TYPE)m.m=e;else{m.m=new o.FLOAT_ARRAY_TYPE(16);var y=m.m;y[0]=e,y[1]=i,y[2]=n,y[3]=r,y[4]=s,y[5]=a,y[6]=c,y[7]=u,y[8]=l,y[9]=h,y[10]=_,y[11]=f,y[12]=d,y[13]=p,y[14]=v,y[15]=g}return m}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,s,a,o,c,u,l,h,_,f,d,p,v){var g=t.m;return g[0]=e,g[1]=i,g[2]=n,g[3]=r,g[4]=s,g[5]=a,g[6]=o,g[7]=c,g[8]=u,g[9]=l,g[10]=h,g[11]=_,g[12]=f,g[13]=d,g[14]=p,g[15]=v,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],s=n[2],a=n[3],o=n[6],c=n[7],u=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]=s,i[9]=o,i[11]=n[14],i[12]=a,i[13]=c,i[14]=u}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;h=i[0],_=i[1],f=i[2],d=i[3],p=i[4],v=i[5],g=i[6],m=i[7],y=i[8],T=i[9],E=i[10],A=i[11],C=i[12],x=i[13],b=i[14],S=i[15];var n=h*v-_*p,r=h*g-f*p,s=h*m-d*p,a=_*g-f*v,o=_*m-d*v,c=f*m-d*g,u=y*x-T*C,l=y*b-E*C,w=y*S-A*C,R=T*b-E*x,I=T*S-A*x,M=E*S-A*b,O=n*M-r*I+s*R+a*w-o*l+c*u;if(0===O)return null;O=1/O;var L=t.m;return L[0]=(v*M-g*I+m*R)*O,L[1]=(f*I-_*M-d*R)*O,L[2]=(x*c-b*o+S*a)*O,L[3]=(E*o-T*c-A*a)*O,L[4]=(g*w-p*M-m*l)*O,L[5]=(h*M-f*w+d*l)*O,L[6]=(b*s-C*c-S*r)*O,L[7]=(y*c-E*s+A*r)*O,L[8]=(p*I-v*w+m*u)*O,L[9]=(_*w-h*I-d*u)*O,L[10]=(C*o-x*s+S*n)*O,L[11]=(T*s-y*o-A*n)*O,L[12]=(v*l-p*R-g*u)*O,L[13]=(h*R-_*l+f*u)*O,L[14]=(x*r-C*a-b*n)*O,L[15]=(y*a-T*r+E*n)*O,t},r.determinant=function(t){var e=t.m;return h=e[0],_=e[1],f=e[2],d=e[3],p=e[4],v=e[5],g=e[6],m=e[7],y=e[8],T=e[9],E=e[10],A=e[11],C=e[12],x=e[13],b=e[14],S=e[15],(h*v-_*p)*(E*S-A*b)-(h*g-f*p)*(T*S-A*x)+(h*m-d*p)*(T*b-E*x)+(_*g-f*v)*(y*S-A*C)-(_*m-d*v)*(y*b-E*C)+(f*m-d*g)*(y*x-T*C)},r.multiply=function(t,e,i){var n=t.m,r=e.m,s=i.m;h=r[0],_=r[1],f=r[2],d=r[3],p=r[4],v=r[5],g=r[6],m=r[7],y=r[8],T=r[9],E=r[10],A=r[11],C=r[12],x=r[13],b=r[14],S=r[15];var a=s[0],o=s[1],c=s[2],u=s[3];return n[0]=a*h+o*p+c*y+u*C,n[1]=a*_+o*v+c*T+u*x,n[2]=a*f+o*g+c*E+u*b,n[3]=a*d+o*m+c*A+u*S,a=s[4],o=s[5],c=s[6],u=s[7],n[4]=a*h+o*p+c*y+u*C,n[5]=a*_+o*v+c*T+u*x,n[6]=a*f+o*g+c*E+u*b,n[7]=a*d+o*m+c*A+u*S,a=s[8],o=s[9],c=s[10],u=s[11],n[8]=a*h+o*p+c*y+u*C,n[9]=a*_+o*v+c*T+u*x,n[10]=a*f+o*g+c*E+u*b,n[11]=a*d+o*m+c*A+u*S,a=s[12],o=s[13],c=s[14],u=s[15],n[12]=a*h+o*p+c*y+u*C,n[13]=a*_+o*v+c*T+u*x,n[14]=a*f+o*g+c*E+u*b,n[15]=a*d+o*m+c*A+u*S,t},r.transform=function(t,e,i){var n=i.x,r=i.y,s=i.z,a=t.m,o=e.m;return e===t?(a[12]=o[0]*n+o[4]*r+o[8]*s+o[12],a[13]=o[1]*n+o[5]*r+o[9]*s+o[13],a[14]=o[2]*n+o[6]*r+o[10]*s+o[14],a[15]=o[3]*n+o[7]*r+o[11]*s+o[15]):(h=o[0],_=o[1],f=o[2],d=o[3],p=o[4],v=o[5],g=o[6],m=o[7],y=o[8],T=o[9],E=o[10],A=o[11],C=o[12],x=o[13],b=o[14],S=o[15],a[0]=h,a[1]=_,a[2]=f,a[3]=d,a[4]=p,a[5]=v,a[6]=g,a[7]=m,a[8]=y,a[9]=T,a[10]=E,a[11]=A,a[12]=h*n+p*r+y*s+o[12],a[13]=_*n+v*r+T*s+o[13],a[14]=f*n+g*r+E*s+o[14],a[15]=d*n+m*r+A*s+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,s=i.z,a=t.m,o=e.m;return a[0]=o[0]*n,a[1]=o[1]*n,a[2]=o[2]*n,a[3]=o[3]*n,a[4]=o[4]*r,a[5]=o[5]*r,a[6]=o[6]*r,a[7]=o[7]*r,a[8]=o[8]*s,a[9]=o[9]*s,a[10]=o[10]*s,a[11]=o[11]*s,a[12]=o[12],a[13]=o[13],a[14]=o[14],a[15]=o[15],t},r.rotate=function(t,e,i,n){var r=n.x,s=n.y,a=n.z,c=Math.sqrt(r*r+s*s+a*a);if(Math.abs(c)<o.EPSILON)return null;r*=c=1/c,s*=c,a*=c;var u=Math.sin(i),l=Math.cos(i),C=1-l,x=e.m;h=x[0],_=x[1],f=x[2],d=x[3],p=x[4],v=x[5],g=x[6],m=x[7],y=x[8],T=x[9],E=x[10],A=x[11];var b=r*r*C+l,S=s*r*C+a*u,w=a*r*C-s*u,R=r*s*C-a*u,I=s*s*C+l,M=a*s*C+r*u,O=r*a*C+s*u,L=s*a*C-r*u,D=a*a*C+l,P=t.m;return P[0]=h*b+p*S+y*w,P[1]=_*b+v*S+T*w,P[2]=f*b+g*S+E*w,P[3]=d*b+m*S+A*w,P[4]=h*R+p*I+y*M,P[5]=_*R+v*I+T*M,P[6]=f*R+g*I+E*M,P[7]=d*R+m*I+A*M,P[8]=h*O+p*L+y*D,P[9]=_*O+v*L+T*D,P[10]=f*O+g*L+E*D,P[11]=d*O+m*L+A*D,e!==t&&(P[12]=x[12],P[13]=x[13],P[14]=x[14],P[15]=x[15]),t},r.rotateX=function(t,e,i){var n=t.m,r=e.m,s=Math.sin(i),a=Math.cos(i),o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],_=r[9],f=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*a+h*s,n[5]=c*a+_*s,n[6]=u*a+f*s,n[7]=l*a+d*s,n[8]=h*a-o*s,n[9]=_*a-c*s,n[10]=f*a-u*s,n[11]=d*a-l*s,t},r.rotateY=function(t,e,i){var n=t.m,r=e.m,s=Math.sin(i),a=Math.cos(i),o=r[0],c=r[1],u=r[2],l=r[3],h=r[8],_=r[9],f=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*a-h*s,n[1]=c*a-_*s,n[2]=u*a-f*s,n[3]=l*a-d*s,n[8]=o*s+h*a,n[9]=c*s+_*a,n[10]=u*s+f*a,n[11]=l*s+d*a,t},r.rotateZ=function(t,e,i){var n=e.m,r=t.m,s=Math.sin(i),a=Math.cos(i),o=e.m[0],c=e.m[1],u=e.m[2],l=e.m[3],h=e.m[4],_=e.m[5],f=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*a+h*s,r[1]=c*a+_*s,r[2]=u*a+f*s,r[3]=l*a+d*s,r[4]=h*a-o*s,r[5]=_*a-c*s,r[6]=f*a-u*s,r[7]=d*a-l*s,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,s=i.z,a=Math.sqrt(n*n+r*r+s*s);if(Math.abs(a)<o.EPSILON)return null;n*=a=1/a,r*=a,s*=a;var c=Math.sin(e),u=Math.cos(e),l=1-u,h=t.m;return h[0]=n*n*l+u,h[1]=r*n*l+s*c,h[2]=s*n*l-r*c,h[3]=0,h[4]=n*r*l-s*c,h[5]=r*r*l+u,h[6]=s*r*l+n*c,h[7]=0,h[8]=n*s*l+r*c,h[9]=r*s*l-n*c,h[10]=s*s*l+u,h[11]=0,h[12]=0,h[13]=0,h[14]=0,h[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,s=e.z,a=e.w,o=n+n,c=r+r,u=s+s,l=n*o,h=n*c,_=n*u,f=r*c,d=r*u,p=s*u,v=a*o,g=a*c,m=a*u,y=t.m;return y[0]=1-(f+p),y[1]=h+m,y[2]=_-g,y[3]=0,y[4]=h-m,y[5]=1-(l+p),y[6]=d+v,y[7]=0,y[8]=_+g,y[9]=d-v,y[10]=1-(l+f),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=I.m,r=n[0]=i[0],s=n[1]=i[1],a=n[2]=i[2],o=n[3]=i[4],u=n[4]=i[5],l=n[5]=i[6],h=n[6]=i[8],_=n[7]=i[9],f=n[8]=i[10];return t.x=Math.sqrt(r*r+s*s+a*a),t.y=Math.sqrt(o*o+u*u+l*l),t.z=Math.sqrt(h*h+_*_+f*f),c.default.determinant(I)<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=I.m;n.x=s.default.set(R,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=s.default.set(R,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=s.default.set(R,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(I)<0&&(n.x*=-1,o[0]*=-1,o[1]*=-1,o[2]*=-1),a.default.fromMat3(e,I),s.default.set(i,r[12],r[13],r[14])},r.fromRTS=function(t,e,i,n){var r=e.x,s=e.y,a=e.z,o=e.w,c=r+r,u=s+s,l=a+a,h=r*c,_=r*u,f=r*l,d=s*u,p=s*l,v=a*l,g=o*c,m=o*u,y=o*l,T=n.x,E=n.y,A=n.z,C=t.m;return C[0]=(1-(d+v))*T,C[1]=(_+y)*T,C[2]=(f-m)*T,C[3]=0,C[4]=(_-y)*E,C[5]=(1-(h+v))*E,C[6]=(p+g)*E,C[7]=0,C[8]=(f+m)*A,C[9]=(p-g)*A,C[10]=(1-(h+d))*A,C[11]=0,C[12]=i.x,C[13]=i.y,C[14]=i.z,C[15]=1,t},r.fromRTSOrigin=function(t,e,i,n,r){var s=e.x,a=e.y,o=e.z,c=e.w,u=s+s,l=a+a,h=o+o,_=s*u,f=s*l,d=s*h,p=a*l,v=a*h,g=o*h,m=c*u,y=c*l,T=c*h,E=n.x,A=n.y,C=n.z,x=r.x,b=r.y,S=r.z,w=t.m;return w[0]=(1-(p+g))*E,w[1]=(f+T)*E,w[2]=(d-y)*E,w[3]=0,w[4]=(f-T)*A,w[5]=(1-(_+g))*A,w[6]=(v+m)*A,w[7]=0,w[8]=(d+y)*C,w[9]=(v-m)*C,w[10]=(1-(_+p))*C,w[11]=0,w[12]=i.x+x-(w[0]*x+w[4]*b+w[8]*S),w[13]=i.y+b-(w[1]*x+w[5]*b+w[9]*S),w[14]=i.z+S-(w[2]*x+w[6]*b+w[10]*S),w[15]=1,t},r.fromQuat=function(t,e){var i=e.x,n=e.y,r=e.z,s=e.w,a=i+i,o=n+n,c=r+r,u=i*a,l=n*a,h=n*o,_=r*a,f=r*o,d=r*c,p=s*a,v=s*o,g=s*c,m=t.m;return m[0]=1-h-d,m[1]=l+g,m[2]=_-v,m[3]=0,m[4]=l-g,m[5]=1-u-d,m[6]=f+p,m[7]=0,m[8]=_+v,m[9]=f-p,m[10]=1-u-h,m[11]=0,m[12]=0,m[13]=0,m[14]=0,m[15]=1,t},r.frustum=function(t,e,i,n,r,s,a){var o=1/(i-e),c=1/(r-n),u=1/(s-a),l=t.m;return l[0]=2*s*o,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=2*s*c,l[6]=0,l[7]=0,l[8]=(i+e)*o,l[9]=(r+n)*c,l[10]=(a+s)*u,l[11]=-1,l[12]=0,l[13]=0,l[14]=a*s*2*u,l[15]=0,t},r.perspective=function(t,e,i,n,r){var s=1/Math.tan(e/2),a=1/(n-r),o=t.m;return o[0]=s/i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(r+n)*a,o[11]=-1,o[12]=0,o[13]=0,o[14]=2*r*n*a,o[15]=0,t},r.ortho=function(t,e,i,n,r,s,a){var o=1/(e-i),c=1/(n-r),u=1/(s-a),l=t.m;return l[0]=-2*o,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=-2*c,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2*u,l[11]=0,l[12]=(e+i)*o,l[13]=(r+n)*c,l[14]=(a+s)*u,l[15]=1,t},r.lookAt=function(t,e,i,n){var r=e.x,s=e.y,a=e.z,o=n.x,c=n.y,u=n.z,l=r-i.x,h=s-i.y,_=a-i.z,f=1/Math.sqrt(l*l+h*h+_*_),d=c*(_*=f)-u*(h*=f),p=u*(l*=f)-o*_,v=o*h-c*l,g=h*(v*=f=1/Math.sqrt(d*d+p*p+v*v))-_*(p*=f),m=_*(d*=f)-l*v,y=l*p-h*d,T=t.m;return T[0]=d,T[1]=g,T[2]=l,T[3]=0,T[4]=p,T[5]=m,T[6]=h,T[7]=0,T[8]=v,T[9]=y,T[10]=_,T[11]=0,T[12]=-(d*r+p*s+v*a),T[13]=-(g*r+m*s+y*a),T[14]=-(l*r+h*s+_*a),T[15]=1,t},r.inverseTranspose=function(t,e){var i=e.m;h=i[0],_=i[1],f=i[2],d=i[3],p=i[4],v=i[5],g=i[6],m=i[7],y=i[8],T=i[9],E=i[10],A=i[11],C=i[12],x=i[13],b=i[14],S=i[15];var n=h*v-_*p,r=h*g-f*p,s=h*m-d*p,a=_*g-f*v,o=_*m-d*v,c=f*m-d*g,u=y*x-T*C,l=y*b-E*C,w=y*S-A*C,R=T*b-E*x,I=T*S-A*x,M=E*S-A*b,O=n*M-r*I+s*R+a*w-o*l+c*u;return O?(O=1/O,(i=t.m)[0]=(v*M-g*I+m*R)*O,i[1]=(g*w-p*M-m*l)*O,i[2]=(p*I-v*w+m*u)*O,i[3]=0,i[4]=(f*I-_*M-d*R)*O,i[5]=(h*M-f*w+d*l)*O,i[6]=(_*w-h*I-d*u)*O,i[7]=0,i[8]=(x*c-b*o+S*a)*O,i[9]=(b*s-C*c-S*r)*O,i[10]=(C*o-x*s+S*n)*O,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,s=i.m;return n[0]=r[0]+s[0],n[1]=r[1]+s[1],n[2]=r[2]+s[2],n[3]=r[3]+s[3],n[4]=r[4]+s[4],n[5]=r[5]+s[5],n[6]=r[6]+s[6],n[7]=r[7]+s[7],n[8]=r[8]+s[8],n[9]=r[9]+s[9],n[10]=r[10]+s[10],n[11]=r[11]+s[11],n[12]=r[12]+s[12],n[13]=r[13]+s[13],n[14]=r[14]+s[14],n[15]=r[15]+s[15],t},r.subtract=function(t,e,i){var n=t.m,r=e.m,s=i.m;return n[0]=r[0]-s[0],n[1]=r[1]-s[1],n[2]=r[2]-s[2],n[3]=r[3]-s[3],n[4]=r[4]-s[4],n[5]=r[5]-s[5],n[6]=r[6]-s[6],n[7]=r[7]-s[7],n[8]=r[8]-s[8],n[9]=r[9]-s[9],n[10]=r[10]-s[10],n[11]=r[11]-s[11],n[12]=r[12]-s[12],n[13]=r[13]-s[13],n[14]=r[14]-s[14],n[15]=r[15]-s[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,s=e.m,a=i.m;return r[0]=s[0]+a[0]*n,r[1]=s[1]+a[1]*n,r[2]=s[2]+a[2]*n,r[3]=s[3]+a[3]*n,r[4]=s[4]+a[4]*n,r[5]=s[5]+a[5]*n,r[6]=s[6]+a[6]*n,r[7]=s[7]+a[7]*n,r[8]=s[8]+a[8]*n,r[9]=s[9]+a[9]*n,r[10]=s[10]+a[10]*n,r[11]=s[11]+a[11]*n,r[12]=s[12]+a[12]*n,r[13]=s[13]+a[13]*n,r[14]=s[14]+a[14]*n,r[15]=s[15]+a[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],s=i[1],a=i[2],o=i[3],c=i[4],u=i[5],l=i[6],h=i[7],_=i[8],f=i[9],d=i[10],p=i[11],v=i[12],g=i[13],m=i[14],y=i[15];return n[0]=u*(d*y-p*m)-f*(l*y-h*m)+g*(l*p-h*d),n[1]=-(s*(d*y-p*m)-f*(a*y-o*m)+g*(a*p-o*d)),n[2]=s*(l*y-h*m)-u*(a*y-o*m)+g*(a*h-o*l),n[3]=-(s*(l*p-h*d)-u*(a*p-o*d)+f*(a*h-o*l)),n[4]=-(c*(d*y-p*m)-_*(l*y-h*m)+v*(l*p-h*d)),n[5]=r*(d*y-p*m)-_*(a*y-o*m)+v*(a*p-o*d),n[6]=-(r*(l*y-h*m)-c*(a*y-o*m)+v*(a*h-o*l)),n[7]=r*(l*p-h*d)-c*(a*p-o*d)+_*(a*h-o*l),n[8]=c*(f*y-p*g)-_*(u*y-h*g)+v*(u*p-h*f),n[9]=-(r*(f*y-p*g)-_*(s*y-o*g)+v*(s*p-o*f)),n[10]=r*(u*y-h*g)-c*(s*y-o*g)+v*(s*h-o*u),n[11]=-(r*(u*p-h*f)-c*(s*p-o*f)+_*(s*h-o*u)),n[12]=-(c*(f*m-d*g)-_*(u*m-l*g)+v*(u*d-l*f)),n[13]=r*(f*m-d*g)-_*(s*m-a*g)+v*(s*d-a*f),n[14]=-(r*(u*m-l*g)-c*(s*m-a*g)+v*(s*l-a*u)),n[15]=r*(u*d-l*f)-c*(s*d-a*f)+_*(s*l-a*u),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 s.default,r.getTranslation(t,this)},n.getScale=function(t){return t=t||new s.default,r.getScaling(t,this)},n.getRotation=function(t){return t=t||new a.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 R=new s.default,I=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 M=function(t){Object.defineProperty(w.prototype,"m"+t,{get:function(){return this.m[t]},set:function(e){this.m[t]=e}})},O=0;O<16;O++)M(O);cc.mat4=function(t,e,i,n,r,s,a,o,c,u,l,h,_,f,d,p){var v=new w(t,e,i,n,r,s,a,o,c,u,l,h,_,f,d,p);return void 0===t&&w.identity(v),v},cc.Mat4=w,e.exports=i.default}),{"../platform/CCClass":158,"./mat3":249,"./quat":251,"./utils":255,"./value-type":256,"./vec3":258}],251:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=c(t("./value-type")),r=c(t("../platform/CCClass")),s=c(t("./vec3")),a=c(t("./mat3")),o=t("./utils");function c(t){return t&&t.__esModule?t:{default:t}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=0,h=0,_=0,f=0,d=(function(t){var e,i;i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,u(e,i);var n=r.prototype;function r(e,i,n,r){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1),(s=t.call(this)||this).x=void 0,s.y=void 0,s.z=void 0,s.w=void 0,e&&"object"==typeof e?(s.x=e.x,s.y=e.y,s.z=e.z,s.w=e.w):(s.x=e,s.y=i,s.z=n,s.w=r),s}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=s.default.dot(e,i);return n<-.999999?(s.default.cross(g,s.default.RIGHT,e),g.mag()<1e-6&&s.default.cross(g,s.default.UP,e),s.default.normalize(g,g),r.fromAxisAngle(t,g,Math.PI),t):n>.999999?(t.x=0,t.y=0,t.z=0,t.w=1,t):(s.default.cross(g,e,i),t.x=g.x,t.y=g.y,t.z=g.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 l=e.x*i.w+e.w*i.x+e.y*i.z-e.z*i.y,h=e.y*i.w+e.w*i.y+e.z*i.x-e.x*i.z,_=e.z*i.w+e.w*i.z+e.x*i.y-e.y*i.x,f=e.w*i.w-e.x*i.x-e.y*i.y-e.z*i.z,t.x=l,t.y=h,t.z=_,t.w=f,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 l=e.x*r+e.w*n,h=e.y*r+e.z*n,_=e.z*r-e.y*n,f=e.w*r-e.x*n,t.x=l,t.y=h,t.z=_,t.w=f,t},r.rotateY=function(t,e,i){i*=.5;var n=Math.sin(i),r=Math.cos(i);return l=e.x*r-e.z*n,h=e.y*r+e.w*n,_=e.z*r+e.x*n,f=e.w*r-e.y*n,t.x=l,t.y=h,t.z=_,t.w=f,t},r.rotateZ=function(t,e,i){i*=.5;var n=Math.sin(i),r=Math.cos(i);return l=e.x*r+e.y*n,h=e.y*r-e.x*n,_=e.z*r+e.w*n,f=e.w*r-e.z*n,t.x=l,t.y=h,t.z=_,t.w=f,t},r.rotateAround=function(t,e,i,n){return r.invert(p,e),s.default.transformQuat(g,i,p),r.fromAxisAngle(p,g,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,s=0,a=e.x*i.x+e.y*i.y+e.z*i.z+e.w*i.w;if(a<0&&(a=-a,i.x=-i.x,i.y=-i.y,i.z=-i.z,i.w=-i.w),1-a>1e-6){var o=Math.acos(a),c=Math.sin(o);r=Math.sin((1-n)*o)/c,s=Math.sin(n*o)/c}else r=1-n,s=n;return t.x=r*e.x+s*i.x,t.y=r*e.y+s*i.y,t.z=r*e.z+s*i.z,t.w=r*e.w+s*i.w,t},r.sqlerp=function(t,e,i,n,s,a){return r.slerp(p,e,s,a),r.slerp(v,i,n,a),r.slerp(t,p,v,2*a*(1-a)),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 a.default.set(m,e.x,e.y,e.z,i.x,i.y,i.z,n.x,n.y,n.z),r.normalize(t,r.fromMat3(t,m))},r.fromViewUp=function(t,e,i){return a.default.fromViewUp(m,e,i),r.normalize(t,r.fromMat3(t,m))},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],s=i[2],a=i[3],o=i[4],c=i[5],u=i[6],l=i[7],h=i[8],_=n+o+h;if(_>0){var f=.5/Math.sqrt(_+1);t.w=.25/f,t.x=(c-l)*f,t.y=(u-s)*f,t.z=(r-a)*f}else if(n>o&&n>h){var d=2*Math.sqrt(1+n-o-h);t.w=(c-l)/d,t.x=.25*d,t.y=(a+r)/d,t.z=(u+s)/d}else if(o>h){var p=2*Math.sqrt(1+o-n-h);t.w=(u-s)/p,t.x=(a+r)/p,t.y=.25*p,t.z=(l+c)/p}else{var v=2*Math.sqrt(1+h-n-o);t.w=(r-a)/v,t.x=(u+s)/v,t.y=(l+c)/v,t.z=.25*v}return t},r.fromEuler=function(t,e,i,n){e*=y,i*=y,n*=y;var r=Math.sin(e),s=Math.cos(e),a=Math.sin(i),o=Math.cos(i),c=Math.sin(n),u=Math.cos(n);return t.x=r*o*u+s*a*c,t.y=s*a*u+r*o*c,t.z=s*o*c-r*a*u,t.w=s*o*u-r*a*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,s=e.z,a=e.w,c=0,u=0,l=0,h=n*r+s*a;if(h>.499999)c=0,u=(0,o.toDegree)(2*Math.atan2(n,a)),l=90;else if(h<-.499999)c=0,u=-(0,o.toDegree)(2*Math.atan2(n,a)),l=-90;else{var _=n*n,f=r*r,d=s*s;c=(0,o.toDegree)(Math.atan2(2*n*a-2*r*s,1-2*_-2*d)),u=(0,o.toDegree)(Math.atan2(2*r*a-2*n*s,1-2*f-2*d)),l=(0,o.toDegree)(Math.asin(2*h)),i&&(c=-180*Math.sign(c+1e-6)+c,u=-180*Math.sign(u+1e-6)+u,l=180*Math.sign(l+1e-6)-l)}return t.x=c,t.y=u,t.z=l,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,v=new d,g=new s.default,m=new a.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":158,"./mat3":249,"./utils":255,"./value-type":256,"./vec3":258}],252:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=o(t("./value-type")),r=o(t("../platform/CCClass")),s=o(t("./vec2")),a=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,n.key,n)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=(function(t){var e,i;function n(e,i,n,r){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),(s=t.call(this)||this).x=void 0,s.y=void 0,s.width=void 0,s.height=void 0,e&&"object"==typeof e&&(i=e.y,n=e.width,r=e.height,e=e.x),s.x=e||0,s.y=i||0,s.width=n||0,s.height=r||0,s}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,u(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,s=this.y,a=this.width,o=this.height;return i.x=r+(t.x-r)*e,i.y=s+(t.y-s)*e,i.width=a+(t.width-a)*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,s=this.y+this.height,a=e.x,o=e.y,c=e.x+e.width,u=e.y+e.height;return t.x=Math.max(i,a),t.y=Math.max(n,o),t.width=Math.min(r,c)-t.x,t.height=Math.min(s,u)-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,s=this.height,a=e.x,o=e.y,c=e.width,u=e.height;return t.x=Math.min(i,a),t.y=Math.min(n,o),t.width=Math.max(i+r,a+c)-t.x,t.height=Math.max(n+s,o+u)-t.y,t},l.transformMat4=function(t,e){var i=this.x,n=this.y,r=i+this.width,s=n+this.height,a=e.m,o=a[0]*i+a[4]*n+a[12],c=a[1]*i+a[5]*n+a[13],u=a[0]*r+a[4]*n+a[12],l=a[1]*r+a[5]*n+a[13],h=a[0]*i+a[4]*s+a[12],_=a[1]*i+a[5]*s+a[13],f=a[0]*r+a[4]*s+a[12],d=a[1]*r+a[5]*s+a[13],p=Math.min(o,u,h,f),v=Math.max(o,u,h,f),g=Math.min(c,l,_,d),m=Math.max(c,l,_,d);return t.x=p,t.y=g,t.width=v-p,t.height=m-g,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 s.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 s.default(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}},{key:"size",get:function(){return new a.default(this.width,this.height)},set:function(t){this.width=t.width,this.height=t.height}}])&&c(r.prototype,o),n})(n.default);i.default=l,r.default.fastDefine("cc.Rect",l,{x:0,y:0,width:0,height:0}),cc.Rect=l,cc.rect=function(t,e,i,n){return new l(t,e,i,n)},e.exports=i.default}),{"../platform/CCClass":158,"./size":253,"./value-type":256,"./vec2":257}],253:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=s(t("./value-type")),r=s(t("../platform/CCClass"));function s(t){return t&&t.__esModule?t:{default:t}}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,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=(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,o(e,i);var r,s,c=n.prototype;return c.clone=function(){return new n(this.width,this.height)},c.equals=function(t){return t&&this.width===t.width&&this.height===t.height},c.lerp=function(t,e,i){i=i||new n;var r=this.width,s=this.height;return i.width=r+(t.width-r)*e,i.height=s+(t.height-s)*e,i},c.set=function(t){return this.width=t.width,this.height=t.height,this},c.toString=function(){return"("+this.width.toFixed(2)+", "+this.height.toFixed(2)+")"},r=n,s=[{key:"ZERO",get:function(){return new n}}],null&&a(r.prototype,null),s&&a(r,s),n})(n.default);i.default=c,c.ZERO_R=c.ZERO,r.default.fastDefine("cc.Size",c,{width:0,height:0}),cc.size=function(t,e){return new c(t,e)},cc.Size=c,e.exports=i.default}),{"../platform/CCClass":158,"./value-type":256}],254:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./quat"))&&n.__esModule?n:{default:n},s=new r.default,a=(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(s,i),r.default.toEuler(e,s),e},t.fromEuler=function(e,i){return r.default.fromEuler(s,i.x,i.y,i.z),t.fromRotation(e,s),e},t.fromEulerNumber=function(e,i,n,a){return r.default.fromEuler(s,i,n,a),t.fromRotation(e,s),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(s,i),t.fromRotation(e,s),e},t.toMat4=function(t,e){var i=e[3],n=e[4],r=e[5],s=e[6],a=i+i,o=n+n,c=r+r,u=i*a,l=i*o,h=i*c,_=n*o,f=n*c,d=r*c,p=s*a,v=s*o,g=s*c,m=e[7],y=e[8],T=e[9],E=t.m;return E[0]=(1-(_+d))*m,E[1]=(l+g)*m,E[2]=(h-v)*m,E[3]=0,E[4]=(l-g)*y,E[5]=(1-(u+d))*y,E[6]=(f+p)*y,E[7]=0,E[8]=(h+v)*T,E[9]=(f-p)*T,E[10]=(1-(u+_))*T,E[11]=0,E[12]=e[0],E[13]=e[1],E[14]=e[2],E[15]=1,t},t})();i.default=a,cc.Trs=a,e.exports=i.default}),{"./quat":251}],255:[(function(t,e,i){"use strict";i.__esModule=!0,i.equals=function(t,e){return Math.abs(t-e)<=s*Math.max(1,Math.abs(t),Math.abs(e))},i.approx=function(t,e,i){return i=i||s,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.lerp=function(t,e,i){return t+(e-t)*i},i.toRadian=function(t){return t*n},i.toDegree=function(t){return t*r},i.randomRange=c,i.randomRangeInt=function(t,e){return Math.floor(c(t,e))},i.pseudoRandom=u,i.pseudoRandomRange=l,i.pseudoRandomRangeInt=function(t,e,i){return Math.floor(l(t,e,i))},i.nextPow2=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},i.repeat=h,i.pingPong=function(t,e){return t=h(t,2*e),e-Math.abs(t-e)},i.inverseLerp=function(t,e,i){return(i-t)/(e-t)},i.sign=function(t){return(t>0)-(t<0)},i.random=i.FLOAT_BYTES=i.FLOAT_ARRAY_TYPE=i.INT_MIN=i.INT_MAX=i.INT_BITS=i.EPSILON=void 0;var n=Math.PI/180,r=180/Math.PI,s=1e-6;i.EPSILON=s,i.INT_BITS=32,i.INT_MAX=2147483647,i.INT_MIN=-1<<31;var a=Float64Array;i.FLOAT_ARRAY_TYPE=a,i.FLOAT_BYTES=8;var o=Math.random;function c(t,e){return Math.random()*(e-t)+t}function u(t){return(t=(9301*t+49297)%233280)/233280}function l(t,e,i){return u(t)*(i-e)+e}function h(t,e){return t-Math.floor(t/e)*e}i.random=o}),{}],256:[(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},s=(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=s,r.default.setClassName("cc.ValueType",s),cc.ValueType=s,e.exports=i.default}),{"../platform/js":179}],257:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=o(t("./value-type")),r=o(t("../platform/CCClass")),s=o(t("../utils/misc")),a=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,n.key,n)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=0,h=0,_=(function(t){var e,i;i=t,(e=_).prototype=Object.create(i.prototype),e.prototype.constructor=e,u(e,i);var n,r,o=_.prototype;function _(e,i){var n;return void 0===e&&(e=0),void 0===i&&(i=0),(n=t.call(this)||this).mag=_.prototype.len,n.magSqr=_.prototype.lengthSqr,n.subSelf=_.prototype.subtract,n.mulSelf=_.prototype.multiplyScalar,n.divSelf=_.prototype.divide,n.scaleSelf=_.prototype.multiply,n.negSelf=_.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 _.subtract(e||new _,this,t)},o.mul=function(t,e){return _.multiplyScalar(e||new _,this,t)},o.div=function(t,e){return _.multiplyScalar(e||new _,this,1/t)},o.scale=function(t,e){return _.multiply(e||new _,this,t)},o.neg=function(t){return _.negate(t||new _,this)},_.clone=function(t){return new _(t.x,t.y)},_.copy=function(t,e){return t.x=e.x,t.y=e.y,t},_.set=function(t,e,i){return t.x=e,t.y=i,t},_.add=function(t,e,i){return t.x=e.x+i.x,t.y=e.y+i.y,t},_.subtract=function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t},_.multiply=function(t,e,i){return t.x=e.x*i.x,t.y=e.y*i.y,t},_.divide=function(t,e,i){return t.x=e.x/i.x,t.y=e.y/i.y,t},_.ceil=function(t,e){return t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t},_.floor=function(t,e){return t.x=Math.floor(e.x),t.y=Math.floor(e.y),t},_.min=function(t,e,i){return t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t},_.max=function(t,e,i){return t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t},_.round=function(t,e){return t.x=Math.round(e.x),t.y=Math.round(e.y),t},_.multiplyScalar=function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t},_.scaleAndAdd=function(t,e,i,n){return t.x=e.x+i.x*n,t.y=e.y+i.y*n,t},_.distance=function(t,e){return l=e.x-t.x,h=e.y-t.y,Math.sqrt(l*l+h*h)},_.squaredDistance=function(t,e){return l=e.x-t.x,h=e.y-t.y,l*l+h*h},_.len=function(t){return l=t.x,h=t.y,Math.sqrt(l*l+h*h)},_.lengthSqr=function(t){return l=t.x,h=t.y,l*l+h*h},_.negate=function(t,e){return t.x=-e.x,t.y=-e.y,t},_.inverse=function(t,e){return t.x=1/e.x,t.y=1/e.y,t},_.inverseSafe=function(t,e){return l=e.x,h=e.y,Math.abs(l)<a.EPSILON?t.x=0:t.x=1/l,Math.abs(h)<a.EPSILON?t.y=0:t.y=1/h,t},_.normalize=function(t,e){l=e.x,h=e.y;var i=l*l+h*h;return i>0&&(i=1/Math.sqrt(i),t.x=l*i,t.y=h*i),t},_.dot=function(t,e){return t.x*e.x+t.y*e.y},_.cross=function(t,e,i){return t.x=t.y=0,t.z=e.x*i.y-e.y*i.x,t},_.lerp=function(t,e,i,n){return l=e.x,h=e.y,t.x=l+n*(i.x-l),t.y=h+n*(i.y-h),t},_.random=function(t,e){e=e||1;var i=2*(0,a.random)()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t},_.transformMat3=function(t,e,i){l=e.x,h=e.y;var n=i.m;return t.x=n[0]*l+n[3]*h+n[6],t.y=n[1]*l+n[4]*h+n[7],t},_.transformMat4=function(t,e,i){l=e.x,h=e.y;var n=i.m;return t.x=n[0]*l+n[4]*h+n[12],t.y=n[1]*l+n[5]*h+n[13],t},_.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y},_.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))},_.angle=function(t,e){_.normalize(f,t),_.normalize(d,e);var i=_.dot(f,d);return i>1?0:i<-1?Math.PI:Math.acos(i)},_.toArray=function(t,e,i){return void 0===i&&(i=0),t[i+0]=e.x,t[i+1]=e.y,t},_.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 _(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 _;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=s.default.clampf(this.x,t.x,e.x),this.y=s.default.clampf(this.y,t.y,e.y),this},o.add=function(t,e){return(e=e||new _).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 _).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=s.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 _).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 _,_.transformMat4(e,this,t),e},o.maxAxis=function(){return Math.max(this.x,this.y)},n=_,r=[{key:"ONE",get:function(){return new _(1,1)}},{key:"ZERO",get:function(){return new _(0,0)}},{key:"UP",get:function(){return new _(0,1)}},{key:"RIGHT",get:function(){return new _(1,0)}}],null&&c(n.prototype,null),r&&c(n,r),_})(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 f=new _,d=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":158,"../utils/misc":233,"./utils":255,"./value-type":256}],258:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=c(t("./value-type")),r=c(t("../platform/CCClass")),s=c(t("../utils/misc")),a=c(t("./vec2")),o=t("./utils");function c(t){return t&&t.__esModule?t:{default:t}}function u(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,n.key,n)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var h=0,_=0,f=0,d=(function(t){var e,i;i=t,(e=d).prototype=Object.create(i.prototype),e.prototype.constructor=e,l(e,i);var n,r,c=d.prototype;function d(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=d.prototype.len,r.magSqr=d.prototype.lengthSqr,r.subSelf=d.prototype.subtract,r.mulSelf=d.prototype.multiplyScalar,r.divSelf=d.prototype.divide,r.scaleSelf=d.prototype.multiply,r.negSelf=d.prototype.negate,r.x=void 0,r.y=void 0,r.z=void 0,r.angle=a.default.prototype.angle,r.project=a.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 d.subtract(e||new d,this,t)},c.mul=function(t,e){return d.multiplyScalar(e||new d,this,t)},c.div=function(t,e){return d.multiplyScalar(e||new d,this,1/t)},c.scale=function(t,e){return d.multiply(e||new d,this,t)},c.neg=function(t){return d.negate(t||new d,this)},d.zero=function(t){return t.x=0,t.y=0,t.z=0,t},d.clone=function(t){return new d(t.x,t.y,t.z)},d.copy=function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t},d.set=function(t,e,i,n){return t.x=e,t.y=i,t.z=n,t},d.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},d.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},d.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},d.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},d.ceil=function(t,e){return t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t.z=Math.ceil(e.z),t},d.floor=function(t,e){return t.x=Math.floor(e.x),t.y=Math.floor(e.y),t.z=Math.floor(e.z),t},d.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},d.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},d.round=function(t,e){return t.x=Math.round(e.x),t.y=Math.round(e.y),t.z=Math.round(e.z),t},d.multiplyScalar=function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},d.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},d.distance=function(t,e){return h=e.x-t.x,_=e.y-t.y,f=e.z-t.z,Math.sqrt(h*h+_*_+f*f)},d.squaredDistance=function(t,e){return h=e.x-t.x,_=e.y-t.y,f=e.z-t.z,h*h+_*_+f*f},d.len=function(t){return h=t.x,_=t.y,f=t.z,Math.sqrt(h*h+_*_+f*f)},d.lengthSqr=function(t){return h=t.x,_=t.y,f=t.z,h*h+_*_+f*f},d.negate=function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},d.inverse=function(t,e){return t.x=1/e.x,t.y=1/e.y,t.z=1/e.z,t},d.inverseSafe=function(t,e){return h=e.x,_=e.y,f=e.z,Math.abs(h)<o.EPSILON?t.x=0:t.x=1/h,Math.abs(_)<o.EPSILON?t.y=0:t.y=1/_,Math.abs(f)<o.EPSILON?t.z=0:t.z=1/f,t},d.normalize=function(t,e){h=e.x,_=e.y,f=e.z;var i=h*h+_*_+f*f;return i>0&&(i=1/Math.sqrt(i),t.x=h*i,t.y=_*i,t.z=f*i),t},d.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},d.cross=function(t,e,i){var n=e.x,r=e.y,s=e.z,a=i.x,o=i.y,c=i.z;return t.x=r*c-s*o,t.y=s*a-n*c,t.z=n*o-r*a,t},d.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},d.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},d.transformMat4=function(t,e,i){h=e.x,_=e.y,f=e.z;var n=i.m,r=n[3]*h+n[7]*_+n[11]*f+n[15];return r=r?1/r:1,t.x=(n[0]*h+n[4]*_+n[8]*f+n[12])*r,t.y=(n[1]*h+n[5]*_+n[9]*f+n[13])*r,t.z=(n[2]*h+n[6]*_+n[10]*f+n[14])*r,t},d.transformMat4Normal=function(t,e,i){h=e.x,_=e.y,f=e.z;var n=i.m,r=n[3]*h+n[7]*_+n[11]*f;return r=r?1/r:1,t.x=(n[0]*h+n[4]*_+n[8]*f)*r,t.y=(n[1]*h+n[5]*_+n[9]*f)*r,t.z=(n[2]*h+n[6]*_+n[10]*f)*r,t},d.transformMat3=function(t,e,i){h=e.x,_=e.y,f=e.z;var n=i.m;return t.x=h*n[0]+_*n[3]+f*n[6],t.y=h*n[1]+_*n[4]+f*n[7],t.z=h*n[2]+_*n[5]+f*n[8],t},d.transformAffine=function(t,e,i){h=e.x,_=e.y,f=e.z;var n=i.m;return t.x=n[0]*h+n[1]*_+n[2]*f+n[3],t.y=n[4]*h+n[5]*_+n[6]*f+n[7],t.x=n[8]*h+n[9]*_+n[10]*f+n[11],t},d.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,s=i.w*e.z+i.x*e.y-i.y*e.x,a=-i.x*e.x-i.y*e.y-i.z*e.z;return t.x=n*i.w+a*-i.x+r*-i.z-s*-i.y,t.y=r*i.w+a*-i.y+s*-i.x-n*-i.z,t.z=s*i.w+a*-i.z+n*-i.y-r*-i.x,t},d.transformRTS=function(t,e,i,n,r){var s=e.x*r.x,a=e.y*r.y,o=e.z*r.z,c=i.w*s+i.y*o-i.z*a,u=i.w*a+i.z*s-i.x*o,l=i.w*o+i.x*a-i.y*s,h=-i.x*s-i.y*a-i.z*o;return t.x=c*i.w+h*-i.x+u*-i.z-l*-i.y+n.x,t.y=u*i.w+h*-i.y+l*-i.x-c*-i.z+n.y,t.z=l*i.w+h*-i.z+c*-i.y-u*-i.x+n.z,t},d.transformInverseRTS=function(t,e,i,n,r){var s=e.x-n.x,a=e.y-n.y,o=e.z-n.z,c=i.w*s-i.y*o+i.z*a,u=i.w*a-i.z*s+i.x*o,l=i.w*o-i.x*a+i.y*s,h=i.x*s+i.y*a+i.z*o;return t.x=(c*i.w+h*i.x+u*i.z-l*i.y)/r.x,t.y=(u*i.w+h*i.y+l*i.x-c*i.z)/r.y,t.z=(l*i.w+h*i.z+c*i.y-u*i.x)/r.z,t},d.rotateX=function(t,e,i,n){h=e.x-i.x,_=e.y-i.y,f=e.z-i.z;var r=Math.cos(n),s=Math.sin(n),a=h,o=_*r-f*s,c=_*s+f*r;return t.x=a+i.x,t.y=o+i.y,t.z=c+i.z,t},d.rotateY=function(t,e,i,n){h=e.x-i.x,_=e.y-i.y,f=e.z-i.z;var r=Math.cos(n),s=Math.sin(n),a=f*s+h*r,o=_,c=f*r-h*s;return t.x=a+i.x,t.y=o+i.y,t.z=c+i.z,t},d.rotateZ=function(t,e,i,n){h=e.x-i.x,_=e.y-i.y,f=e.z-i.z;var r=Math.cos(n),s=Math.sin(n),a=h*r-_*s,o=h*s+_*r,c=f;return t.x=a+i.x,t.y=o+i.y,t.z=c+i.z,t},d.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z},d.equals=function(t,e,i){void 0===i&&(i=o.EPSILON);var n=t.x,r=t.y,s=t.z,a=e.x,c=e.y,u=e.z;return Math.abs(n-a)<=i*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-c)<=i*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(s-u)<=i*Math.max(1,Math.abs(s),Math.abs(u))},d.angle=function(t,e){d.normalize(p,t),d.normalize(v,e);var i=d.dot(p,v);return i>1?0:i<-1?Math.PI:Math.acos(i)},d.projectOnPlane=function(t,e,i){return d.subtract(t,e,d.project(t,e,i))},d.project=function(t,e,i){var n=d.lengthSqr(i);return n<1e-6?d.set(t,0,0,0):d.multiplyScalar(t,i,d.dot(e,i)/n)},d.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},d.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 d(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 d,d.lerp(i,this,t,e),i},c.clampf=function(t,e){return this.x=s.default.clampf(this.x,t.x,e.x),this.y=s.default.clampf(this.y,t.y,e.y),this.z=s.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 d).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 d,d.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 d.normalize(this,this),this},c.normalize=function(t){return t=t||new d,d.normalize(t,this),t},c.transformMat4=function(t,e){return e=e||new d,d.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 a.default(this.x,this.y),i=new a.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)"),a.default.prototype.rotate.call(this,t,e)},c.rotateSelf=function(t){return cc.warnID(1408,"vec3.rotateSelf","v2.1","cc.v2(selfVector).rotateSelf(radians)"),a.default.prototype.rotateSelf.call(this,t)},n=d,r=[{key:"ONE",get:function(){return new d(1,1,1)}},{key:"ZERO",get:function(){return new d}},{key:"UP",get:function(){return new d(0,1,0)}},{key:"RIGHT",get:function(){return new d(1,0,0)}},{key:"FORWARD",get:function(){return new d(0,0,1)}}],null&&u(n.prototype,null),r&&u(n,r),d})(n.default);i.default=d,d.sub=d.subtract,d.mul=d.multiply,d.scale=d.multiplyScalar,d.mag=d.len,d.squaredMagnitude=d.lengthSqr,d.div=d.divide,d.ONE_R=d.ONE,d.ZERO_R=d.ZERO,d.UP_R=d.UP,d.RIGHT_R=d.RIGHT,d.FRONT_R=d.FORWARD;var p=new d,v=new d;r.default.fastDefine("cc.Vec3",d,{x:0,y:0,z:0}),cc.v3=function(t,e,i){return new d(t,e,i)},cc.Vec3=d,e.exports=i.default}),{"../platform/CCClass":158,"../utils/misc":233,"./utils":255,"./value-type":256,"./vec2":257}],259:[(function(t,e,i){"use strict";i.__esModule=!0,i.v4=d,i.default=void 0;var n=a(t("../platform/CCClass")),r=a(t("./value-type")),s=t("./utils");function a(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,n.key,n)}}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=0,l=0,h=0,_=0,f=(function(t){var e,i;i=t,(e=f).prototype=Object.create(i.prototype),e.prototype.constructor=e,c(e,i);var n,r,a=f.prototype;function f(e,i,n,r){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),(s=t.call(this)||this).mag=f.prototype.len,s.magSqr=f.prototype.lengthSqr,s.subSelf=f.prototype.subtract,s.mulSelf=f.prototype.multiplyScalar,s.divSelf=f.prototype.divide,s.scaleSelf=f.prototype.multiply,s.negSelf=f.prototype.negate,s.x=void 0,s.y=void 0,s.z=void 0,s.w=void 0,e&&"object"==typeof e?(s.x=e.x,s.y=e.y,s.z=e.z,s.w=e.w):(s.x=e,s.y=i,s.z=n,s.w=r),s}return a.sub=function(t,e){return f.subtract(e||new f,this,t)},a.mul=function(t,e){return f.multiplyScalar(e||new f,this,t)},a.div=function(t,e){return f.multiplyScalar(e||new f,this,1/t)},a.scale=function(t,e){return f.multiply(e||new f,this,t)},a.neg=function(t){return f.negate(t||new f,this)},f.clone=function(t){return new f(t.x,t.y,t.z,t.w)},f.copy=function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t},f.set=function(t,e,i,n,r){return t.x=e,t.y=i,t.z=n,t.w=r,t},f.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},f.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},f.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},f.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},f.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},f.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},f.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},f.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},f.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},f.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},f.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},f.distance=function(t,e){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,s=e.w-t.w;return Math.sqrt(i*i+n*n+r*r+s*s)},f.squaredDistance=function(t,e){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,s=e.w-t.w;return i*i+n*n+r*r+s*s},f.len=function(t){return u=t.x,l=t.y,h=t.z,_=t.w,Math.sqrt(u*u+l*l+h*h+_*_)},f.lengthSqr=function(t){return u=t.x,l=t.y,h=t.z,_=t.w,u*u+l*l+h*h+_*_},f.negate=function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},f.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},f.inverseSafe=function(t,e){return u=e.x,l=e.y,h=e.z,_=e.w,Math.abs(u)<s.EPSILON?t.x=0:t.x=1/u,Math.abs(l)<s.EPSILON?t.y=0:t.y=1/l,Math.abs(h)<s.EPSILON?t.z=0:t.z=1/h,Math.abs(_)<s.EPSILON?t.w=0:t.w=1/_,t},f.normalize=function(t,e){u=e.x,l=e.y,h=e.z,_=e.w;var i=u*u+l*l+h*h+_*_;return i>0&&(i=1/Math.sqrt(i),t.x=u*i,t.y=l*i,t.z=h*i,t.w=_*i),t},f.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},f.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},f.random=function(t,e){e=e||1;var i=2*(0,s.random)()*Math.PI,n=2*(0,s.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},f.transformMat4=function(t,e,i){u=e.x,l=e.y,h=e.z,_=e.w;var n=i.m;return t.x=n[0]*u+n[4]*l+n[8]*h+n[12]*_,t.y=n[1]*u+n[5]*l+n[9]*h+n[13]*_,t.z=n[2]*u+n[6]*l+n[10]*h+n[14]*_,t.w=n[3]*u+n[7]*l+n[11]*h+n[15]*_,t},f.transformAffine=function(t,e,i){u=e.x,l=e.y,h=e.z,_=e.w;var n=i.m;return t.x=n[0]*u+n[1]*l+n[2]*h+n[3]*_,t.y=n[4]*u+n[5]*l+n[6]*h+n[7]*_,t.x=n[8]*u+n[9]*l+n[10]*h+n[11]*_,t.w=e.w,t},f.transformQuat=function(t,e,i){var n=e.x,r=e.y,s=e.z;u=i.x,l=i.y,h=i.z;var a=(_=i.w)*n+l*s-h*r,o=_*r+h*n-u*s,c=_*s+u*r-l*n,f=-u*n-l*r-h*s;return t.x=a*_+f*-u+o*-h-c*-l,t.y=o*_+f*-l+c*-u-a*-h,t.z=c*_+f*-h+a*-l-o*-u,t.w=e.w,t},f.strictEquals=function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},f.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))&&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))},f.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},f.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},a.clone=function(){return new f(this.x,this.y,this.z,this.w)},a.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},a.equals=function(t,e){return void 0===e&&(e=s.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))},a.equals4f=function(t,e,i,n,r){return void 0===r&&(r=s.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))},a.strictEquals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},a.strictEquals4f=function(t,e,i,n){return this.x===t&&this.y===e&&this.z===i&&this.w===n},a.lerp=function(t,e){return u=this.x,l=this.y,h=this.z,_=this.w,this.x=u+e*(t.x-u),this.y=l+e*(t.y-l),this.z=h+e*(t.z-h),this.w=_+e*(t.w-_),this},a.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.z.toFixed(2)+", "+this.w.toFixed(2)+")"},a.clampf=function(t,e){return this.x=(0,s.clamp)(this.x,t.x,e.x),this.y=(0,s.clamp)(this.y,t.y,e.y),this.z=(0,s.clamp)(this.z,t.z,e.z),this.w=(0,s.clamp)(this.w,t.w,e.w),this},a.addSelf=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},a.add=function(t,e){return(e=e||new f).x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e.w=this.w+t.w,e},a.subtract=function(t,e){return(e=e||new f).x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e.w=this.w-t.w,e},a.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},a.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},a.divide=function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},a.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},a.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},a.cross=function(t,e){e=e||new f;var i=this.x,n=this.y,r=this.z,s=t.x,a=t.y,o=t.z;return e.x=n*o-r*a,e.y=r*s-i*o,e.z=i*a-n*s,e},a.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)},a.lengthSqr=function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},a.normalizeSelf=function(){return this.normalize(this),this},a.normalize=function(t){t=t||new f,u=this.x,l=this.y,h=this.z,_=this.w;var e=u*u+l*l+h*h+_*_;return e>0&&(e=1/Math.sqrt(e),t.x=u*e,t.y=l*e,t.z=h*e,t.w=_*e),t},a.transformMat4=function(t,e){e=e||new f,u=this.x,l=this.y,h=this.z,_=this.w;var i=t.m;return e.x=i[0]*u+i[4]*l+i[8]*h+i[12]*_,e.y=i[1]*u+i[5]*l+i[9]*h+i[13]*_,e.z=i[2]*u+i[6]*l+i[10]*h+i[14]*_,e.w=i[3]*u+i[7]*l+i[11]*h+i[15]*_,e},a.maxAxis=function(){return Math.max(this.x,this.y,this.z,this.w)},n=f,r=[{key:"ZERO",get:function(){return new f(0,0,0,0)}},{key:"ONE",get:function(){return new f(1,1,1,1)}},{key:"NEG_ONE",get:function(){return new f(-1,-1,-1,-1)}}],null&&o(n.prototype,null),r&&o(n,r),f})(r.default);function d(t,e,i,n){return new f(t,e,i,n)}i.default=f,f.sub=f.subtract,f.mul=f.multiply,f.div=f.divide,f.scale=f.multiplyScalar,f.mag=f.len,f.squaredMagnitude=f.lengthSqr,f.ZERO_R=f.ZERO,f.ONE_R=f.ONE,f.NEG_ONE_R=f.NEG_ONE,n.default.fastDefine("cc.Vec4",f,{x:0,y:0,z:0,w:0}),cc.v4=d,cc.Vec4=f}),{"../platform/CCClass":158,"./utils":255,"./value-type":256}],260:[(function(){"use strict";cc.js}),{}],261:[(function(t){"use strict";t("./core/CCGame"),t("./actions")}),{"./actions":7,"./core/CCGame":24}],262:[(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":58,"../core/assets/CCSpriteFrame":70}],263:[(function(t,e){"use strict";var i,n,r,s,a,o,c,u,l,h,_,f,d,p,v,g,m,y,T,E,A,C,x,b,S,w,R,I,M,O,L,D,P,N,F,B,z,V,U,k,H,W;(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"})(s||(s={})),(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"})(a||(a={})),(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"})(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"})(u||(u={})),(function(t){t[t.NONE=0]="NONE",t[t.READ=1]="READ",t[t.WRITE=2]="WRITE"})(l||(l={})),(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"})(h||(h={})),(function(t){t[t.FILL=0]="FILL",t[t.POINT=1]="POINT",t[t.LINE=2]="LINE"})(_||(_={})),(function(t){t[t.GOURAND=0]="GOURAND",t[t.FLAT=1]="FLAT"})(f||(f={})),(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"})(v||(v={})),(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"})(g||(g={})),(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"})(m||(m={})),(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"})(E||(E={})),(function(t){t[t.TEX1D=0]="TEX1D",t[t.TEX2D=1]="TEX2D",t[t.TEX3D=2]="TEX3D"})(A||(A={})),(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"})(C||(C={})),(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"})(x||(x={})),(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"})(b||(b={})),(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"})(R||(R={})),(function(t){t[t.PRIMARY=0]="PRIMARY",t[t.SECONDARY=1]="SECONDARY"})(I||(I={})),(function(t){t[t.LOAD=0]="LOAD",t[t.CLEAR=1]="CLEAR",t[t.DISCARD=2]="DISCARD"})(M||(M={})),(function(t){t[t.STORE=0]="STORE",t[t.DISCARD=1]="DISCARD"})(O||(O={})),(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"})(L||(L={})),(function(t){t[t.GRAPHICS=0]="GRAPHICS",t[t.COMPUTE=1]="COMPUTE",t[t.RAY_TRACING=2]="RAY_TRACING"})(D||(D={})),(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"})(P||(P={})),(function(t){t[t.FRONT=0]="FRONT",t[t.BACK=1]="BACK",t[t.ALL=2]="ALL"})(N||(N={})),(function(t){t[t.GRAPHICS=0]="GRAPHICS",t[t.COMPUTE=1]="COMPUTE",t[t.TRANSFER=2]="TRANSFER"})(F||(F={})),(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"})(z||(z={})),(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"})(W||(W={}));var G={};G[G.bool=a.BOOL]="bool",G[G.int=a.INT]="int",G[G.ivec2=a.INT2]="ivec2invTypeParams",G[G.ivec3=a.INT3]="ivec3",G[G.ivec4=a.INT4]="ivec4",G[G.float=a.FLOAT]="float",G[G.vec2=a.FLOAT2]="vec2",G[G.vec3=a.FLOAT3]="vec3",G[G.vec4=a.FLOAT4]="vec4",G[G.mat2=a.MAT2]="mat2",G[G.mat3=a.MAT3]="mat3",G[G.mat4=a.MAT4]="mat4",G[G.sampler2D=a.SAMPLER2D]="sampler2D",G[G.samplerCube=a.SAMPLER_CUBE]="samplerCube";var j=((k={})[a.BOOL]=4,k[a.INT]=4,k[a.INT2]=8,k[a.INT3]=12,k[a.INT4]=16,k[a.FLOAT]=4,k[a.FLOAT2]=8,k[a.FLOAT3]=12,k[a.FLOAT4]=16,k[a.MAT2]=16,k[a.MAT3]=36,k[a.MAT4]=64,k[a.SAMPLER2D]=4,k[a.SAMPLER_CUBE]=4,k),Y=((H={})[a.BOOL]=o.R32I,H[a.INT]=o.R32I,H[a.INT2]=o.RG32I,H[a.INT3]=o.RGB32I,H[a.INT4]=o.RGBA32I,H[a.FLOAT]=o.R32F,H[a.FLOAT2]=o.RG32F,H[a.FLOAT3]=o.RGB32F,H[a.FLOAT4]=o.RGBA32F,H),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,z);var q={murmurhash2_32_gc:function(t,e){for(var i,n=t.length,r=e^n,s=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<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,++s;switch(n){case 3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0},SamplerInfoIndex:W,effectStructure:{$techniques:[{$passes:[{depthStencilState:{},rasterizerState:{},blendState:{targets:[{}]},properties:{any:{sampler:{},inspector:{}}}}]}]},typeMap:G,sizeMap:j,formatMap:Y,passParams:X,RenderQueue:{OPAQUE:0,TRANSPARENT:1,OVERLAY:2},RenderPriority:V,GFXGetTypeSize:function(t){switch(t){case a.BOOL:case a.INT:case a.UINT:case a.FLOAT:return 4;case a.BOOL2:case a.INT2:case a.UINT2:case a.FLOAT2:return 8;case a.BOOL3:case a.INT3:case a.UINT3:case a.FLOAT3:return 12;case a.BOOL4:case a.INT4:case a.UINT4:case a.FLOAT4:case a.MAT2:return 16;case a.MAT2X3:return 24;case a.MAT2X4:return 32;case a.MAT3X2:return 24;case a.MAT3:return 36;case a.MAT3X4:return 48;case a.MAT4X2:case a.MAT4X2:return 32;case a.MAT4:return 64;case a.SAMPLER1D:case a.SAMPLER1D_ARRAY:case a.SAMPLER2D:case a.SAMPLER2D_ARRAY:case a.SAMPLER3D:case a.SAMPLER_CUBE:return 4;default:return 0}},UniformBinding:U};e.exports=q}),{}],264:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../memop"),r=u(t("../enums")),s=t("../../core/value-types"),a=u(t("./program-lib")),o=u(t("./view")),c=u(t("../gfx"));function u(t){return t&&t.__esModule?t:{default:t}}var l=new s.Mat4,h=new n.RecyclePool(function(){return{stage:null,items:null}},8),_=new n.RecyclePool(function(){return new Float32Array(2)},8),f=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),v=new n.RecyclePool(function(){return new Float32Array(16)},8),g=new n.RecyclePool(function(){return new Float32Array(64)},8),m=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),E=new n.RecyclePool(function(){return new Int32Array(64)},8),A=(function(){function t(t,e){var i;this._device=t,this._programLib=new a.default(t),this._opts=e,this._type2defaultValue=((i={})[r.default.PARAM_INT]=0,i[r.default.PARAM_INT2]=new s.Vec2(0,0),i[r.default.PARAM_INT3]=new s.Vec3(0,0,0),i[r.default.PARAM_INT4]=new s.Vec4(0,0,0,0),i[r.default.PARAM_FLOAT]=0,i[r.default.PARAM_FLOAT2]=new s.Vec2(0,0),i[r.default.PARAM_FLOAT3]=new s.Vec3(0,0,0),i[r.default.PARAM_FLOAT4]=new s.Vec4(0,0,0,0),i[r.default.PARAM_COLOR4]=new s.Color(0,0,0,1),i[r.default.PARAM_MAT3]=new s.Mat3,i[r.default.PARAM_MAT4]=new s.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=s.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 a=0;a<e._models.length;++a){var o=e._models.data[a];if(0!=(o._cullingMask&t._cullingMask)){var c=this._drawItemsPools.add();o.extractDrawItem(c)}}h.reset();for(var u=0;u<t._stages.length;++u){var l=t._stages[u],_=this._stageItemsPools.add();_.reset();for(var f=0;f<this._drawItemsPools.length;++f){var d=this._drawItemsPools.data[f],p=d.effect.stagePasses[l];if(p&&0!==p.length){var v=_.add();v.passes=p,v.model=d.model,v.node=d.node,v.ia=d.ia,v.effect=d.effect,v.defines=d.defines,v.sortKey=-1,v.uniforms=d.uniforms}}var g=h.add();g.stage=l,g.items=_}for(var m=0;m<h.length;++m){var y=h.data[m];(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=E.add(),s=0;s<i.length;++s)n[s]=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,a=t.passes,o=t.effect;_.reset(),f.reset(),d.reset(),p.reset(),v.reset(),g.reset(),m.reset(),y.reset(),T.reset(),E.reset(),n.getWorldMatrix(l),e.setUniform("cc_matWorld",s.Mat4.toArray(v.add(),l)),s.Mat4.invert(l,l),s.Mat4.transpose(l,l),e.setUniform("cc_matWorldIT",s.Mat4.toArray(v.add(),l));for(var u=this._defines,h=0;h<a.length;++h){var A=a[h];this._definesChanged&&(A._programKey=null);var C=r.count;r._vertexBuffer&&e.setVertexBuffer(0,r._vertexBuffer),r._indexBuffer&&e.setIndexBuffer(r._indexBuffer),e.setPrimitiveType(r._primitiveType),Object.setPrototypeOf(u,A._defines);var x=i.getProgram(A,u,o.name);e.setProgram(x);for(var b=x._uniforms,S=A._properties,w=0;w<b.length;w++){var R=S[b[w].name];void 0!==R&&this._setProperty(R)}e.setCullMode(A._cullMode),A._blend&&(e.enableBlend(),e.setBlendFuncSep(A._blendSrc,A._blendDst,A._blendSrcAlpha,A._blendDstAlpha),e.setBlendEqSep(A._blendEq,A._blendAlphaEq),e.setBlendColor32(A._blendColor)),A._depthTest&&(e.enableDepthTest(),e.setDepthFunc(A._depthFunc)),A._depthWrite&&e.enableDepthWrite(),e.setStencilTest(A._stencilTest),A._stencilTest===c.default.STENCIL_ENABLE&&(e.setStencilFuncFront(A._stencilFuncFront,A._stencilRefFront,A._stencilMaskFront),e.setStencilOpFront(A._stencilFailOpFront,A._stencilZFailOpFront,A._stencilZPassOpFront,A._stencilWriteMaskFront),e.setStencilFuncBack(A._stencilFuncBack,A._stencilRefBack,A._stencilMaskBack),e.setStencilOpBack(A._stencilFailOpBack,A._stencilZFailOpBack,A._stencilZPassOpBack,A._stencilWriteMaskBack)),e.draw(r._start,C),this._resetTextuerUnit()}},t})();i.default=A,e.exports=i.default}),{"../../core/value-types":248,"../enums":270,"../gfx":275,"../memop":287,"./program-lib":267,"./view":269}],265:[(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 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,n.key,n)}}var a=(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}}])&&s(e.prototype,i),t})();i.default=a,e.exports=i.default}),{"../gfx":275}],266:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../gfx")),r=a(t("../enums")),s=a(t("../../core/value-types/value-type"));function a(t){return t&&t.__esModule?t:{default:t}}var o=(function(){function t(t,e,i,r,s,a){void 0===s&&(s={}),void 0===a&&(a={}),this._name=t,this._detailName=e,this._programName=i,this._programKey=null,this._stage=r,this._properties=s,this._defines=a,this._propertyNames=Object.keys(s),this._defineNames=Object.keys(a),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,s,a,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===s&&(s=n.default.BLEND_FUNC_ADD),void 0===a&&(a=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=s,this._blendSrcAlpha=a,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,s,a,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===s&&(s=n.default.STENCIL_OP_KEEP),void 0===a&&(a=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=s,this._stencilZFailOpFront=a,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,s,a,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===s&&(s=n.default.STENCIL_OP_KEEP),void 0===a&&(a=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=s,this._stencilZFailOpBack=a,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 a=n.value;if(a.length!==e.length)return void cc.warnID(9105,this._name,t);for(var o=0;o<e.length;o++)a[o]=e[o]}else e&&!ArrayBuffer.isView(e)?n.type===r.default.PARAM_TEXTURE_2D?n.value=e.getImpl():e instanceof s.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 s=n[r],a=i[r]={},o=s.value;for(var c in Array.isArray(o)?a.value=o.concat():ArrayBuffer.isView(o)?a.value=new o.__proto__.constructor(o):a.value=o,s)"value"!==c&&(a[c]=s[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":256,"../enums":270,"../gfx":275}],267:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("../gfx"))&&n.__esModule?n:{default:n},s=0;function a(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n].name,s=e[r];"number"!=typeof s&&(s=s?1:0),i.push("#define "+r+" "+s)}return i.join("\n")+"\n"}function o(t,e,i){for(var n=t,r=0;r<e.length;r++){var s=e[r].name,a=i[s];if(Number.isInteger(a)){var o=new RegExp(s,"g");n=n.replace(o,a)}}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 s="",a=parseInt(i),o=parseInt(n);(a.isNaN||o.isNaN)&&console.error("Unroll For Loops Error: begin and end of range must be an int num.");for(var c=a;c<o;++c)s+=r.replace(new RegExp("{"+e+"}","g"),c);return s}))}function u(t){return t.replace(/\bhighp\b/g,"mediump")}var l=(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,a=n.frag;if(!this._templates[e]){for(var o=++s,c=0,u=0;u<i.length;++u){var l=i[u],h=1;if("number"===l.type){var _=l.range||[];l.min=_[0]||0,l.max=_[1]||4,h=Math.ceil(Math.log2(l.max-l.min)),l._map=function(t){return t-this.min<<this._offset}.bind(l)}else l._map=function(t){return t?1<<this._offset:0}.bind(l);l._offset=c,c+=h}var f=t.uniforms||[];if(t.samplers)for(var d=0;d<t.samplers.length;d++)f.push(t.samplers[d]);if(t.blocks)for(var p=0;p<t.blocks.length;p++)for(var v=t.blocks[p].defines,g=t.blocks[p].members,m=0;m<g.length;m++)f.push({defines:v,name:g[m].name,type:g[m].type});this._templates[e]={id:o,name:e,vert:r,frag:a,defines:i,attributes:t.attributes,uniforms:f,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 s=i.defines[r],a=e[s.name];void 0!==a&&(n|=s._map(a))}return i.id+":"+n},e.getProgram=function(t,e,i){var n=t._programKey=t._programKey||this.getKey(t._programName,e),s=this._cache[n];if(s)return s;var l=this._templates[t._programName],h=a(l.defines,e),_=o(l.vert,l.defines,e);_=h+c(_),this._highpSupported||(_=u(_));var f=o(l.frag,l.defines,e);f=h+c(f),this._highpSupported||(f=u(f));var d=(s=new r.default.Program(this._device,{vert:_,frag:f})).link();if(d){var p=_.split("\n"),v=f.split("\n"),g=l.defines.length;d.forEach((function(t){var e=t.line-1,n=t.line-g,r=("vs"===t.type?p:v)[e],s=t.info||"Failed to compile "+t.type+" "+t.fileID+" (ln "+n+"): \n "+t.message+": \n "+r;cc.error(i+" : "+s)}))}return this._cache[n]=s,s},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=l,e.exports=i.default}),{"../gfx":275}],268:[(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,n.key,n)}}i.__esModule=!0,i.default=void 0;var r=(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),t})();i.default=r,e.exports=i.default}),{}],269:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../../core/value-types"),s=(n=t("../enums"))&&n.__esModule?n:{default:n},a=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=s.default.CLEAR_COLOR|s.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(a,this._matView),r.Mat4.getTranslation(t,a)},t})();i.default=c,e.exports=i.default}),{"../../core/value-types":248,"../enums":270}],270:[(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":263}],271:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r,s=u(t("./state")),a=t("./enums"),o=u(t("./texture-2d")),c=u(t("./texture-cube"));function u(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,n.key,n)}}var h=((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 f(t,e,i){if(e.blend!==i.blend)return i.blend?(t.enable(t.BLEND),i.blendSrc!==a.enums.BLEND_CONSTANT_COLOR&&i.blendSrc!==a.enums.BLEND_ONE_MINUS_CONSTANT_COLOR&&i.blendDst!==a.enums.BLEND_CONSTANT_COLOR&&i.blendDst!==a.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 d(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=a.enums.DS_FUNC_ALWAYS,t.enable(t.DEPTH_TEST),t.depthFunc(i.depthFunc))}function p(t,e,i){if(i.stencilTest!==a.enums.STENCIL_INHERIT)return i.stencilTest!==e.stencilTest?i.stencilTest===a.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!==a.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!==a.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 s=0;s<n.maxStream+1;++s)if(i.vertexBuffers[s]!==n.vertexBuffers[s]||i.vertexBufferOffsets[s]!==n.vertexBufferOffsets[s]){r=!0;break}if(r){for(var a=0;a<t._caps.maxVertexAttribs;++a)t._newAttributes[a]=0;for(var o=0;o<n.maxStream+1;++o){var c=n.vertexBuffers[o],u=n.vertexBufferOffsets[o];if(c&&-1!==c._glID){e.bindBuffer(e.ARRAY_BUFFER,c._glID);for(var l=0;l<n.program._attributes.length;++l){var h=n.program._attributes[l],_=c._format.element(h.name);_?(0===t._enabledAttributes[h.location]&&(e.enableVertexAttribArray(h.location),t._enabledAttributes[h.location]=1),t._newAttributes[h.location]=1,e.vertexAttribPointer(h.location,_.num,_.type,_.normalize,_.stride,_.offset+u*_.stride)):console.warn("Can not find vertex attribute: "+h.name)}}}for(var f=0;f<t._caps.maxVertexAttribs;++f)t._enabledAttributes[f]!==t._newAttributes[f]&&(e.disableVertexAttribArray(f),t._enabledAttributes[f]=0)}}}function m(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 y(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 T=(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_atc","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(),s.default.initDefault(this),this._current=new s.default(this),this._next=new s.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_"],s=0;s<r.length;s++)try{var a=e.getExtension(r[s]+n);if(a){this._extensions[n]=a;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];y(e,e.COLOR_ATTACHMENT0+n,r)}for(var s=i;s<this._caps.maxColorAttachments;++s)e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+s,e.TEXTURE_2D,null,0);t._depth&&y(e,e.DEPTH_ATTACHMENT,t._depth),t._stencil&&y(e,e.STENCIL_ATTACHMENT,t._stencil),t._depthStencil&&y(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!==a.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 s=i[r];this._next.textureUnits[s]=e[r],this._next.maxTextureSlot<s&&(this._next.maxTextureSlot=s)}this.setUniform(t,i)}},n.setUniform=function(t,e){var i=this._uniforms[t],n=!1,r=!1,s=!1,a=!1;do{if(!i)break;if(s=Array.isArray(e)||e instanceof Float32Array,a=e instanceof Int32Array,r=s||a,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 u=0,l=o.length;u<l;u++)o[u]!==e[u]&&(c=!0,o[u]=e[u]);else o!==e&&(c=!0,i.value=e);c&&(i.dirty=!0)}else{var h=e;s?h=new Float32Array(e):a&&(h=new Int32Array(e)),i={dirty:!0,value:h,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;f(i,n,r),d(i,n,r),p(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 s=!1;n.program!==r.program&&(r.program._linked?i.useProgram(r.program._glID):console.warn("Failed to use program: has not linked yet."),s=!0),m(i,n,r);for(var a=0;a<r.program._uniforms.length;++a){var o=r.program._uniforms[a],c=this._uniforms[o.name];if(c&&(s||c.dirty)){c.dirty=!1;var u=void 0===o.size?h[o.type]:_[o.type];u?u(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}}])&&l(e.prototype,i),t})();i.default=T,e.exports=i.default}),{"./enums":272,"./state":279,"./texture-2d":280,"./texture-cube":281}],272:[(function(t,e,i){"use strict";i.__esModule=!0,i.attrTypeBytes=function(t){return t===s.ATTR_TYPE_INT8?1:t===s.ATTR_TYPE_UINT8?1:t===s.ATTR_TYPE_INT16?2:t===s.ATTR_TYPE_UINT16?2:t===s.ATTR_TYPE_INT32?4:t===s.ATTR_TYPE_UINT32?4:t===s.ATTR_TYPE_FLOAT32?4:(console.warn("Unknown ATTR_TYPE: "+t),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[s.TEXTURE_FMT_RGBA8]):e},i.enums=void 0;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}],s={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,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=s}),{}],273:[(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}),{}],274:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./enums");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,n.key,n)}}var a=((n={})[r.enums.INDEX_FMT_UINT8]=1,n[r.enums.INDEX_FMT_UINT16]=2,n[r.enums.INDEX_FMT_UINT32]=4,n),o=(function(){function t(t,e,i,n){this._device=t,this._format=e,this._usage=i,this._bytesPerIndex=a[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}}])&&s(e.prototype,i),t})();o.BYTES_PER_INDEX=a;var c=o;i.default=c,e.exports=i.default}),{"./enums":272}],275:[(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 s=n;i.default=s,cc.gfx=n,e.exports=i.default}),{"./device":271,"./enums":272,"./frame-buffer":273,"./index-buffer":274,"./program":277,"./render-buffer":278,"./texture":282,"./texture-2d":280,"./texture-cube":281,"./vertex-buffer":283,"./vertex-format":284}],276:[(function(t,e,i){"use strict";i.__esModule=!0,i.isPow2=function(t){return!(t&t-1||!t)}}),{}],277:[(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,n.key,n)}}i.__esModule=!0,i.default=void 0;var r=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 a=(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=r++}var e,i,a=t.prototype;return a.link=function(){if(!this._linked){var t=this._device._gl,e=o(t,t.VERTEX_SHADER,this._vertSource),i=o(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 c=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),u=0;u<c;++u){var l=t.getActiveAttrib(n,u),h=t.getAttribLocation(n,l.name);this._attributes.push({name:l.name,location:h,type:l.type})}for(var _=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),f=0;f<_;++f){var d=t.getActiveUniform(n,f),p=d.name,v=t.getUniformLocation(n,p),g="[0]"===p.substr(p.length-3);g&&(p=p.substr(0,p.length-3));var m={name:p,location:v,type:d.type,size:g?d.size:void 0};this._uniforms.push(m)}this._linked=!0}},a.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),t})();function o(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}i.default=a,e.exports=i.default}),{}],278:[(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}),{}],279:[(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},s=(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=s,e.exports=i.default}),{"./enums":272}],280:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./texture"))&&n.__esModule?n:{default:n},s=t("./enums"),a=t("./misc");function o(t,e){return(o=Object.setPrototypeOf||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>=s.enums.TEXTURE_FMT_RGB_DXT1&&this._format<=s.enums.TEXTURE_FMT_RGBA_PVRTC_4BPPV1||this._format>=s.enums.TEXTURE_FMT_RGB_ETC2&&this._format<=s.enums.TEXTURE_FMT_RGBA_ETC2),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,a.isPow2)(this._width)&&(0,a.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,s.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,s.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,s=e.image;!s||ArrayBuffer.isView(s)||s 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,s):i.texSubImage2D(i.TEXTURE_2D,e.level,e.x,e.y,e.width,e.height,t.format,t.pixelType,s)):(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,s))},r._setImage=function(t,e){var i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,s=e.image;!s||ArrayBuffer.isView(s)||s 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,s):i.texImage2D(i.TEXTURE_2D,e.level,t.internalFormat,e.width,e.height,0,t.format,t.pixelType,s)):(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,s))},r._setMipmap=function(t,e,i){for(var n=(0,s.glTextureFmt)(this._format),r={width:this._width,height:this._height,flipY:e,premultiplyAlpha:i,level:0,image:null},a=0;a<t.length;++a)r.level=a,r.width=this._width>>a,r.height=this._height>>a,r.image=t[a],this._setImage(n,r)},r._setTexInfo=function(){var t=this._device._gl,e=(0,a.isPow2)(this._width)&&(0,a.isPow2)(this._height);e||this._wrapS===s.enums.WRAP_CLAMP&&this._wrapT===s.enums.WRAP_CLAMP||(console.warn("WebGL1 doesn't support all wrap modes with NPOT textures"),this._wrapS=s.enums.WRAP_CLAMP,this._wrapT=s.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,s.glFilter)(t,this._minFilter,i)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,(0,s.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":272,"./misc":276,"./texture":282}],281:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=(n=t("./texture"))&&n.__esModule?n:{default:n},s=t("./enums"),a=t("./misc");function o(t,e){return(o=Object.setPrototypeOf||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>=s.enums.TEXTURE_FMT_RGB_DXT1&&this._format<=s.enums.TEXTURE_FMT_RGBA_PVRTC_4BPPV1||this._format>=s.enums.TEXTURE_FMT_RGB_ETC2&&this._format<=s.enums.TEXTURE_FMT_RGBA_ETC2),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,a.isPow2)(this._width)&&(0,a.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,s.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,s.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,s=e.faceIndex,a=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),!a||ArrayBuffer.isView(a)||a instanceof ArrayBuffer?this._compressed?i.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,e.x,e.y,e.width,e.height,t.format,a):i.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,e.x,e.y,e.width,e.height,t.format,t.pixelType,a):i.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,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,s=e.faceIndex,a=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),!a||ArrayBuffer.isView(a)||a instanceof ArrayBuffer?this._compressed?i.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,t.internalFormat,e.width,e.height,0,a):i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,t.internalFormat,e.width,e.height,0,t.format,t.pixelType,a):i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,t.internalFormat,t.format,t.pixelType,a)},r._setMipmap=function(t,e,i){for(var n=(0,s.glTextureFmt)(this._format),r={width:this._width,height:this._height,faceIndex:0,flipY:e,premultiplyAlpha:i,level:0,image:null},a=0;a<t.length;++a){var o=t[a];r.level=a,r.width=this._width>>a,r.height=this._height>>a;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,a.isPow2)(this._width)&&(0,a.isPow2)(this._height);e||this._wrapS===s.enums.WRAP_CLAMP&&this._wrapT===s.enums.WRAP_CLAMP||(console.warn("WebGL1 doesn't support all wrap modes with NPOT textures"),this._wrapS=s.enums.WRAP_CLAMP,this._wrapT=s.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,s.glFilter)(t,this._minFilter,i)),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,(0,s.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":272,"./misc":276,"./texture":282}],282:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("./enums"),r=0,s=(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=s,e.exports=i.default}),{"./enums":272}],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,n.key,n)}}i.__esModule=!0,i.default=void 0,t("./enums");var r=(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),t})();i.default=r,e.exports=i.default}),{"./enums":272}],284:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("./enums"),s=(n=t("../murmurhash2_gc"))&&n.__esModule?n:{default:n},a=(function(){function t(t){this._attr2el={},this._elements=[],this._bytes=0;for(var e="",i=0,n=t.length;i<n;++i){var a=t[i],o={name:a.name,offset:this._bytes,stride:0,stream:-1,type:a.type,num:a.num,normalize:void 0!==a.normalize&&a.normalize,bytes:a.num*(0,r.attrTypeBytes)(a.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,u=this._elements.length;c<u;++c)this._elements[c].stride=this._bytes;this._hash=(0,s.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=a,e.exports=i.default}),{"../murmurhash2_gc":293,"./enums":272}],285:[(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}),{}],286:[(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 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,n.key,n)}}var a=(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}}])&&s(e.prototype,i),t})();i.default=a,e.exports=i.default}),{"./timsort":291}],287:[(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=u(t("./circular-pool"));i.CircularPool=n.default;var r=u(t("./fixed-array"));i.FixedArray=r.default;var s=u(t("./linked-array"));i.LinkedArray=s.default;var a=u(t("./pool"));i.Pool=a.default;var o=u(t("./recycle-pool"));i.RecyclePool=o.default;var c=u(t("./typed-array-pool"));function u(t){return t&&t.__esModule?t:{default:t}}i.TypedArrayPool=c.default}),{"./circular-pool":285,"./fixed-array":286,"./linked-array":288,"./pool":289,"./recycle-pool":290,"./typed-array-pool":292}],288:[(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 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,n.key,n)}}var a=(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}}])&&s(e.prototype,i),t})();i.default=a,e.exports=i.default}),{"./pool":289}],289:[(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,s=0;r<t;++r,++s)this._frees[r]=e[s];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}),{}],290:[(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 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,n.key,n)}}var a=(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}}])&&s(e.prototype,i),t})();i.default=a,cc.RecyclePool=a,e.exports=i.default}),{"./timsort":291}],291:[(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 s=i-e;if(!(s<2)){var a=0;if(s<n)return void _(t,e,i,e+(a=l(t,e,i,r)),r);var o=new p(t,r),h=u(s);do{if((a=l(t,e,i,r))<h){var f=s;f>h&&(f=h),_(t,e,e+f,e+a,r),a=f}o.pushRun(e,a),o.mergeRuns(),s-=a,e+=a}while(0!==s);o.forceMergeRuns()}};var n=32,r=7,s=256,a=[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*=a[n-i-1],e/=10,r=-1):i>n&&(e*=a[i-n-1],t/=10,r=1),t===e?r:t<e?-1:1}var s=String(t),c=String(e);return s===c?0:s<c?-1:1}function u(t){for(var e=0;t>=n;)e|=1&t,t>>=1;return t+e}function l(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++;h(t,e,r)}else for(;r<i&&n(t[r],t[r-1])>=0;)r++;return r-e}function h(t,e,i){for(i--;e<i;){var n=t[e];t[e++]=t[i],t[i--]=n}}function _(t,e,i,n,r){for(n===e&&n++;n<i;n++){for(var s=t[n],a=e,o=n;a<o;){var c=a+o>>>1;r(s,t[c])<0?o=c:a=c+1}var u=n-a;switch(u){case 3:t[a+3]=t[a+2];case 2:t[a+2]=t[a+1];case 1:t[a+1]=t[a];break;default:for(;u>0;)t[a+u]=t[a+u-1],u--}t[a]=s}}function f(t,e,i,n,r,s){var a=0,o=0,c=1;if(s(t,e[i+r])>0){for(o=n-r;c<o&&s(t,e[i+r+c])>0;)a=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o),a+=r,c+=r}else{for(o=r+1;c<o&&s(t,e[i+r-c])<=0;)a=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o);var u=a;a=r-c,c=r-u}for(a++;a<c;){var l=a+(c-a>>>1);s(t,e[i+l])>0?a=l+1:c=l}return c}function d(t,e,i,n,r,s){var a=0,o=0,c=1;if(s(t,e[i+r])<0){for(o=r+1;c<o&&s(t,e[i+r-c])<0;)a=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o);var u=a;a=r-c,c=r-u}else{for(o=n-r;c<o&&s(t,e[i+r+c])>=0;)a=c,(c=1+(c<<1))<=0&&(c=o);c>o&&(c=o),a+=r,c+=r}for(a++;a<c;){var l=a+(c-a>>>1);s(t,e[i+l])<0?c=l:a=l+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=s,this.length<2*s&&(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],s=this.runStart[t+1],a=this.runLength[t+1];this.runLength[t]=r+a,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[s],i,n,r,0,e);n+=o,0!=(r-=o)&&0!==(a=f(i[n+r-1],i,s,a,a-1,e))&&(r<=a?this.mergeLow(n,r,s,a):this.mergeHigh(n,r,s,a))},e.mergeLow=function(t,e,i,n){var s=this.compare,a=this.array,o=this.tmp,c=0;for(c=0;c<e;c++)o[c]=a[t+c];var u=0,l=i,h=t;if(a[h++]=a[l++],0!=--n)if(1!==e){for(var _=this.minGallop;;){var p=0,v=0,g=!1;do{if(s(a[l],o[u])<0){if(a[h++]=a[l++],v++,p=0,0==--n){g=!0;break}}else if(a[h++]=o[u++],p++,v=0,1==--e){g=!0;break}}while((p|v)<_);if(g)break;do{if(0!==(p=d(a[l],o,u,e,0,s))){for(c=0;c<p;c++)a[h+c]=o[u+c];if(h+=p,u+=p,(e-=p)<=1){g=!0;break}}if(a[h++]=a[l++],0==--n){g=!0;break}if(0!==(v=f(o[u],a,l,n,0,s))){for(c=0;c<v;c++)a[h+c]=a[l+c];if(h+=v,l+=v,0==(n-=v)){g=!0;break}}if(a[h++]=o[u++],1==--e){g=!0;break}_--}while(p>=r||v>=r);if(g)break;_<0&&(_=0),_+=2}if(this.minGallop=_,_<1&&(this.minGallop=1),1===e){for(c=0;c<n;c++)a[h+c]=a[l+c];a[h+n]=o[u]}else{if(0===e)throw new Error("mergeLow preconditions were not respected");for(c=0;c<e;c++)a[h+c]=o[u+c]}}else{for(c=0;c<n;c++)a[h+c]=a[l+c];a[h+n]=o[u]}else for(c=0;c<e;c++)a[h+c]=o[u+c]},e.mergeHigh=function(t,e,i,n){var s=this.compare,a=this.array,o=this.tmp,c=0;for(c=0;c<n;c++)o[c]=a[i+c];var u=t+e-1,l=n-1,h=i+n-1,_=0,p=0;if(a[h--]=a[u--],0!=--e)if(1!==n){for(var v=this.minGallop;;){var g=0,m=0,y=!1;do{if(s(o[l],a[u])<0){if(a[h--]=a[u--],g++,m=0,0==--e){y=!0;break}}else if(a[h--]=o[l--],m++,g=0,1==--n){y=!0;break}}while((g|m)<v);if(y)break;do{if(0!=(g=e-d(o[l],a,t,e,e-1,s))){for(e-=g,p=1+(h-=g),_=1+(u-=g),c=g-1;c>=0;c--)a[p+c]=a[_+c];if(0===e){y=!0;break}}if(a[h--]=o[l--],1==--n){y=!0;break}if(0!=(m=n-f(a[u],o,0,n,n-1,s))){for(n-=m,p=1+(h-=m),_=1+(l-=m),c=0;c<m;c++)a[p+c]=o[_+c];if(n<=1){y=!0;break}}if(a[h--]=a[u--],0==--e){y=!0;break}v--}while(g>=r||m>=r);if(y)break;v<0&&(v=0),v+=2}if(this.minGallop=v,v<1&&(this.minGallop=1),1===n){for(p=1+(h-=e),_=1+(u-=e),c=e-1;c>=0;c--)a[p+c]=a[_+c];a[h]=o[l]}else{if(0===n)throw new Error("mergeHigh preconditions were not respected");for(_=h-(n-1),c=0;c<n;c++)a[_+c]=o[c]}}else{for(p=1+(h-=e),_=1+(u-=e),c=e-1;c>=0;c--)a[p+c]=a[_+c];a[h]=o[l]}else for(_=h-(n-1),c=0;c<n;c++)a[_+c]=o[c]},t})();e.exports=i.default}),{}],292:[(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 s(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}function a(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=s(t),i=n[a(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[a(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}),{}],293:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=function(t,e){for(var i,n=t.length,r=e^n,s=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<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,++s;switch(n){case 3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+((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}),{}],294:[(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")),s=o(t("../enums")),a=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 u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=new Float32Array(16),h=new Float32Array(16),_=new Float32Array(16),f=new Float32Array(16),d=new Float32Array(4),p=new Float32Array(64),v=[],g=new Float32Array(4),m=new n.Vec4(0,0,0,0),y=new n.Vec3(0,0,0),T=new n.Vec3(0,0,0),E=new a.RecyclePool(function(){return new Float32Array(16)},8);function A(t,e){return t._priority-e._priority}var C=(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,u(e,i);var a=r.prototype;return a.reset=function(){E.reset(),t.prototype.reset.call(this)},a.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(),s=i.width,a=i.height;t._cameras.data[n].extractView(r,s,a)}this._viewPools.sort(A);for(var o=0;o<this._viewPools.length;++o){var c=this._viewPools.data[o];this._render(c,t)}},a.renderCamera=function(t,e){this.reset(),this._updateLights(e);var i=this._device._gl.canvas,n=i.width,r=i.height,s=this._requestView();t.extractView(s,n,r),this._viewPools.sort(A);for(var a=0;a<this._viewPools.length;++a){var o=this._viewPools.data[a];this._render(o,e)}},a._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!==s.default.SHADOW_NONE){this._shadowLights.length<2&&this._shadowLights.splice(0,0,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},a._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 s=Math.min(4,this._lights.length);t.CC_NUM_LIGHTS!==s&&(t.CC_NUM_LIGHTS=s,this._definesChanged=!0),s=Math.min(4,this._shadowLights.length),t.CC_NUM_SHADOW_LIGHTS!==s&&(t.CC_NUM_SHADOW_LIGHTS=s,this._definesChanged=!0)},a._submitLightsUniforms=function(){var t=this._device;if(this._lights.length>0){for(var e=E.add(),i=E.add(),n=E.add(),r=Math.min(4,this._lights.length),a=0;a<r;++a){var o=this._lights[a],c=4*a;n.set(o._colorUniform,c),i.set(o._directionUniform,c),e.set(o._positionUniform,c),e[c+3]=o._range,o._type===s.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)}},a._submitShadowStageUniforms=function(t){var e=t._shadowLight,i=g;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(f,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},a._submitOtherStagesUniforms=function(){for(var t=E.add(),e=0;e<this._shadowLights.length;++e){var i=this._shadowLights[e],r=v[e];r||(r=v[e]=new Float32Array(p.buffer,64*e,16)),n.Mat4.toArray(r,i.viewProjMatrix);var s=4*e;t[s]=i.shadowMinDepth,t[s+1]=i.shadowMaxDepth,t[s+2]=i._shadowResolution,t[s+3]=i.shadowDarkness}this._device.setUniform("cc_shadow_lightViewProjMatrix",p),this._device.setUniform("cc_shadow_info",t)},a._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}))},a._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)}},a._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 s=0;s<e.length;++s){for(var a=e.data[s],o=0;o<i.length;++o)this._device.setTexture("cc_shadow_map_"+o,i[o].shadowMap,this._allocTextureUnit());this._draw(a)}},a._opaqueStage=function(t,e){t.getPosition(m),this._device.setUniform("cc_matView",n.Mat4.toArray(l,t._matView)),this._device.setUniform("cc_matViewInv",n.Mat4.toArray(h,t._matViewInv)),this._device.setUniform("cc_matProj",n.Mat4.toArray(_,t._matProj)),this._device.setUniform("cc_matViewProj",n.Mat4.toArray(f,t._matViewProj)),this._device.setUniform("cc_cameraPos",n.Vec4.toArray(d,m)),this._submitLightsUniforms(),this._submitOtherStagesUniforms(),this._drawItems(t,e)},a._transparentStage=function(t,e){t.getPosition(m),t.getForward(y),this._device.setUniform("cc_matView",n.Mat4.toArray(l,t._matView)),this._device.setUniform("cc_matViewInv",n.Mat4.toArray(h,t._matViewInv)),this._device.setUniform("cc_matProj",n.Mat4.toArray(_,t._matProj)),this._device.setUniform("cc_matViewProj",n.Mat4.toArray(f,t._matViewProj)),this._device.setUniform("cc_cameraPos",n.Vec4.toArray(d,m)),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,m),r.sortKey=-n.Vec3.dot(T,y)}this._sortItems(e),this._drawItems(t,e)},r})(r.default);i.default=C,e.exports=i.default}),{"../../core/value-types":248,"../core/base-renderer":264,"../enums":270,"../memop":287}],295:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r=t("../../core/value-types"),s=t("../../core/geom-utils"),a=(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,n.key,n)}}var c=new r.Mat4,u=new r.Mat4,l=new r.Mat4,h=new r.Mat4,_=new r.Mat4,f=new r.Mat4,d=new r.Vec3,p=new r.Vec3,v=(function(){function t(){this._poolID=-1,this._node=null,this._projection=a.default.PROJ_PERSPECTIVE,this._priority=0,this._color=new r.Vec4(.2,.3,.47,1),this._depth=1,this._stencil=0,this._clearFlags=a.default.CLEAR_COLOR|a.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(l),r.Mat4.invert(u,l);var i=t/e;if(this._projection===a.default.PROJ_PERSPECTIVE)r.Mat4.perspective(h,this._fov,i,this._near,this._far);else{var n=this._orthoHeight*i,s=this._orthoHeight;r.Mat4.ortho(h,-n,n,-s,s,this._near,this._far)}r.Mat4.mul(_,h,u),r.Mat4.invert(f,_)},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,u),r.Mat4.copy(t._matViewInv,l),r.Mat4.copy(t._matProj,h),r.Mat4.copy(t._matViewProj,_),r.Mat4.copy(t._matInvViewProj,f),t._cullingMask=this._cullingMask},n.screenPointToRay=function(t,e,i,n,o){if(!cc.geomUtils)return o;o=o||new s.Ray,this._calcMatrices(i,n);var c=this._rect.x*i,u=this._rect.y*n,l=this._rect.w*i,h=this._rect.h*n;return r.Vec3.set(p,(t-c)/l*2-1,(e-u)/h*2-1,1),r.Vec3.transformMat4(p,p,f),this._projection===a.default.PROJ_PERSPECTIVE?this._node.getWorldPosition(d):(r.Vec3.set(d,(t-c)/l*2-1,(e-u)/h*2-1,-1),r.Vec3.transformMat4(d,d,f)),s.Ray.fromPoints(o,d,p)},n.screenToWorld=function(t,e,i,n){this._calcMatrices(i,n);var s=this._rect.x*i,o=this._rect.y*n,c=this._rect.w*i,u=this._rect.h*n;return this._projection===a.default.PROJ_PERSPECTIVE?(r.Vec3.set(t,(e.x-s)/c*2-1,(e.y-o)/u*2-1,.9999),r.Vec3.transformMat4(t,t,f),this._node.getWorldPosition(d),r.Vec3.lerp(t,d,t,(0,r.lerp)(this._near/this._far,1,e.z))):(r.Vec3.set(t,(e.x-s)/c*2-1,(e.y-o)/u*2-1,2*e.z-1),r.Vec3.transformMat4(t,t,f)),t},n.worldToScreen=function(t,e,i,n){this._calcMatrices(i,n);var s=this._rect.x*i,a=this._rect.y*n,o=this._rect.w*i,c=this._rect.h*n;return r.Vec3.transformMat4(t,e,_),t.x=s+.5*(t.x+1)*o,t.y=a+.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 s=i/2,a=n/2;return r.Mat4.identity(c),r.Mat4.transform(c,c,r.Vec3.set(d,s,a,0)),r.Mat4.scale(c,c,r.Vec3.set(d,s,a,1)),r.Mat4.mul(t,c,t),t},e=t,(i=[{key:"cullingMask",get:function(){return this._cullingMask},set:function(t){this._cullingMask=t}}])&&o(e.prototype,i),t})();i.default=v,e.exports=i.default}),{"../../core/geom-utils":139,"../../core/value-types":248,"../enums":270}],296:[(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}),{}],297:[(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":287}],298:[(function(t,e,i){"use strict";i.__esModule=!0,i.getInspectorProps=function(t){var e={type:t.type};Object.assign(e,t.editor||t.inspector),e.defines=t.defines,e.value=m(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.getClassName=i.getInstanceCtor=i.getInstanceType=i.enums2default=i.ctor2enums=void 0;var n,r,s,a,o=l(t("./enums")),c=t("../core/value-types"),u=l(t("../core/assets/CCTexture2D"));function l(t){return t&&t.__esModule?t:{default:t}}var h;h=t("./gfx/texture-2d");var _=cc.Object,f=((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[u.default]=function(){return null},n[_]=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]=u.default,r.color=c.Color,r.number=Number,r.boolean=Boolean,r.default=_,r),p=((s={})[Number]=o.default.PARAM_FLOAT,s[c.Vec2]=o.default.PARAM_FLOAT2,s[c.Vec3]=o.default.PARAM_FLOAT3,s[c.Vec4]=o.default.PARAM_FLOAT4,s[c.Color]=o.default.PARAM_COLOR3,s[c.Color]=o.default.PARAM_COLOR4,s[c.Mat4]=o.default.PARAM_MAT4,s[u.default]=o.default.PARAM_TEXTURE_2D,s[h]=o.default.PARAM_TEXTURE_2D,s);i.ctor2enums=p;var v=((a={})[o.default.PARAM_INT]=new Uint32Array([0]),a[o.default.PARAM_INT2]=new Uint32Array([0,0]),a[o.default.PARAM_INT3]=new Uint32Array([0,0,0]),a[o.default.PARAM_INT4]=new Uint32Array([0,0,0,0]),a[o.default.PARAM_FLOAT]=new Float32Array([0]),a[o.default.PARAM_FLOAT2]=new Float32Array([0,0]),a[o.default.PARAM_FLOAT3]=new Float32Array([0,0,0]),a[o.default.PARAM_FLOAT4]=new Float32Array([0,0,0,0]),a[o.default.PARAM_MAT4]=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a[o.default.PARAM_TEXTURE_2D]=null,a.number=0,a.boolean=!1,a);i.enums2default=v;var g=function(t){return d[t]||d.default};i.getInstanceType=g;var m=function(t){return f[g(t)]};i.getInstanceCtor=m;var y=function(t){return cc.js.getClassName(g(t))};i.getClassName=y;var T={Number:"number",Boolean:"boolean"}}),{"../core/assets/CCTexture2D":73,"../core/value-types":248,"./enums":270,"./gfx/texture-2d":280}],299:[(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}),{}],300:[(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":151,"./cocos2d/core/components/CCStudioComponent":void 0,"./cocos2d/deprecated":260,"./cocos2d/particle":void 0,"./cocos2d/particle/CCParticleAsset":262,"./cocos2d/tilemap":void 0,"./cocos2d/tilemap/CCTiledMapAsset":299,"./cocos2d/videoplayer/CCVideoPlayer":void 0,"./cocos2d/webview/CCWebView":void 0,"./extensions/ccpool/CCNodePool":301,"./extensions/dragonbones":void 0,"./extensions/spine":void 0}],301:[(function(t,e){"use strict";cc.NodePool=function(t){this.poolHandlerComp=t,this._pool=[]},cc.NodePool.prototype={constructor:cc.NodePool,size:function(){return this._pool.length},clear:function(){for(var t=this._pool.length,e=0;e<t;++e)this._pool[e].destroy();this._pool.length=0},put:function(t){if(t&&-1===this._pool.indexOf(t)){t.removeFromParent(!1);var e=this.poolHandlerComp?t.getComponent(this.poolHandlerComp):null;e&&e.unuse&&e.unuse(),this._pool.push(t)}},get:function(){var t=this._pool.length-1;if(t<0)return null;var e=this._pool[t];this._pool.length=t;var i=this.poolHandlerComp?e.getComponent(this.poolHandlerComp):null;return i&&i.reuse&&i.reuse.apply(i,arguments),e}},e.exports=cc.NodePool}),{}],302:[(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":261,"./cocos2d/core/predefine":183,"./extends":300,"./package":void 0,"./polyfill/array":304,"./polyfill/array-buffer":303,"./polyfill/misc":305,"./polyfill/number":306,"./polyfill/object":307,"./polyfill/string":308,"./polyfill/typescript":309,"./predefine":310}],303:[(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}}}),{}],304:[(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)})}),{}],305:[(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")}}}),{}],306:[(function(){"use strict";Number.parseFloat=Number.parseFloat||parseFloat,Number.parseInt=Number.parseInt||parseInt}),{}],307:[(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})}),{}],308:[(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+/,"")})}),{}],309:[(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,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},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,s){function a(t){try{c(n.next(t))}catch(e){s(e)}}function o(t){try{c(n.throw(t))}catch(e){s(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(a,o)}c((n=n.apply(t,e||[])).next())})},window.__generator=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return c([t,e])}}function c(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(o){s=[6,o],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[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,s=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(o){r={error:o}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a},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 s=arguments[e],a=0,o=s.length;a<o;a++,r++)n[r]=s[a];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||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){r[t]&&(n[t]=function(e){return new Promise(function(i,n){s.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,u):l(s[0][2],i)}catch(n){l(s[0][3],n)}var i}function c(t){o("next",t)}function u(t){o("throw",t)}function l(t,e){t(e),s.shift(),s.length&&o(s[0][0],s[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,s){r(n,s,(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}}),{}],310:[(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=!0,t.CC_PHYSICS_BUILTIN=!1,t.CC_PHYSICS_CANNON=!1,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),s=i("bk");e("CC_WECHATGAMESUB",n),e("CC_WECHATGAME",r),e("CC_QQPLAY",s),t.CocosEngine=cc.ENGINE_VERSION="2.4.6"}),{}]},{},[302]);