var Laya=window.Laya=function(t,e){var i={onMessage:function(t){},__internals:[],__packages:{},__classmap:{Object:Object,Function:Function,Array:Array,String:String},__sysClass:{object:"Object",array:"Array",string:"String",dictionary:"Dictionary"},__propun:{writable:!0,enumerable:!1,configurable:!0},__presubstr:String.prototype.substr,__substr:function(t,e){return 1==arguments.length?i.__presubstr.call(this,t):i.__presubstr.call(this,t,e>0?e:this.length+e)},__init:function(t){t.forEach(function(t){t.__init$&&t.__init$()})},__isClass:function(t){return t&&(t.__isclass||t==Object||t==String||t==Array)},__newvec:function(t,e){var i=[];i.length=t;for(var s=0;s1)for(var a=0,o=r.length-1;a0){if(0==s.indexOf("laya.")){var a=s.split(".");r=r||a[a.length-1],i[r]&&console.log("Warning!,this class["+r+"] already exist:",i[r]),i[r]=e}}else"Main"==s?t.Main=e:(i[s]&&console.log("Error!,this class["+s+"] already exist:",i[s]),i[s]=e);var o=i.un,h=e.prototype;o(h,"hasOwnProperty",i.__hasOwnProperty),o(h,"__class",e),o(h,"__super",n),o(h,"__className",s),o(e,"__super",n),o(e,"__className",s),o(e,"__isclass",!0),o(e,"super",function(t){this.__super.call(t)})},imps:function(t,e){if(!e)return null;var s=t.__imps||i.un(t,"__imps",{});function __(t){var e,n;if((e=i.__internals[t])&&(s[t]=!0,n=e.extend))for(var r=0;r.01||t._needRepaint()){var o=e.globalAlpha;e.globalAlpha*=n,e.drawTexture(a,i-r.pivotX+a.offsetX,s-r.pivotY+a.offsetY,t._width||a.width,t._height||a.height),e.globalAlpha=o}},LayaGLQuickRunner.alpha_transform_drawTexture=function(t,e,i,s){var n,r=t._style,a=t.texture;if((n=r.alpha)>.01||t._needRepaint()){var o=e.globalAlpha;e.globalAlpha*=n,e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,s),e.drawTexture(a,-r.pivotX+a.offsetX,-r.pivotY+a.offsetY,t._width||a.width,t._height||a.height),e.restoreTransform(LayaGLQuickRunner.curMat),e.globalAlpha=o}},LayaGLQuickRunner.alpha_transform_drawLayaGL=function(t,e,i,s){var n,r=t._style;if((n=r.alpha)>.01||t._needRepaint()){var a=e.globalAlpha;e.globalAlpha*=n,e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,s),t._graphics&&t._graphics._render(t,e,-r.pivotX,-r.pivotY),e.restoreTransform(LayaGLQuickRunner.curMat),e.globalAlpha=a}},LayaGLQuickRunner.alpha_drawLayaGL=function(t,e,i,s){var n,r=t._style;if((n=r.alpha)>.01||t._needRepaint()){var a=e.globalAlpha;e.globalAlpha*=n,t._graphics&&t._graphics._render(t,e,i-r.pivotX,s-r.pivotY),e.globalAlpha=a}},LayaGLQuickRunner.transform_drawLayaGL=function(t,e,i,s){var n=t._style;e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,s),t._graphics&&t._graphics._render(t,e,-n.pivotX,-n.pivotY),e.restoreTransform(LayaGLQuickRunner.curMat)},LayaGLQuickRunner.transform_drawNodes=function(t,e,i,s){var n=t._getBit(256)&&e.drawCallOptimize(!0),r=t._style;e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,s),i=-r.pivotX,s=-r.pivotY;var a,o=t._children,h=o.length;if(r.viewport){var l=r.viewport,c=l.x,u=l.y,_=l.right,d=l.bottom,f=NaN,p=NaN;for(g=0;gc&&(p=a._y)u&&a.render(e,i,s)}else for(var g=0;gc&&(p=a._y)u&&a.render(e,i,s)}else for(var g=0;g=0||t.indexOf("rgb(")>=0){var n,r,a=t;for(n=a.indexOf("("),r=a.indexOf(")"),a=a.substring(n+1,r),this.arrColor=a.split(","),i=this.arrColor.length,e=0;e=0||9===this.strColor.length?(this.arrColor=[((4278190080&s)>>>24)/255,((16711680&s)>>16)/255,((65280&s)>>8)/255,(255&s)/255],this.numColor=(4278190080&s)>>>24|(16711680&s)>>8|(65280&s)<<8|(255&s)<<24):(this.arrColor=[((16711680&s)>>16)/255,((65280&s)>>8)/255,(255&s)/255,1],this.numColor=4278190080|(16711680&s)>>16|65280&s|(255&s)<<16),this.arrColor.__id=++ColorUtils._COLODID}return n(ColorUtils,"laya.utils.ColorUtils"),ColorUtils._initDefault=function(){for(var t in ColorUtils._DEFAULT={},ColorUtils._COLOR_MAP)ColorUtils._SAVE[t]=ColorUtils._DEFAULT[t]=new ColorUtils(ColorUtils._COLOR_MAP[t]);return ColorUtils._DEFAULT},ColorUtils._initSaveMap=function(){for(var t in ColorUtils._SAVE_SIZE=0,ColorUtils._SAVE={},ColorUtils._DEFAULT)ColorUtils._SAVE[t]=ColorUtils._DEFAULT[t]},ColorUtils.create=function(t){var e=t+"",i=ColorUtils._SAVE[e];return null!=i?i:(ColorUtils._SAVE_SIZE<1e3&&ColorUtils._initSaveMap(),ColorUtils._SAVE[e]=new ColorUtils(t))},ColorUtils._SAVE={},ColorUtils._SAVE_SIZE=0,ColorUtils._COLOR_MAP={purple:"#800080",orange:"#ffa500",white:"#FFFFFF",red:"#FF0000",green:"#00FF00",blue:"#0000FF",black:"#000000",yellow:"#FFFF00",gray:"#808080"},ColorUtils._DEFAULT=ColorUtils._initDefault(),ColorUtils._COLODID=1,ColorUtils}(),h=(function(){function Config(){}n(Config,"Config"),Config.animationInterval=50,Config.isAntialias=!1,Config.isAlpha=!1,Config.premultipliedAlpha=!0,Config.isStencil=!0,Config.preserveDrawingBuffer=!1,Config.webGL2D_MeshAllocMaxMem=!0,Config.is2DPixelArtGame=!1,Config.useWebGL2=!1}(),function(){var t;function EventDispatcher(){this._events=null}n(EventDispatcher,"laya.events.EventDispatcher");var e=EventDispatcher.prototype;return e.hasListener=function(t){return!!(this._events&&this._events[t])},e.event=function(t,e){if(!this._events||!this._events[t])return!1;var i=this._events[t];if(i.run)i.once&&delete this._events[t],null!=e?i.runWith(e):i.run();else{for(var s=0,n=i.length;s-1;e--)t[e]&&(t[e].recover(),t[e]=null)},e.isMouseEvent=function(t){return EventDispatcher.MOUSE_EVENTS[t]||!1},EventDispatcher.MOUSE_EVENTS={rightmousedown:!0,rightmouseup:!0,rightclick:!0,mousedown:!0,mouseup:!0,mousemove:!0,mouseover:!0,mouseout:!0,click:!0,doubleclick:!0},EventDispatcher.__init$=function(){Object.defineProperty(laya.events.EventDispatcher.prototype,"_events",{enumerable:!1,writable:!0}),t=function(t){function EventHandler(t,e,i,s){EventHandler.__super.call(this,t,e,i,s)}return n(EventHandler,"",l),EventHandler.prototype.recover=function(){this._id>0&&(this._id=0,EventHandler._pool.push(this.clear()))},EventHandler.create=function(t,e,i,s){return void 0===s&&(s=!0),EventHandler._pool.length?EventHandler._pool.pop().setTo(t,e,i,s):new EventHandler(t,e,i,s)},EventHandler._pool=[],EventHandler}()},EventDispatcher}()),l=function(){function Handler(t,e,i,s){this.once=!1,this._id=0,void 0===s&&(s=!1),this.setTo(t,e,i,s)}n(Handler,"laya.utils.Handler");var t=Handler.prototype;return t.setTo=function(t,e,i,s){return this._id=Handler._gid++,this.caller=t,this.method=e,this.args=i,this.once=s,this},t.run=function(){if(null==this.method)return null;var t=this._id,e=this.method.apply(this.caller,this.args);return this._id===t&&this.once&&this.recover(),e},t.runWith=function(t){if(null==this.method)return null;var e=this._id;if(null==t)var i=this.method.apply(this.caller,this.args);else i=this.args||t.unshift?this.args?this.method.apply(this.caller,this.args.concat(t)):this.method.apply(this.caller,t):this.method.call(this.caller,t);return this._id===e&&this.once&&this.recover(),i},t.clear=function(){return this.caller=null,this.method=null,this.args=null,this},t.recover=function(){this._id>0&&(this._id=0,Handler._pool.push(this.clear()))},Handler.create=function(t,e,i,s){return void 0===s&&(s=!0),Handler._pool.length?Handler._pool.pop().setTo(t,e,i,s):new Handler(t,e,i,s)},Handler._pool=[],Handler._gid=1,Handler}(),c=function(){function Filter(){this._action=null,this._glRender=null}n(Filter,"laya.filters.Filter");var t=Filter.prototype;return i.imps(t,{"laya.filters.IFilter":!0}),r(0,t,"type",function(){return-1}),Filter.BLUR=16,Filter.COLOR=32,Filter.GLOW=8,Filter._filter=null,Filter._recycleScope=null,Filter}(),u=function(){function TouchManager(){this.preOvers=[],this.preDowns=[],this.preRightDowns=[],this.enable=!0,this._lastClickTime=0,this._event=new L}n(TouchManager,"laya.events.TouchManager");var t=TouchManager.prototype;return t._clearTempArrs=function(){TouchManager._oldArr.length=0,TouchManager._newArr.length=0,TouchManager._tEleArr.length=0},t.getTouchFromArr=function(t,e){var i,s,n=0;for(i=e.length,n=0;n=0;i--)e[i].id==t&&e.splice(i,1)},t.createTouchO=function(t,e){var i;return(i=y.getItem("TouchData")||{}).id=e,i.tar=t,i},t.onMouseDown=function(t,e,i){var s,n,r,a;(void 0===i&&(i=!1),this.enable)&&(s=this.getTouchFromArr(e,this.preOvers),r=this.getEles(t,null,TouchManager._tEleArr),s?s.tar=t:(n=this.createTouchO(t,e),this.preOvers.push(n)),P.onMobile&&this.sendEvents(r,"mouseover"),a=i?this.preDowns:this.preRightDowns,(s=this.getTouchFromArr(e,a))?s.tar=t:(n=this.createTouchO(t,e),a.push(n)),this.sendEvents(r,i?"mousedown":"rightmousedown"),this._clearTempArrs())},t.sendEvents=function(t,e){var i,s,n,r=0;for(i=t.length,this._event._stoped=!1,s=t[0],r=0;r=0){h.splice(l,h.length-l);break}n.push(s)}n.length>0&&this.sendEvents(n,"mouseout"),h.length>0&&this.sendEvents(h,"mouseover")}}},t.onMouseMove=function(t,e){var i,s;this.enable&&((i=this.getTouchFromArr(e,this.preOvers))?(this.checkMouseOutAndOverOfMove(t,i.tar),i.tar=t,s=this.getEles(t,null,TouchManager._tEleArr)):(s=this.getEles(t,null,TouchManager._tEleArr),this.sendEvents(s,"mouseover"),this.preOvers.push(this.createTouchO(t,e))),this.sendEvents(s,"mousemove"),this._clearTempArrs())},t.getLastOvers=function(){return TouchManager._tEleArr.length=0,this.preOvers.length>0&&this.preOvers[0].tar?this.getEles(this.preOvers[0].tar,null,TouchManager._tEleArr):(TouchManager._tEleArr.push(i.stage),TouchManager._tEleArr)},t.stageMouseOut=function(){var t;t=this.getLastOvers(),this.preOvers.length=0,this.sendEvents(t,"mouseout")},t.onMouseUp=function(t,e,i){if(void 0===i&&(i=!1),this.enable){var s,n,r,a,o,h,l=0,c=0,u=P.onMobile;if(n=this.getEles(t,null,TouchManager._tEleArr),this.sendEvents(n,i?"mouseup":"rightmouseup"),h=i?this.preDowns:this.preRightDowns,s=this.getTouchFromArr(e,h)){var _,d=P.now();if(_=d-this._lastClickTime<300,this._lastClickTime=d,t==s.tar)o=n;else for(r=this.getEles(s.tar,null,TouchManager._oldArr),(o=TouchManager._newArr).length=0,c=r.length,l=0;l=0&&o.push(a);o.length>0&&this.sendEvents(o,i?"click":"rightclick"),i&&_&&this.sendEvents(o,"doubleclick"),this.removeTouchFromArr(e,h),s.tar=null,y.recover("TouchData",s)}else;(s=this.getTouchFromArr(e,this.preOvers))&&u&&((o=this.getEles(s.tar,null,o))&&o.length>0&&this.sendEvents(o,"mouseout"),this.removeTouchFromArr(e,this.preOvers),s.tar=null,y.recover("TouchData",s)),this._clearTempArrs()}},TouchManager._oldArr=[],TouchManager._newArr=[],TouchManager._tEleArr=[],s(TouchManager,["I",function(){return this.I=new TouchManager}]),TouchManager}(),_=function(){function Component(){this._id=dt.getGID(),this._resetComp()}n(Component,"laya.components.Component");var t=Component.prototype;return i.imps(t,{"laya.resource.ISingletonElement":!0,"laya.resource.IDestroy":!0}),t._isScript=function(){return!1},t._resetComp=function(){this._indexInList=-1,this._enabled=!0,this._awaked=!1,this.owner=null},t._getIndexInList=function(){return this._indexInList},t._setIndexInList=function(t){this._indexInList=t},t._onAdded=function(){},t._onAwake=function(){},t._onEnable=function(){},t._onDisable=function(){},t._onEnableInScene=function(){},t._onDisableInScene=function(){},t._onDestroy=function(){},t.onReset=function(){},t._parse=function(t){},t._cloneTo=function(t){},t._setActive=function(t){t?(this._awaked||(this._awaked=!0,this._onAwake()),this._enabled&&this._onEnable()):this._enabled&&this._onDisable()},t._setActiveInScene=function(t){t?this._onEnableInScene():this._onDisableInScene()},t.destroy=function(){this.owner&&this.owner._destroyComponent(this)},t._destroy=function(){this.owner.activeInHierarchy&&this._enabled&&(this._setActive(!1),this._isScript()&&this.onDisable()),this.owner._scene&&this._setActiveInScene(!1),this._onDestroy(),this._destroyed=!0,this.onReset!==laya.components.Component.prototype.onReset?(this.onReset(),this._resetComp(),y.recoverByClass(this)):this._resetComp()},r(0,t,"id",function(){return this._id}),r(0,t,"enabled",function(){return this._enabled},function(t){this._enabled=t,this.owner&&(t?this.owner.activeInHierarchy&&this._onEnable():this.owner.activeInHierarchy&&this._onDisable())}),r(0,t,"isSingleton",function(){return!0}),r(0,t,"destroyed",function(){return this._destroyed}),Component}(),d=function(){var t;function CallLater(){this._pool=[],this._map=[],this._laters=[]}n(CallLater,"laya.utils.CallLater");var e=CallLater.prototype;return e._update=function(){var t=this._laters,e=t.length;if(e>0){for(var i=0,s=e-1;i<=s;i++){var n=t[i];this._map[n.key]=null,null!==n.method&&(n.run(),n.clear()),this._pool.push(n),i===s&&(s=t.length-1)}t.length=0}},e._getHandler=function(t,e){var i=t?t.$_GID||(t.$_GID=dt.getGID()):0,s=e.$_TID||(e.$_TID=1e5*B._mid++);return this._map[i+s]},e.callLater=function(e,i,s){if(null==this._getHandler(e,i)){if(this._pool.length)var n=this._pool.pop();else n=new t;n.caller=e,n.method=i,n.args=s;var r=e?e.$_GID:0,a=i.$_TID;n.key=r+a,this._map[n.key]=n,this._laters.push(n)}},e.runCallLater=function(t,e){var i=this._getHandler(t,e);i&&null!=i.method&&(this._map[i.key]=null,i.run(),i.clear())},CallLater.I=new CallLater,CallLater.__init$=function(){t=function(){function LaterHandler(){this.key=0,this.caller=null,this.method=null,this.args=null}n(LaterHandler,"");var t=LaterHandler.prototype;return t.clear=function(){this.caller=null,this.method=null,this.args=null},t.run=function(){var t=this.caller;if(t&&t.destroyed)return this.clear();var e=this.method,i=this.args;null!=e&&(i?e.apply(t,i):e.call(t))},LaterHandler}()},CallLater}(),f=function(){function MiniLocalStorage(){}return n(MiniLocalStorage,"laya.tt.mini.MiniLocalStorage"),MiniLocalStorage.__init__=function(){MiniLocalStorage.items=MiniLocalStorage},MiniLocalStorage.setItem=function(t,e){try{tt.setStorageSync(t,e)}catch(i){tt.setStorage({key:t,data:e})}},MiniLocalStorage.getItem=function(t){return tt.getStorageSync(t)},MiniLocalStorage.setJSON=function(t,e){MiniLocalStorage.setItem(t,e)},MiniLocalStorage.getJSON=function(t){return MiniLocalStorage.getItem(t)},MiniLocalStorage.removeItem=function(t){tt.removeStorageSync(t)},MiniLocalStorage.clear=function(){tt.clearStorageSync()},MiniLocalStorage.getStorageInfoSync=function(){try{var t=tt.getStorageInfoSync();return console.log(t.keys),console.log(t.currentSize),console.log(t.limitSize),t}catch(t){}return null},MiniLocalStorage.support=!0,MiniLocalStorage.items=null,MiniLocalStorage}(),p=(function(){function HTMLChar(){this.reset()}n(HTMLChar,"laya.utils.HTMLChar");var t=HTMLChar.prototype;t.setData=function(t,e,i,s){return this.char=t,this.charNum=t.charCodeAt(0),this.x=this.y=0,this.width=e,this.height=i,this.style=s,this.isWord=!HTMLChar._isWordRegExp.test(t),this},t.reset=function(){return this.x=this.y=this.width=this.height=0,this.isWord=!1,this.char=null,this.charNum=0,this.style=null,this},t.recover=function(){y.recover("HTMLChar",this.reset())},t._isChar=function(){return!0},t._getCSSStyle=function(){return this.style},HTMLChar.create=function(){return y.getItemByClass("HTMLChar",HTMLChar)},HTMLChar._isWordRegExp=new RegExp("[\\w.]","")}(),function(){function DrawRectCmd(){}n(DrawRectCmd,"laya.display.cmd.DrawRectCmd");var t=DrawRectCmd.prototype;return t.recover=function(){this.fillColor=null,this.lineColor=null,y.recover("DrawRectCmd",this)},t.run=function(t,e,i){t.drawRect(this.x+e,this.y+i,this.width,this.height,this.fillColor,this.lineColor,this.lineWidth)},r(0,t,"cmdID",function(){return"DrawRect"}),DrawRectCmd.create=function(t,e,i,s,n,r,a){var o=y.getItemByClass("DrawRectCmd",DrawRectCmd);return o.x=t,o.y=e,o.width=i,o.height=s,o.fillColor=n,o.lineColor=r,o.lineWidth=a,o},DrawRectCmd.ID="DrawRect",DrawRectCmd}()),g=function(){function DrawCircleCmd(){}n(DrawCircleCmd,"laya.display.cmd.DrawCircleCmd");var t=DrawCircleCmd.prototype;return t.recover=function(){this.fillColor=null,this.lineColor=null,y.recover("DrawCircleCmd",this)},t.run=function(t,e,i){t._drawCircle(this.x+e,this.y+i,this.radius,this.fillColor,this.lineColor,this.lineWidth,this.vid)},r(0,t,"cmdID",function(){return"DrawCircle"}),DrawCircleCmd.create=function(t,e,i,s,n,r,a){var o=y.getItemByClass("DrawCircleCmd",DrawCircleCmd);return o.x=t,o.y=e,o.radius=i,o.fillColor=s,o.lineColor=n,o.lineWidth=r,o.vid=a,o},DrawCircleCmd.ID="DrawCircle",DrawCircleCmd}(),m=function(){function Styles(){}return n(Styles,"laya.ui.Styles"),Styles.labelColor="#000000",Styles.buttonStateNum=3,Styles.scrollBarMinNum=15,Styles.scrollBarDelayTime=500,s(Styles,["defaultSizeGrid",function(){return this.defaultSizeGrid=[4,4,4,4,0]},"labelPadding",function(){return this.labelPadding=[2,2,2,2]},"inputLabelPadding",function(){return this.inputLabelPadding=[1,1,1,3]},"buttonLabelColors",function(){return this.buttonLabelColors=["#32556b","#32cc6b","#ff0000","#C0C0C0"]},"comboBoxItemColors",function(){return this.comboBoxItemColors=["#5e95b6","#ffffff","#000000","#8fa4b1","#ffffff"]}]),Styles}(),v=function(){function URL(t){this._url=null,this._path=null,this._url=URL.formatURL(t),this._path=URL.getPath(t)}n(URL,"laya.net.URL");var t=URL.prototype;return r(0,t,"path",function(){return this._path}),r(0,t,"url",function(){return this._url}),URL.formatURL=function(t){if(!t)return"null path";if(t.indexOf(":")>0)return t;if(null!=URL.customFormat&&(t=URL.customFormat(t)),t.indexOf(":")>0)return t;var e=t.charAt(0);if("."===e)return URL._formatRelativePath(URL.basePath+t);if("~"===e)return URL.rootPath+t.substring(1);if("d"===e){if(0===t.indexOf("data:image"))return t}else if("/"===e)return t;return URL.basePath+t},URL._formatRelativePath=function(t){for(var e=t.split("/"),i=0,s=e.length;i0?t.substr(0,e+1):""},URL.getFileName=function(t){var e=t.lastIndexOf("/");return e>0?t.substr(e+1):t},URL.getAdptedFilePath=function(t){if(!URL.exportSceneToJson||!t)return t;var e,i,s=0;for(e=URL._adpteTypeList.length,s=0;sthis.maxCount&&e.splice(this.maxCount,e.length-this.maxCount)},PoolCache.addPoolCacheManager=function(t,e){var i;void 0===e&&(e=100),(i=new PoolCache).sign=t,i.maxCount=e,yt.regCacheByFunction(dt.bind(i.tryDispose,i),dt.bind(i.getCacheList,i))}}(),function(){function SpriteStyle(){this.reset()}n(SpriteStyle,"laya.display.css.SpriteStyle");var t=SpriteStyle.prototype;return t.reset=function(){return this.scaleX=this.scaleY=1,this.skewX=this.skewY=0,this.pivotX=this.pivotY=this.rotation=0,this.alpha=1,this.scrollRect&&this.scrollRect.recover(),this.scrollRect=null,this.viewport&&this.viewport.recover(),this.viewport=null,this.hitArea=null,this.dragging=null,this.blendMode=null,this},t.recover=function(){this!==SpriteStyle.EMPTY&&y.recover("SpriteStyle",this.reset())},SpriteStyle.create=function(){return y.getItemByClass("SpriteStyle",SpriteStyle)},SpriteStyle.EMPTY=new SpriteStyle,SpriteStyle}()),S=function(){function MouseManager(){this.mouseX=0,this.mouseY=0,this.disableMouseEvent=!1,this.mouseDownTime=0,this.mouseMoveAccuracy=2,this._stage=null,this._captureSp=null,this._captureExlusiveMode=!1,this._hitCaputreSp=!1,this._target=null,this._lastMoveTimer=0,this._isLeftMouse=!1,this._touchIDs={},this._id=1,this._tTouchID=0,this._event=new L,this._captureChain=[],this._matrix=new Z,this._point=new it,this._rect=new mt,this._prePoint=new it,this._curTouchID=NaN}n(MouseManager,"laya.events.MouseManager");var t=MouseManager.prototype;return t.__init__=function(t,e){var i=this;this._stage=t;var s=this;e.oncontextmenu=function(t){if(MouseManager.enabled)return!1},e.addEventListener("mousedown",function(t){MouseManager.enabled&&(P.onIE||t.preventDefault(),s.mouseDownTime=P.now(),i.runEvent(t))}),e.addEventListener("mouseup",function(t){MouseManager.enabled&&(t.preventDefault(),s.mouseDownTime=-P.now(),i.runEvent(t))},!0),e.addEventListener("mousemove",function(t){if(MouseManager.enabled){t.preventDefault();var e=P.now();if(e-s._lastMoveTimer<10)return;s._lastMoveTimer=e,i.runEvent(t)}},!0),e.addEventListener("mouseout",function(t){MouseManager.enabled&&i.runEvent(t)}),e.addEventListener("mouseover",function(t){MouseManager.enabled&&i.runEvent(t)}),e.addEventListener("touchstart",function(t){MouseManager.enabled&&(MouseManager._isFirstTouch||t.preventDefault(),s.mouseDownTime=P.now(),i.runEvent(t))}),e.addEventListener("touchend",function(t){MouseManager.enabled?(MouseManager._isFirstTouch||t.preventDefault(),MouseManager._isFirstTouch=!1,s.mouseDownTime=-P.now(),i.runEvent(t)):i._curTouchID=NaN},!0),e.addEventListener("touchmove",function(t){MouseManager.enabled&&(t.preventDefault(),i.runEvent(t))},!0),e.addEventListener("touchcancel",function(t){MouseManager.enabled?(t.preventDefault(),i.runEvent(t)):i._curTouchID=NaN},!0),e.addEventListener("mousewheel",function(t){MouseManager.enabled&&i.runEvent(t)}),e.addEventListener("DOMMouseScroll",function(t){MouseManager.enabled&&i.runEvent(t)})},t.initEvent=function(t,e){var i;this._event._stoped=!1,this._event.nativeEvent=e||t,this._target=null,this._point.setTo(t.pageX||t.clientX,t.pageY||t.clientY),this._stage._canvasTransform&&(this._stage._canvasTransform.invertTransformPoint(this._point),this.mouseX=this._point.x,this.mouseY=this._point.y),this._event.touchId=t.identifier||0,this._tTouchID=this._event.touchId,(i=u.I._event)._stoped=!1,i.nativeEvent=this._event.nativeEvent,i.touchId=this._event.touchId},t.checkMouseWheel=function(t){this._event.delta=t.wheelDelta?.025*t.wheelDelta:-t.detail;for(var e=u.I.getLastOvers(),i=0,s=e.length;i-1;r--){var a=t._children[r];if(!a.destroyed&&a._mouseState>1&&a._visible&&this.check(a,e,i,s))return!0}for(r=t._extUIChild.length-1;r>=0;r--){var o=t._extUIChild[r];if(!o.destroyed&&o._mouseState>1&&o._visible&&this.check(o,e,i,s))return!0}}var h=!(!t.hitTestPrior||t.mouseThrough||this.disableMouseEvent)||this.hitTest(t,e,i);return h?(this._target=t,s.call(this,t),this._target==this._hitCaputreSp&&(this._hitCaputreSp=!0)):s===this.onMouseUp&&t===this._stage&&(this._target=this._stage,s.call(this,this._target)),h},t.hitTest=function(t,e,i){var s=!1;t.scrollRect&&(e-=t._style.scrollRect.x,i-=t._style.scrollRect.y);var n=t._style.hitArea;return n&&n._hit?n.contains(e,i):((t.width>0&&t.height>0||t.mouseThrough||n)&&(s=t.mouseThrough?t.getGraphicBounds().contains(e,i):(n||this._rect.setTo(0,0,t.width,t.height)).contains(e,i)),s)},t._checkAllBaseUI=function(t,e,i){var s=this.handleExclusiveCapture(this.mouseX,this.mouseY,i);return!!s||(s=this.check(this._stage,this.mouseX,this.mouseY,i),this.handleCapture(this.mouseX,this.mouseY,i)||s)},t.check3DUI=function(t,e,i){for(var s=this._stage._3dUI,n=0,r=!1;n1&&a._visible&&(r=r||this.check(a,this.mouseX,this.mouseY,i))}return this._stage._curUIBase=this._stage,r},t.handleExclusiveCapture=function(t,e,i){if(this._captureExlusiveMode&&this._captureSp&&this._captureChain.length>0){var s;this._point.setTo(t,e);for(var n=0;n0){var s;this._point.setTo(t,e);for(var n=0;n=this.mouseMoveAccuracy&&(this._prePoint.x=t.clientX,this._prePoint.y=t.clientY,this.initEvent(t),this._checkAllBaseUI(this.mouseX,this.mouseY,this.onMouseMove));break;case"touchstart":MouseManager._isTouchRespond=!0,this._isLeftMouse=!0;var n=t.changedTouches;for(i=0,s=n.length;i=0?"/":"\\",n=t.lastIndexOf(s),r=n>=0?t.substr(0,n+1):"",a=0,o=i.length;a\s+<");try{i=(new t.Parser.DOMParser).parseFromString(e,"text/xml")}catch(t){throw"需要引入xml解析库文件"}return i},MiniAdpter.idx=1,s(MiniAdpter,["nativefiles",function(){return this.nativefiles=["layaNativeDir","wxlocal"]}]),MiniAdpter}()),L=function(){function Event(){}n(Event,"laya.events.Event");var t=Event.prototype;return t.setTo=function(t,e,i){return this.type=t,this.currentTarget=e,this.target=i,this},t.stopPropagation=function(){this._stoped=!0},r(0,t,"stageY",function(){return i.stage.mouseY}),r(0,t,"charCode",function(){return this.nativeEvent.charCode}),r(0,t,"touches",function(){if(!this.nativeEvent)return null;var t=this.nativeEvent.touches;if(t)for(var e=i.stage,s=0,n=t.length;s=this._duration)return this.complete();for(var s=i>0?this._ease(i,0,1,this._duration):0,n=this._props,r=0,a=n.length;r=this.repeat?(this.clear(),s&&s.run()):this.restart()}},t.pause=function(){i.timer.clear(this,this._beginLoop),i.timer.clear(this,this._doEase),i.timer.clear(this,this.firstStart);var t;(t=P.now()-this._startTimer-this._delay)<0&&(this._usedTimer=t)},t.setStartTime=function(t){this._startTimer=t},t.clear=function(){this._target&&(this._remove(),this._clear())},t._clear=function(){this.pause(),i.timer.clear(this,this.firstStart),this._complete=null,this._target=null,this._ease=null,this._props=null,this._delayParam=null,this._usedPool&&(this.update=null,y.recover("tween",this))},t.recover=function(){this._usedPool=!0,this._clear()},t._remove=function(){var t=Tween.tweenMap[this._target.$_GID];if(t)for(var e=0,i=t.length;e=this._duration||(this._startTimer=P.now()-this._usedTimer-this._delay,this._delayParam?this._usedTimer<0?i.timer.once(-this._usedTimer,this,this.firstStart,this._delayParam):this.firstStart.apply(this,this._delayParam):this._beginLoop())},r(0,t,"progress",null,function(t){var e=t*this._duration;this._startTimer=P.now()-this._delay-e}),Tween.to=function(t,e,i,s,n,r,a,o){return void 0===r&&(r=0),void 0===a&&(a=!1),void 0===o&&(o=!0),y.getItemByClass("tween",Tween)._create(t,e,i,s,n,r,a,!0,o,!0)},Tween.from=function(t,e,i,s,n,r,a,o){return void 0===r&&(r=0),void 0===a&&(a=!1),void 0===o&&(o=!0),y.getItemByClass("tween",Tween)._create(t,e,i,s,n,r,a,!1,o,!0)},Tween.clearAll=function(t){if(t&&t.$_GID){var e=Tween.tweenMap[t.$_GID];if(e){for(var i=0,s=e.length;i-1)Browser._pixelRatio=2;else{var t=Browser.context,e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;Browser._pixelRatio=(Browser._window.devicePixelRatio||1)/e,Browser._pixelRatio<1&&(Browser._pixelRatio=1)}return Browser._pixelRatio}),r(1,Browser,"height",function(){return Browser.__init__(),(i.stage&&i.stage.canvasRotation?Browser.clientWidth:Browser.clientHeight)*Browser.pixelRatio}),r(1,Browser,"clientWidth",function(){return Browser.__init__(),Browser._window.innerWidth||Browser._document.body.clientWidth}),r(1,Browser,"window",function(){return Browser._window||Browser.__init__()}),r(1,Browser,"clientHeight",function(){return Browser.__init__(),Browser._window.innerHeight||Browser._document.body.clientHeight||Browser._document.documentElement.clientHeight}),r(1,Browser,"width",function(){return Browser.__init__(),(i.stage&&i.stage.canvasRotation?Browser.clientHeight:Browser.clientWidth)*Browser.pixelRatio}),r(1,Browser,"container",function(){return Browser._container||(Browser.__init__(),Browser._container=Browser.createElement("div"),Browser._container.id="layaContainer",Browser._document.body.appendChild(Browser._container)),Browser._container},function(t){Browser._container=t}),r(1,Browser,"document",function(){return Browser.__init__(),Browser._document}),Browser.__init__=function(){if(Browser._window)return Browser._window;var e=Browser._window=t,s=Browser._document=e.document,n=Browser.userAgent=e.navigator.userAgent,r=e._layalibs;if(r){r.sort(function(t,e){return t.i>e.i});for(var a=0;a-1,Browser.onIOS=!!n.match(/\(i[^;]+;(U;)? CPU.+Mac OS X/),Browser.onIPhone=n.indexOf("iPhone")>-1,Browser.onMac=n.indexOf("Mac OS X")>-1,Browser.onIPad=n.indexOf("iPad")>-1,Browser.onAndroid=n.indexOf("Android")>-1||n.indexOf("Adr")>-1,Browser.onWP=n.indexOf("Windows Phone")>-1,Browser.onQQBrowser=n.indexOf("QQBrowser")>-1,Browser.onMQQBrowser=n.indexOf("MQQBrowser")>-1||n.indexOf("Mobile")>-1&&n.indexOf("QQ")>-1,Browser.onIE=!!e.ActiveXObject||"ActiveXObject"in e,Browser.onWeiXin=n.indexOf("MicroMessenger")>-1,Browser.onSafari=n.indexOf("Safari")>-1,Browser.onPC=!Browser.onMobile,Browser.onMiniGame=!1,Browser.onTTMiniGame=!0,Browser.onBDMiniGame=n.indexOf("SwanGame")>-1,Browser.onLimixiu=n.indexOf("limixiu")>-1,Tt._mainCanvas=new qt(!0);var d=Tt._mainCanvas.source.style;d.position="absolute",d.top=d.left="0px",d.background="#000000",Browser.canvas=new qt(!0),Browser.context=Browser.canvas.getContext("2d");var f=new qt(!0),p=["webgl","experimental-webgl","webkit-3d","moz-webgl"],g=null;for(l=0;l=a.exeTime)if(a.repeat)if(a.jumpFrame)for(;o>=a.exeTime;)a.exeTime+=a.delay,a.run(!1);else a.exeTime+=a.delay,a.run(!1),o>a.exeTime&&(a.exeTime+=Math.ceil((o-a.exeTime)/a.delay)*a.delay);else a.run(!0)}else this._count++}(this._count>30||t%200==0)&&this._clearHandlers()}},e._clearHandlers=function(){for(var t=this._handlers,e=0,i=t.length;e0?Timer._pool.pop():new t).repeat=i,h.userFrame=e,h.delay=s,h.caller=n,h.method=r,h.args=a,h.exeTime=s+(e?this.currFrame:this.currTimer+P.now()-this._lastTimer),this._indexHandler(h),this._handlers.push(h),h},e._indexHandler=function(t){var e=t.caller,i=t.method,s=e?e.$_GID||(e.$_GID=dt.getGID()):0,n=i.$_TID||(i.$_TID=1e5*Timer._mid++);t.key=s+n,this._map[t.key]=t},e.once=function(t,e,i,s,n){void 0===n&&(n=!0),this._create(!1,!1,t,e,i,s,n)},e.loop=function(t,e,i,s,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var a=this._create(!1,!0,t,e,i,s,n);a&&(a.jumpFrame=r)},e.frameOnce=function(t,e,i,s,n){void 0===n&&(n=!0),this._create(!0,!1,t,e,i,s,n)},e.frameLoop=function(t,e,i,s,n){void 0===n&&(n=!0),this._create(!0,!0,t,e,i,s,n)},e.toString=function(){return" handlers:"+this._handlers.length+" pool:"+Timer._pool.length},e.clear=function(t,e){var i=this._getHandler(t,e);i&&(this._map[i.key]=null,i.key=0,i.clear())},e.clearAll=function(t){if(t)for(var e=0,i=this._handlers.length;e0&&(this._size=parseInt(e[0]));else{for(var s=-1,n=0;n0||e[n].indexOf("pt")>0){s=n,this._size=parseInt(e[n]),this._size<=0&&(console.error("font parse error:"+t),this._size=14);break}var r=s+1,a=e[r];for(r++;r=0,this._bold=e.indexOf("bold")>=0}},FontInfo.Parse=function(t){if(t===FontInfo._lastFont)return FontInfo._lastFontInfo;var e=FontInfo._cache[t];return e||(e=FontInfo._cache[t]=new FontInfo(t)),FontInfo._lastFont=t,FontInfo._lastFontInfo=e,e},FontInfo.EMPTY=new FontInfo(null),FontInfo._cache={},FontInfo._gfontID=0,FontInfo._lastFont="",FontInfo._lastFontInfo=null,FontInfo}()),F=(function(){function SpriteConst(){}n(SpriteConst,"laya.display.SpriteConst"),SpriteConst.POSRENDERTYPE=0,SpriteConst.POSBUFFERBEGIN=1,SpriteConst.POSBUFFEREND=2,SpriteConst.POSFRAMECOUNT=3,SpriteConst.POSREPAINT=4,SpriteConst.POSVISIBLE_NATIVE=5,SpriteConst.POSX=6,SpriteConst.POSY=7,SpriteConst.POSPIVOTX=8,SpriteConst.POSPIVOTY=9,SpriteConst.POSSCALEX=10,SpriteConst.POSSCALEY=11,SpriteConst.POSSKEWX=12,SpriteConst.POSSKEWY=13,SpriteConst.POSROTATION=14,SpriteConst.POSTRANSFORM_FLAG=15,SpriteConst.POSMATRIX=16,SpriteConst.POSCOLOR=22,SpriteConst.POSGRAPICS=23,SpriteConst.POSSIM_TEXTURE_ID=24,SpriteConst.POSSIM_TEXTURE_DATA=25,SpriteConst.POSLAYAGL3D=26,SpriteConst.POSCUSTOM=27,SpriteConst.POSCLIP=28,SpriteConst.POSCLIP_NEG_POS=32,SpriteConst.POSCOLORFILTER_COLOR=34,SpriteConst.POSCOLORFILTER_ALPHA=50,SpriteConst.POSCALLBACK_OBJ_ID=54,SpriteConst.POSCUSTOM_CALLBACK_FUN_ID=55,SpriteConst.POSCANVAS_CALLBACK_FUN_ID=56,SpriteConst.POSCANVAS_CALLBACK_END_FUN_ID=57,SpriteConst.POSCANVAS_BEGIN_CMD_ID=58,SpriteConst.POSCANVAS_END_CMD_ID=59,SpriteConst.POSCANVAS_DRAW_TARGET_CMD_ID=60,SpriteConst.POSCANVAS_DRAW_TARGET_PARAM_ID=61,SpriteConst.POSLAYA3D_FUN_ID=62,SpriteConst.POSCACHE_CANVAS_SKIP_PAINT_FLAG=63,SpriteConst.POSFILTER_BEGIN_CMD_ID=64,SpriteConst.POSFILTER_CALLBACK_FUN_ID=65,SpriteConst.POSFILTER_END_CMD_ID=66,SpriteConst.POSFILTER_END_CALLBACK_FUN_ID=67,SpriteConst.POSGRAPHICS_CALLBACK_FUN_ID=68,SpriteConst.POSMASK_CALLBACK_FUN_ID=69,SpriteConst.POSMASK_CMD_ID=70,SpriteConst.POSBLEND_SRC=71,SpriteConst.POSBLEND_DEST=72,SpriteConst.POSSIM_RECT_FILL_CMD=73,SpriteConst.POSSIM_RECT_FILL_DATA=74,SpriteConst.POSSIM_RECT_STROKE_CMD=75,SpriteConst.POSSIM_RECT_STROKE_DATA=76,SpriteConst.POSSIZE=77,SpriteConst.ALPHA=1,SpriteConst.TRANSFORM=2,SpriteConst.BLEND=4,SpriteConst.CANVAS=8,SpriteConst.FILTERS=16,SpriteConst.MASK=32,SpriteConst.CLIP=64,SpriteConst.STYLE=128,SpriteConst.TEXTURE=256,SpriteConst.GRAPHICS=512,SpriteConst.LAYAGL3D=1024,SpriteConst.CUSTOM=2048,SpriteConst.ONECHILD=4096,SpriteConst.CHILDS=8192,SpriteConst.REPAINT_NONE=0,SpriteConst.REPAINT_NODE=1,SpriteConst.REPAINT_CACHE=2,SpriteConst.REPAINT_ALL=3}(),function(){function DrawLinesCmd(){}n(DrawLinesCmd,"laya.display.cmd.DrawLinesCmd");var t=DrawLinesCmd.prototype;return t.recover=function(){this.points=null,this.lineColor=null,y.recover("DrawLinesCmd",this)},t.run=function(t,e,i){t._drawLines(this.x+e,this.y+i,this.points,this.lineColor,this.lineWidth,this.vid)},r(0,t,"cmdID",function(){return"DrawLines"}),DrawLinesCmd.create=function(t,e,i,s,n,r){var a=y.getItemByClass("DrawLinesCmd",DrawLinesCmd);return a.x=t,a.y=e,a.points=i,a.lineColor=s,a.lineWidth=n,a.vid=r,a},DrawLinesCmd.ID="DrawLines",DrawLinesCmd}()),k=function(){function BoundsStyle(){}n(BoundsStyle,"laya.display.css.BoundsStyle");var t=BoundsStyle.prototype;return t.reset=function(){return this.bounds&&this.bounds.recover(),this.userBounds&&this.userBounds.recover(),this.bounds=null,this.userBounds=null,this.temBM=null,this},t.recover=function(){y.recover("BoundsStyle",this.reset())},BoundsStyle.create=function(){return y.getItemByClass("BoundsStyle",BoundsStyle)},BoundsStyle}(),O=function(){function DrawPieCmd(){}n(DrawPieCmd,"laya.display.cmd.DrawPieCmd");var t=DrawPieCmd.prototype;return t.recover=function(){this.fillColor=null,this.lineColor=null,y.recover("DrawPieCmd",this)},t.run=function(t,e,i){t._drawPie(this.x+e,this.y+i,this.radius,this._startAngle,this._endAngle,this.fillColor,this.lineColor,this.lineWidth,this.vid)},r(0,t,"startAngle",function(){return 180*this._startAngle/Math.PI},function(t){this._startAngle=t*Math.PI/180}),r(0,t,"cmdID",function(){return"DrawPie"}),r(0,t,"endAngle",function(){return 180*this._endAngle/Math.PI},function(t){this._endAngle=t*Math.PI/180}),DrawPieCmd.create=function(t,e,i,s,n,r,a,o,h){var l=y.getItemByClass("DrawPieCmd",DrawPieCmd);return l.x=t,l.y=e,l.radius=i,l._startAngle=s,l._endAngle=n,l.fillColor=r,l.lineColor=a,l.lineWidth=o,l.vid=h,l},DrawPieCmd.ID="DrawPie",DrawPieCmd}(),U=function(){function MiniFileMgr(){}return n(MiniFileMgr,"laya.tt.mini.MiniFileMgr"),MiniFileMgr.isLocalNativeFile=function(t){for(var e=0,i=b.nativefiles.length;e=52428800&&(t.size>b.minClearSize&&(b.minClearSize=t.size),MiniFileMgr.onClearCacheRes()),MiniFileMgr.deleteFile(a,e,i,s,t.size)},fail:function(t){null!=i&&i.runWith([1,t])}}):null!=i&&i.runWith([0]):MiniFileMgr.fs.getFileInfo({filePath:t,success:function(r){n&&l+4194304+r.size>=52428800&&(r.size>b.minClearSize&&(b.minClearSize=r.size),MiniFileMgr.onClearCacheRes()),MiniFileMgr.fs.copyFile({srcPath:t,destPath:h,success:function(t){MiniFileMgr.onSaveFile(e,a,!0,s,i,r.size)},fail:function(t){null!=i&&i.runWith([1,t])}})},fail:function(t){null!=i&&i.runWith([1,t])}})},MiniFileMgr.onClearCacheRes=function(){var t=b.minClearSize,e=[];for(var i in MiniFileMgr.filesListObj)e.push(MiniFileMgr.filesListObj[i]);MiniFileMgr.sortOn(e,"times",16);for(var s=0,n=1,r=e.length;n=t)break;s+=a.size,MiniFileMgr.deleteFile("",a.readyUrl)}},MiniFileMgr.sortOn=function(t,e,i){return void 0===i&&(i=0),16==i?t.sort(function(t,i){return t[e]-i[e]}):18==i?t.sort(function(t,i){return i[e]-t[e]}):t.sort(function(t,i){return t[e]-i[e]})},MiniFileMgr.getFileNativePath=function(t){return laya.tt.mini.MiniFileMgr.fileNativeDir+"/"+t},MiniFileMgr.deleteFile=function(t,e,i,s,n){void 0===e&&(e=""),void 0===s&&(s=""),void 0===n&&(n=0);var r=MiniFileMgr.getFileInfo(e),a=MiniFileMgr.getFileNativePath(r.md5);MiniFileMgr.fs.unlink({filePath:a,success:function(r){var a=""!=t;if(""!=t){var o=MiniFileMgr.getFileNativePath(t);MiniFileMgr.fs.copyFile({srcPath:t,destPath:o,success:function(n){MiniFileMgr.onSaveFile(e,t,a,s,i,n.size)},fail:function(t){null!=i&&i.runWith([1,t])}})}else MiniFileMgr.onSaveFile(e,t,a,s,i,n)},fail:function(t){}})},MiniFileMgr.deleteAll=function(){var t=[];for(var e in MiniFileMgr.filesListObj)t.push(MiniFileMgr.filesListObj[e]);for(var i=1,s=t.length;i-1;i--)if(this._isTextCmd(e[i]))return e[i].text=t,!0}else if(this._one&&this._isTextCmd(this._one))return this._one.text=t,!0;return!1},t._isTextCmd=function(t){var e=t.cmdID;return"FillText"==e||"StrokeText"==e||"FillBorderText"==e},t.replaceTextColor=function(t){this._repaint();var e=this._cmds;if(e)for(var i=e.length-1;i>-1;i--)this._isTextCmd(e[i])&&this._setTextCmdColor(e[i],t);else this._one&&this._isTextCmd(this._one)&&this._setTextCmdColor(this._one,t)},t._setTextCmdColor=function(t,e){switch(t.cmdID){case"FillText":case"StrokeText":t.color=e;break;case"FillBorderText":case"FillBorderWords":case"FillBorderText":t.fillColor=e}},t.loadImage=function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0);var a=kt.getRes(t);a?a.getIsReady()?this.drawImage(a,e,i,s,n):a.once("ready",this,this.drawImage,[a,e,i,s,n]):((a=new Ut).load(t),kt.cacheRes(t,a),a.once("ready",this,this.drawImage,[a,e,i,s,n])),null!=r&&(a.getIsReady()?r.call(this._sp):a.on("ready",this._sp,r))},t._renderEmpty=function(t,e,i,s){},t._renderAll=function(t,e,i,s){for(var n=this._cmds,r=0,a=n.length;r=1&&r?a/2:0,h=r?a:0;return this._saveToCmd(Tt._context.drawRect,p.create.call(this,t+o,e+o,i-h,s-h,n,r,a))},t.drawCircle=function(t,e,i,s,n,r){void 0===r&&(r=1);var a=r>=1&&n?r/2:0,o=0;return Tt.isWebGL&&(o=nt.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(o)),this._saveToCmd(Tt._context._drawCircle,g.create.call(this,t,e,i-a,s,n,r,o))},t.drawPie=function(t,e,i,s,n,r,a,o){void 0===o&&(o=1);var h=o>=1&&a?o/2:0,l=a?o:0,c=0;return Tt.isWebGL&&(c=nt.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(c)),this._saveToCmd(Tt._context._drawPie,O.create.call(this,t+h,e+h,i-l,dt.toRadian(s),dt.toRadian(n),r,a,o,c))},t.drawPoly=function(t,e,i,s,n,r){void 0===r&&(r=1);var a=0;if(Tt.isWebGL){a=nt.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(a);var o=!1;o=!(i.length>6)}var h=r>=1&&n?r%2==0?0:.5:0;return this._saveToCmd(Tt._context._drawPoly,Lt.create.call(this,t+h,e+h,i,s,n,r,o,a))},t.drawPath=function(t,e,i,s,n){return this._saveToCmd(Tt._context._drawPath,D.create.call(this,t,e,i,s,n))},r(0,t,"cmds",function(){return this._cmds},function(t){this._sp&&(this._sp._renderType|=512,this._sp._setRenderType(this._sp._renderType)),this._cmds=t,this._render=this._renderAll,this._repaint()}),Graphics}(),Y=function(){function RestoreCmd(){}n(RestoreCmd,"laya.display.cmd.RestoreCmd");var t=RestoreCmd.prototype;return t.recover=function(){y.recover("RestoreCmd",this)},t.run=function(t,e,i){t.restore()},r(0,t,"cmdID",function(){return"Restore"}),RestoreCmd.create=function(){return y.getItemByClass("RestoreCmd",RestoreCmd)},RestoreCmd.ID="Restore",RestoreCmd}(),H=(function(){function ResourceVersion(){}n(ResourceVersion,"laya.net.ResourceVersion"),ResourceVersion.enable=function(t,e,s){void 0===s&&(s=2),laya.net.ResourceVersion.type=s,i.loader.load(t,l.create(null,ResourceVersion.onManifestLoaded,[e]),null,"json")},ResourceVersion.onManifestLoaded=function(t,e){ResourceVersion.manifest=e,v.customFormat=ResourceVersion.addVersionPrefix,t.run(),e||console.warn("资源版本清单文件不存在,不使用资源版本管理。忽略ERR_FILE_NOT_FOUND错误。")},ResourceVersion.addVersionPrefix=function(t){return t=v.getAdptedFilePath(t),ResourceVersion.manifest&&ResourceVersion.manifest[t]?2==ResourceVersion.type?ResourceVersion.manifest[t]:ResourceVersion.manifest[t]+"/"+t:t},ResourceVersion.FOLDER_VERSION=1,ResourceVersion.FILENAME_VERSION=2,ResourceVersion.manifest=null,ResourceVersion.type=1}(),function(){function FillBorderWordsCmd(){}n(FillBorderWordsCmd,"laya.display.cmd.FillBorderWordsCmd");var t=FillBorderWordsCmd.prototype;return t.recover=function(){this.words=null,y.recover("FillBorderWordsCmd",this)},t.run=function(t,e,i){t.fillBorderWords(this.words,this.x+e,this.y+i,this.font,this.fillColor,this.borderColor,this.lineWidth)},r(0,t,"cmdID",function(){return"FillBorderWords"}),FillBorderWordsCmd.create=function(t,e,i,s,n,r,a){var o=y.getItemByClass("FillBorderWordsCmd",FillBorderWordsCmd);return o.words=t,o.x=e,o.y=i,o.font=s,o.fillColor=n,o.borderColor=r,o.lineWidth=a,o},FillBorderWordsCmd.ID="FillBorderWords",FillBorderWordsCmd}()),X=function(){function ScaleCmd(){}n(ScaleCmd,"laya.display.cmd.ScaleCmd");var t=ScaleCmd.prototype;return t.recover=function(){y.recover("ScaleCmd",this)},t.run=function(t,e,i){t._scale(this.scaleX,this.scaleY,this.pivotX+e,this.pivotY+i)},r(0,t,"cmdID",function(){return"Scale"}),ScaleCmd.create=function(t,e,i,s){var n=y.getItemByClass("ScaleCmd",ScaleCmd);return n.scaleX=t,n.scaleY=e,n.pivotX=i,n.pivotY=s,n},ScaleCmd.ID="Scale",ScaleCmd}(),z=function(){function AlphaCmd(){}n(AlphaCmd,"laya.display.cmd.AlphaCmd");var t=AlphaCmd.prototype;return t.recover=function(){y.recover("AlphaCmd",this)},t.run=function(t,e,i){t.alpha(this.alpha)},r(0,t,"cmdID",function(){return"Alpha"}),AlphaCmd.create=function(t){var e=y.getItemByClass("AlphaCmd",AlphaCmd);return e.alpha=t,e},AlphaCmd.ID="Alpha",AlphaCmd}(),V=function(){function Prefab(){this.json=null}return n(Prefab,"laya.components.Prefab"),Prefab.prototype.create=function(){return this.json?rt.createByData(null,this.json):null},Prefab}(),j=function(){function WordText(){this.id=NaN,this.save=[],this.toUpperCase=null,this.changed=!1,this._text=null,this.width=-1,this.pageChars=[],this.startID=0,this.startIDStroke=0,this.lastGCCnt=0}n(WordText,"laya.utils.WordText");var t=WordText.prototype;return t.setText=function(t){this.changed=!0,this._text=t,this.width=-1,this.pageChars=[]},t.toString=function(){return this._text},t.charCodeAt=function(t){return this._text?this._text.charCodeAt(t):NaN},t.charAt=function(t){return this._text?this._text.charAt(t):null},t.cleanCache=function(){this.pageChars=[],this.startID=0},r(0,t,"length",function(){return this._text?this._text.length:0}),WordText}(),$=function(){function GrahamScan(){}return n(GrahamScan,"laya.maths.GrahamScan"),GrahamScan.multiply=function(t,e,i){return(t.x-i.x)*(e.y-i.y)-(e.x-i.x)*(t.y-i.y)},GrahamScan.dis=function(t,e){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)},GrahamScan._getPoints=function(t,e,i){for(void 0===e&&(e=!1),GrahamScan._mPointList||(GrahamScan._mPointList=[]);GrahamScan._mPointList.length=0;n--)s=(e=t[n]).x+"_"+e.y,h.hasOwnProperty(s)||(h[s]=!0,i.push(e));for(o=i.length,dt.copyArray(t,i),n=1;n0||0==GrahamScan.multiply(t[r],t[a],t[0])&&GrahamScan.dis(t[0],t[r])=2&&GrahamScan.multiply(t[n],i[i.length-1],i[i.length-2])>=0;)i.pop();t[n]&&i.push(t[n])}return i},GrahamScan._mPointList=null,GrahamScan._tempPointList=[],GrahamScan._temPList=[],GrahamScan._temArr=[],GrahamScan}(),q=(function(){function Const(){}n(Const,"laya.Const"),Const.NOT_ACTIVE=1,Const.ACTIVE_INHIERARCHY=2,Const.AWAKED=4,Const.NOT_READY=8,Const.DISPLAY=16,Const.HAS_ZORDER=32,Const.HAS_MOUSE=64,Const.DISPLAYED_INSTAGE=128,Const.DRAWCALL_OPTIMIZE=256}(),function(){function MathUtil(){}n(MathUtil,"laya.maths.MathUtil"),MathUtil.subtractVector3=function(t,e,i){i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2]},MathUtil.lerp=function(t,e,i){return t*(1-i)+e*i},MathUtil.scaleVector3=function(t,e,i){i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e},MathUtil.lerpVector3=function(t,e,i,s){var n=t[0],r=t[1],a=t[2];s[0]=n+i*(e[0]-n),s[1]=r+i*(e[1]-r),s[2]=a+i*(e[2]-a)},MathUtil.lerpVector4=function(t,e,i,s){var n=t[0],r=t[1],a=t[2],o=t[3];s[0]=n+i*(e[0]-n),s[1]=r+i*(e[1]-r),s[2]=a+i*(e[2]-a),s[3]=o+i*(e[3]-o)},MathUtil.slerpQuaternionArray=function(t,e,i,s,n,r,a){var o,h,l,c,u,_=t[e+0],d=t[e+1],f=t[e+2],p=t[e+3],g=i[s+0],m=i[s+1],v=i[s+2],y=i[s+3];return(h=_*g+d*m+f*v+p*y)<0&&(h=-h,g=-g,m=-m,v=-v,y=-y),1-h>1e-6?(o=Math.acos(h),l=Math.sin(o),c=Math.sin((1-n)*o)/l,u=Math.sin(n*o)/l):(c=1-n,u=n),r[a+0]=c*_+u*g,r[a+1]=c*d+u*m,r[a+2]=c*f+u*v,r[a+3]=c*p+u*y,r},MathUtil.getRotation=function(t,e,i,s){return Math.atan2(s-e,i-t)/Math.PI*180},MathUtil.sortBigFirst=function(t,e){return t==e?0:e>t?1:-1},MathUtil.sortSmallFirst=function(t,e){return t==e?0:e>t?-1:1},MathUtil.sortNumBigFirst=function(t,e){return parseFloat(e)-parseFloat(t)},MathUtil.sortNumSmallFirst=function(t,e){return parseFloat(t)-parseFloat(e)},MathUtil.sortByKey=function(t,e,i){var s;return void 0===e&&(e=!1),void 0===i&&(i=!0),s=e?i?MathUtil.sortNumBigFirst:MathUtil.sortBigFirst:i?MathUtil.sortNumSmallFirst:MathUtil.sortSmallFirst,function(e,i){return s(e[t],i[t])}}}(),function(){function DrawCurvesCmd(){}n(DrawCurvesCmd,"laya.display.cmd.DrawCurvesCmd");var t=DrawCurvesCmd.prototype;return t.recover=function(){this.points=null,this.lineColor=null,y.recover("DrawCurvesCmd",this)},t.run=function(t,e,i){t.drawCurves(this.x+e,this.y+i,this.points,this.lineColor,this.lineWidth)},r(0,t,"cmdID",function(){return"DrawCurves"}),DrawCurvesCmd.create=function(t,e,i,s,n){var r=y.getItemByClass("DrawCurvesCmd",DrawCurvesCmd);return r.x=t,r.y=e,r.points=i,r.lineColor=s,r.lineWidth=n,r},DrawCurvesCmd.ID="DrawCurves",DrawCurvesCmd}()),K=function(){function SaveCmd(){}n(SaveCmd,"laya.display.cmd.SaveCmd");var t=SaveCmd.prototype;return t.recover=function(){y.recover("SaveCmd",this)},t.run=function(t,e,i){t.save()},r(0,t,"cmdID",function(){return"Save"}),SaveCmd.create=function(){return y.getItemByClass("SaveCmd",SaveCmd)},SaveCmd.ID="Save",SaveCmd}(),Q=function(){function DrawImageCmd(){}n(DrawImageCmd,"laya.display.cmd.DrawImageCmd");var t=DrawImageCmd.prototype;return t.recover=function(){this.texture._removeReference(),this.texture=null,y.recover("DrawImageCmd",this)},t.run=function(t,e,i){t.drawTexture(this.texture,this.x+e,this.y+i,this.width,this.height)},r(0,t,"cmdID",function(){return"DrawImage"}),DrawImageCmd.create=function(t,e,i,s,n){var r=y.getItemByClass("DrawImageCmd",DrawImageCmd);return r.texture=t,t._addReference(),r.x=e,r.y=i,r.width=s,r.height=n,r},DrawImageCmd.ID="DrawImage",DrawImageCmd}(),Z=function(){function Matrix(t,e,i,s,n,r,a){if(this._bTransform=!1,void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===a&&(a=0),null!=Matrix._createFun)return Matrix._createFun(t,e,i,s,n,r,a);this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=r,this._checkTransform()}n(Matrix,"laya.maths.Matrix");var t=Matrix.prototype;return t.identity=function(){return this.a=this.d=1,this.b=this.tx=this.ty=this.c=0,this._bTransform=!1,this},t._checkTransform=function(){return this._bTransform=1!==this.a||0!==this.b||0!==this.c||1!==this.d},t.setTranslate=function(t,e){return this.tx=t,this.ty=e,this},t.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this._bTransform=!0,this},t.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),s=this.a,n=this.c,r=this.tx;return this.a=s*e-this.b*i,this.b=s*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=r*e-this.ty*i,this.ty=r*i+this.ty*e,this._bTransform=!0,this},t.skew=function(t,e){var i=Math.tan(t),s=Math.tan(e),n=this.a,r=this.b;return this.a+=s*this.c,this.b+=s*this.d,this.c+=i*n,this.d+=i*r,this},t.invertTransformPoint=function(t){var e=this.a,i=this.b,s=this.c,n=this.d,r=this.tx,a=e*n-i*s,o=n/a,h=-i/a,l=-s/a,c=e/a,u=(s*this.ty-n*r)/a,_=-(e*this.ty-i*r)/a;return t.setTo(o*t.x+l*t.y+u,h*t.x+c*t.y+_)},t.transformPoint=function(t){return t.setTo(this.a*t.x+this.c*t.y+this.tx,this.b*t.x+this.d*t.y+this.ty)},t.transformPointN=function(t){return t.setTo(this.a*t.x+this.c*t.y,this.b*t.x+this.d*t.y)},t.getScaleX=function(){return 0===this.b?this.a:Math.sqrt(this.a*this.a+this.b*this.b)},t.getScaleY=function(){return 0===this.c?this.d:Math.sqrt(this.c*this.c+this.d*this.d)},t.invert=function(){var t=this.a,e=this.b,i=this.c,s=this.d,n=this.tx,r=t*s-e*i;return this.a=s/r,this.b=-e/r,this.c=-i/r,this.d=t/r,this.tx=(i*this.ty-s*n)/r,this.ty=-(t*this.ty-e*n)/r,this},t.setTo=function(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=r,this},t.concat=function(t){var e=this.a,i=this.c,s=this.tx;return this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d,this.tx=s*t.a+this.ty*t.c+t.tx,this.ty=s*t.b+this.ty*t.d+t.ty,this},t.scaleEx=function(t,e){var i=this.a,s=this.b,n=this.c,r=this.d;0!==s||0!==n?(this.a=t*i,this.b=t*s,this.c=e*n,this.d=e*r):(this.a=t*i,this.b=0*r,this.c=0*i,this.d=e*r),this._bTransform=!0},t.rotateEx=function(t){var e=Math.cos(t),i=Math.sin(t),s=this.a,n=this.b,r=this.c,a=this.d;0!==n||0!==r?(this.a=e*s+i*r,this.b=e*n+i*a,this.c=-i*s+e*r,this.d=-i*n+e*a):(this.a=e*s,this.b=i*a,this.c=-i*s,this.d=e*a),this._bTransform=!0},t.clone=function(){var t=Matrix.create();return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t._bTransform=this._bTransform,t},t.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t._bTransform=this._bTransform,t},t.toString=function(){return this.a+","+this.b+","+this.c+","+this.d+","+this.tx+","+this.ty},t.destroy=function(){this.recover()},t.recover=function(){y.recover("Matrix",this.identity())},Matrix.mul=function(t,e,i){var s=t.a,n=t.b,r=t.c,a=t.d,o=t.tx,h=t.ty,l=e.a,c=e.b,u=e.c,_=e.d,d=e.tx,f=e.ty;return 0!==c||0!==u?(i.a=s*l+n*u,i.b=s*c+n*_,i.c=r*l+a*u,i.d=r*c+a*_,i.tx=l*o+u*h+d,i.ty=c*o+_*h+f):(i.a=s*l,i.b=n*_,i.c=r*l,i.d=a*_,i.tx=l*o+d,i.ty=_*h+f),i},Matrix.mul16=function(t,e,i){var s=t.a,n=t.b,r=t.c,a=t.d,o=t.tx,h=t.ty,l=e.a,c=e.b,u=e.c,_=e.d,d=e.tx,f=e.ty;return 0!==c||0!==u?(i[0]=s*l+n*u,i[1]=s*c+n*_,i[4]=r*l+a*u,i[5]=r*c+a*_,i[12]=l*o+u*h+d,i[13]=c*o+_*h+f):(i[0]=s*l,i[1]=n*_,i[4]=r*l,i[5]=a*_,i[12]=l*o+d,i[13]=_*h+f),i},Matrix.create=function(){return y.getItemByClass("Matrix",Matrix)},Matrix.EMPTY=new Matrix,Matrix.TEMP=new Matrix,Matrix._createFun=null,Matrix}(),J=(function(){function Byte(t){this._xd_=!0,this._allocated_=8,this._pos_=0,this._length=0,t?(this._u8d_=new Uint8Array(t),this._d_=new DataView(this._u8d_.buffer),this._length=this._d_.byteLength):this._resizeBuffer(this._allocated_)}n(Byte,"laya.utils.Byte");var t=Byte.prototype;t._resizeBuffer=function(t){try{var e=new Uint8Array(t);null!=this._u8d_&&(this._u8d_.length<=t?e.set(this._u8d_):e.set(this._u8d_.subarray(0,t))),this._u8d_=e,this._d_=new DataView(e.buffer)}catch(e){throw"Invalid typed array length:"+t}},t.getString=function(){return this.readString()},t.readString=function(){return this._rUTF(this.getUint16())},t.getFloat32Array=function(t,e){return this.readFloat32Array(t,e)},t.readFloat32Array=function(t,e){var i=t+e;i=i>this._length?this._length:i;var s=new Float32Array(this._d_.buffer.slice(t,i));return this._pos_=i,s},t.getUint8Array=function(t,e){return this.readUint8Array(t,e)},t.readUint8Array=function(t,e){var i=t+e;i=i>this._length?this._length:i;var s=new Uint8Array(this._d_.buffer.slice(t,i));return this._pos_=i,s},t.getInt16Array=function(t,e){return this.readInt16Array(t,e)},t.readInt16Array=function(t,e){var i=t+e;i=i>this._length?this._length:i;var s=new Int16Array(this._d_.buffer.slice(t,i));return this._pos_=i,s},t.getFloat32=function(){return this.readFloat32()},t.readFloat32=function(){if(this._pos_+4>this._length)throw"getFloat32 error - Out of bounds";var t=this._d_.getFloat32(this._pos_,this._xd_);return this._pos_+=4,t},t.getFloat64=function(){return this.readFloat64()},t.readFloat64=function(){if(this._pos_+8>this._length)throw"getFloat64 error - Out of bounds";var t=this._d_.getFloat64(this._pos_,this._xd_);return this._pos_+=8,t},t.writeFloat32=function(t){this._ensureWrite(this._pos_+4),this._d_.setFloat32(this._pos_,t,this._xd_),this._pos_+=4},t.writeFloat64=function(t){this._ensureWrite(this._pos_+8),this._d_.setFloat64(this._pos_,t,this._xd_),this._pos_+=8},t.getInt32=function(){return this.readInt32()},t.readInt32=function(){if(this._pos_+4>this._length)throw"getInt32 error - Out of bounds";var t=this._d_.getInt32(this._pos_,this._xd_);return this._pos_+=4,t},t.getUint32=function(){return this.readUint32()},t.readUint32=function(){if(this._pos_+4>this._length)throw"getUint32 error - Out of bounds";var t=this._d_.getUint32(this._pos_,this._xd_);return this._pos_+=4,t},t.writeInt32=function(t){this._ensureWrite(this._pos_+4),this._d_.setInt32(this._pos_,t,this._xd_),this._pos_+=4},t.writeUint32=function(t){this._ensureWrite(this._pos_+4),this._d_.setUint32(this._pos_,t,this._xd_),this._pos_+=4},t.getInt16=function(){return this.readInt16()},t.readInt16=function(){if(this._pos_+2>this._length)throw"getInt16 error - Out of bounds";var t=this._d_.getInt16(this._pos_,this._xd_);return this._pos_+=2,t},t.getUint16=function(){return this.readUint16()},t.readUint16=function(){if(this._pos_+2>this._length)throw"getUint16 error - Out of bounds";var t=this._d_.getUint16(this._pos_,this._xd_);return this._pos_+=2,t},t.writeUint16=function(t){this._ensureWrite(this._pos_+2),this._d_.setUint16(this._pos_,t,this._xd_),this._pos_+=2},t.writeInt16=function(t){this._ensureWrite(this._pos_+2),this._d_.setInt16(this._pos_,t,this._xd_),this._pos_+=2},t.getUint8=function(){return this.readUint8()},t.readUint8=function(){if(this._pos_+1>this._length)throw"getUint8 error - Out of bounds";return this._u8d_[this._pos_++]},t.writeUint8=function(t){this._ensureWrite(this._pos_+1),this._d_.setUint8(this._pos_,t),this._pos_++},t._getUInt8=function(t){return this._readUInt8(t)},t._readUInt8=function(t){return this._d_.getUint8(t)},t._getUint16=function(t){return this._readUint16(t)},t._readUint16=function(t){return this._d_.getUint16(t,this._xd_)},t._getMatrix=function(){return this._readMatrix()},t._readMatrix=function(){return new Z(this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32())},t._rUTF=function(t){for(var e="",i=this._pos_+t,s=0,n=String.fromCharCode,r=this._u8d_;this._pos_0;)if((s=r[this._pos_])<128)e+=n(s),this._pos_++,t--;else for(i=s-128,this._pos_++,t-=i;i>0;)s=r[this._pos_++],e+=n(r[this._pos_++]<<8|s),i--;return e},t.clear=function(){this._pos_=0,this.length=0},t.__getBuffer=function(){return this._d_.buffer},t.writeUTFBytes=function(t){for(var e=0,i=(t+="").length;e>6,128|63&s],this._pos_),this._pos_+=2):s<=65535?(this._ensureWrite(this._pos_+3),this._u8d_.set([224|s>>12,128|s>>6&63,128|63&s],this._pos_),this._pos_+=3):(this._ensureWrite(this._pos_+4),this._u8d_.set([240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s],this._pos_),this._pos_+=4)}},t.writeUTFString=function(t){var e=this.pos;this.writeUint16(1),this.writeUTFBytes(t);var i=this.pos-e-2;this._d_.setUint16(e,i,this._xd_)},t.readUTFString=function(){return this.readUTFBytes(this.getUint16())},t.getUTFString=function(){return this.readUTFString()},t.readUTFBytes=function(t){if(void 0===t&&(t=-1),0===t)return"";var e=this.bytesAvailable;if(t>e)throw"readUTFBytes error - Out of bounds";return t=t>0?t:e,this._rUTF(t)},t.getUTFBytes=function(t){return void 0===t&&(t=-1),this.readUTFBytes(t)},t.writeByte=function(t){this._ensureWrite(this._pos_+1),this._d_.setInt8(this._pos_,t),this._pos_+=1},t.readByte=function(){if(this._pos_+1>this._length)throw"readByte error - Out of bounds";return this._d_.getInt8(this._pos_++)},t.getByte=function(){return this.readByte()},t._ensureWrite=function(t){this._lengtht&&this._resizeBuffer(this._allocated_=t),this._length=t}),r(0,t,"pos",function(){return this._pos_},function(t){this._pos_=t}),r(0,t,"bytesAvailable",function(){return this._length-this._pos_}),Byte.getSystemEndian=function(){if(!Byte._sysEndian){var t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,!0),Byte._sysEndian=256===new Int16Array(t)[0]?"littleEndian":"bigEndian"}return Byte._sysEndian},Byte.BIG_ENDIAN="bigEndian",Byte.LITTLE_ENDIAN="littleEndian",Byte._sysEndian=null}(),function(){function UIUtils(){}return n(UIUtils,"laya.ui.UIUtils"),UIUtils.fillArray=function(t,e,i){var s=t.concat();if(e)for(var n=e.split(","),r=0,a=Math.min(s.length,n.length);r0){for(var n=s.length-1;n>-1;n--){var r=s[n];i.__typeof(r,e)&&s.splice(n,1)}t.filters=s}},UIUtils._getReplaceStr=function(t){return UIUtils.escapeSequence[t]},UIUtils.adptString=function(t){return t.replace(/\\(\w)/g,UIUtils._getReplaceStr)},UIUtils.getBindFun=function(t){var e=UIUtils._funMap.get(t);if(null==e){var s='"'+t+'"',n="(function(data){if(data==null)return;with(data){try{\nreturn "+(s=s.replace(/^"\${|}"$/g,"").replace(/\${/g,'"+').replace(/}/g,'+"'))+"\n}catch(e){}}})";e=i._runScript(n),UIUtils._funMap.set(t,e)}return e},s(UIUtils,["grayFilter",function(){return this.grayFilter=new Pt([.3086,.6094,.082,0,0,.3086,.6094,.082,0,0,.3086,.6094,.082,0,0,0,0,0,1,0])},"escapeSequence",function(){return this.escapeSequence={"\\n":"\n","\\t":"\t"}},"_funMap",function(){return this._funMap=new ut}]),UIUtils}()),et=function(){function CacheStyle(){this.reset()}n(CacheStyle,"laya.display.css.CacheStyle");var t=CacheStyle.prototype;return t.needBitmapCache=function(){return this.cacheForFilters||!!this.mask},t.needEnableCanvasRender=function(){return"none"!=this.userSetCache||this.cacheForFilters||!!this.mask},t.releaseContext=function(){this.canvas&&this.canvas.size&&(y.recover("CacheCanvas",this.canvas),this.canvas.size(0,0)),this.canvas=null},t.createContext=function(){if(!this.canvas){this.canvas=y.getItem("CacheCanvas")||new qt(!Tt.isWebGL);var t=this.canvas.context;t||(t=this.canvas.getContext("2d"))}},t.releaseFilterCache=function(){var t=this.filterCache;t&&(t.destroy(),t.recycle(),this.filterCache=null)},t.recover=function(){this!==CacheStyle.EMPTY&&y.recover("SpriteCache",this.reset())},t.reset=function(){return this.releaseContext(),this.releaseFilterCache(),this.cacheAs="none",this.enableCanvasRender=!1,this.userSetCache="none",this.cacheForFilters=!1,this.staticCache=!1,this.reCache=!0,this.mask=null,this.maskParent=null,this.filterCache=null,this.filters=null,this.hasGlowFilter=!1,this.cacheRect&&this.cacheRect.recover(),this.cacheRect=null,this},t._calculateCacheRect=function(t,e,s,n){var r=!1;(Tt.isWebGL||Tt.isConchApp)&&(r=!0);var a,o=t._cacheStyle;o.cacheRect||(o.cacheRect=mt.create()),r&&"bitmap"!==e?o.cacheRect.setTo(-t._style.pivotX,-t._style.pivotY,1,1):(a=t.getSelfBounds(),Tt.isConchApp?(a.width=a.x+a.width+32,a.height=a.x+a.height+32):(a.width=a.width+32,a.height=a.height+32),a.x=a.x-t.pivotX,a.y=a.y-t.pivotY,a.x=a.x-16,a.y=a.y-16,a.x=Math.floor(a.x+s)-s,a.y=Math.floor(a.y+n)-n,a.width=Math.floor(a.width),a.height=Math.floor(a.height),o.cacheRect.copyFrom(a)),a=o.cacheRect;var h=r?1:P.pixelRatio*i.stage.clientScaleX,l=r?1:P.pixelRatio*i.stage.clientScaleY;if(!r){var c,u=1,_=1;for(c=t;c&&c!=i.stage;)u*=c.scaleX,_*=c.scaleY,c=c.parent;u>1&&(h*=u),_>1&&(l*=_)}if(t._style.scrollRect){var d=t._style.scrollRect;a.x-=d.x,a.y-=d.y}return CacheStyle._scaleInfo.setTo(h,l),CacheStyle._scaleInfo},CacheStyle.create=function(){return y.getItemByClass("SpriteCache",CacheStyle)},CacheStyle.EMPTY=new CacheStyle,CacheStyle.CANVAS_EXTEND_EDGE=16,s(CacheStyle,["_scaleInfo",function(){return this._scaleInfo=new it}]),CacheStyle}(),it=function(){function Point(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}n(Point,"laya.maths.Point");var t=Point.prototype;return t.setTo=function(t,e){return this.x=t,this.y=e,this},t.reset=function(){return this.x=this.y=0,this},t.recover=function(){y.recover("Point",this.reset())},t.distance=function(t,e){return Math.sqrt((this.x-t)*(this.x-t)+(this.y-e)*(this.y-e))},t.toString=function(){return this.x+","+this.y},t.normalize=function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);if(t>0){var e=1/t;this.x*=e,this.y*=e}},t.copy=function(t){return this.setTo(t.x,t.y)},Point.create=function(){return y.getItemByClass("Point",Point)},Point.TEMP=new Point,Point.EMPTY=new Point,Point}(),st=function(){function Context(){}n(Context,"laya.resource.Context");var t=Context.prototype;return t.drawCanvas=function(t,e,i,s,n){Mt.renderBatch++,this.drawImage(t._source,e,i,s,n)},t._drawRect=function(t,e,i,s,n){Mt.renderBatch++,n&&(this.fillStyle=n),this.fillRect(t,e,i,s)},t.drawText=function(t,e,i,s,n,r){Mt.renderBatch++,arguments.length>3&&null!=s&&(this.font=s,this.fillStyle=n,this.textAlign=r,this.textBaseline="top"),this.fillText(t,e,i)},t.fillBorderText=function(t,e,i,s,n,r,a,o){Mt.renderBatch++,this.font=s,this.fillStyle=n,this.textBaseline="top",this.strokeStyle=r,this.lineWidth=a,this.textAlign=o,this.strokeText(t,e,i),this.fillText(t,e,i)},t.fillWords=function(t,e,i,s,n){s&&(this.font=s),n&&(this.fillStyle=n),this.textBaseline="top",this.textAlign="left";for(var r=0,a=t.length;r3&&null!=s&&(this.font=s,this.strokeStyle=n,this.lineWidth=r,this.textAlign=a,this.textBaseline="top"),this.strokeText(t,e,i)},t.setTransformByMatrix=function(t){this.setTransform(t.a,t.b,t.c,t.d,t.tx,t.ty)},t.clipRect=function(t,e,i,s){Mt.renderBatch++,this.beginPath(),this.rect(t,e,i,s),this.clip()},t.drawTextureWithTransform=function(t,e,i,s,n,r,a,o,h,l,c){if(t._getSource()){Mt.renderBatch++;var u=1!==h;if(u){var _=this.globalAlpha;this.globalAlpha*=h}l&&(this.globalCompositeOperation=l);var d=t.uv,f=t.bitmap._width,p=t.bitmap._height;r?(this.save(),this.transform(r.a,r.b,r.c,r.d,r.tx+a,r.ty+o),this.drawImage(t.bitmap._source,d[0]*f,d[1]*p,(d[2]-d[0])*f,(d[5]-d[3])*p,e,i,s,n),this.restore()):this.drawImage(t.bitmap._source,d[0]*f,d[1]*p,(d[2]-d[0])*f,(d[5]-d[3])*p,a+e,o+i,s,n),u&&(this.globalAlpha=_),l&&(this.globalCompositeOperation="source-over")}},t.drawTexture2=function(t,e,i,s,n,r){var a=r[0];Mt.renderBatch++;var o=a.uv,h=a.bitmap._width,l=a.bitmap._height;n?(this.save(),this.transform(n.a,n.b,n.c,n.d,n.tx+t,n.ty+e),this.drawImage(a.bitmap._source,o[0]*h,o[1]*l,(o[2]-o[0])*h,(o[5]-o[3])*l,r[1]-i,r[2]-s,r[3],r[4]),this.restore()):this.drawImage(a.bitmap._source,o[0]*h,o[1]*l,(o[2]-o[0])*h,(o[5]-o[3])*l,r[1]-i+t,r[2]-s+e,r[3],r[4])},t.fillTexture=function(t,e,i,s,n,r,a,o){if(!o.pat){if(t.uv!=Ut.DEF_UV){var h=new qt;h.getContext("2d"),h.size(t.width,t.height),h.context.drawTexture(t,0,0,t.width,t.height),t=new Ut(h)}o.pat=this.createPattern(t.bitmap._source,r)}var l=e,c=i,u=0,_=0;a&&(l+=a.x%t.width,c+=a.y%t.height,u-=a.x%t.width,_-=a.y%t.height),this.translate(l,c),this._drawRect(u,_,s,n,o.pat),this.translate(-l,-c)},t.flush=function(){return 0},t.destroy=function(){this.canvas.width=this.canvas.height=0},t.clear=function(){Tt.isConchApp||this.clearRect(0,0,Tt._mainCanvas.width,Tt._mainCanvas.height)},t.drawTriangle=function(t,e,i,s,n,r,a,o){var h=t.bitmap,l=h._getSource(),c=t.width,u=t.height,_=h.width,d=h.height,f=i[s]*_,p=i[n]*_,g=i[r]*_,m=i[s+1]*d,v=i[n+1]*d,y=i[r+1]*d,C=e[s],S=e[n],w=e[r],x=e[s+1],T=e[n+1],M=e[r+1];if(o){var b=(C+S+w)/3,L=(x+T+M)/3,I=C-b,R=x-L,P=Math.sqrt(I*I+R*R);C=b+I/P*(P+1),x=L+R/P*(P+1),R=T-L,S=b+(I=S-b)/(P=Math.sqrt(I*I+R*R))*(P+1),T=L+R/P*(P+1),R=M-L,w=b+(I=w-b)/(P=Math.sqrt(I*I+R*R))*(P+1),M=L+R/P*(P+1)}this.save(),a&&this.transform(a.a,a.b,a.c,a.d,a.tx,a.ty),this.beginPath(),this.moveTo(C,x),this.lineTo(S,T),this.lineTo(w,M),this.closePath(),this.clip();var D=1/(f*v+m*g+p*y-v*g-m*p-f*y),B=C*v+m*w+S*y-v*w-m*S-C*y,A=f*S+C*g+p*w-S*g-C*p-f*w,E=f*v*w+m*S*g+C*p*y-C*v*g-m*p*w-f*S*y,F=x*v+m*M+T*y-v*M-m*T-x*y,k=f*T+x*g+p*M-T*g-x*p-f*M,O=f*v*M+m*T*g+x*p*y-x*v*g-m*p*M-f*T*y;this.transform(B*D,F*D,A*D,k*D,E*D,O*D),this.drawImage(l,t.uv[0]*_,t.uv[1]*d,c,u,t.uv[0]*_,t.uv[1]*d,c,u),this.restore()},t.transformByMatrix=function(t,e,i){this.transform(t.a,t.b,t.c,t.d,t.tx+e,t.ty+i)},t.saveTransform=function(t){this.save()},t.restoreTransform=function(t){this.restore()},t.drawRect=function(t,e,i,s,n,r,a){null!=n&&(this.fillStyle=n,this.fillRect(t,e,i,s)),null!=r&&(this.strokeStyle=r,this.lineWidth=a,this.strokeRect(t,e,i,s))},t.drawTexture=function(t,e,i,s,n){var r=t._getSource();if(r){Mt.renderBatch++;var a=t.uv,o=t.bitmap.width,h=t.bitmap.height;this.drawImage(r,a[0]*o,a[1]*h,(a[2]-a[0])*o,(a[5]-a[3])*h,e,i,s,n)}},t.drawTextures=function(t,e,i,s){Mt.renderBatch+=e.length/2;for(var n=t.width,r=t.height,a=0,o=e.length;a0&&(this.strokeStyle=e,this.lineWidth=i,this.stroke())},t._drawCircle=function(t,e,i,s,n,r,a){Mt.renderBatch++,Tt.isWebGL?this.beginPath(!0):this.beginPath(),this.arc(t,e,i,0,Context.PI2),this.closePath(),this._fillAndStroke(s,n,r)},t._drawPie=function(t,e,i,s,n,r,a,o,h){this.beginPath(),this.moveTo(t,e),this.arc(t,e,i,s,n),this.closePath(),this._fillAndStroke(r,a,o)},t._drawPoly=function(t,e,i,s,n,r,a,o){var h=2,l=i.length;if(this.beginPath(),Tt.isWebGL)this.setPathId(o),this.addPath(i.slice(),!0,a,t,e);else for(this.moveTo(t+i[0],e+i[1]);h0&&null==i.props.hitTestPrior&&!t.mouseThrough&&(t.hitTestPrior=!0),s.beginLoad(t),t},SceneUtils.createInitTool=function(){return e.create()},SceneUtils.createComp=function(t,e,s,n,r){if("Scene3D"==t.type||"Sprite3D"==t.type){var a=[],o=i.Utils3D._createSceneByJsonForMaker(t,a,r);return"Sprite3D"==t.type?i.StaticBatchManager.combine(o,a):i.StaticBatchManager.combine(null,a),o}if(!(e=e||SceneUtils.getCompInstance(t)))return t.props&&t.props.runtime?console.warn("runtime not found:"+t.props.runtime):console.warn("can not create:"+t.type),null;var h=t.child;if(h)for(var l="List"==e._$componentType,c=0,u=h.length;c=0||m.indexOf("@Prefab:")>=0)?r&&r.addNodeRef(e,g,m):SceneUtils.setCompValue(e,g,m,s,n)}return e._afterInited&&e._afterInited(),t.compId&&r&&r._idMap&&(r._idMap[t.compId]=e),e},SceneUtils.setCompValue=function(e,i,s,n,r){if("string"==typeof s&&s.indexOf("${")>-1){if(SceneUtils._sheet||(SceneUtils._sheet=ft.getClass("laya.data.Table")),!SceneUtils._sheet)return void console.warn("Can not find class Sheet");if(r)r.push(e,i,s);else if(n){-1==s.indexOf("].")&&(s=s.replace(".","[0]."));var a,o,h=new t(e,i,s);h.exe(n);for(var l=s.replace(/\[.*?\]\./g,".");null!=(a=SceneUtils._parseWatchData.exec(l));){for(var c=a[1];null!=(o=SceneUtils._parseKeyWord.exec(c));){var u=o[0],_=n._watchMap[u]||(n._watchMap[u]=[]);_.push(h),SceneUtils._sheet.I.notifer.on(u,n,n.changeData,[u])}(_=n._watchMap[c]||(n._watchMap[c]=[])).push(h),SceneUtils._sheet.I.notifer.on(c,n,n.changeData,[c])}}}else"var"===i&&n?n[s]=e:e[i]="true"===s||"false"!==s&&s},SceneUtils.getCompInstance=function(t){if("UIView"==t.type&&t.props&&t.props.pageData)return SceneUtils.createByData(null,t.props.pageData);var e=t.props&&t.props.runtime||t.type,i=ft.getClass(e);if(!i)throw"Can not find class "+e;if("Script"===t.type&&i.prototype._doAwake){var s=y.createByClass(i);return s._destroyed=!1,s}return t.props&&t.props.hasOwnProperty("renderType")&&"instance"==t.props.renderType?(i.instance||(i.instance=new i),i.instance):new i},SceneUtils._sheet=null,s(SceneUtils,["_funMap",function(){return this._funMap=new ut},"_parseWatchData",function(){return this._parseWatchData=/\${(.*?)}/g},"_parseKeyWord",function(){return this._parseKeyWord=/[a-zA-Z_][a-zA-Z0-9_]*(?:(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+)/g}]),SceneUtils.__init$=function(){t=function(){function DataWatcher(t,e,i){this.comp=null,this.prop=null,this.value=null,this.comp=t,this.prop=e,this.value=i}return n(DataWatcher,""),DataWatcher.prototype.exe=function(t){var e=SceneUtils.getBindFun(this.value);this.comp[this.prop]=e.call(this,t)},DataWatcher}(),e=function(){function InitTool(){this._nodeRefList=null,this._initList=null,this._loadList=null,this._idMap=null,this._scene=null}n(InitTool,"");var t=InitTool.prototype;return t.reset=function(){this._nodeRefList=null,this._initList=null,this._idMap=null,this._loadList=null,this._scene=null},t.recover=function(){this.reset(),y.recover("InitTool",this)},t.addLoadRes=function(t,e){this._loadList||(this._loadList=[]),e?this._loadList.push({url:t,type:e}):this._loadList.push(t)},t.addNodeRef=function(t,e,i){this._nodeRefList||(this._nodeRefList=[]),this._nodeRefList.push([t,e,i]),i.indexOf("@Prefab:")>=0&&this.addLoadRes(i.replace("@Prefab:",""),"prefab")},t.setNodeRef=function(){if(this._nodeRefList)if(this._idMap){var t,e,i=0;for(t=this._nodeRefList.length,i=0;i=0)return kt.getRes(t.replace("@Prefab:",""));if(t.indexOf("@arr:")>=0){var e,i,s,n=0;for(i=(e=(t=t.replace("@arr:","")).split(",")).length,n=0;n0&&n0&&n0&&n=Math.max(o,l)))(s.y-o)*(h-a)/(l-o)+a>s.x&&r++}return r%2==1},HitArea._cmds=[],s(HitArea,["_rect",function(){return this._rect=new mt},"_ptPoint",function(){return this._ptPoint=new it}]),HitArea}(),lt=function(){function AtlasInfoManager(){}return n(AtlasInfoManager,"laya.net.AtlasInfoManager"),AtlasInfoManager.enable=function(t,e){i.loader.load(t,l.create(null,AtlasInfoManager._onInfoLoaded,[e]),null,"json")},AtlasInfoManager._onInfoLoaded=function(t,e){var i,s,n,r=0,a=0;for(i in e)for(s=(n=e[i])[0],a=(n=n[1]).length,r=0;r-1&&t[s]._zOrder>r;)t[s+1]=t[s];t[s+1]=e,i++}return!0},Utils.transPointList=function(t,e,i){var s=0,n=t.length;for(s=0;s1?e[1].toLowerCase():null},Utils.getTransformRelativeToWindow=function(t,e,s){var n=i.stage,r=laya.utils.Utils.getGlobalPosAndScale(t),a=n._canvasTransform.clone(),o=a.tx,h=a.ty;a.rotate(-Math.PI/180*i.stage.canvasDegree),a.scale(i.stage.clientScaleX,i.stage.clientScaleY);var l=i.stage.canvasDegree%180!=0,c=NaN,u=NaN;l?(c=s+r.y,u=e+r.x,c*=a.d,u*=a.a,90==i.stage.canvasDegree?(c=o-c,u+=h):(c+=o,u=h-u)):(c=e+r.x,u=s+r.y,c*=a.a,u*=a.d,c+=o,u+=h),u+=i.stage._safariOffsetY;var _=NaN,d=NaN;return l?(_=a.d*r.height,d=a.a*r.width):(_=a.a*r.width,d=a.d*r.height),{x:c,y:u,scaleX:_,scaleY:d}},Utils.fitDOMElementInArea=function(t,e,s,n,r,a){t._fitLayaAirInitialized||(t._fitLayaAirInitialized=!0,t.style.transformOrigin=t.style.webKittransformOrigin="left top",t.style.position="absolute");var o=Utils.getTransformRelativeToWindow(e,s,n);t.style.transform=t.style.webkitTransform="scale("+o.scaleX+","+o.scaleY+") rotate("+i.stage.canvasDegree+"deg)",t.style.width=r+"px",t.style.height=a+"px",t.style.left=o.x+"px",t.style.top=o.y+"px"},Utils.isOkTextureList=function(t){if(!t)return!1;var e,i=0,s=t.length;for(i=0;i\s+<"),(e=(new DOMParser).parseFromString(t,"text/xml")).firstChild.textContent.indexOf("This page contains the following errors")>-1)throw new Error(e.firstChild.firstChild.textContent);return e},Utils}()),ft=function(){function ClassUtils(){}return n(ClassUtils,"laya.utils.ClassUtils"),ClassUtils.regClass=function(t,e){ClassUtils._classMap[t]=e},ClassUtils.regShortClassName=function(t){for(var e=0;e0?t:5),s=0;s<=1;s+=i)this._calFun(s,e)},t.getBezierPoints=function(t,e,i){void 0===e&&(e=5),void 0===i&&(i=2);var s,n=0;if((s=t.length)<2*(i+1))return[];var r=[];switch(i){case 2:this._calFun=this.getPoint2;break;case 3:this._calFun=this.getPoint3;break;default:return[]}for(;this._controlPoints.length<=i;)this._controlPoints.push(it.create());for(n=0;n<2*i;n+=2)this._switchPoint(t[n],t[n+1]);for(n=2*i;n=this.x&&t=this.y&&ethis.x+this.width||t.x+t.widththis.y+this.height||t.y+t.heightt&&(this.width+=this.x-t,this.x=t),this.y>e&&(this.height+=this.y-e,this.y=e),this.widthh.x?n:h.x,a=a>h.y?a:h.y;return e.setTo(s,r,n-s,a-r)},Rectangle.EMPTY=new Rectangle,Rectangle.TEMP=new Rectangle,Rectangle._temB=[],Rectangle._temA=[],Rectangle}(),vt=function(){function GraphicsBounds(){this._cacheBoundsType=!1}n(GraphicsBounds,"laya.display.GraphicsBounds");var t=GraphicsBounds.prototype;return t.destroy=function(){this._graphics=null,this._cacheBoundsType=!1,this._temp&&(this._temp.length=0),this._rstBoundPoints&&(this._rstBoundPoints.length=0),this._bounds&&this._bounds.recover(),this._bounds=null,y.recover("GraphicsBounds",this)},t.reset=function(){this._temp&&(this._temp.length=0)},t.getBounds=function(t){return void 0===t&&(t=!1),(!this._bounds||!this._temp||this._temp.length<1||t!=this._cacheBoundsType)&&(this._bounds=mt._getWrapRec(this.getBoundPoints(t),this._bounds)),this._cacheBoundsType=t,this._bounds},t.getBoundPoints=function(t){return void 0===t&&(t=!1),(!this._temp||this._temp.length<1||t!=this._cacheBoundsType)&&(this._temp=this._getCmdPoints(t)),this._cacheBoundsType=t,this._rstBoundPoints=dt.copyArray(this._rstBoundPoints,this._temp)},t._getCmdPoints=function(t){void 0===t&&(t=!1);Tt._context;var e,i=this._graphics.cmds;if((e=this._temp||(this._temp=[])).length=0,i||null==this._graphics._one||(GraphicsBounds._tempCmds.length=0,GraphicsBounds._tempCmds.push(this._graphics._one),i=GraphicsBounds._tempCmds),!i)return e;var s=GraphicsBounds._tempMatrixArrays;s.length=0;var n=GraphicsBounds._initMatrix;n.identity();for(var r,a,o=GraphicsBounds._tempMatrix,h=0,l=i.length;h0?a.offsetX:0,p=a.offsetY>0?a.offsetY:0;f*=c,p*=u,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x-f,r.y-p,_,d),n)}break;case"FillTexture":r.width&&r.height?GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x,r.y,r.width,r.height),n):(a=r.texture,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x,r.y,a.width,a.height),n));break;case"DrawTexture":var g;r.matrix?(n.copyTo(o),o.concat(r.matrix),g=o):g=n,t?r.width&&r.height?GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x,r.y,r.width,r.height),g):(a=r.texture,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x,r.y,a.width,a.height),g)):(a=r.texture,c=(r.width||a.sourceWidth)/a.width,u=(r.height||a.sourceHeight)/a.height,_=c*a.sourceWidth,d=u*a.sourceHeight,f=a.offsetX>0?a.offsetX:0,p=a.offsetY>0?a.offsetY:0,f*=c,p*=u,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x-f,r.y-p,_,d),g));break;case"DrawRect":GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x,r.y,r.width,r.height),n);break;case"DrawCircle":GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(r.x-r.radius,r.y-r.radius,r.radius+r.radius,r.radius+r.radius),n);break;case"DrawLine":GraphicsBounds._tempPoints.length=0;var m;m=.5*r.lineWidth,r.fromX==r.toX?GraphicsBounds._tempPoints.push(r.fromX+m,r.fromY,r.toX+m,r.toY,r.fromX-m,r.fromY,r.toX-m,r.toY):r.fromY==r.toY?GraphicsBounds._tempPoints.push(r.fromX,r.fromY+m,r.toX,r.toY+m,r.fromX,r.fromY-m,r.toX,r.toY-m):GraphicsBounds._tempPoints.push(r.fromX,r.fromY,r.toX,r.toY),GraphicsBounds._addPointArrToRst(e,GraphicsBounds._tempPoints,n);break;case"DrawCurves":GraphicsBounds._addPointArrToRst(e,pt.I.getBezierPoints(r.points),n,r.x,r.y);break;case"DrawLines":case"DrawPoly":GraphicsBounds._addPointArrToRst(e,r.points,n,r.x,r.y);break;case"DrawPath":GraphicsBounds._addPointArrToRst(e,this._getPathPoints(r.paths),n,r.x,r.y);break;case"DrawPie":GraphicsBounds._addPointArrToRst(e,this._getPiePoints(r.x,r.y,r.radius,r.startAngle,r.endAngle),n)}return e.length>200?e=dt.copyArray(e,mt._getWrapRec(e)._getBoundPoints()):e.length>8&&(e=$.scanPList(e)),e},t._switchMatrix=function(t,e){e.concat(t),e.copyTo(t)},t._getPiePoints=function(t,e,i,s,n){var r=GraphicsBounds._tempPoints;GraphicsBounds._tempPoints.length=0,r.push(t,e);var a=Math.PI/10,o=NaN;for(o=s;o1&&(n.push(i[1],i[2]),i.length>3&&n.push(i[3],i[4]));return n},GraphicsBounds.create=function(){return y.getItemByClass("GraphicsBounds",GraphicsBounds)},GraphicsBounds._addPointArrToRst=function(t,e,i,s,n){void 0===s&&(s=0),void 0===n&&(n=0);var r,a=0;for(r=e.length,a=0;a0&&(CacheManger._index++,CacheManger._index=CacheManger._index%e,t[CacheManger._index].tryDispose(!1),!(P.now()-i>CacheManger.loopTimeLimit));)s--}},CacheManger.loopTimeLimit=2,CacheManger._cacheList=[],CacheManger._index=0,CacheManger}(),Ct=function(){function MiniImage(){}return n(MiniImage,"laya.tt.mini.MiniImage"),MiniImage.prototype._loadImage=function(t){if(b.isZiYu)MiniImage.onCreateImage(v.formatURL(t),this,!0);else{var e=!1;if(U.isLocalNativeFile(t)){if(-1!=t.indexOf("http://")||-1!=t.indexOf("https://"))if(""!=U.loadPath)t=t.split(U.loadPath)[1];else{var i=""!=v.rootPath?v.rootPath:v.basePath,s=t;""!=i&&(t=t.split(i)[1]),t||(t=s)}if(b.subNativeFiles&&0==b.subNativeheads.length)for(var n in b.subNativeFiles){var r=b.subNativeFiles[n];b.subNativeheads=b.subNativeheads.concat(r);for(var a=0;a0||!r.graphics._isOnlyOne())&&(r.cacheAs="bitmap"),r.render(e,i-t._style.pivotX,s-t._style.pivotY)),e.globalCompositeOperation="source-over"},t._texture=function(t,e,i,s){var n=t.texture;n._getSource()&&e.drawTexture(n,i-t.pivotX+n.offsetX,s-t.pivotY+n.offsetY,t._width||n.width,t._height||n.height);var r=this._next;r._fun.call(r,t,e,i,s)},t._graphics=function(t,e,i,s){t._graphics&&t._graphics._render(t,e,i-t.pivotX,s-t.pivotY);var n=this._next;n._fun.call(n,t,e,i,s)},t._image=function(t,e,i,s){var n=t._style;e.drawTexture2(i,s,n.pivotX,n.pivotY,t.transform,t._graphics._one)},t._image2=function(t,e,i,s){var n=t._style;e.drawTexture2(i,s,n.pivotX,n.pivotY,t.transform,t._graphics._one)},t._alpha=function(t,e,i,s){var n;if((n=t._style.alpha)>.01||t._needRepaint()){var r=e.globalAlpha;e.globalAlpha*=n;var a=this._next;a._fun.call(a,t,e,i,s),e.globalAlpha=r}},t._transform=function(t,e,i,s){var n=t.transform,r=this._next;t._style;n&&r!=RenderSprite.NORENDER?(e.save(),e.transform(n.a,n.b,n.c,n.d,n.tx+i,n.ty+s),r._fun.call(r,t,e,0,0),e.restore()):r._fun.call(r,t,e,i,s)},t._children=function(t,e,i,s){var n,r=t._style,a=t._children,o=a.length;i-=t.pivotX,s-=t.pivotY;var h=t._getBit(256)&&e.drawCallOptimize(!0);if(r.viewport){var l=r.viewport,c=l.x,u=l.y,_=l.right,d=l.bottom,f=NaN,p=NaN;for(g=0;gc&&(p=n._y)u&&n.render(e,i,s)}else for(var g=0;g2048||l>2048))return console.warn("cache bitmap size larger than 2048,cache ignored"),d.releaseContext(),void f._fun.call(f,t,e,i,s);if(p||(d.createContext(),p=d.canvas),(n=p.context).sprite=t,(p.width!=h||p.height!=l)&&p.size(h,l),"bitmap"===g?n.asBitmap=!0:"normal"===g&&(n.asBitmap=!1),n.clear(),1!=c||1!=u){var m=n;m.save(),m.scale(c,u),f._fun.call(f,t,n,-r,-a),m.restore(),t._applyFilters()}else m=n,f._fun.call(f,t,n,-r,-a),t._applyFilters();d.staticCache&&(d.reCache=!1),Mt.canvasReCache++},t._canvas_webgl_normal_repaint=function(t,e){var s=t._cacheStyle,n=this._next,r=s.canvas,a=s.cacheAs;s._calculateCacheRect(t,a,0,0);r||(r=s.canvas=new i.WebGLCacheAsNormalCanvas(e,t));var o=r.context;r.startRec(),n._fun.call(n,t,o,t.pivotX,t.pivotY),t._applyFilters(),Mt.canvasReCache++,r.endRec()},RenderSprite.__init__=function(){a.__init__();var t,e,i=0;for(e=I.createRenderSprite(69905,null),t=RenderSprite.renders.length=16384,i=0;i0;)i&t&&(e=I.createRenderSprite(i,e)),i>>=1;return e},RenderSprite.INIT=69905,RenderSprite.renders=[],RenderSprite.NORENDER=new RenderSprite(0,null),RenderSprite}(),wt=function(){function FillWordsCmd(){}n(FillWordsCmd,"laya.display.cmd.FillWordsCmd");var t=FillWordsCmd.prototype;return t.recover=function(){this.words=null,y.recover("FillWordsCmd",this)},t.run=function(t,e,i){t.fillWords(this.words,this.x+e,this.y+i,this.font,this.color)},r(0,t,"cmdID",function(){return"FillWords"}),FillWordsCmd.create=function(t,e,i,s,n){var r=y.getItemByClass("FillWordsCmd",FillWordsCmd);return r.words=t,r.x=e,r.y=i,r.font=s,r.color=n,r},FillWordsCmd.ID="FillWords",FillWordsCmd}(),xt=function(){function TransformCmd(){}n(TransformCmd,"laya.display.cmd.TransformCmd");var t=TransformCmd.prototype;return t.recover=function(){this.matrix=null,y.recover("TransformCmd",this)},t.run=function(t,e,i){t._transform(this.matrix,this.pivotX+e,this.pivotY+i)},r(0,t,"cmdID",function(){return"Transform"}),TransformCmd.create=function(t,e,i){var s=y.getItemByClass("TransformCmd",TransformCmd);return s.matrix=t,s.pivotX=e,s.pivotY=i,s},TransformCmd.ID="Transform",TransformCmd}(),Tt=(function(){function DrawCanvasCmd(){this._graphicsCmdEncoder=null,this._index=0,this._paramData=null,this.texture=null,this.x=NaN,this.y=NaN,this.width=NaN,this.height=NaN}n(DrawCanvasCmd,"laya.display.cmd.DrawCanvasCmd");var t=DrawCanvasCmd.prototype;t.recover=function(){this._graphicsCmdEncoder=null,y.recover("DrawCanvasCmd",this)},r(0,t,"cmdID",function(){return"DrawCanvasCmd"}),DrawCanvasCmd.create=function(t,e,i,s,n){return null},DrawCanvasCmd.ID="DrawCanvasCmd",DrawCanvasCmd._DRAW_IMAGE_CMD_ENCODER_=null,DrawCanvasCmd._PARAM_TEXTURE_POS_=2,DrawCanvasCmd._PARAM_VB_POS_=5}(),function(){function Render(t,e){this._timeId=0,Render._mainCanvas.source.id="layaCanvas",Render._mainCanvas.source.width=t,Render._mainCanvas.source.height=e,laya.renders.Render.isConchApp?P.document.body.appendChild(Render._mainCanvas.source):P.container.appendChild(Render._mainCanvas.source),I.initRender(Render._mainCanvas,t,e),P.window.requestAnimationFrame(function loop(t){i.stage._loop();P.window.requestAnimationFrame(loop)}),i.stage.on("visibilitychange",this,this._onVisibilitychange)}n(Render,"laya.renders.Render");var e=Render.prototype;return e._onVisibilitychange=function(){i.stage.isVisibility?0!=this._timeId&&P.window.clearInterval(this._timeId):this._timeId=P.window.setInterval(this._enterFrame,1e3)},e._enterFrame=function(t){i.stage._loop()},r(1,Render,"context",function(){return Render._context}),r(1,Render,"canvas",function(){return Render._mainCanvas.source}),Render._context=null,Render._mainCanvas=null,Render.isWebGL=!1,Render.is3DMode=!1,s(Render,["isConchApp",function(){return this.isConchApp=null!=t.conch}]),Render}()),Mt=function(){function Stat(){}return n(Stat,"laya.utils.Stat"),r(1,Stat,"onclick",null,function(t){Stat._sp&&Stat._sp.on("click",Stat._sp,t),Stat._canvas&&(Stat._canvas.source.onclick=t,Stat._canvas.source.style.pointerEvents="")}),Stat.show=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),P.onMiniGame||P.onLimixiu||(Stat._useCanvas=!0),Stat._show=!0,Stat._fpsData.length=60,Tt.isConchApp?Stat._view[0]={title:"FPS",value:"_fpsStr",color:"yellow",units:"int"}:Stat._view[0]={title:"FPS(Canvas)",value:"_fpsStr",color:"yellow",units:"int"},Stat._view[1]={title:"Sprite",value:"_spriteStr",color:"white",units:"int"},Stat._view[2]={title:"RenderBatch",value:"renderBatch",color:"white",units:"int"},Stat._view[3]={title:"CPUMemory",value:"cpuMemory",color:"yellow",units:"M"},Stat._view[4]={title:"GPUMemory",value:"gpuMemory",color:"yellow",units:"M"},Tt.isWebGL&&(Stat._view[5]={title:"Shader",value:"shaderCall",color:"white",units:"int"},Tt.is3DMode?(Stat._view[0].title="FPS(3D)",Stat._view[6]={title:"TriFaces",value:"trianglesFaces",color:"white",units:"int"}):(Stat._view[0].title="FPS(WebGL)",Stat._view[6]={title:"Canvas",value:"_canvasStr",color:"white",units:"int"})),Stat._useCanvas?Stat.createUIPre(t,e):Stat.createUI(t,e),Stat.enable()},Stat.createUIPre=function(t,e){var s=P.pixelRatio;Stat._width=130*s,Stat._vx=75*s,Stat._height=s*(12*Stat._view.length+3*s)+4,Stat._fontSize=12*s;for(var n=0;n0?Math.floor(1e3/Stat.FPS).toString():" ";Stat._fpsStr=Stat.FPS+(Stat.renderSlow?" slow":"")+" "+i,Stat._spriteStr=Stat.spriteCount+(Stat.spriteRenderUseCacheCount?"/"+Stat.spriteRenderUseCacheCount:""),Stat._canvasStr=Stat.canvasReCache+"/"+Stat.canvasNormal+"/"+Stat.canvasBitmap,Stat.cpuMemory=Et.cpuMemory,Stat.gpuMemory=Et.gpuMemory,Stat._useCanvas?Stat.renderInfoPre():Stat.renderInfo(),Stat.clear()}Stat._count=0,Stat._timer=t}},Stat.renderInfoPre=function(){var t,e,i=0;if(Tt.isConchApp)for(Stat._sp.graphics.clear(),i=0;i1||Math.abs(r*i.stage._canvasTransform.getScaleY())>1))return;this._clickOnly=!1,this._offsets||(this._offsets=[]),this._offsets.length=0,this.target.event("dragstart",this.data),S.instance.disableMouseEvent=this._disableMouseEvent}else this._offsets.push(n,r);0===n&&0===r||(this._lastX=e,this._lastY=s,this.target.x+=n*this._elasticRateX,this.target.y+=r*this._elasticRateY,this.area&&this.checkArea(),this.target.event("dragmove",this.data))},t.checkArea=function(){if(this.elasticDistance<=0)this.backToArea();else{if(this.target._xthis.area.x+this.area.width?this.target._x-this.area.x-this.area.width:0;if(this._elasticRateX=Math.max(0,1-t/this.elasticDistance),this.target._ythis.area.y+this.area.height?this.target._y-this.area.y-this.area.height:0;this._elasticRateY=Math.max(0,1-e/this.elasticDistance)}},t.backToArea=function(){this.target.x=Math.min(Math.max(this.target._x,this.area.x),this.area.x+this.area.width),this.target.y=Math.min(Math.max(this.target._y,this.area.y),this.area.y+this.area.height)},t.onStageMouseUp=function(t){if(S.instance.disableMouseEvent=!1,i.stage.off("mouseup",this,this.onStageMouseUp),i.stage.off("mouseout",this,this.onStageMouseUp),i.systemTimer.clear(this,this.loop),!this._clickOnly&&this.target)if(this.hasInertia){this._offsets.length<1&&this._offsets.push(this._parent.mouseX-this._lastX,this._parent.mouseY-this._lastY),this._offsetX=this._offsetY=0;for(var e=this._offsets.length,s=Math.min(e,6),n=this._offsets.length-s,r=e-1;r>n;r--)this._offsetY+=this._offsets[r--],this._offsetX+=this._offsets[r];this._offsetX=this._offsetX/s*2,this._offsetY=this._offsetY/s*2,Math.abs(this._offsetX)>this.maxOffset&&(this._offsetX=this._offsetX>0?this.maxOffset:-this.maxOffset),Math.abs(this._offsetY)>this.maxOffset&&(this._offsetY=this._offsetY>0?this.maxOffset:-this.maxOffset),i.systemTimer.frameLoop(1,this,this.tweenMove)}else this.elasticDistance>0?this.checkElastic():this.clear()},t.checkElastic=function(){var t=NaN,e=NaN;if(this.target.xthis.area.x+this.area.width&&(t=this.area.x+this.area.width),this.target.ythis.area.y+this.area.height&&(e=this.area.y+this.area.height),isNaN(t)&&isNaN(e))this.clear();else{var i={};isNaN(t)||(i.x=t),isNaN(e)||(i.y=e),this._tween=R.to(this.target,i,this.elasticBackTime,ot.sineOut,l.create(this,this.clear),0,!1,!1)}},t.tweenMove=function(){this._offsetX*=this.ratio*this._elasticRateX,this._offsetY*=this.ratio*this._elasticRateY,this.target.x+=this._offsetX,this.target.y+=this._offsetY,this.area&&this.checkArea(),this.target.event("dragmove",this.data),(Math.abs(this._offsetX)<1&&Math.abs(this._offsetY)<1||this._elasticRateX<.5||this._elasticRateY<.5)&&(i.systemTimer.clear(this,this.tweenMove),this.elasticDistance>0?this.checkElastic():this.clear())},t.clear=function(){if(this.target){this.clearTimer();var t=this.target;this.target=null,this._parent=null,t.event("dragend",this.data)}},Dragging}(),Rt=function(){function DrawTrianglesCmd(){}n(DrawTrianglesCmd,"laya.display.cmd.DrawTrianglesCmd");var t=DrawTrianglesCmd.prototype;return t.recover=function(){this.texture=null,this.vertices=null,this.uvs=null,this.indices=null,this.matrix=null,y.recover("DrawTrianglesCmd",this)},t.run=function(t,e,i){t.drawTriangles(this.texture,this.x+e,this.y+i,this.vertices,this.uvs,this.indices,this.matrix,this.alpha,this.color,this.blendMode)},r(0,t,"cmdID",function(){return"DrawTriangles"}),DrawTrianglesCmd.create=function(t,e,i,s,n,r,a,h,l,c){var u=y.getItemByClass("DrawTrianglesCmd",DrawTrianglesCmd);if(u.texture=t,u.x=e,u.y=i,u.vertices=s,u.uvs=n,u.indices=r,u.matrix=a,u.alpha=h,l){u.color=new Pt;var _=o.create(l).arrColor;u.color.color(255*_[0],255*_[1],255*_[2],255*_[3])}return u.blendMode=c,u},DrawTrianglesCmd.ID="DrawTriangles",DrawTrianglesCmd}(),Pt=function(t){function ColorFilter(t){ColorFilter.__super.call(this),t||(t=this._copyMatrix(ColorFilter.IDENTITY_MATRIX)),this._mat=new Float32Array(16),this._alpha=new Float32Array(4),this.setByMatrix(t),this._action=new M,this._action.data=this}n(ColorFilter,"laya.filters.ColorFilter",c);var e=ColorFilter.prototype;return i.imps(e,{"laya.filters.IFilter":!0}),e.gray=function(){return this.setByMatrix(ColorFilter.GRAY_MATRIX)},e.color=function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),this.setByMatrix([1,0,0,0,t,0,1,0,0,e,0,0,1,0,i,0,0,0,1,s])},e.setColor=function(t){var e=o.create(t).arrColor,i=[0,0,0,0,256*e[0],0,0,0,0,256*e[1],0,0,0,0,256*e[2],0,0,0,1,0];return this.setByMatrix(i)},e.setByMatrix=function(t){this._matrix!=t&&this._copyMatrix(t);for(var e=0,i=0,s=0;s<20;s++)s%5!=4?this._mat[e++]=t[s]:this._alpha[i++]=t[s];return this},e.adjustColor=function(t,e,i,s){return this.adjustHue(s),this.adjustContrast(e),this.adjustBrightness(t),this.adjustSaturation(i),this},e.adjustBrightness=function(t){return 0==(t=this._clampValue(t,100))||isNaN(t)?this:this._multiplyMatrix([1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])},e.adjustContrast=function(t){if(0==(t=this._clampValue(t,100))||isNaN(t))return this;var e=NaN,i=(e=t<0?127+t/100*127:127*(e=0==(e=t%1)?ColorFilter.DELTA_INDEX[t]:ColorFilter.DELTA_INDEX[t<<0]*(1-e)+ColorFilter.DELTA_INDEX[1+(t<<0)]*e)+127)/127,s=.5*(127-e);return this._multiplyMatrix([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0,0,0,0,0,1])},e.adjustSaturation=function(t){if(0==(t=this._clampValue(t,100))||isNaN(t))return this;var e=1+(t>0?3*t/100:t/100),i=1-e,s=.3086*i,n=.6094*i,r=.082*i;return this._multiplyMatrix([s+e,n,r,0,0,s,n+e,r,0,0,s,n,r+e,0,0,0,0,0,1,0,0,0,0,0,1])},e.adjustHue=function(t){if(0==(t=this._clampValue(t,180)/180*Math.PI)||isNaN(t))return this;var e=Math.cos(t),i=Math.sin(t),s=.213,n=.715,r=.072;return this._multiplyMatrix([s+e*(1-s)+i*-s,n+e*-n+i*-n,r+e*-r+i*(1-r),0,0,s+e*-s+.143*i,n+e*(1-n)+.14*i,r+e*-r+-.283*i,0,0,s+e*-s+-.787*i,n+e*-n+i*n,r+e*(1-r)+i*r,0,0,0,0,0,1,0,0,0,0,0,1])},e.reset=function(){return this.setByMatrix(this._copyMatrix(ColorFilter.IDENTITY_MATRIX))},e._multiplyMatrix=function(t){var e=[];this._matrix=this._fixMatrix(this._matrix);for(var i=0;i<5;i++){for(var s=0;s<5;s++)e[s]=this._matrix[s+5*i];for(s=0;s<5;s++){for(var n=0,r=0;r<5;r++)n+=t[s+5*r]*e[r];this._matrix[s+5*i]=n}}return this.setByMatrix(this._matrix)},e._clampValue=function(t,e){return Math.min(e,Math.max(-e,t))},e._fixMatrix=function(t){return null==t?ColorFilter.IDENTITY_MATRIX:(t.length<25?t=t.slice(0,t.length).concat(ColorFilter.IDENTITY_MATRIX.slice(t.length,25)):t.length>25&&(t=t.slice(0,25)),t)},e._copyMatrix=function(t){this._matrix||(this._matrix=[]);for(var e=0;e<25;e++)this._matrix[e]=t[e];return this._matrix},r(0,e,"type",function(){return 32}),ColorFilter.LENGTH=25,s(ColorFilter,["DELTA_INDEX",function(){return this.DELTA_INDEX=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10]},"GRAY_MATRIX",function(){return this.GRAY_MATRIX=[.3086,.6094,.082,0,0,.3086,.6094,.082,0,0,.3086,.6094,.082,0,0,0,0,0,1,0]},"IDENTITY_MATRIX",function(){return this.IDENTITY_MATRIX=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}]),ColorFilter}(),Dt=function(t){function Widget(){Widget.__super.call(this),this._top=NaN,this._bottom=NaN,this._left=NaN,this._right=NaN,this._centerX=NaN,this._centerY=NaN}n(Widget,"laya.ui.Widget",_);var e=Widget.prototype;return e.onReset=function(){this._top=this._bottom=this._left=this._right=this._centerX=this._centerY=NaN},e._onEnable=function(){this.owner.parent?this._onAdded():this.owner.once("added",this,this._onAdded)},e._onDisable=function(){this.owner.off("added",this,this._onAdded),this.owner.parent&&this.owner.parent.off("resize",this,this._onParentResize)},e._onAdded=function(){this.owner.parent&&this.owner.parent.on("resize",this,this._onParentResize),this.resetLayoutX(),this.resetLayoutY()},e._onParentResize=function(){(this.resetLayoutX()||this.resetLayoutY())&&this.owner.event("resize")},e.resetLayoutX=function(){var t=this.owner;if(!t)return!1;var e=t.parent;if(e)if(isNaN(this.centerX)){if(isNaN(this.left))isNaN(this.right)||(t.x=Math.round(e.width-t.displayWidth-this.right+t.pivotX*t.scaleX));else if(t.x=Math.round(this.left+t.pivotX*t.scaleX),!isNaN(this.right)){var i=(e._width-this.left-this.right)/(t.scaleX||.01);if(i!=t.width)return t.width=i,!0}}else t.x=Math.round(.5*(e.width-t.displayWidth)+this.centerX+t.pivotX*t.scaleX);return!1},e.resetLayoutY=function(){var t=this.owner;if(!t)return!1;var e=t.parent;if(e)if(isNaN(this.centerY)){if(isNaN(this.top))isNaN(this.bottom)||(t.y=Math.round(e.height-t.displayHeight-this.bottom+t.pivotY*t.scaleY));else if(t.y=Math.round(this.top+t.pivotY*t.scaleY),!isNaN(this.bottom)){var i=(e._height-this.top-this.bottom)/(t.scaleY||.01);if(i!=t.height)return t.height=i,!0}}else t.y=Math.round(.5*(e.height-t.displayHeight)+this.centerY+t.pivotY*t.scaleY);return!1},e.resetLayout=function(){this.owner&&(this.resetLayoutX(),this.resetLayoutY())},r(0,e,"centerX",function(){return this._centerX},function(t){this._centerX!=t&&(this._centerX=t,this.resetLayoutX())}),r(0,e,"top",function(){return this._top},function(t){this._top!=t&&(this._top=t,this.resetLayoutY())}),r(0,e,"bottom",function(){return this._bottom},function(t){this._bottom!=t&&(this._bottom=t,this.resetLayoutY())}),r(0,e,"left",function(){return this._left},function(t){this._left!=t&&(this._left=t,this.resetLayoutX())}),r(0,e,"right",function(){return this._right},function(t){this._right!=t&&(this._right=t,this.resetLayoutX())}),r(0,e,"centerY",function(){return this._centerY},function(t){this._centerY!=t&&(this._centerY=t,this.resetLayoutY())}),s(Widget,["EMPTY",function(){return this.EMPTY=new Widget}]),Widget}(),Bt=function(t){function Node(){this._bits=0,this._parent=null,this.name="",this.destroyed=!1,this._conchData=null,this._components=null,this._activeChangeScripts=null,this._scene=null,Node.__super.call(this),this._children=Node.ARRAY_EMPTY,this._extUIChild=Node.ARRAY_EMPTY,this.createGLBuffer()}n(Node,"laya.display.Node",h);var e=Node.prototype;return e.createGLBuffer=function(){},e._setBit=function(t,e){16===t&&(this._getBit(t)!=e&&this._updateDisplayedInstage());e?this._bits|=t:this._bits&=~t},e._getBit=function(t){return 0!=(this._bits&t)},e._setUpNoticeChain=function(){this._getBit(16)&&this._setBitUp(16)},e._setBitUp=function(t){var e=this;for(e._setBit(t,!0),e=e._parent;e;){if(e._getBit(t))return;e._setBit(t,!0),e=e._parent}},e.on=function(t,e,i,s){return"display"!==t&&"undisplay"!==t||this._getBit(16)||this._setBitUp(16),this._createListener(t,e,i,s,!1)},e.once=function(t,e,i,s){return"display"!==t&&"undisplay"!==t||this._getBit(16)||this._setBitUp(16),this._createListener(t,e,i,s,!0)},e.destroy=function(t){void 0===t&&(t=!0),this.destroyed=!0,this._destroyAllComponent(),this._parent&&this._parent.removeChild(this),this._children&&(t?this.destroyChildren():this.removeChildren()),this.onDestroy(),this._children=null,this.offAll()},e.onDestroy=function(){},e.destroyChildren=function(){if(this._children)for(var t=0,e=this._children.length;t=0)return null;this._extUIChild.push(t)}return null},e.removeInputChild=function(t){var e=this._extUIChild.indexOf(t);e>=0&&this._extUIChild.splice(e,1)},e.addChildren=function(t){for(var e=arguments,i=0,s=e.length;i=0&&e<=this._children.length){if(t._parent===this){var i=this.getChildIndex(t);this._children.splice(i,1),this._children.splice(e,0,t),this._childChanged()}else t._parent&&t._parent.removeChild(t),this._children===Node.ARRAY_EMPTY&&(this._children=[]),this._children.splice(e,0,t),t._setParent(this);return t}throw new Error("appendChildAt:The index is out of bounds")},e.getChildIndex=function(t){return this._children.indexOf(t)},e.getChildByName=function(t){var e=this._children;if(e)for(var i=0,s=e.length;i=i.length)throw new Error("setChildIndex:The index is out of bounds.");var s=this.getChildIndex(t);if(s<0)throw new Error("setChildIndex:node is must child of this object.");return i.splice(s,1),i.splice(e,0,t),this._childChanged(),t},e._childChanged=function(t){},e.removeChild=function(t){if(!this._children)return t;var e=this._children.indexOf(t);return this.removeChildAt(e)},e.removeSelf=function(){return this._parent&&this._parent.removeChild(this),this},e.removeChildByName=function(t){var e=this.getChildByName(t);return e&&this.removeChild(e),e},e.removeChildAt=function(t){var e=this.getChildAt(t);return e&&(this._children.splice(t,1),e._setParent(null)),e},e.removeChildren=function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=2147483647),this._children&&this._children.length>0){var i=this._children;if(0===t&&e>=i.length-1){var s=i;this._children=Node.ARRAY_EMPTY}else s=i.splice(t,e-t);for(var n=0,r=s.length;n-1?(this._children.splice(i,1,t),e._setParent(null),t._setParent(this),t):null},e._setParent=function(t){this._parent!==t&&(t?(this._parent=t,this._onAdded(),this.event("added"),this._getBit(16)&&(this._setUpNoticeChain(),t.displayedInStage&&this._displayChild(this,!0)),t._childChanged(this)):(this._onRemoved(),this.event("removed"),this._parent._childChanged(),this._getBit(16)&&this._displayChild(this,!1),this._parent=t))},e._updateDisplayedInstage=function(){var t;t=this;for(var e=i.stage,s=!1;t;){if(t._getBit(16)){s=t._getBit(128);break}if(t===e||t._getBit(128)){s=!0;break}t=t._parent}this._setBit(128,s)},e._setDisplay=function(t){this._getBit(128)!==t&&(this._setBit(128,t),t?this.event("display"):this.event("undisplay"))},e._displayChild=function(t,e){var i=t._children;if(i)for(var s=0,n=i.length;s0?this._displayChild(r,e):r._setDisplay(e))}t._setDisplay(e)},e.contains=function(t){if(t===this)return!0;for(;t;){if(t._parent===this)return!0;t=t._parent}return!1},e.timerLoop=function(t,e,s,n,r,a){void 0===r&&(r=!0),void 0===a&&(a=!1),(this.scene?this.scene.timer:i.timer).loop(t,e,s,n,r,a)},e.timerOnce=function(t,e,s,n,r){void 0===r&&(r=!0),(this.scene?this.scene.timer:i.timer)._create(!1,!1,t,e,s,n,r)},e.frameLoop=function(t,e,s,n,r){void 0===r&&(r=!0),(this.scene?this.scene.timer:i.timer)._create(!0,!0,t,e,s,n,r)},e.frameOnce=function(t,e,s,n,r){void 0===r&&(r=!0),(this.scene?this.scene.timer:i.timer)._create(!0,!1,t,e,s,n,r)},e.clearTimer=function(t,e){(this.scene?this.scene.timer:i.timer).clear(t,e)},e.callLater=function(t,e){(this.scene?this.scene.timer:i.timer).callLater(this,t,e)},e.runCallLater=function(t){(this.scene?this.scene.timer:i.timer).runCallLater(this,t)},e._onActive=function(){},e._onInActive=function(){},e._onActiveInScene=function(){},e._onInActiveInScene=function(){},e._parse=function(t){},e._setBelongScene=function(t){if(!this._scene){if(this._scene=t,this._components)for(var e=0,i=this._components.length;e=this.maxLoader)){for(var t=0;t0;){var i=e.shift();if(i)return this._doLoad(i)}this._loaderCount||this.event("complete")}},r._doLoad=function(t){this._loaderCount++;var e=this._loaders.length?this._loaders.pop():new kt;e.on("complete",null,onLoaded),e.on("progress",null,function(e){t.event("progress",e)}),e.on("error",null,function(t){onLoaded(null)});var i=this;function onLoaded(s){e.offAll(),e._data=null,e._customParse=!1,i._loaders.push(e),i._endLoad(t,s instanceof Array?[s]:s),i._loaderCount--,i._next()}e._constructParams=t.createConstructParams,e._propertyParams=t.createPropertyParams,e._createCache=t.createCache,e.load(t.url,t.type,t.cache,t.group,t.ignoreCache,t.useWorkerLoader)},r._endLoad=function(t,e){var s=t.url;if(null==e){var n=this._failRes[s]||0;if(n-1;i--){var s=e[i];s&&(s.offAll(),this._infoPool.push(s))}e.length=0}this._loaderCount=0,LoaderManager._resMap={}},r.cancelLoadByUrls=function(t){if(t)for(var e=0,i=t.length;e-1;s--){var n=i[s];n&&n.url===t&&(i[s]=null,n.offAll(),this._infoPool.push(n))}LoaderManager._resMap[t]&&delete LoaderManager._resMap[t]},r._loadAssets=function(t,e,i,s,n,r,a){void 0===n&&(n=1),void 0===r&&(r=!0);for(var o=t.length,h=0,c=0,u=[],_=!0,d=0;d=0||kt.getRes(t)||(e?this._toLoadList.push({url:t}):this._toLoadList.push(t),this.totalCount++)},e._checkNext=function(){if(!this._isLoading){if(0==this._toLoadList.length)return void this.event("complete");var t;"string"==typeof(t=this._toLoadList.pop())?this.loadOne(t):this.loadOne(t.url,!0)}},e.loadOne=function(t,e){void 0===e&&(e=!1),this._curUrl=t;var s=dt.getFileExtension(this._curUrl);e?i.loader.create(t,this._completeHandler):SceneLoader.LoadableExtensions[s]?i.loader.load(t,this._completeHandler,null,SceneLoader.LoadableExtensions[s]):t!=lt.getFileLoadPath(t)||SceneLoader.No3dLoadTypes[s]||!At.createMap[s]?i.loader.load(t,this._completeHandler):i.loader.create(t,this._completeHandler)},e.onOneLoadComplete=function(){this._isLoading=!1,kt.getRes(this._curUrl)||console.log("Fail to load:",this._curUrl);var t,e=dt.getFileExtension(this._curUrl);SceneLoader.LoadableExtensions[e]&&((t=kt.getRes(this._curUrl))&&t instanceof laya.components.Prefab&&(t=t.json),t&&(t.loadList&&this.load(t.loadList,!1,!1),t.loadList3D&&this.load(t.loadList3D,!0,!1)));"sk"==e&&this.load(this._curUrl.replace(".sk",".png"),!1,!1),this.event("progress",this.getProgress()),this._checkNext()},e.getProgress=function(){return this.loadedCount/this.totalCount},r(0,e,"loadedCount",function(){return this.totalCount-this.leftCount}),r(0,e,"leftCount",function(){return this._isLoading?this._toLoadList.length+1:this._toLoadList.length}),s(SceneLoader,["LoadableExtensions",function(){return this.LoadableExtensions={scene:"json",scene3d:"json",ani:"json",ui:"json",prefab:"prefab"}},"No3dLoadTypes",function(){return this.No3dLoadTypes={png:!0,jpg:!0,txt:!0}}]),SceneLoader}(),kt=function(t){function Loader(){this._data=null,this._url=null,this._type=null,this._cache=!1,this._http=null,this._useWorkerLoader=!1,this._customParse=!1,this._constructParams=null,this._propertyParams=null,this._createCache=!1,Loader.__super.call(this)}n(Loader,"laya.net.Loader",h);var e=Loader.prototype;return e.load=function(t,e,i,s,n,r){if(void 0===i&&(i=!0),void 0===n&&(n=!1),void 0===r&&(r=!1),t){if(Loader.setGroup(t,"666"),this._url=t,0===t.indexOf("data:image")?e="image":t=v.formatURL(t),this._type=e||(e=Loader.getTypeFromUrl(this._url)),this._cache=i,this._useWorkerLoader=r,this._data=null,!n&&Loader.loadedMap[t])return this._data=Loader.loadedMap[t],this.event("progress",1),void this.event("complete",this._data);if(s&&Loader.setGroup(t,s),null!=Loader.parserMap[e])return this._customParse=!0,void(Loader.parserMap[e]instanceof laya.utils.Handler?Loader.parserMap[e].runWith(this):Loader.parserMap[e].call(null,this));if("image"===e||"htmlimage"===e||"nativeimage"===e)return this._loadImage(t);var a;switch(e){case"atlas":case"prefab":case"plf":a="json";break;case"font":a="xml";break;default:a=e}Loader.preLoadedMap[t]?this.onLoaded(Loader.preLoadedMap[t]):(this._http||(this._http=new Gt,this._http.on("progress",this,this.onProgress),this._http.on("error",this,this.onError),this._http.on("complete",this,this.onLoaded)),this._http.send(t,null,"get",a))}else this.onLoaded(null)},e._loadImage=function(t){t=v.formatURL(t);var e,i=this;function clear(){var i=e;i&&(i.onload=null,i.onerror=null,delete Loader._imgCache[t])}var s=function(){clear(),i.event("error","Load image failed")};if("nativeimage"===this._type){var n=function(){clear(),i.onLoaded(e)};(e=new P.window.Image).crossOrigin="",e.onload=n,e.onerror=s,e.src=t,Loader._imgCache[t]=e}else{var r=new P.window.Image;n=function(){(e=Kt.create(r.width,r.height)).loadImageSource(r,!0),e._setCreateURL(t),clear(),i.onLoaded(e)},r.crossOrigin="",r.onload=n,r.onerror=s,r.src=t,e=r,Loader._imgCache[t]=r}},e.onProgress=function(t){"atlas"===this._type?this.event("progress",.3*t):this.event("progress",t)},e.onError=function(t){this.event("error",t)},e.onLoaded=function(t){var e=this._type;if("plf"==e)this.parsePLFData(t),this.complete(t);else if("image"===e){var i=new Ut(t);i.url=this._url,this.complete(i)}else if("sound"===e||"htmlimage"===e||"nativeimage"===e)this.complete(t);else if("atlas"===e){if(!t.url&&!t._setContext){if(!this._data){if(this._data=t,t.meta&&t.meta.image)for(var s=t.meta.image.split(","),n=this._url.indexOf("/")>=0?"/":"\\",r=this._url.lastIndexOf(n),a=r>=0?this._url.substr(0,r+1):"",o=0,h=s.length;o0)return this.event("progress",.3+1/this._data.toLoads.length*.6),this._loadImage(this._data.toLoads.pop());var l=this._data.frames,c=this._url.split("?")[0],u=this._data.meta&&this._data.meta.prefix?this._data.meta.prefix:c.substring(0,c.lastIndexOf("."))+"/",_=this._data.pics,d=v.formatURL(this._url),f=Loader.atlasMap[d]||(Loader.atlasMap[d]=[]);f.dir=u;var p=1;if(this._data.meta&&this._data.meta.scale&&1!=this._data.meta.scale)for(var g in p=parseFloat(this._data.meta.scale),l){var m,y=l[g],C=_[y.frame.idx?y.frame.idx:0],S=v.formatURL(u+g);C.scaleRate=p,m=Ut._create(C,y.frame.x,y.frame.y,y.frame.w,y.frame.h,y.spriteSourceSize.x,y.spriteSourceSize.y,y.sourceSize.w,y.sourceSize.h,laya.net.Loader.getRes(S)),Loader.cacheRes(S,m),m.url=S,f.push(S)}else for(g in l)C=_[(y=l[g]).frame.idx?y.frame.idx:0],S=v.formatURL(u+g),m=Ut._create(C,y.frame.x,y.frame.y,y.frame.w,y.frame.h,y.spriteSourceSize.x,y.spriteSourceSize.y,y.sourceSize.w,y.sourceSize.h,laya.net.Loader.getRes(S)),Loader.cacheRes(S,m),m.url=S,f.push(S);delete this._data.pics,this.complete(this._data)}else if("font"===e){if(!t._source)return this._data=t,this.event("progress",.5),this._loadImage(this._url.replace(".fnt",".png"))}else if("prefab"===e){var w=new V;w.json=t,this.complete(w)}else this.complete(t)},e.parsePLFData=function(t){var e,i,s;for(e in t)switch(s=t[e],e){case"json":case"text":for(i in s)Loader.preLoadedMap[v.formatURL(i)]=s[i];break;default:for(i in s)Loader.preLoadedMap[v.formatURL(i)]=s[i]}},e.complete=function(t){this._data=t,this._customParse?this.event("loaded",t instanceof Array?[t]:t):(Loader._loaders.push(this),Loader._isWorking||Loader.checkNext())},e.endLoad=function(t){t&&(this._data=t),this._cache&&Loader.cacheRes(this._url,this._data),this.event("progress",1),this.event("complete",this.data instanceof Array?[this.data]:this.data)},r(0,e,"url",function(){return this._url}),r(0,e,"data",function(){return this._data}),r(0,e,"cache",function(){return this._cache}),r(0,e,"type",function(){return this._type}),Loader.getTypeFromUrl=function(t){var e=dt.getFileExtension(t);return e?Loader.typeMap[e]:(console.warn("Not recognize the resources suffix",t),"text")},Loader.checkNext=function(){Loader._isWorking=!0;for(var t=P.now();Loader._startIndexLoader.maxTimeOut)return console.warn("loader callback cost a long time:"+(P.now()-t)+" url="+Loader._loaders[Loader._startIndex-1].url),void i.systemTimer.frameOnce(1,null,Loader.checkNext);Loader._loaders.length=0,Loader._startIndex=0,Loader._isWorking=!1},Loader.clearRes=function(t){t=v.formatURL(t);var e=Loader.getAtlas(t);if(e){for(var i=0,s=e.length;i0?laya.net.Loader.getRes(e[0]):laya.net.Loader.getRes(t);i instanceof laya.resource.Texture&&i.disposeBitmap()},Loader.getRes=function(t){return Loader.loadedMap[v.formatURL(t)]},Loader.getAtlas=function(t){return Loader.atlasMap[v.formatURL(t)]},Loader.cacheRes=function(t,e){t=v.formatURL(t),null!=Loader.loadedMap[t]?console.warn("Resources already exist,is repeated loading:",t):Loader.loadedMap[t]=e},Loader.setGroup=function(t,e){Loader.groupMap[e]||(Loader.groupMap[e]=[]),Loader.groupMap[e].push(t)},Loader.clearResByGroup=function(t){if(Loader.groupMap[t]){var e=Loader.groupMap[t],i=0,s=e.length;for(i=0;in&&(i-=t+i-n),e+s>r&&(s-=e+s-r),i<=0||s<=0?null:(P.canvas.size(i,s),P.canvas.clear(),P.context.drawImage(this.bitmap._source,t,e,i,s,0,0,i,s),P.context.getImageData(0,0,i,s).data)},e.recoverBitmap=function(){var t=this._bitmap.url;this._destroyed||this._bitmap&&!this._bitmap.destroyed||!t||this.load(t)},e.disposeBitmap=function(){!this._destroyed&&this._bitmap&&this._bitmap.destroy()},e.destroy=function(){this._destroyed||(this._destroyed=!0,this.bitmap&&(this.bitmap._removeReference(this._referenceCount),this.bitmap=null),this.url&&this===i.loader.getRes(this.url)&&i.loader.clearRes(this.url))},r(0,e,"height",function(){return this._h?this._h:this.bitmap?this.uv&&this.uv!==Texture.DEF_UV?(this.uv[5]-this.uv[1])*this.bitmap.height:this.bitmap.height:0},function(t){this._h=t,this.sourceHeight||(this.sourceHeight=t)}),r(0,e,"uv",function(){return this._uv},function(t){this.uvrect[0]=Math.min(t[0],t[2],t[4],t[6]),this.uvrect[1]=Math.min(t[1],t[3],t[5],t[7]),this.uvrect[2]=Math.max(t[0],t[2],t[4],t[6])-this.uvrect[0],this.uvrect[3]=Math.max(t[1],t[3],t[5],t[7])-this.uvrect[1],this._uv=t}),r(0,e,"width",function(){return this._w?this._w:this.bitmap?this.uv&&this.uv!==Texture.DEF_UV?(this.uv[2]-this.uv[0])*this.bitmap.width:this.bitmap.width:0},function(t){this._w=t,this.sourceWidth||(this.sourceWidth=t)}),r(0,e,"bitmap",function(){return this._bitmap},function(t){this._bitmap&&this._bitmap._removeReference(this._referenceCount),this._bitmap=t,t&&t._addReference(this._referenceCount)}),r(0,e,"destroyed",function(){return this._destroyed}),Texture.moveUV=function(t,e,i){for(var s=0;s<8;s+=2)i[s]+=t,i[s+1]+=e;return i},Texture.create=function(t,e,i,s,n,r,a,o,h){return void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),Texture._create(t,e,i,s,n,r,a,o,h)},Texture._create=function(t,e,i,s,n,r,a,o,h,l){void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0);var c,u=t instanceof laya.resource.Texture,_=u?t.uv:Texture.DEF_UV,d=u?t.bitmap:t;d.width&&e+s>d.width&&(s=d.width-e),d.height&&i+n>d.height&&(n=d.height-i),l?(c=l).setTo(d,null,o||s,h||n):c=new Texture(d,null,o||s,h||n),c.width=s,c.height=n,c.offsetX=r,c.offsetY=a;var f=1/d.width,p=1/d.height;e*=f,i*=p,s*=f,n*=p;var g=c.uv[0],m=c.uv[1],v=c.uv[4],y=c.uv[5],C=v-g,S=y-m,w=Texture.moveUV(_[0],_[1],[e,i,e+s,i,e+s,i+n,e,i+n]);c.uv=[g+w[0]*C,m+w[1]*S,v-(1-w[2])*C,m+w[3]*S,v-(1-w[4])*C,y-(1-w[5])*S,g+w[6]*C,y-(1-w[7])*S];var x=d.scaleRate;return x&&1!=x?(c.sourceWidth/=x,c.sourceHeight/=x,c.width/=x,c.height/=x,c.scaleRate=x):c.scaleRate=1,c},Texture.createFromTexture=function(t,e,i,s,n){var r=t.scaleRate;1!=r&&(e*=r,i*=r,s*=r,n*=r);var a=mt.TEMP.setTo(e-t.offsetX,i-t.offsetY,s,n),o=a.intersection(Texture._rect1.setTo(0,0,t.width,t.height),Texture._rect2);return o?Texture.create(t,o.x,o.y,o.width,o.height,o.x-a.x,o.y-a.y,s,n):null},Texture.DEF_UV=[0,0,1,0,1,1,0,1],Texture.NO_UV=[0,0,0,0,0,0,0,0],Texture.INV_UV=[0,1,1,1,1,0,0,0],Texture._rect1=new mt,Texture._rect2=new mt,Texture}()),Nt=function(t){function TextStyle(){this.italic=!1,TextStyle.__super.call(this)}n(TextStyle,"laya.display.css.TextStyle",t);var e=TextStyle.prototype;return e.reset=function(){return t.prototype.reset.call(this),this.italic=!1,this.align="left",this.wordWrap=!1,this.leading=0,this.padding=[0,0,0,0],this.bgColor=null,this.borderColor=null,this.asPassword=!1,this.stroke=0,this.strokeColor="#000000",this.bold=!1,this.underline=!1,this.underlineColor=null,this},e.recover=function(){this!==TextStyle.EMPTY&&y.recover("TextStyle",this.reset())},e.render=function(t,e,i,s){(this.bgColor||this.borderColor)&&e.drawRect(i,s,t.width,t.height,this.bgColor,this.borderColor,1)},TextStyle.create=function(){return y.getItemByClass("TextStyle",TextStyle)},TextStyle.EMPTY=new TextStyle,TextStyle}(C),Wt=(function(t){function Script(){Script.__super.call(this)}n(Script,"laya.components.Script",_);var e=Script.prototype;e._onAwake=function(){this.onAwake(),this.onStart!==laya.components.Script.prototype.onStart&&i.startTimer.callLater(this,this.onStart)},e._onEnable=function(){var t=laya.components.Script.prototype;this.onTriggerEnter!==t.onTriggerEnter&&this.owner.on("triggerenter",this,this.onTriggerEnter),this.onTriggerStay!==t.onTriggerStay&&this.owner.on("triggerstay",this,this.onTriggerStay),this.onTriggerExit!==t.onTriggerExit&&this.owner.on("triggerexit",this,this.onTriggerExit),this.onMouseDown!==t.onMouseDown&&this.owner.on("mousedown",this,this.onMouseDown),this.onMouseUp!==t.onMouseUp&&this.owner.on("mouseup",this,this.onMouseUp),this.onClick!==t.onClick&&this.owner.on("click",this,this.onClick),this.onStageMouseDown!==t.onStageMouseDown&&i.stage.on("mousedown",this,this.onStageMouseDown),this.onStageMouseUp!==t.onStageMouseUp&&i.stage.on("mouseup",this,this.onStageMouseUp),this.onStageClick!==t.onStageClick&&i.stage.on("click",this,this.onStageClick),this.onStageMouseMove!==t.onStageMouseMove&&i.stage.on("mousemove",this,this.onStageMouseMove),this.onDoubleClick!==t.onDoubleClick&&this.owner.on("doubleclick",this,this.onDoubleClick),this.onRightClick!==t.onRightClick&&this.owner.on("rightclick",this,this.onRightClick),this.onMouseMove!==t.onMouseMove&&this.owner.on("mousemove",this,this.onMouseMove),this.onMouseOver!==t.onMouseOver&&this.owner.on("mouseover",this,this.onMouseOver),this.onMouseOut!==t.onMouseOut&&this.owner.on("mouseout",this,this.onMouseOut),this.onKeyDown!==t.onKeyDown&&i.stage.on("keydown",this,this.onKeyDown),this.onKeyPress!==t.onKeyPress&&i.stage.on("keypress",this,this.onKeyPress),this.onKeyUp!==t.onKeyUp&&i.stage.on("keyup",this,this.onKeyUp),this.onUpdate!==t.onUpdate&&i.updateTimer.frameLoop(1,this,this.onUpdate),this.onLateUpdate!==t.onLateUpdate&&i.lateTimer.frameLoop(1,this,this.onLateUpdate),this.onPreRender!==t.onPreRender&&i.lateTimer.frameLoop(1,this,this.onPreRender)},e._onDisable=function(){this.owner.offAllCaller(this),i.stage.offAllCaller(this),i.startTimer.clearAll(this),i.updateTimer.clearAll(this),i.lateTimer.clearAll(this)},e._isScript=function(){return!0},e._onDestroy=function(){this.onDestroy()},e.onAwake=function(){},e.onEnable=function(){},e.onStart=function(){},e.onTriggerEnter=function(t,e,i){},e.onTriggerStay=function(t,e,i){},e.onTriggerExit=function(t,e,i){},e.onMouseDown=function(t){},e.onMouseUp=function(t){},e.onClick=function(t){},e.onStageMouseDown=function(t){},e.onStageMouseUp=function(t){},e.onStageClick=function(t){},e.onStageMouseMove=function(t){},e.onDoubleClick=function(t){},e.onRightClick=function(t){},e.onMouseMove=function(t){},e.onMouseOver=function(t){},e.onMouseOut=function(t){},e.onKeyDown=function(t){},e.onKeyPress=function(t){},e.onKeyUp=function(t){},e.onUpdate=function(){},e.onLateUpdate=function(){},e.onPreRender=function(){},e.onPostRender=function(){},e.onDisable=function(){},e.onDestroy=function(){},r(0,e,"isSingleton",function(){return!1})}(),function(t){var e;function TimeLine(){this._labelDic=null,this._tweenDic={},this._tweenDataList=[],this._endTweenDataList=null,this._currTime=0,this._lastTime=0,this._startTime=0,this._index=0,this._gidIndex=0,this._firstTweenDic={},this._startTimeSort=!1,this._endTimeSort=!1,this._loopKey=!1,this.scale=1,this._frameRate=60,this._frameIndex=0,this._total=0,TimeLine.__super.call(this)}n(TimeLine,"laya.utils.TimeLine",h);var s=TimeLine.prototype;return s.to=function(t,e,i,s,n){return void 0===n&&(n=0),this._create(t,e,i,s,n,!0)},s.from=function(t,e,i,s,n){return void 0===n&&(n=0),this._create(t,e,i,s,n,!1)},s._create=function(t,i,s,n,r,a){var o=y.getItemByClass("tweenData",e);return o.isTo=a,o.type=0,o.target=t,o.duration=s,o.data=i,o.startTime=this._startTime+r,o.endTime=o.startTime+o.duration,o.ease=n,this._startTime=Math.max(o.endTime,this._startTime),this._tweenDataList.push(o),this._startTimeSort=!0,this._endTimeSort=!0,this},s.addLabel=function(t,i){var s=y.getItemByClass("tweenData",e);return s.type=1,s.data=t,s.endTime=s.startTime=this._startTime+i,this._labelDic||(this._labelDic={}),this._labelDic[t]=s,this._tweenDataList.push(s),this},s.removeLabel=function(t){if(this._labelDic&&this._labelDic[t]){var e=this._labelDic[t];if(e){var i=this._tweenDataList.indexOf(e);i>-1&&this._tweenDataList.splice(i,1)}delete this._labelDic[t]}},s.gotoTime=function(t){if(null!=this._tweenDataList&&0!=this._tweenDataList.length){var e,i,s,n;for(var r in this._firstTweenDic)if(i=this._firstTweenDic[r])for(var a in i)i.diyTarget.hasOwnProperty(a)&&(i.diyTarget[a]=i[a]);for(r in this._tweenDic)(e=this._tweenDic[r]).clear(),delete this._tweenDic[r];if(this._index=0,this._gidIndex=0,this._currTime=t,this._lastTime=P.now(),null==this._endTweenDataList||this._endTimeSort){this._endTimeSort=!1,this._endTweenDataList=s=this._tweenDataList.concat(),s.sort(function(t,e){return t.endTime>e.endTime?1:t.endTime=n.endTime))break;this._index=Math.max(this._index,o+1);var c=n.data;if(n.isTo)for(var u in c)n.target[u]=c[u]}for(o=0,h=this._tweenDataList.length;o=n.startTime&&te.startTime?1:t.startTime=this._startTime){if(!this._loopKey){for(var t in this._tweenDic)(e=this._tweenDic[t]).complete();return this._complete(),void this.pause()}if(this._complete(),!this._tweenDataList)return;this.gotoTime(0)}var e,i=P.now(),s=i-this._lastTime,n=this._currTime+=s*this.scale;for(t in this._lastTime=i,this._tweenDic)(e=this._tweenDic[t])._updateEase(n);if(0!=this._tweenDataList.length&&this._index=r.startTime&&(this._index++,0==r.type?(this._gidIndex++,(e=y.getItemByClass("tween",R))._create(r.target,r.data,r.duration,r.ease,l.create(this,this._animComplete,[this._gidIndex]),0,!1,r.isTo,!0,!1),e.setStartTime(n),e.gid=this._gidIndex,this._tweenDic[this._gidIndex]=e,e._updateEase(n)):this.event("label",r.data))}},s._animComplete=function(t){this._tweenDic[t]&&delete this._tweenDic[t]},s._complete=function(){this.event("complete")},s.reset=function(){var t;if(this._labelDic)for(t in this._labelDic)delete this._labelDic[t];for(t in this._tweenDic)this._tweenDic[t].clear(),delete this._tweenDic[t];for(t in this._firstTweenDic)delete this._firstTweenDic[t];if(this._endTweenDataList=null,this._tweenDataList&&this._tweenDataList.length){var e,s=0;for(e=this._tweenDataList.length,s=0;se){var _=e;u=!0,e=l+o,this.save(),this.clipRect(0,0,_,i)}l&&a&&this.drawImage(AutoBitmap.getTexture(t,0,0,l,a),0,0,l,a),o&&a&&this.drawImage(AutoBitmap.getTexture(t,n-o,0,o,a),e-o,0,o,a),l&&h&&this.drawImage(AutoBitmap.getTexture(t,0,r-h,l,h),0,i-h,l,h),o&&h&&this.drawImage(AutoBitmap.getTexture(t,n-o,r-h,o,h),e-o,i-h,o,h),a&&this.drawBitmap(c,AutoBitmap.getTexture(t,l,0,n-l-o,a),l,0,e-l-o,a),h&&this.drawBitmap(c,AutoBitmap.getTexture(t,l,r-h,n-l-o,h),l,i-h,e-l-o,h),l&&this.drawBitmap(c,AutoBitmap.getTexture(t,0,a,l,r-a-h),0,a,l,i-a-h),o&&this.drawBitmap(c,AutoBitmap.getTexture(t,n-o,a,o,r-a-h),e-o,a,o,i-a-h),this.drawBitmap(c,AutoBitmap.getTexture(t,l,a,n-l-o,r-a-h),l,a,e-l-o,i-a-h),u&&this.restore()}this._repaint()}},e.drawBitmap=function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r=0),n<.1||r<.1||(!t||e.width==n&&e.height==r?this.drawImage(e,i,s,n,r):this.fillTexture(e,i,s,n,r))},r(0,e,"sizeGrid",function(){return this._sizeGrid},function(t){this._sizeGrid=t,this._setChanged()}),r(0,e,"width",function(){return this._width?this._width:this._source?this._source.sourceWidth:0},function(t){this._width!=t&&(this._width=t,this._setChanged())}),r(0,e,"height",function(){return this._height?this._height:this._source?this._source.sourceHeight:0},function(t){this._height!=t&&(this._height=t,this._setChanged())}),r(0,e,"source",function(){return this._source},function(t){t?(this._source=t,this._setChanged()):(this._source=null,this.clear())}),AutoBitmap.getTexture=function(t,e,i,s,n){var r;return s<=0&&(s=1),n<=0&&(n=1),t.$_GID||(t.$_GID=dt.getGID()),r&&r._getSource()||(r=Ut.createFromTexture(t,e,i,s,n)),r},AutoBitmap}(G),Ht=function(t){function Sprite(){this._x=0,this._y=0,this._width=0,this._height=0,this._visible=!0,this._mouseState=0,this._zOrder=0,this._renderType=0,this._transform=null,this._tfChanged=!1,this._texture=null,this._boundStyle=null,this._graphics=null,this.mouseThrough=!1,this.autoSize=!1,this.hitTestPrior=!1,Sprite.__super.call(this),this._repaint=0,this._style=C.EMPTY,this._cacheStyle=et.EMPTY}n(Sprite,"laya.display.Sprite",t);var e=Sprite.prototype;return e.destroy=function(e){void 0===e&&(e=!0),t.prototype.destroy.call(this,e),this._style&&this._style.recover(),this._cacheStyle&&this._cacheStyle.recover(),this._boundStyle&&this._boundStyle.recover(),this._style=null,this._cacheStyle=null,this._boundStyle=null,this._transform=null,this._graphics&&this._graphics.autoDestroy&&this._graphics.destroy(),this._graphics=null,this.texture=null},e.updateZOrder=function(){dt.updateOrder(this._children)&&this.repaint()},e._getBoundsStyle=function(){return this._boundStyle||(this._boundStyle=k.create()),this._boundStyle},e._setCustomRender=function(){},e._setCacheAs=function(t){},e._checkCanvasEnable=function(){var t=this._cacheStyle.needEnableCanvasRender();this._getCacheStyle().enableCanvasRender=t,t?(this._cacheStyle.needBitmapCache()?this._cacheStyle.cacheAs="bitmap":this._cacheStyle.cacheAs=this._cacheStyle.userSetCache,this._cacheStyle.reCache=!0,this._renderType|=8):(this._cacheStyle.cacheAs="none",this._cacheStyle.releaseContext(),this._renderType&=-9),this._setCacheAs(this._cacheStyle.cacheAs),this._setRenderType(this._renderType)},e.reCache=function(){this._cacheStyle.reCache=!0,this._repaint|=2},e.getRepaint=function(){return this._repaint},e._setX=function(t){this._x=t},e._setY=function(t){this._y=t},e._setWidth=function(t,e){},e._setHeight=function(t,e){},e.setSelfBounds=function(t){this._getBoundsStyle().userBounds=t},e.getBounds=function(){return this._getBoundsStyle().bounds=mt._getWrapRec(this._boundPointsToParent())},e.getSelfBounds=function(){return this._boundStyle&&this._boundStyle.userBounds?this._boundStyle.userBounds:this._graphics||0!==this._children.length||this._texture?this._getBoundsStyle().bounds=mt._getWrapRec(this._getBoundPointsM(!1)):mt.TEMP.setTo(0,0,0,0)},e._boundPointsToParent=function(t){void 0===t&&(t=!1);var e=0,i=0;this._style&&(e=this.pivotX,i=this.pivotY,t=t||0!==this._style.rotation,this._style.scrollRect&&(e+=this._style.scrollRect.x,i+=this._style.scrollRect.y));var s=this._getBoundPointsM(t);if(!s||s.length<1)return s;if(8!=s.length&&(s=t?$.scanPList(s):mt._getWrapRec(s,mt.TEMP)._getBoundPoints()),!this.transform)return dt.transPointList(s,this._x-e,this._y-i),s;var n=it.TEMP,r=0,a=s.length;for(r=0;r=0;)t=(n=r[a]).fromParentPoint(t),a--;return t},e.toParentPoint=function(t){if(!t)return t;t.x-=this.pivotX,t.y-=this.pivotY,this.transform&&this._transform.transformPoint(t),t.x+=this._x,t.y+=this._y;var e=this._style.scrollRect;return e&&(t.x-=e.x,t.y-=e.y),t},e.fromParentPoint=function(t){if(!t)return t;t.x-=this._x,t.y-=this._y;var e=this._style.scrollRect;return e&&(t.x+=e.x,t.y+=e.y),this.transform&&this._transform.invertTransformPoint(t),t.x+=this.pivotX,t.y+=this.pivotY,t},e.fromStagePoint=function(t){return t},e.on=function(e,i,s,n){return 1!==this._mouseState&&this.isMouseEvent(e)?(this.mouseEnabled=!0,this._setBit(64,!0),this._parent&&this._$2__onDisplay(),this._createListener(e,i,s,n,!1)):t.prototype.on.call(this,e,i,s,n)},e.once=function(e,i,s,n){return 1!==this._mouseState&&this.isMouseEvent(e)?(this.mouseEnabled=!0,this._setBit(64,!0),this._parent&&this._$2__onDisplay(),this._createListener(e,i,s,n,!0)):t.prototype.once.call(this,e,i,s,n)},e._$2__onDisplay=function(){if(1!==this._mouseState){var t=this;for(t=t.parent;t&&1!==t._mouseState&&!t._getBit(64);)t.mouseEnabled=!0,t._setBit(64,!0),t=t.parent}},e._setParent=function(e){t.prototype._setParent.call(this,e),e&&this._getBit(64)&&this._$2__onDisplay()},e.loadImage=function(t,e){var i=this;if(null==t)this.texture=null,loaded();else{var s=kt.getRes(t);s||((s=new Ut).load(t),kt.cacheRes(t,s)),this.texture=s,s.getIsReady()?loaded():s.once("ready",null,loaded)}function loaded(){i.repaint(3),e&&e.run()}return this},e.repaint=function(t){void 0===t&&(t=2),this._repaint&t||(this._repaint|=t,this.parentRepaint(t)),this._cacheStyle&&this._cacheStyle.maskParent&&this._cacheStyle.maskParent.repaint(t)},e._needRepaint=function(){return 2&this._repaint&&this._cacheStyle.enableCanvasRender&&this._cacheStyle.reCache},e._childChanged=function(t){this._children.length?this._renderType|=8192:this._renderType&=-8193,this._setRenderType(this._renderType),t&&this._getBit(32)&&i.systemTimer.callLater(this,this.updateZOrder),this.repaint(3)},e.parentRepaint=function(t){void 0===t&&(t=2);var e=this._parent;!e||e._repaint&t||(e._repaint|=t,e.parentRepaint(t))},e._setMask=function(t){},e.startDrag=function(t,e,i,s,n,r,a){void 0===e&&(e=!1),void 0===i&&(i=0),void 0===s&&(s=300),void 0===r&&(r=!1),void 0===a&&(a=.92),this._style.dragging||(this.getStyle().dragging=new It),this._style.dragging.start(this,t,e,i,s,n,r,a)},e.stopDrag=function(){this._style.dragging&&this._style.dragging.stop()},e._setDisplay=function(e){e||this._cacheStyle&&(this._cacheStyle.releaseContext(),this._cacheStyle.releaseFilterCache(),this._cacheStyle.hasGlowFilter&&(this._cacheStyle.hasGlowFilter=!1)),t.prototype._setDisplay.call(this,e)},e.hitTestPoint=function(t,e){var i=this.globalToLocal(it.TEMP.setTo(t,e));return t=i.x,e=i.y,(this._style.hitArea?this._style.hitArea:this._width>0&&this._height>0?mt.TEMP.setTo(0,0,this._width,this._height):this.getSelfBounds()).contains(t,e)},e.getMousePoint=function(){return this.globalToLocal(it.TEMP.setTo(i.stage.mouseX,i.stage.mouseY))},e._setTexture=function(t){},e._setRenderType=function(t){},e._setTranformChange=function(){this._tfChanged=!0,this._renderType|=2,this.parentRepaint(2)},e._setBgStyleColor=function(t,e,i,s,n){},e._setBorderStyleColor=function(t,e,i,s,n,r){},e.captureMouseEvent=function(t){S.instance.setCapture(this,t)},e.releaseMouseEvent=function(){S.instance.releaseCapture()},r(0,e,"customRenderEnable",null,function(t){t&&(this._renderType|=2048,this._setRenderType(this._renderType),this._setCustomRender())}),r(0,e,"cacheAs",function(){return this._cacheStyle.cacheAs},function(t){t!==this._cacheStyle.userSetCache&&(Tt.isConchApp&&"bitmap"!=t||this.mask&&"normal"===t||(this._setCacheAs(t),this._getCacheStyle().userSetCache=t,this._checkCanvasEnable(),this.repaint()))}),r(0,e,"globalScaleY",function(){for(var t=1,e=this;e&&e!==i.stage;)t*=e.scaleY,e=e.parent;return t}),r(0,e,"hitArea",function(){return this._style.hitArea},function(t){this.getStyle().hitArea=t}),r(0,e,"staticCache",function(){return this._cacheStyle.staticCache},function(t){this._getCacheStyle().staticCache=t,t||this.reCache()}),r(0,e,"displayWidth",function(){return this.width*this.scaleX}),r(0,e,"zOrder",function(){return this._zOrder},function(t){this._zOrder!=t&&(this._zOrder=t,this._parent&&(t&&this._parent._setBit(32,!0),i.systemTimer.callLater(this._parent,this.updateZOrder)))}),r(0,e,"rotation",function(){return this._style.rotation},function(t){this.getStyle().rotation!==t&&(this._setRotation(t),this._setTranformChange())}),r(0,e,"width",function(){return this.autoSize?this.texture?this.texture.width:this._graphics||0!==this._children.length?this.getSelfBounds().width:0:this._width||(this.texture?this.texture.width:0)},function(t){this._width!==t&&(this._width=t,this._setWidth(this.texture,t),this._setTranformChange())}),r(0,e,"x",function(){return this._x},function(t){if(!this.destroyed&&this._x!==t){this._setX(t),this.parentRepaint(2);var e=this._cacheStyle.maskParent;e&&e.repaint(2)}}),r(0,e,"drawCallOptimize",function(){return this._getBit(256)},function(t){this._setBit(256,t)}),r(0,e,"texture",function(){return this._texture},function(t){"string"==typeof t?this.loadImage(t):this._texture!=t&&(this._texture&&this._texture._removeReference(),this._texture=t,t&&t._addReference(),this._setTexture(t),this._setWidth(this._texture,this.width),this._setHeight(this._texture,this.height),t?this._renderType|=256:this._renderType&=-257,this._setRenderType(this._renderType),this.repaint())}),r(0,e,"globalRotation",function(){for(var t=0,e=this;e&&e!==i.stage;)t+=e.rotation,e=e.parent;return t}),r(0,e,"y",function(){return this._y},function(t){if(!this.destroyed&&this._y!==t){this._setY(t),this.parentRepaint(2);var e=this._cacheStyle.maskParent;e&&e.repaint(2)}}),r(0,e,"displayHeight",function(){return this.height*this.scaleY}),r(0,e,"height",function(){return this.autoSize?this.texture?this.texture.height:this._graphics||0!==this._children.length?this.getSelfBounds().height:0:this._height||(this.texture?this.texture.height:0)},function(t){this._height!==t&&(this._height=t,this._setHeight(this.texture,t),this._setTranformChange())}),r(0,e,"blendMode",function(){return this._style.blendMode},function(t){this._setBlendMode(t),this.getStyle().blendMode=t,t&&"source-over"!=t?this._renderType|=4:this._renderType&=-5,this._setRenderType(this._renderType),this.parentRepaint()}),r(0,e,"scaleX",function(){return this._style.scaleX},function(t){this.getStyle().scaleX!==t&&(this._setScaleX(t),this._setTranformChange())}),r(0,e,"scaleY",function(){return this._style.scaleY},function(t){this.getStyle().scaleY!==t&&(this._setScaleY(t),this._setTranformChange())}),r(0,e,"stage",function(){return i.stage}),r(0,e,"skewX",function(){return this._style.skewX},function(t){this.getStyle().skewX!==t&&(this._setSkewX(t),this._setTranformChange())}),r(0,e,"scrollRect",function(){return this._style.scrollRect},function(t){this.getStyle().scrollRect=t,this._setScrollRect(t),this.repaint(),t?this._renderType|=64:this._renderType&=-65,this._setRenderType(this._renderType)}),r(0,e,"skewY",function(){return this._style.skewY},function(t){this.getStyle().skewY!==t&&(this._setSkewY(t),this._setTranformChange())}),r(0,e,"transform",function(){return this._tfChanged?this._adjustTransform():this._transform},function(t){this._tfChanged=!1;var e=this._transform||(this._transform=this._createTransform());t.copyTo(e),this._setTransform(e),t&&(this._x=t.tx,this._y=t.ty,t.tx=t.ty=0),t?this._renderType|=2:this._renderType&=-3,this._setRenderType(this._renderType),this.parentRepaint()}),r(0,e,"pivotX",function(){return this._getPivotX()},function(t){this._setPivotX(t),this.repaint()}),r(0,e,"pivotY",function(){return this._getPivotY()},function(t){this._setPivotY(t),this.repaint()}),r(0,e,"alpha",function(){return this._getAlpha()},function(t){t=t<0?0:t>1?1:t,this._setAlpha(t)}),r(0,e,"visible",function(){return this._visible},function(t){this._visible!==t&&(this._visible=t,this.parentRepaint(3))}),r(0,e,"graphics",function(){return this._graphics||(this.graphics=new G,this._graphics.autoDestroy=!0),this._graphics},function(t){this._graphics&&(this._graphics._sp=null),this._graphics=t,t?(this._setGraphics(t),this._renderType|=512,t._sp=this):this._renderType&=-513,this._setRenderType(this._renderType),this.repaint()}),r(0,e,"filters",function(){return this._cacheStyle.filters},function(t){t&&0===t.length&&(t=null),this._cacheStyle.filters!=t&&(this._getCacheStyle().filters=t?t.slice():null,(Tt.isWebGL||Tt.isConchApp)&&(t&&t.length?(this._setColorFilter(t[0]),this._renderType|=16):(this._setColorFilter(null),this._renderType&=-17),this._setRenderType(this._renderType)),t&&t.length>0?(this._getBit(16)||this._setBitUp(16),(Tt.isWebGL||Tt.isConchApp)&&1==t.length&&t[0]instanceof laya.filters.ColorFilter||(this._getCacheStyle().cacheForFilters=!0,this._checkCanvasEnable())):this._cacheStyle.cacheForFilters&&(this._cacheStyle.cacheForFilters=!1,this._checkCanvasEnable()),this._getCacheStyle().hasGlowFilter=this._isHaveGlowFilter(),this.repaint())}),r(0,e,"mask",function(){return this._cacheStyle.mask},function(t){t&&this.mask&&this.mask._cacheStyle.maskParent||(this._getCacheStyle().mask=t,this._setMask(t),this._checkCanvasEnable(),t?t._getCacheStyle().maskParent=this:this.mask&&(this.mask._getCacheStyle().maskParent=null),this._renderType|=32,this._setRenderType(this._renderType),this.parentRepaint(3))}),r(0,e,"mouseEnabled",function(){return this._mouseState>1},function(t){this._mouseState=t?2:1}),r(0,e,"globalScaleX",function(){for(var t=1,e=this;e&&e!==i.stage;)t*=e.scaleX,e=e.parent;return t}),r(0,e,"mouseX",function(){return this.getMousePoint().x}),r(0,e,"mouseY",function(){return this.getMousePoint().y}),r(0,e,"viewport",function(){return this._style.viewport},function(t){var e;"string"==typeof t&&((e=t.split(",")).length>3&&(t=new mt(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]))));this.getStyle().viewport=t}),Sprite.fromImage=function(t){return(new Sprite).loadImage(t)},Sprite}(Bt),Xt=function(t){function Bitmap(){Bitmap.__super.call(this),this._width=-1,this._height=-1}n(Bitmap,"laya.resource.Bitmap",Et);var e=Bitmap.prototype;return e._getSource=function(){throw"Bitmap: must override it."},r(0,e,"width",function(){return this._width}),r(0,e,"height",function(){return this._height}),Bitmap}(),zt=function(t){function Scene(){this.autoDestroyAtClosed=!1,this.url=null,this._timer=null,this._viewCreated=!1,this._idMap=null,this._$componentType="Scene",Scene.__super.call(this),this._setBit(8,!0),Scene.unDestroyedScenes.push(this),this._scene=this,this.createChildren()}n(Scene,"laya.display.Scene",t);var e=Scene.prototype;return e.createChildren=function(){},e.loadScene=function(t){var e=t.indexOf(".")>-1?t:t+".scene",s=i.loader.getRes(e);if(s)this.createView(s);else{i.loader.resetProgress();var n=new Ft;n.on("complete",this,this._onSceneLoaded,[e]),n.load(e)}},e._onSceneLoaded=function(t){this.createView(kt.getRes(t))},e.createView=function(t){t&&!this._viewCreated&&(this._viewCreated=!0,rt.createByData(this,t))},e.getNodeByID=function(t){return this._idMap?this._idMap[t]:null},e.open=function(t,e){void 0===t&&(t=!0),t&&Scene.closeAll(),Scene.root.addChild(this.scene),this.onOpened(e)},e.onOpened=function(t){},e.close=function(t){this.autoDestroyAtClosed?this.destroy():this.removeSelf(),this.onClosed(t)},e.onClosed=function(t){},e.destroy=function(e){void 0===e&&(e=!0),this._idMap=null,t.prototype.destroy.call(this,e);for(var i=laya.display.Scene.unDestroyedScenes,s=i.length-1;s>-1;s--)if(i[s]===this)return void i.splice(s,1)},e._sizeChanged=function(){this.event("resize")},r(0,e,"scaleX",t.prototype._$get_scaleX,function(t){i.superGet(Ht,this,"scaleX")!=t&&(i.superSet(Ht,this,"scaleX",t),this.event("resize"))}),r(0,e,"scaleY",t.prototype._$get_scaleY,function(t){i.superGet(Ht,this,"scaleY")!=t&&(i.superSet(Ht,this,"scaleY",t),this.event("resize"))}),r(0,e,"width",function(){if(this._width)return this._width;for(var t=0,e=this.numChildren-1;e>-1;e--){var i=this.getChildAt(e);i._visible&&(t=Math.max(i._x+i.width*i.scaleX,t))}return t},function(t){i.superGet(Ht,this,"width")!=t&&(i.superSet(Ht,this,"width",t),this.callLater(this._sizeChanged))}),r(0,e,"timer",function(){return this._timer||i.timer},function(t){this._timer=t}),r(0,e,"height",function(){if(this._height)return this._height;for(var t=0,e=this.numChildren-1;e>-1;e--){var i=this.getChildAt(e);i._visible&&(t=Math.max(i._y+i.height*i.scaleY,t))}return t},function(t){i.superGet(Ht,this,"height")!=t&&(i.superSet(Ht,this,"height",t),this.callLater(this._sizeChanged))}),r(1,Scene,"root",function(){if(!Scene._root){function resize(){Scene._root.size(i.stage.width,i.stage.height),Scene._root.event("resize")}Scene._root=i.stage.addChild(new Ht),Scene._root.name="root",i.stage.on("resize",null,resize),resize()}return Scene._root},laya.display.Sprite._$SET_root),Scene.load=function(t,e,s){i.loader.resetProgress();var n=new Ft;function onProgress(t){Scene._loadPage&&Scene._loadPage.event("progress",t),s&&s.runWith(t)}n.on("progress",null,onProgress),n.once("complete",null,function(){n.off("progress",null,onProgress);var i=kt.getRes(t);if(!i)throw"Can not find scene:"+t;if(!i.props)throw"Scene data is error:"+t;var s=i.props.runtime?i.props.runtime:i.type,r=ft.getClass(s);if("instance"==i.props.renderType)var a=r.instance||(r.instance=new r);else a=new r;if(!(a&&a instanceof laya.display.Node))throw"Can not find scene:"+s;a.url=t,a._getBit(8)?(a.on("onViewCreated",null,function(){e&&e.runWith(a)}),a.createView(i)):e&&e.runWith(a),Scene.hideLoadingPage()}),n.load(t)},Scene.open=function(t,e,i,s,n){if(void 0===e&&(e=!0),i instanceof laya.utils.Handler){var r=s;s=i,i=r}Scene.showLoadingPage(),Scene.load(t,l.create(null,this._onSceneLoaded,[e,s,i]),n)},Scene._onSceneLoaded=function(t,e,i,s){s.open(t,i),e&&e.runWith(s)},Scene.close=function(t,e){void 0===e&&(e="");for(var i=!1,s=laya.display.Scene.unDestroyedScenes,n=0,r=s.length;n0;i--)e+="●";return e},a._renderText=function(){var t=this.padding,e=this._lines.length;"visible"!=this.overflow&&(e=Math.min(e,Math.floor((this.height-t[0]-t[2])/(this.leading+this._charSize.height))+1));var i=this.scrollY/(this._charSize.height+this.leading)|0,s=this.graphics;s.clear(!0);var n=this._getContextFont();P.context.font=n;var r=t[3],a="left",o=this._lines,h=this.leading+this._charSize.height,l=t[0];if(this._width>0&&this._textWidth<=this._width&&("right"==this.align?(a="right",r=this._width-t[1]):"center"==this.align&&(a="center",r=.5*this._width+t[3]-t[1])),this._height>0){var c=this._textHeight>this._height?"top":this.valign;"middle"===c?l=.5*(this._height-e*h)+t[0]-t[2]:"bottom"===c&&(l=this._height-e*h-t[2])}var u=this._style;this._clipPoint&&(s.save(),s.clipRect(t[3],t[0],this._width?this._width-t[3]-t[1]:this._textWidth,this._height?this._height-t[0]-t[2]:this._textHeight),this.repaint());var _=u.asPassword;"prompt"in this&&this.prompt==this._text&&(_=!1);for(var d=0,f=0,p=Math.min(this._lines.length,e+i)||1,g=i;g0;C--)v+="●"}null==v&&(v=""),d=r-(this._clipPoint?this._clipPoint.x:0),f=l+h*g-(this._clipPoint?this._clipPoint.y:0),this.underline&&this._drawUnderline(a,d,f,g),Tt.isWebGL?(this._words||(this._words=[]),(m=this._words.length>g-i?this._words[g-i]:new j).setText(v)):m=v,u.stroke?s.fillBorderText(m,d,f,n,this.color,u.strokeColor,u.stroke,a):s.fillText(m,d,f,n,this.color,a)}this._clipPoint&&s.restore(),this._startX=r,this._startY=l},a._drawUnderline=function(t,e,i,s){var n=this._lineWidths[s];switch(t){case"center":e-=n/2;break;case"right":e-=n}i+=this._charSize.height,this._graphics.drawLine(e,i,e+n,i,this.underlineColor||this.color,1)},a.typeset=function(){if(this._isChanged=!1,!this._text)return this._clipPoint=null,this._textWidth=this._textHeight=0,void this.graphics.clear(!0);Tt.isConchApp?t.conchTextCanvas.font=this._getContextFont():P.context.font=this._getContextFont(),this._lines.length=0,this._lineWidths.length=0,this._isPassWordMode()?this._parseLines(this._getPassWordTxt(this._text)):this._parseLines(this._text),this._evalTextSize(),this._checkEnabledViewportOrNot()?this._clipPoint||(this._clipPoint=new it(0,0)):this._clipPoint=null,this._renderText()},a._evalTextSize=function(){var t,e;t=Math.max.apply(this,this._lineWidths),e=this._lines.length*(this._charSize.height+this.leading)+this.padding[0]+this.padding[2],t==this._textWidth&&e==this._textHeight||(this._textWidth=t,this._textHeight=e)},a._checkEnabledViewportOrNot=function(){return"scroll"==this.overflow&&(this._width>0&&this._textWidth>this._width||this._height>0&&this._textHeight>this._height)},a.changeText=function(t){this._text!==t&&(this.lang(t+""),this._graphics&&this._graphics.replaceText(this._text)||this.typeset())},a._parseLines=function(e){var i=this.wordWrap||"hidden"==this.overflow;if(i)var s=this._getWordWrapWidth();var n=null;n=Tt.isConchApp?t.conchTextCanvas.measureText(this._testWord):P.context.measureText(Text._testWord),this._charSize.width=n.width,this._charSize.height=n.height||this.fontSize;for(var r=e.replace(/\r\n/g,"\n").split("\n"),a=0,o=r.length;ae)if(this.wordWrap){var c=t.substring(o,h);if(c.charCodeAt(c.length-1)<255&&(i=/(?:\w|-)+$/.exec(c))&&(h=i.index+o,0==i.index?h+=c.length:c=t.substring(o,h)),s.push(c),this._lineWidths.push(a-r),o=h,!(h+ne?e:t,this._clipPoint.x=t,this._renderText()}}),r(0,a,"scrollY",function(){return this._clipPoint?this._clipPoint.y:0},function(t){if(!("scroll"!=this.overflow||this.textHeighte?e:t,this._clipPoint.y=t,this._renderText()}}),r(0,a,"maxScrollX",function(){return this.textWidth-1;e--){var i=this.getChildAt(e);i._visible&&(t=Math.max(i._x+i.width*i.scaleX,t))}return t},e.commitMeasure=function(){},e.measureHeight=function(){var t=0;this.commitMeasure();for(var e=this.numChildren-1;e>-1;e--){var i=this.getChildAt(e);i._visible&&(t=Math.max(i._y+i.height*i.scaleY,t))}return t},e._sizeChanged=function(){isNaN(this._anchorX)||(this.pivotX=this.anchorX*this.width),isNaN(this._anchorY)||(this.pivotY=this.anchorY*this.height),this.event("resize"),this._widget!==Dt.EMPTY&&this._widget.resetLayout()},e.onMouseOver=function(t){i.stage.event("showtip",this._toolTip)},e.onMouseOut=function(t){i.stage.event("hidetip",this._toolTip)},e._getWidget=function(){return this._widget===Dt.EMPTY&&(this._widget=this.addComponent(Dt)),this._widget},e.onCompResize=function(){this._sizeChanged()},e._childChanged=function(e){this.callLater(this._sizeChanged),t.prototype._childChanged.call(this,e)},r(0,e,"centerY",function(){return this._widget.centerY},function(t){t!=this._widget.centerY&&(this._getWidget().centerY=t)}),r(0,e,"width",function(){return this._width?this._width:this.measureWidth()},function(t){i.superGet(Ht,this,"width")!=t&&(i.superSet(Ht,this,"width",t),this.callLater(this._sizeChanged))}),r(0,e,"bottom",function(){return this._widget.bottom},function(t){t!=this._widget.bottom&&(this._getWidget().bottom=t)}),r(0,e,"height",function(){return this._height?this._height:this.measureHeight()},function(t){i.superGet(Ht,this,"height")!=t&&(i.superSet(Ht,this,"height",t),this.callLater(this._sizeChanged))}),r(0,e,"left",function(){return this._widget.left},function(t){t!=this._widget.left&&(this._getWidget().left=t)}),r(0,e,"dataSource",function(){return this._dataSource},function(t){for(var e in this._dataSource=t,this._dataSource)this.hasOwnProperty(e)&&"function"!=typeof this[e]&&(this[e]=this._dataSource[e])}),r(0,e,"centerX",function(){return this._widget.centerX},function(t){t!=this._widget.centerX&&(this._getWidget().centerX=t)}),r(0,e,"top",function(){return this._widget.top},function(t){t!=this._widget.top&&(this._getWidget().top=t)}),r(0,e,"right",function(){return this._widget.right},function(t){t!=this._widget.right&&(this._getWidget().right=t)}),r(0,e,"tag",function(){return this._tag},function(t){this._tag=t}),r(0,e,"toolTip",function(){return this._toolTip},function(t){this._toolTip!=t&&(this._toolTip=t,null!=t?(this.on("mouseover",this,this.onMouseOver),this.on("mouseout",this,this.onMouseOut)):(this.off("mouseover",this,this.onMouseOver),this.off("mouseout",this,this.onMouseOut)))}),r(0,e,"gray",function(){return this._gray},function(t){t!==this._gray&&(this._gray=t,J.gray(this,t))}),r(0,e,"disabled",function(){return this._disabled},function(t){t!==this._disabled&&(this.gray=this._disabled=t,this.mouseEnabled=!t)}),r(0,e,"scaleX",t.prototype._$get_scaleX,function(t){i.superGet(Ht,this,"scaleX")!=t&&(i.superSet(Ht,this,"scaleX",t),this.event("resize"))}),r(0,e,"scaleY",t.prototype._$get_scaleY,function(t){i.superGet(Ht,this,"scaleY")!=t&&(i.superSet(Ht,this,"scaleY",t),this.event("resize"))}),r(0,e,"anchorX",function(){return this._anchorX},function(t){this._anchorX!=t&&(this._anchorX=t,this.callLater(this._sizeChanged))}),r(0,e,"anchorY",function(){return this._anchorY},function(t){this._anchorY!=t&&(this._anchorY=t,this.callLater(this._sizeChanged))}),UIComponent}(Ht),$t=function(e){function Stage(){this.focus=null,this._frameRate="fast",this.designWidth=0,this.designHeight=0,this.canvasRotation=!1,this.canvasDegree=0,this.renderingEnabled=!0,this.screenAdaptationEnabled=!0,this._screenMode="none",this._scaleMode="noscale",this._alignV="top",this._alignH="left",this._bgColor="black",this._mouseMoveTime=0,this._renderCount=0,this._safariOffsetY=0,this._frameStartTime=0,this._isFocused=!1,this._isVisibility=!1,this._wgColor=[0,0,0,1],this._scene3Ds=[],this._globalRepaintSet=!1,this._globalRepaintGet=!1,this._curUIBase=null,Stage.__super.call(this),this.offset=new it,this._canvasTransform=new Z,this._previousOrientation=P.window.orientation,this._3dUI=[];var t=this;this.transform=Z.create(),this.mouseEnabled=!0,this.hitTestPrior=!0,this.autoSize=!1,this._setBit(128,!0),this._setBit(2,!0),this._isFocused=!0,this._isVisibility=!0;var e=P.window,i=this;e.addEventListener("focus",function(){t._isFocused=!0,i.event("focus"),i.event("focuschange")}),e.addEventListener("blur",function(){t._isFocused=!1,i.event("blur"),i.event("focuschange")});var s="visibilityState",n="visibilitychange",r=e.document;void 0!==r.hidden?(n="visibilitychange",s="visibilityState"):void 0!==r.mozHidden?(n="mozvisibilitychange",s="mozVisibilityState"):void 0!==r.msHidden?(n="msvisibilitychange",s="msVisibilityState"):void 0!==r.webkitHidden&&(n="webkitvisibilitychange",s="webkitVisibilityState"),e.document.addEventListener(n,function(){"hidden"==P.document[s]?t._isVisibility=!1:t._isVisibility=!0;t.renderingEnabled=t._isVisibility,i.event("visibilitychange")}),e.addEventListener("resize",function(){var e=P.window.orientation;t._previousOrientation=e,i._isInputting()||(P.onSafari&&(i._safariOffsetY=(P.window.__innerHeight||P.document.body.clientHeight||P.document.documentElement.clientHeight)-P.window.innerHeight),i._resetCanvas())}),e.addEventListener("orientationchange",function(t){i._resetCanvas()}),this.on("mousemove",this,this._onmouseMove),P.onMobile&&this.on("mousedown",this,this._onmouseMove)}n(Stage,"laya.display.Stage",e);var a=Stage.prototype;return a._isInputting=function(){return P.onMobile},a._changeCanvasSize=function(){this.setScreenSize(P.clientWidth*P.pixelRatio,P.clientHeight*P.pixelRatio)},a._resetCanvas=function(){this.screenAdaptationEnabled&&this._changeCanvasSize()},a.setScreenSize=function(t,e){var i=!1;if("none"!==this._screenMode&&(i=(t/e<1?"vertical":"horizontal")!==this._screenMode)){var s=e;e=t,t=s}this.canvasRotation=i;var n=Tt._mainCanvas,r=n.source.style,a=this._canvasTransform.identity(),o=this._scaleMode,h=t/this.designWidth,l=e/this.designHeight,c=this.designWidth,u=this.designHeight,_=t,d=e,f=P.pixelRatio;switch(this._width=this.designWidth,this._height=this.designHeight,o){case"noscale":h=l=1,_=this.designWidth,d=this.designHeight;break;case"showall":h=l=Math.min(h,l),c=_=Math.round(this.designWidth*h),u=d=Math.round(this.designHeight*l);break;case"noborder":h=l=Math.max(h,l),_=Math.round(this.designWidth*h),d=Math.round(this.designHeight*l);break;case"full":h=l=1,this._width=c=t,this._height=u=e;break;case"fixedwidth":l=h,this._height=u=Math.round(e/h);break;case"fixedheight":h=l,this._width=c=Math.round(t/l);break;case"fixedauto":t/e0?1:-1:t},a.getMousePoint=function(){return it.TEMP.setTo(this.mouseX,this.mouseY)},a.repaint=function(t){void 0===t&&(t=2),this._repaint|=t},a.repaintForNative=function(t){void 0===t&&(t=2),this._conchData._int32Data[4]|=t},a.parentRepaint=function(t){void 0===t&&(t=2)},a._loop=function(){return this._globalRepaintGet=this._globalRepaintSet,this._globalRepaintSet=!1,this.render(Tt._context,0,0),!0},a.getFrameTm=function(){return this._frameStartTime},a._onmouseMove=function(t){this._mouseMoveTime=P.now()},a.getTimeFromFrameStart=function(){return P.now()-this._frameStartTime},a.render=function(t,i,s){if(Stage._dbgSprite.graphics.clear(),"sleep"===this._frameRate){var n=P.now();if(!(n-this._frameStartTime>=1e3))return;this._frameStartTime=n}else{if(!this._visible)return this._renderCount++,void(this._renderCount%5==0&&(d.I._update(),Mt.loopCount++,this._updateTimers()));this._frameStartTime=P.now()}this._renderCount++;var r="slow"!==("mouse"===this._frameRate?this._frameStartTime-this._mouseMoveTime<2e3?"fast":"slow":this._frameRate),a=this._renderCount%2==0;if(Mt.renderSlow=!r,(r||a)&&(d.I._update(),Mt.loopCount++,!Tt.isConchApp&&Tt.isWebGL&&this.renderingEnabled)){for(var o=0,h=this._scene3Ds.length;o=0||this._3dUI.push(e)},a.remove3DUI=function(t){var e=t.rootView,i=this._3dUI.indexOf(e);return i>=0&&(this._3dUI.splice(i,1),!0)},r(0,a,"clientScaleY",function(){return this._transform?this._transform.getScaleY():1}),r(0,a,"width",e.prototype._$get_width,function(t){this.designWidth=t,i.superSet(Ht,this,"width",t),i.systemTimer.callLater(this,this._changeCanvasSize)}),r(0,a,"isFocused",function(){return this._isFocused}),r(0,a,"alignH",function(){return this._alignH},function(t){this._alignH=t,i.systemTimer.callLater(this,this._changeCanvasSize)}),r(0,a,"height",e.prototype._$get_height,function(t){this.designHeight=t,i.superSet(Ht,this,"height",t),i.systemTimer.callLater(this,this._changeCanvasSize)}),r(0,a,"transform",function(){return this._tfChanged&&this._adjustTransform(),this._transform=this._transform||this._createTransform()},e.prototype._$set_transform),r(0,a,"isVisibility",function(){return this._isVisibility}),r(0,a,"scaleMode",function(){return this._scaleMode},function(t){this._scaleMode=t,i.systemTimer.callLater(this,this._changeCanvasSize)}),r(0,a,"alignV",function(){return this._alignV},function(t){this._alignV=t,i.systemTimer.callLater(this,this._changeCanvasSize)}),r(0,a,"bgColor",function(){return this._bgColor},function(t){this._bgColor=t,Tt.isWebGL&&(this._wgColor=t?o.create(t).arrColor:null),P.onLimixiu?this._wgColor=o.create(t).arrColor:Tt.canvas.style.background=t||"none",Tt.isConchApp&&(this._renderType|=128,this._setBgStyleColor(0,0,this.width,this.height,t),this._setRenderType(this._renderType))}),r(0,a,"mouseX",function(){return Math.round(S.instance.mouseX/this.clientScaleX)}),r(0,a,"mouseY",function(){return Math.round(S.instance.mouseY/this.clientScaleY)}),r(0,a,"clientScaleX",function(){return this._transform?this._transform.getScaleX():1}),r(0,a,"screenMode",function(){return this._screenMode},function(t){this._screenMode=t}),r(0,a,"visible",e.prototype._$get_visible,function(t){this.visible!==t&&(i.superSet(Ht,this,"visible",t),Tt._mainCanvas.source.style.visibility=t?"visible":"hidden")}),r(0,a,"fullScreenEnabled",null,function(t){var e=P.document,i=Tt.canvas;t?(i.addEventListener("mousedown",this._requestFullscreen),i.addEventListener("touchstart",this._requestFullscreen),e.addEventListener("fullscreenchange",this._fullScreenChanged),e.addEventListener("mozfullscreenchange",this._fullScreenChanged),e.addEventListener("webkitfullscreenchange",this._fullScreenChanged),e.addEventListener("msfullscreenchange",this._fullScreenChanged)):(i.removeEventListener("mousedown",this._requestFullscreen),i.removeEventListener("touchstart",this._requestFullscreen),e.removeEventListener("fullscreenchange",this._fullScreenChanged),e.removeEventListener("mozfullscreenchange",this._fullScreenChanged),e.removeEventListener("webkitfullscreenchange",this._fullScreenChanged),e.removeEventListener("msfullscreenchange",this._fullScreenChanged))}),r(0,a,"frameRate",function(){return Tt.isConchApp?this._frameRateNative:this._frameRate},function(e){if(Tt.isConchApp){switch(e){case"fast":t.conch.config.setLimitFPS(60);break;case"mouse":t.conch.config.setMouseFrame(2e3);break;case"slow":t.conch.config.setSlowFrame(!0);break;case"sleep":t.conch.config.setLimitFPS(1)}this._frameRateNative=e}else this._frameRate=e}),Stage.SCALE_NOSCALE="noscale",Stage.SCALE_EXACTFIT="exactfit",Stage.SCALE_SHOWALL="showall",Stage.SCALE_NOBORDER="noborder",Stage.SCALE_FULL="full",Stage.SCALE_FIXED_WIDTH="fixedwidth",Stage.SCALE_FIXED_HEIGHT="fixedheight",Stage.SCALE_FIXED_AUTO="fixedauto",Stage.ALIGN_LEFT="left",Stage.ALIGN_RIGHT="right",Stage.ALIGN_CENTER="center",Stage.ALIGN_TOP="top",Stage.ALIGN_MIDDLE="middle",Stage.ALIGN_BOTTOM="bottom",Stage.SCREEN_NONE="none",Stage.SCREEN_HORIZONTAL="horizontal",Stage.SCREEN_VERTICAL="vertical",Stage.FRAME_FAST="fast",Stage.FRAME_SLOW="slow",Stage.FRAME_MOUSE="mouse",Stage.FRAME_SLEEP="sleep",s(Stage,["_dbgSprite",function(){return this._dbgSprite=new Ht}]),Stage}(Ht),qt=function(t){function HTMLCanvas(t){HTMLCanvas.__super.call(this),void 0===t&&(t=!1),t||!Tt.isWebGL?this._source=P.createElement("canvas"):this._source=this,this.lock=!0}n(HTMLCanvas,"laya.resource.HTMLCanvas",Xt);var e=HTMLCanvas.prototype;return e._getSource=function(){return this._source},e.clear=function(){this._ctx&&this._ctx.clear(),this._texture&&(this._texture.destroy(),this._texture=null)},e.destroy=function(){this._ctx&&this._ctx.destroy(),this._ctx=null},e.release=function(){},e._setContext=function(t){this._ctx=t},e.getContext=function(t,e){return this.context},e.getMemSize=function(){return 0},e.size=function(t,e){(this._width!=t||this._height!=e||this._source&&(this._source.width!=t||this._source.height!=e))&&(this._width=t,this._height=e,this._setGPUMemory(t*e*4),this._ctx&&this._ctx.size&&this._ctx.size(t,e),this._source&&(this._source.height=e,this._source.width=t),this._texture&&(this._texture.destroy(),this._texture=null))},e.getTexture=function(){return this._texture||(this._texture=new Ut(this,Ut.DEF_UV)),this._texture},e.toBase64=function(t,e,i){this._source&&(Tt.isConchApp&&this._source.toBase64?this._source.toBase64(t,e,i):i(this._source.toDataURL(t,e)))},r(0,e,"source",function(){return this._source}),r(0,e,"context",function(){return this._ctx?this._ctx:(Tt.isWebGL&&this._source==this?this._ctx=new laya.webgl.canvas.WebGLContext2D:this._ctx=this._source.getContext(Tt.isConchApp?"layagl":"2d"),this._ctx._canvas=this,this._ctx)}),HTMLCanvas}(),Kt=function(t){function HTMLImage(){HTMLImage.__super.call(this)}n(HTMLImage,"laya.resource.HTMLImage",Xt);var e=HTMLImage.prototype;return e.loadImageSource=function(t){var e=t.width,i=t.height;if(e<=0||i<=0)throw new Error("HTMLImage:width or height must large than 0.");this._width=e,this._height=i,this._source=t,this._setGPUMemory(e*i*4),this._activeResource()},e._disposeResource=function(){this._source&&(this._source=null,this._setGPUMemory(0))},e._getSource=function(){return this._source},HTMLImage.create=function(t,e){return new HTMLImage},HTMLImage}(),Qt=function(t){function View(){this._watchMap={},this._widget=null,this._dataSource=null,this._anchorX=NaN,this._anchorY=NaN,this._widget=Dt.EMPTY,View.__super.call(this)}n(View,"laya.ui.View",t);var e=View.prototype;return e.destroy=function(e){void 0===e&&(e=!0),this._watchMap=null,t.prototype.destroy.call(this,e)},e.changeData=function(t){var e=this._watchMap[t];if(e)for(var i=0,s=e.length;i3?3:t,this.callLater(this.changeClips))}),r(0,e,"label",function(){return this._text?this._text.text:null},function(t){(this._text||t)&&(this.createText(),this._text.text!=t&&(t&&!this._text.parent&&this.addChild(this._text),this._text.text=(t+"").replace(/\\n/g,"\n"),this._setStateChanged()))}),r(0,e,"labelSize",function(){return this.createText(),this._text.fontSize},function(t){this.createText(),this._text.fontSize=t}),r(0,e,"selected",function(){return this._selected},function(t){this._selected!=t&&(this._selected=t,this.state=this._selected?2:0,this.event("change"))}),r(0,e,"strokeColors",function(){return this._strokeColors?this._strokeColors.join(","):""},function(t){this._strokeColors=J.fillArray(m.buttonLabelColors,t,String),this._setStateChanged()}),r(0,e,"labelColors",function(){return this._labelColors.join(",")},function(t){this._labelColors=J.fillArray(m.buttonLabelColors,t,String),this._setStateChanged()}),r(0,e,"labelStroke",function(){return this.createText(),this._text.stroke},function(t){this.createText(),this._text.stroke=t}),r(0,e,"labelStrokeColor",function(){return this.createText(),this._text.strokeColor},function(t){this.createText(),this._text.strokeColor=t}),r(0,e,"labelBold",function(){return this.createText(),this._text.bold},function(t){this.createText(),this._text.bold=t}),r(0,e,"labelFont",function(){return this.createText(),this._text.font},function(t){this.createText(),this._text.font=t}),r(0,e,"labelAlign",function(){return this.createText(),this._text.align},function(t){this.createText(),this._text.align=t}),r(0,e,"clickHandler",function(){return this._clickHandler},function(t){this._clickHandler=t}),r(0,e,"sizeGrid",function(){return this._bitmap.sizeGrid?this._bitmap.sizeGrid.join(","):null},function(t){this._bitmap.sizeGrid=J.fillArray(m.defaultSizeGrid,t,Number)}),r(0,e,"width",t.prototype._$get_width,function(t){i.superSet(jt,this,"width",t),this._autoSize&&(this._bitmap.width=t,this._text&&(this._text.width=t))}),r(0,e,"height",t.prototype._$get_height,function(t){i.superSet(jt,this,"height",t),this._autoSize&&(this._bitmap.height=t,this._text&&(this._text.height=t))}),r(0,e,"dataSource",t.prototype._$get_dataSource,function(t){this._dataSource=t,"number"==typeof t||"string"==typeof t?this.label=t+"":i.superSet(jt,this,"dataSource",t)}),r(0,e,"iconOffset",function(){return this._bitmap._offset?this._bitmap._offset.join(","):null},function(t){this._bitmap._offset=t?J.fillArray([1,1],t,Number):[]}),s(Button,["stateMap",function(){return this.stateMap={mouseup:0,mouseover:1,mousedown:2,mouseout:0}}]),Button}(jt),ee=function(t){function Clip(t,e,i){this._sources=null,this._bitmap=null,this._skin=null,this._clipX=1,this._clipY=1,this._clipWidth=0,this._clipHeight=0,this._autoPlay=!1,this._interval=50,this._complete=null,this._isPlaying=!1,this._index=0,this._clipChanged=!1,this._group=null,this._toIndex=-1,Clip.__super.call(this),void 0===e&&(e=1),void 0===i&&(i=1),this._clipX=e,this._clipY=i,this.skin=t}n(Clip,"laya.ui.Clip",t);var e=Clip.prototype;return e.destroy=function(e){void 0===e&&(e=!0),t.prototype.destroy.call(this,!0),this._bitmap&&this._bitmap.destroy(),this._bitmap=null,this._sources=null},e.dispose=function(){this.destroy(!0),i.loader.clearRes(this._skin)},e.createChildren=function(){this.graphics=this._bitmap=new Yt},e._onDisplay=function(t){this._isPlaying?this._getBit(128)?this.play():this.stop():this._autoPlay&&this.play()},e._skinLoaded=function(){this._setClipChanged(),this._sizeChanged(),this.event("loaded")},e.changeClip=function(){if(this._clipChanged=!1,this._skin){var t=kt.getRes(this._skin);t?this.loadComplete(this._skin,t):i.loader.load(this._skin,l.create(this,this.loadComplete,[this._skin]))}},e.loadComplete=function(t,e){if(t===this._skin&&e){var i=this._clipWidth||Math.ceil(e.sourceWidth/this._clipX),s=this._clipHeight||Math.ceil(e.sourceHeight/this._clipY),n=this._skin+i+s,r=ut.I.get(n);if(dt.isOkTextureList(r)||(r=null),r)this._sources=r;else{this._sources=[];for(var a=0;a-1&&this._index>=this._toIndex?this.stop():this._index>=this._sources.length&&(this._index=0),this.index=this._index)},e.stop=function(){this._isPlaying=!1,i.timer.clear(this,this._loop),this.event("complete")},e._setClipChanged=function(){this._clipChanged||(this._clipChanged=!0,this.callLater(this.changeClip))},r(0,e,"interval",function(){return this._interval},function(t){this._interval!=t&&(this._interval=t,this._isPlaying&&this.play())}),r(0,e,"skin",function(){return this._skin},function(t){this._skin!=t&&(this._skin=t,t?kt.getRes(t)?this._skinLoaded():i.loader.load(this._skin,l.create(this,this._skinLoaded),null,"image",1):this._bitmap.source=null)}),r(0,e,"sources",function(){return this._sources},function(t){this._sources=t,this.index=this._index,this.event("loaded")}),r(0,e,"clipX",function(){return this._clipX},function(t){this._clipX=t||1,this._setClipChanged()}),r(0,e,"clipY",function(){return this._clipY},function(t){this._clipY=t||1,this._setClipChanged()}),r(0,e,"total",function(){return this.runCallLater(this.changeClip),this._sources?this._sources.length:0}),r(0,e,"clipWidth",function(){return this._clipWidth},function(t){this._clipWidth=t,this._setClipChanged()}),r(0,e,"sizeGrid",function(){return this._bitmap.sizeGrid?this._bitmap.sizeGrid.join(","):null},function(t){this._bitmap.sizeGrid=J.fillArray(m.defaultSizeGrid,t,Number)}),r(0,e,"group",function(){return this._group},function(t){t&&this._skin&&kt.setGroup(this._skin,t),this._group=t}),r(0,e,"clipHeight",function(){return this._clipHeight},function(t){this._clipHeight=t,this._setClipChanged()}),r(0,e,"width",t.prototype._$get_width,function(t){i.superSet(jt,this,"width",t),this._bitmap.width=t}),r(0,e,"height",t.prototype._$get_height,function(t){i.superSet(jt,this,"height",t),this._bitmap.height=t}),r(0,e,"index",function(){return this._index},function(t){this._index=t,this._bitmap&&this._sources&&(this._bitmap.source=this._sources[t]),this.event("change")}),r(0,e,"autoPlay",function(){return this._autoPlay},function(t){this._autoPlay!=t&&(this._autoPlay=t,t?this.play():this.stop())}),r(0,e,"isPlaying",function(){return this._isPlaying},function(t){this._isPlaying=t}),r(0,e,"dataSource",t.prototype._$get_dataSource,function(t){this._dataSource=t,"number"==typeof t&&Math.floor(t)==t||"string"==typeof t?this.index=parseInt(t):i.superSet(jt,this,"dataSource",t)}),r(0,e,"bitmap",function(){return this._bitmap}),Clip}(jt),ie=function(t){function Label(t){this._tf=null,Label.__super.call(this),void 0===t&&(t=""),this.text=t}n(Label,"laya.ui.Label",t);var e=Label.prototype;return e.destroy=function(e){void 0===e&&(e=!0),t.prototype.destroy.call(this,e),this._tf=null},e.createChildren=function(){this.addChild(this._tf=new Vt)},e.changeText=function(t){this._tf.changeText(t)},e.measureWidth=function(){return this._tf.width},e.measureHeight=function(){return this._tf.height},r(0,e,"padding",function(){return this._tf.padding.join(",")},function(t){this._tf.padding=J.fillArray(m.labelPadding,t,Number)}),r(0,e,"bold",function(){return this._tf.bold},function(t){this._tf.bold=t}),r(0,e,"align",function(){return this._tf.align},function(t){this._tf.align=t}),r(0,e,"text",function(){return this._tf.text},function(t){this._tf.text!=t&&(t&&(t=J.adptString(t+"")),this._tf.text=t,this.event("change"),this._width&&this._height||this.onCompResize())}),r(0,e,"italic",function(){return this._tf.italic},function(t){this._tf.italic=t}),r(0,e,"wordWrap",function(){return this._tf.wordWrap},function(t){this._tf.wordWrap=t}),r(0,e,"font",function(){return this._tf.font},function(t){this._tf.font=t}),r(0,e,"dataSource",t.prototype._$get_dataSource,function(t){this._dataSource=t,"number"==typeof t||"string"==typeof t?this.text=t+"":i.superSet(jt,this,"dataSource",t)}),r(0,e,"color",function(){return this._tf.color},function(t){this._tf.color=t}),r(0,e,"valign",function(){return this._tf.valign},function(t){this._tf.valign=t}),r(0,e,"leading",function(){return this._tf.leading},function(t){this._tf.leading=t}),r(0,e,"fontSize",function(){return this._tf.fontSize},function(t){this._tf.fontSize=t}),r(0,e,"bgColor",function(){return this._tf.bgColor},function(t){this._tf.bgColor=t}),r(0,e,"borderColor",function(){return this._tf.borderColor},function(t){this._tf.borderColor=t}),r(0,e,"stroke",function(){return this._tf.stroke},function(t){this._tf.stroke=t}),r(0,e,"strokeColor",function(){return this._tf.strokeColor},function(t){this._tf.strokeColor=t}),r(0,e,"textField",function(){return this._tf}),r(0,e,"width",function(){return this._width||this._tf.text?i.superGet(jt,this,"width"):0},function(t){i.superSet(jt,this,"width",t),this._tf.width=t}),r(0,e,"height",function(){return this._height||this._tf.text?i.superGet(jt,this,"height"):0},function(t){i.superSet(jt,this,"height",t),this._tf.height=t}),r(0,e,"overflow",function(){return this._tf.overflow},function(t){this._tf.overflow=t}),r(0,e,"underline",function(){return this._tf.underline},function(t){this._tf.underline=t}),r(0,e,"underlineColor",function(){return this._tf.underlineColor},function(t){this._tf.underlineColor=t}),Label}(jt),se=function(t){function ScrollBar(t){this.rollRatio=.97,this.changeHandler=null,this.scaleBar=!0,this.autoHide=!1,this.elasticDistance=0,this.elasticBackTime=500,this.upButton=null,this.downButton=null,this.slider=null,this._scrollSize=1,this._skin=null,this._thumbPercent=1,this._target=null,this._lastPoint=null,this._lastOffset=0,this._checkElastic=!1,this._isElastic=!1,this._value=NaN,this._hide=!1,this._clickOnly=!0,this._offsets=null,this.isLockedFun=null,this.triggerDownDragLimit=null,this.triggerUpDragLimit=null,ScrollBar.__super.call(this),this._showButtons=_t.showButtons,this._touchScrollEnable=_t.touchScrollEnable,this._mouseWheelEnable=_t.mouseWheelEnable,this.skin=t,this.max=1}n(ScrollBar,"laya.ui.ScrollBar",t);var e=ScrollBar.prototype;return e.destroy=function(e){void 0===e&&(e=!0),this.stopScroll(),this.target=null,t.prototype.destroy.call(this,e),this.upButton&&this.upButton.destroy(e),this.downButton&&this.downButton.destroy(e),this.slider&&this.slider.destroy(e),this.upButton=this.downButton=null,this.slider=null,this.changeHandler=null,this._offsets=null},e.createChildren=function(){this.addChild(this.slider=new ne),this.addChild(this.upButton=new te),this.addChild(this.downButton=new te)},e.initialize=function(){this.slider.showLabel=!1,this.slider.tick=0,this.slider.on("change",this,this.onSliderChange),this.slider.setSlider(0,0,0),this.upButton.on("mousedown",this,this.onButtonMouseDown),this.downButton.on("mousedown",this,this.onButtonMouseDown)},e.onSliderChange=function(){this._value!=this.slider.value&&(this.value=this.slider.value)},e.onButtonMouseDown=function(t){var e=t.currentTarget===this.upButton;this.slide(e),i.timer.once(m.scrollBarDelayTime,this,this.startLoop,[e]),i.stage.once("mouseup",this,this.onStageMouseUp)},e.startLoop=function(t){i.timer.frameLoop(1,this,this.slide,[t])},e.slide=function(t){t?this.value-=this._scrollSize:this.value+=this._scrollSize},e.onStageMouseUp=function(t){i.timer.clear(this,this.startLoop),i.timer.clear(this,this.slide)},e._skinLoaded=function(){this.slider.skin=this._skin,this.callLater(this.changeScrollBar),this._sizeChanged(),this.event("loaded")},e.changeScrollBar=function(){this.upButton.visible=this._showButtons,this.downButton.visible=this._showButtons,this._showButtons&&(this.upButton.skin=this._skin.replace(".png","$up.png"),this.downButton.skin=this._skin.replace(".png","$down.png")),this.slider.isVertical?this.slider.y=this._showButtons?this.upButton.height:0:this.slider.x=this._showButtons?this.upButton.width:0,this.resetPositions(),this.repaint()},e._sizeChanged=function(){t.prototype._sizeChanged.call(this),this.repaint(),this.resetPositions(),this.event("change"),this.changeHandler&&this.changeHandler.runWith(this.value)},e.resetPositions=function(){this.slider.isVertical?this.slider.height=this.height-(this._showButtons?this.upButton.height+this.downButton.height:0):this.slider.width=this.width-(this._showButtons?this.upButton.width+this.downButton.width:0),this.resetButtonPosition()},e.resetButtonPosition=function(){this.slider.isVertical?this.downButton.y=this.slider._y+this.slider.height:this.downButton.x=this.slider._x+this.slider.width},e.measureWidth=function(){return this.slider.isVertical?this.slider.width:100},e.measureHeight=function(){return this.slider.isVertical?100:this.slider.height},e.setScroll=function(t,e,i){this.runCallLater(this._sizeChanged),this.slider.setSlider(t,e,i),this.slider.bar.visible=e>0,!this._hide&&this.autoHide&&(this.visible=!1)},e.onTargetMouseWheel=function(t){this.value-=t.delta*this._scrollSize,this.target=this._target},e.onTargetMouseDown=function(t){this.isLockedFun&&!this.isLockedFun(t)||(this.event("end"),this._clickOnly=!0,this._lastOffset=0,this._checkElastic=!1,this._lastPoint||(this._lastPoint=new it),this._lastPoint.setTo(i.stage.mouseX,i.stage.mouseY),i.timer.clear(this,this.tweenMove),R.clearTween(this),i.stage.once("mouseup",this,this.onStageMouseUp2),i.stage.once("mouseout",this,this.onStageMouseUp2),i.timer.frameLoop(1,this,this.loop))},e.startDragForce=function(){this._clickOnly=!0,this._lastOffset=0,this._checkElastic=!1,this._lastPoint||(this._lastPoint=new it),this._lastPoint.setTo(i.stage.mouseX,i.stage.mouseY),i.timer.clear(this,this.tweenMove),R.clearTween(this),i.stage.once("mouseup",this,this.onStageMouseUp2),i.stage.once("mouseout",this,this.onStageMouseUp2),i.timer.frameLoop(1,this,this.loop)},e.cancelDragOp=function(){i.stage.off("mouseup",this,this.onStageMouseUp2),i.stage.off("mouseout",this,this.onStageMouseUp2),i.timer.clear(this,this.tweenMove),i.timer.clear(this,this.loop),this._target.mouseEnabled=!0},e.checkTriggers=function(t){return void 0===t&&(t=!1),this.value>=0&&this.value-this._lastOffset<=0&&this.triggerDownDragLimit&&this.triggerDownDragLimit(t)?(this.cancelDragOp(),this.value=0,!0):!!(this.value<=this.max&&this.value-this._lastOffset>=this.max&&this.triggerUpDragLimit&&this.triggerUpDragLimit(t))&&(this.cancelDragOp(),this.value=this.max,!0)},e.startTweenMoveForce=function(t){this._lastOffset=t,i.timer.frameLoop(1,this,this.tweenMove,[200])},e.loop=function(){var t=i.stage.mouseY,e=i.stage.mouseX;if(this._lastOffset=this.isVertical?t-this._lastPoint.y:e-this._lastPoint.x,this._clickOnly){if(!(Math.abs(this._lastOffset*(this.isVertical?i.stage._canvasTransform.getScaleY():i.stage._canvasTransform.getScaleX()))>1))return;if(this._clickOnly=!1,this.checkTriggers())return;this._offsets||(this._offsets=[]),this._offsets.length=0,this._target.mouseEnabled=!1,!this.hide&&this.autoHide&&(this.alpha=1,this.visible=!0),this.event("start")}else if(this.checkTriggers())return;this._offsets.push(this._lastOffset),this._lastPoint.x=e,this._lastPoint.y=t,0!==this._lastOffset&&(this._checkElastic||(this.elasticDistance>0?this._checkElastic||0==this._lastOffset||(this._lastOffset>0&&this._value<=this.min||this._lastOffset<0&&this._value>=this.max?(this._isElastic=!0,this._checkElastic=!0):this._isElastic=!1):this._checkElastic=!0),this._isElastic?this._value<=this.min?this._lastOffset>0?this.value-=this._lastOffset*Math.max(0,1-(this.min-this._value)/this.elasticDistance):(this.value-=.5*this._lastOffset,this._value>=this.min&&(this._checkElastic=!1)):this._value>=this.max&&(this._lastOffset<0?this.value-=this._lastOffset*Math.max(0,1-(this._value-this.max)/this.elasticDistance):(this.value-=.5*this._lastOffset,this._value<=this.max&&(this._checkElastic=!1))):this.value-=this._lastOffset)},e.onStageMouseUp2=function(t){if(i.stage.off("mouseup",this,this.onStageMouseUp2),i.stage.off("mouseout",this,this.onStageMouseUp2),i.timer.clear(this,this.loop),!(this._clickOnly&&this._value>=this.min&&this._value<=this.max))if(this._target.mouseEnabled=!0,this._isElastic)this._valuethis.max&&R.to(this,{value:this.max},this.elasticBackTime,ot.sineOut,l.create(this,this.elasticOver));else{if(!this._offsets)return;this._offsets.length<1&&(this._offsets[0]=this.isVertical?i.stage.mouseY-this._lastPoint.y:i.stage.mouseX-this._lastPoint.x);for(var e=0,s=Math.min(this._offsets.length,3),n=0;n250&&(this._lastOffset=this._lastOffset>0?250:-250);var r=Math.round(Math.abs(this.elasticDistance*(this._lastOffset/150)));i.timer.frameLoop(1,this,this.tweenMove,[r])}},e.elasticOver=function(){this._isElastic=!1,!this.hide&&this.autoHide&&R.to(this,{alpha:0},500),this.event("end")},e.tweenMove=function(t){if(this._lastOffset*=this.rollRatio,!this.checkTriggers(!0)){var e=NaN;if(t>0&&(this._lastOffset>0&&this.value<=this.min?(this._isElastic=!0,e=.5*-(this.min-t-this.value),this._lastOffset>e&&(this._lastOffset=e)):this._lastOffset<0&&this.value>=this.max&&(this._isElastic=!0,e=.5*-(this.max+t-this.value),this._lastOffsetthis.max?R.to(this,{value:this.max},this.elasticBackTime,ot.sineOut,l.create(this,this.elasticOver)):this.elasticOver());this.event("end"),!this.hide&&this.autoHide&&R.to(this,{alpha:0},500)}}},e.stopScroll=function(){this.onStageMouseUp2(null),i.timer.clear(this,this.tweenMove),R.clearTween(this)},r(0,e,"thumbPercent",function(){return this._thumbPercent},function(t){this.runCallLater(this.changeScrollBar),this.runCallLater(this._sizeChanged),t=t>=1?.99:t,this._thumbPercent=t,this.scaleBar&&(this.slider.isVertical?this.slider.bar.height=Math.max(this.slider.height*t,m.scrollBarMinNum):this.slider.bar.width=Math.max(this.slider.width*t,m.scrollBarMinNum))}),r(0,e,"dataSource",t.prototype._$get_dataSource,function(t){this._dataSource=t,"number"==typeof t||"string"==typeof t?this.value=Number(t):i.superSet(jt,this,"dataSource",t)}),r(0,e,"skin",function(){return this._skin},function(t){" "!=t&&this._skin!=t&&(this._skin=t,this._skin&&!kt.getRes(this._skin)?i.loader.load([this._skin,this._skin.replace(".png","$up.png"),this._skin.replace(".png","$down.png"),this._skin.replace(".png","$bar.png")],l.create(this,this._skinLoaded)):this._skinLoaded())}),r(0,e,"max",function(){return this.slider.max},function(t){this.slider.max=t}),r(0,e,"min",function(){return this.slider.min},function(t){this.slider.min=t}),r(0,e,"value",function(){return this._value},function(t){t!==this._value&&(this._value=t,this._isElastic||(this.slider._value!=t&&(this.slider._value=t,this.slider.changeValue()),this._value=this.slider._value),this.event("change"),this.changeHandler&&this.changeHandler.runWith(this._value))}),r(0,e,"isVertical",function(){return this.slider.isVertical},function(t){this.slider.isVertical=t}),r(0,e,"sizeGrid",function(){return this.slider.sizeGrid},function(t){this.slider.sizeGrid=t}),r(0,e,"scrollSize",function(){return this._scrollSize},function(t){this._scrollSize=t}),r(0,e,"target",function(){return this._target},function(t){this._target&&(this._target.off("mousewheel",this,this.onTargetMouseWheel),this._target.off("mousedown",this,this.onTargetMouseDown)),this._target=t,t&&(this._mouseWheelEnable&&this._target.on("mousewheel",this,this.onTargetMouseWheel),this._touchScrollEnable&&this._target.on("mousedown",this,this.onTargetMouseDown))}),r(0,e,"hide",function(){return this._hide},function(t){this._hide=t,this.visible=!t}),r(0,e,"showButtons",function(){return this._showButtons},function(t){this._showButtons=t,this.callLater(this.changeScrollBar)}),r(0,e,"touchScrollEnable",function(){return this._touchScrollEnable},function(t){this._touchScrollEnable=t,this.target=this._target}),r(0,e,"mouseWheelEnable",function(){return this._mouseWheelEnable},function(t){this._mouseWheelEnable=t,this.target=this._target}),r(0,e,"lastOffset",function(){return this._lastOffset}),r(0,e,"tick",function(){return this.slider.tick},function(t){this.slider.tick=t}),ScrollBar}(jt),ne=function(t){function Slider(t){this.changeHandler=null,this.isVertical=!0,this.showLabel=!0,this._allowClickBack=!1,this._max=100,this._min=0,this._tick=1,this._value=0,this._skin=null,this._bg=null,this._progress=null,this._bar=null,this._tx=NaN,this._ty=NaN,this._maxMove=NaN,this._globalSacle=null,Slider.__super.call(this),this.skin=t}n(Slider,"laya.ui.Slider",t);var e=Slider.prototype;return e.destroy=function(e){void 0===e&&(e=!0),t.prototype.destroy.call(this,e),this._bg&&this._bg.destroy(e),this._bar&&this._bar.destroy(e),this._progress&&this._progress.destroy(e),this._bg=null,this._bar=null,this._progress=null,this.changeHandler=null},e.createChildren=function(){this.addChild(this._bg=new Zt),this.addChild(this._bar=new te)},e.initialize=function(){this._bar.on("mousedown",this,this.onBarMouseDown),this._bg.sizeGrid=this._bar.sizeGrid="4,4,4,4,0",this._progress&&(this._progress.sizeGrid=this._bar.sizeGrid),this.allowClickBack=!0},e.onBarMouseDown=function(t){this._globalSacle||(this._globalSacle=new it),this._globalSacle.setTo(this.globalScaleX||.01,this.globalScaleY||.01),this._maxMove=this.isVertical?this.height-this._bar.height:this.width-this._bar.width,this._tx=i.stage.mouseX,this._ty=i.stage.mouseY,i.stage.on("mousemove",this,this.mouseMove),i.stage.once("mouseup",this,this.mouseUp),i.stage.once("mouseout",this,this.mouseUp),this.showValueText()},e.showValueText=function(){if(this.showLabel){var t=laya.ui.Slider.label;this.addChild(t),t.textField.changeText(this._value+""),this.isVertical?(t.x=this._bar._x+20,t.y=.5*(this._bar.height-t.height)+this._bar._y):(t.y=this._bar._y-20,t.x=.5*(this._bar.width-t.width)+this._bar._x)}},e.hideValueText=function(){laya.ui.Slider.label&&laya.ui.Slider.label.removeSelf()},e.mouseUp=function(t){i.stage.off("mousemove",this,this.mouseMove),i.stage.off("mouseup",this,this.mouseUp),i.stage.off("mouseout",this,this.mouseUp),this.sendChangeEvent("changed"),this.hideValueText()},e.mouseMove=function(t){var e=this._value;if(this.isVertical?(this._bar.y+=(i.stage.mouseY-this._ty)/this._globalSacle.y,this._bar._y>this._maxMove?this._bar.y=this._maxMove:this._bar._y<0&&(this._bar.y=0),this._value=this._bar._y/this._maxMove*(this._max-this._min)+this._min,this._progress&&(this._progress.height=this._bar._y+.5*this._bar.height)):(this._bar.x+=(i.stage.mouseX-this._tx)/this._globalSacle.x,this._bar._x>this._maxMove?this._bar.x=this._maxMove:this._bar._x<0&&(this._bar.x=0),this._value=this._bar._x/this._maxMove*(this._max-this._min)+this._min,this._progress&&(this._progress.width=this._bar._x+.5*this._bar.width)),this._tx=i.stage.mouseX,this._ty=i.stage.mouseY,0!=this._tick){var s=Math.pow(10,(this._tick+"").length-1);this._value=Math.round(Math.round(this._value/this._tick)*this._tick*s)/s}this._value!=e&&this.sendChangeEvent(),this.showValueText()},e.sendChangeEvent=function(t){void 0===t&&(t="change"),this.event(t),this.changeHandler&&this.changeHandler.runWith(this._value)},e._skinLoaded=function(){this._bg.skin=this._skin,this._bar.skin=this._skin.replace(".png","$bar.png");var t=this._skin.replace(".png","$progress.png");kt.getRes(t)&&(this._progress||(this.addChild(this._progress=new Zt),this._progress.sizeGrid=this._bar.sizeGrid,this.setChildIndex(this._progress,1)),this._progress.skin=t),this.setBarPoint(),this.callLater(this.changeValue),this._sizeChanged(),this.event("loaded")},e.setBarPoint=function(){this.isVertical?this._bar.x=Math.round(.5*(this._bg.width-this._bar.width)):this._bar.y=Math.round(.5*(this._bg.height-this._bar.height))},e.measureWidth=function(){return Math.max(this._bg.width,this._bar.width)},e.measureHeight=function(){return Math.max(this._bg.height,this._bar.height)},e._sizeChanged=function(){t.prototype._sizeChanged.call(this),this.isVertical?this._bg.height=this.height:this._bg.width=this.width,this.setBarPoint(),this.changeValue()},e.setSlider=function(t,e,i){this._value=-1,this._min=t,this._max=e>t?e:t,this.value=ie?e:i},e.changeValue=function(){if(0!=this.tick){var t=Math.pow(10,(this._tick+"").length-1);this._value=Math.round(Math.round(this._value/this._tick)*this._tick*t)/t}this._value=this._value>this._max?this._max:this._value0&&(this._repeatX2=this._isVertical?Math.round(this._width/e):Math.ceil(this._width/e)),this._height>0&&(this._repeatY2=this._isVertical?Math.ceil(this._height/i):Math.round(this._height/i));var s=this._width?this._width:e*this.repeatX-this._spaceX,n=this._height?this._height:i*this.repeatY-this._spaceY;this._cellSize=this._isVertical?i:e,this._cellOffset=this._isVertical?i*Math.max(this._repeatY2,this._repeatY)-n-this._spaceY:e*Math.max(this._repeatX2,this._repeatX)-s-this._spaceX,this._isVertical&&this.vScrollBarSkin?this._scrollBar.height=n:!this._isVertical&&this.hScrollBarSkin&&(this._scrollBar.width=s),this.setContentSize(s,n);var r=this._isVertical?this.repeatX:this.repeatY,a=(this._isVertical?this.repeatY:this.repeatX)+(this._scrollBar?1:0);this._createItems(0,r,a),this._createdLine=a,this._array&&(this.array=this._array,this.runCallLater(this.renderItems))}},e._getOneCell=function(){if(0===this._cells.length){var t=this.createItem();if(this._offset.setTo(t._x,t._y),this.cacheContent)return t;this._cells.push(t)}return this._cells[0]},e._createItems=function(t,e,i){var s=this._content,n=this._getOneCell(),r=n.width+this._spaceX,a=n.height+this._spaceY;if(this.cacheContent){var o=new Jt;o.cacheAs="normal",o.pos((this._isVertical?0:t)*r,(this._isVertical?t:0)*a),this._content.addChild(o),s=o}else{for(var h=[],l=this._cells.length-1;l>-1;l--){var c=this._cells[l];c.removeSelf(),h.push(c)}this._cells.length=0}for(var u=t;uthis._startIndex){a=r-this._startIndex;var o=!0,h=this._startIndex+i*(s+1);this._isMoved=!0}else r=0&&e=0&&this.renderItems(e),this._preLen=this._array.length),this._scrollBar){var i=t.length,s=this._isVertical?this.repeatX:this.repeatY,n=this._isVertical?this.repeatY:this.repeatX,r=Math.ceil(i/s);r>=n&&(this._scrollBar.thumbPercent=n/r,this._scrollBar.slider._max=(r-n)*this._cellSize+this._cellOffset)}},e.refresh=function(){this.array=this._array},e.getItem=function(t){return t>-1&&t-1&&t=this._startIndex&&t-1&&this._cells?this._cells[(t-this._startIndex)%this._cells.length]:null},e.scrollTo=function(t){if(this._scrollBar){var e=this._isVertical?this.repeatX:this.repeatY;this._scrollBar.value=Math.floor(t/e)*this._cellSize}else this.startIndex=t},e.tweenTo=function(t,e,i){if(void 0===e&&(e=200),this._scrollBar){this._scrollBar.stopScroll();var s=this._isVertical?this.repeatX:this.repeatY;R.to(this._scrollBar,{value:Math.floor(t/s)*this._cellSize},e,null,i,0,!0)}else this.startIndex=t,i&&i.run()},e._setCellChanged=function(){this._cellChanged||(this._cellChanged=!0,this.callLater(this.changeCells))},e.commitMeasure=function(){this.runCallLater(this.changeCells)},r(0,e,"cacheAs",t.prototype._$get_cacheAs,function(t){i.superSet(Jt,this,"cacheAs",t),this._scrollBar&&(this._usedCache=null,"none"!==t?this._scrollBar.on("start",this,this.onScrollStart):this._scrollBar.off("start",this,this.onScrollStart))}),r(0,e,"content",function(){return this._content}),r(0,e,"height",t.prototype._$get_height,function(t){t!=this._height&&(i.superSet(Jt,this,"height",t),this._setCellChanged())}),r(0,e,"itemRender",function(){return this._itemRender},function(t){if(this._itemRender!=t){this._itemRender=t;for(var e=this._cells.length-1;e>-1;e--)this._cells[e].destroy();this._cells.length=0,this._setCellChanged()}}),r(0,e,"vScrollBarSkin",function(){return this._scrollBar?this._scrollBar.skin:null},function(t){this._removePreScrollBar();var e=new he;e.name="scrollBar",e.right=0,e.skin=t,e.elasticDistance=this._elasticEnabled?200:0,this.scrollBar=e,this.addChild(e),this._setCellChanged()}),r(0,e,"page",function(){return this._page},function(t){this._page=t,this._array&&(this._page=t>0?t:0,this._page=this._page0?this._repeatX:this._repeatX2>0?this._repeatX2:1},function(t){this._repeatX=t,this._setCellChanged()}),r(0,e,"scrollBar",function(){return this._scrollBar},function(t){this._scrollBar!=t&&(this._scrollBar=t,t&&(this._isVertical=this._scrollBar.isVertical,this.addChild(this._scrollBar),this._scrollBar.on("change",this,this.onScrollBarChange)))}),r(0,e,"width",t.prototype._$get_width,function(t){t!=this._width&&(i.superSet(Jt,this,"width",t),this._setCellChanged())}),r(0,e,"repeatY",function(){return this._repeatY>0?this._repeatY:this._repeatY2>0?this._repeatY2:1},function(t){this._repeatY=t,this._setCellChanged()}),r(0,e,"spaceX",function(){return this._spaceX},function(t){this._spaceX=t,this._setCellChanged()}),r(0,e,"spaceY",function(){return this._spaceY},function(t){this._spaceY=t,this._setCellChanged()}),r(0,e,"selectedIndex",function(){return this._selectedIndex},function(t){this._selectedIndex!=t&&(this._selectedIndex=t,this.changeSelectStatus(),this.event("change"),this.selectHandler&&this.selectHandler.runWith(t),this.startIndex=this._startIndex)}),r(0,e,"selectedItem",function(){return-1!=this._selectedIndex?this._array[this._selectedIndex]:null},function(t){this.selectedIndex=this._array.indexOf(t)}),r(0,e,"length",function(){return this._array?this._array.length:0}),r(0,e,"selection",function(){return this.getCell(this._selectedIndex)},function(t){this.selectedIndex=this._startIndex+this._cells.indexOf(t)}),r(0,e,"startIndex",function(){return this._startIndex},function(t){this._startIndex=t>0?t:0,this.callLater(this.renderItems)}),r(0,e,"array",function(){return this._array},function(t){this.runCallLater(this.changeCells),this._array=t||[],this._preLen=this._array.length;var e=this._array.length;if(this.totalPage=Math.ceil(e/(this.repeatX*this.repeatY)),this._selectedIndex=this._selectedIndex0?this.totalPage+1:this.totalPage)>1&&n>=s?(this._scrollBar.scrollSize=this._cellSize,this._scrollBar.thumbPercent=s/n,this._scrollBar.setScroll(0,(n-s)*this._cellSize+this._cellOffset,this._scrollBar.value),this._scrollBar.target=this._content):(this._scrollBar.setScroll(0,0,0),this._scrollBar.target=this._content)}}),r(0,e,"dataSource",t.prototype._$get_dataSource,function(t){this._dataSource=t,"number"==typeof t&&Math.floor(t)==t||"string"==typeof t?this.selectedIndex=parseInt(t):t instanceof Array?this.array=t:i.superSet(Jt,this,"dataSource",t)}),r(0,e,"cells",function(){return this.runCallLater(this.changeCells),this._cells}),r(0,e,"elasticEnabled",function(){return this._elasticEnabled},function(t){this._elasticEnabled=t,this._scrollBar&&(this._scrollBar.elasticDistance=t?200:0)}),List}(Jt),ae=function(t){function Panel(){this._content=null,this._vScrollBar=null,this._hScrollBar=null,this._scrollChanged=!1,this._usedCache=null,this._elasticEnabled=!1,Panel.__super.call(this),this.width=this.height=100}n(Panel,"laya.ui.Panel",t);var e=Panel.prototype;return e.destroy=function(t){void 0===t&&(t=!0),laya.ui.UIComponent.prototype.destroy.call(this,t),this._content&&this._content.destroy(t),this._vScrollBar&&this._vScrollBar.destroy(t),this._hScrollBar&&this._hScrollBar.destroy(t),this._vScrollBar=null,this._hScrollBar=null,this._content=null},e.destroyChildren=function(){this._content.destroyChildren()},e.createChildren=function(){laya.display.Node.prototype.addChild.call(this,this._content=new Jt)},e.addChild=function(t){return t.on("resize",this,this.onResize),this._setScrollChanged(),this._content.addChild(t)},e.onResize=function(){this._setScrollChanged()},e.addChildAt=function(t,e){return t.on("resize",this,this.onResize),this._setScrollChanged(),this._content.addChildAt(t,e)},e.removeChild=function(t){return t.off("resize",this,this.onResize),this._setScrollChanged(),this._content.removeChild(t)},e.removeChildAt=function(t){return this.getChildAt(t).off("resize",this,this.onResize),this._setScrollChanged(),this._content.removeChildAt(t)},e.removeChildren=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=2147483647),this._content.removeChildren(t,e),this._setScrollChanged(),this},e.getChildAt=function(t){return this._content.getChildAt(t)},e.getChildByName=function(t){return this._content.getChildByName(t)},e.getChildIndex=function(t){return this._content.getChildIndex(t)},e.changeScroll=function(){this._scrollChanged=!1;var t=this.contentWidth||1,e=this.contentHeight||1,i=this._vScrollBar,s=this._hScrollBar,n=i&&e>this._height,r=s&&t>this._width,a=n?this._width-i.width:this._width,o=r?this._height-s.height:this._height;i&&(i.x=this._width-i.width,i.y=0,i.height=this._height-(r?s.height:0),i.scrollSize=Math.max(.033*this._height,1),i.thumbPercent=o/e,i.setScroll(0,e-o,i.value)),s&&(s.x=0,s.y=this._height-s.height,s.width=this._width-(n?i.width:0),s.scrollSize=Math.max(.033*this._width,1),s.thumbPercent=a/t,s.setScroll(0,t-a,s.value))},e._sizeChanged=function(){laya.ui.UIComponent.prototype._sizeChanged.call(this),this.setContentSize(this._width,this._height)},e.setContentSize=function(t,e){var i=this._content;i.width=t,i.height=e,i._style.scrollRect||(i.scrollRect=mt.create()),i._style.scrollRect.setTo(0,0,t,e),i.scrollRect=i.scrollRect},e.onScrollBarChange=function(t){var e=this._content._style.scrollRect;if(e){var i=Math.round(t.value);t.isVertical?e.y=i:e.x=i,this._content.scrollRect=e}},e.scrollTo=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.vScrollBar&&(this.vScrollBar.value=e),this.hScrollBar&&(this.hScrollBar.value=t)},e.refresh=function(){this.changeScroll()},e.onScrollStart=function(){this._usedCache||(this._usedCache=i.superGet(Jt,this,"cacheAs")),i.superSet(Jt,this,"cacheAs","none"),this._hScrollBar&&this._hScrollBar.once("end",this,this.onScrollEnd),this._vScrollBar&&this._vScrollBar.once("end",this,this.onScrollEnd)},e.onScrollEnd=function(){i.superSet(Jt,this,"cacheAs",this._usedCache)},e._setScrollChanged=function(){this._scrollChanged||(this._scrollChanged=!0,this.callLater(this.changeScroll))},r(0,e,"numChildren",function(){return this._content.numChildren}),r(0,e,"hScrollBarSkin",function(){return this._hScrollBar?this._hScrollBar.skin:null},function(t){null==this._hScrollBar&&(laya.display.Node.prototype.addChild.call(this,this._hScrollBar=new ce),this._hScrollBar.on("change",this,this.onScrollBarChange,[this._hScrollBar]),this._hScrollBar.target=this._content,this._hScrollBar.elasticDistance=this._elasticEnabled?200:0,this._setScrollChanged()),this._hScrollBar.skin=t}),r(0,e,"contentWidth",function(){for(var t=0,e=this._content.numChildren-1;e>-1;e--){var i=this._content.getChildAt(e);t=Math.max(i._x+i.width*i.scaleX-i.pivotX,t)}return t}),r(0,e,"contentHeight",function(){for(var t=0,e=this._content.numChildren-1;e>-1;e--){var i=this._content.getChildAt(e);t=Math.max(i._y+i.height*i.scaleY-i.pivotY,t)}return t}),r(0,e,"width",t.prototype._$get_width,function(t){i.superSet(Jt,this,"width",t),this._setScrollChanged()}),r(0,e,"hScrollBar",function(){return this._hScrollBar}),r(0,e,"content",function(){return this._content}),r(0,e,"height",t.prototype._$get_height,function(t){i.superSet(Jt,this,"height",t),this._setScrollChanged()}),r(0,e,"vScrollBarSkin",function(){return this._vScrollBar?this._vScrollBar.skin:null},function(t){null==this._vScrollBar&&(laya.display.Node.prototype.addChild.call(this,this._vScrollBar=new he),this._vScrollBar.on("change",this,this.onScrollBarChange,[this._vScrollBar]),this._vScrollBar.target=this._content,this._vScrollBar.elasticDistance=this._elasticEnabled?200:0,this._setScrollChanged()),this._vScrollBar.skin=t}),r(0,e,"vScrollBar",function(){return this._vScrollBar}),r(0,e,"cacheAs",t.prototype._$get_cacheAs,function(t){i.superSet(Jt,this,"cacheAs",t),this._usedCache=null,"none"!==t?(this._hScrollBar&&this._hScrollBar.on("start",this,this.onScrollStart),this._vScrollBar&&this._vScrollBar.on("start",this,this.onScrollStart)):(this._hScrollBar&&this._hScrollBar.off("start",this,this.onScrollStart),this._vScrollBar&&this._vScrollBar.off("start",this,this.onScrollStart))}),r(0,e,"elasticEnabled",function(){return this._elasticEnabled},function(t){this._elasticEnabled=t,this._vScrollBar&&(this._vScrollBar.elasticDistance=t?200:0),this._hScrollBar&&(this._hScrollBar.elasticDistance=t?200:0)}),Panel}(Jt),oe=function(t){function FontClip(t,e){this._valueArr=null,this._indexMap=null,this._sheet=null,this._direction="horizontal",this._spaceX=0,this._spaceY=0,this._align="left",this._wordsW=0,this._wordsH=0,FontClip.__super.call(this),t&&(this.skin=t),e&&(this.sheet=e)}n(FontClip,"laya.ui.FontClip",t);var e=FontClip.prototype;return e.createChildren=function(){this._bitmap=new Yt,this.on("loaded",this,this._onClipLoaded)},e._onClipLoaded=function(){this.callLater(this.changeValue)},e.changeValue=function(){var t;if(this._sources&&(this._valueArr&&(this.graphics.clear(!0),t=this._sources[0]))){var e="horizontal"===this._direction;e?(this._wordsW=this._valueArr.length*(t.sourceWidth+this.spaceX),this._wordsH=t.sourceHeight):(this._wordsW=t.sourceWidth,this._wordsH=(t.sourceHeight+this.spaceY)*this._valueArr.length);var i=0;if(this._width)switch(this._align){case"center":i=.5*(this._width-this._wordsW);break;case"right":i=this._width-this._wordsW;break;default:i=0}for(var s=0,n=this._valueArr.length;s