UNPKG

shadow-function

Version:

ioing lib - shadow Function, worker Function

1 lines 286 kB
var Laya=window.Laya=function(l,t){var u={__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?u.__presubstr.call(this,t):u.__presubstr.call(this,t,0<e?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 n=0;n<t;n++)i[n]=e;return i},__extend:function(t,e){for(var i in e)if(e.hasOwnProperty(i)){var n=Object.getOwnPropertyDescriptor(e,i),s=n.get,r=n.set;s||r?s&&r?Object.defineProperty(t,i,n):(s&&Object.defineProperty(t,i,s),r&&Object.defineProperty(t,i,r)):t[i]=e[i]}function o(){u.un(this,"constructor",t)}o.prototype=e.prototype,t.prototype=new o,u.un(t.prototype,"__imps",u.__copy({},e.prototype.__imps))},__copy:function(t,e){if(!e)return null;for(var i in t=t||{},e)t[i]=e[i];return t},__package:function(t,e){if(!u.__packages[t]){u.__packages[t]=!0;var i=l,n=t.split(".");if(1<n.length)for(var s=0,r=n.length-1;s<r;s++){var o=i[n[s]];i=o||(i[n[s]]={})}i[n[n.length-1]]||(i[n[n.length-1]]=e||{})}},__hasOwnProperty:function(t,e){return e=e||this,Object.hasOwnProperty.call(e,t)||function t(e,i){if(Object.hasOwnProperty.call(i.prototype,e))return!0;var n=i.prototype.__super;return null==n?null:t(e,n)}(t,e.__class)},__typeof:function(t,e){if(!t||!e)return!1;if(e===String)return"string"==typeof t;if(e===Number)return"number"==typeof t;if(e.__interface__)e=e.__interface__;else if("string"!=typeof e)return t instanceof e;return t.__imps&&t.__imps[e]||t.__class==e},__as:function(t,e){return this.__typeof(t,e)?t:null},__int:function(t){return t?parseInt(t):0},interface:function(t,e){u.__package(t,{});var i=u.__internals,n=i[t]=i[t]||{self:t};if(e){var s=e.split(",");n.extend=[];for(var r=0;r<s.length;r++){var o=s[r];i[o]=i[o]||{self:o},n.extend.push(i[o])}}var a=l,h=t.split(".");for(r=0;r<h.length-1;r++)a=a[h[r]];a[h[h.length-1]]={__interface__:t}},class:function(t,e,i,n){if(i&&u.__extend(t,i),e)if(u.__package(e,t),u.__classmap[e]=t,0<e.indexOf(".")){if(0==e.indexOf("laya.")){var s=e.split(".");n=n||s[s.length-1],u[n]&&console.log("Warning!,this class["+n+"] already exist:",u[n]),u[n]=t}}else"Main"==e?l.Main=t:(u[e]&&console.log("Error!,this class["+e+"] already exist:",u[e]),u[e]=t);var r=u.un,o=t.prototype;r(o,"hasOwnProperty",u.__hasOwnProperty),r(o,"__class",t),r(o,"__super",i),r(o,"__className",e),r(t,"__super",i),r(t,"__className",e),r(t,"__isclass",!0),r(t,"super",function(t){this.__super.call(t)})},imps:function(t,e){if(!e)return null;var s=t.__imps||u.un(t,"__imps",{});function r(t){var e,i;if((e=u.__internals[t])&&(s[t]=!0,i=e.extend))for(var n=0;n<i.length;n++)r(i[n].self)}for(var i in e)r(i)},superSet:function(t,e,i,n){var s=t.prototype["_$set_"+i];s&&s.call(e,n)},superGet:function(t,e,i){var n=t.prototype["_$get_"+i];return n?n.call(e):null},getset:function(t,e,i,n,s){t?(n&&(e["_$GET_"+i]=n),s&&(e["_$SET_"+i]=s)):(n&&u.un(e,"_$get_"+i,n),s&&u.un(e,"_$set_"+i,s)),n&&s?Object.defineProperty(e,i,{get:n,set:s,enumerable:!1,configurable:!0}):(n&&Object.defineProperty(e,i,{get:n,enumerable:!1,configurable:!0}),s&&Object.defineProperty(e,i,{set:s,enumerable:!1,configurable:!0}))},static:function(i,n){for(var s=0,t=n.length;s<t;s+=2)if("length"==n[s])i.length=n[s+1].call(i);else{function e(){var e=n[s],t=n[s+1];Object.defineProperty(i,e,{get:function(){return delete this[e],this[e]=t.call(this)},set:function(t){delete this[e],this[e]=t},enumerable:!0,configurable:!0})}e()}},un:function(t,e,i){return i||(i=t[e]),u.__propun.value=i,Object.defineProperty(t,e,u.__propun),i},uns:function(e,t){t.forEach(function(t){u.un(e,t)})}};return l.console=l.console||{log:function(){}},l.trace=l.console.log,Error.prototype.throwError=function(){throw arguments},Object.defineProperty(Array.prototype,"fixed",{enumerable:!1}),u}(window,document);!function(t,e,i){i.un,i.uns,i.static,i.class,i.getset,i.__newvec}(window,document,Laya),function(o,e,b){b.un,b.uns;var h=b.static,p=b.class,u=b.getset;b.__newvec;b.interface("laya.runtime.IMarket"),b.interface("laya.filters.IFilter"),b.interface("laya.display.ILayout"),b.interface("laya.resource.IDispose"),b.interface("laya.runtime.IPlatform"),b.interface("laya.resource.IDestroy"),b.interface("laya.runtime.IConchNode"),b.interface("laya.filters.IFilterAction"),b.interface("laya.runtime.ICPlatformClass"),b.interface("laya.resource.ICreateResource"),b.interface("laya.runtime.IConchRenderObject"),b.interface("laya.runtime.IPlatformClass","laya.runtime.IPlatform");var A=function(){function r(){}return p(r,"laya.utils.RunDriver"),r.FILTER_ACTIONS=[],r.pixelRatio=-1,r._charSizeTestDiv=null,r.now=function(){return Date.now()},r.getWindow=function(){return o},r.getPixelRatio=function(){if(r.pixelRatio<0){var t=B.context,e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;(r.pixelRatio=(B.window.devicePixelRatio||1)/e)<1&&(r.pixelRatio=1)}return r.pixelRatio},r.getIncludeStr=function(t){return null},r.createShaderCondition=function(t){var e="(function() {return "+t+";})";return b._runScript(e)},r.fontMap=[],r.measureText=function(t,e){var i=r.hanzi.test(t);if(i&&r.fontMap[e])return r.fontMap[e];var n=B.context;n.font=e;var s=n.measureText(t);return i&&(r.fontMap[e]=s),s},r.getWebGLContext=function(t){},r.beginFlush=function(){},r.endFinish=function(){},r.addToAtlas=null,r.flashFlushImage=function(t){},r.drawToCanvas=function(t,e,i,n,s,r){var o=yt.create("2D"),a=new F(i,n,o);return k.renders[e]._fun(t,a,s,r),o},r.createParticleTemplate2D=null,r.createGLTextur=null,r.createWebGLContext2D=null,r.changeWebGLSize=function(t,e){},r.createRenderSprite=function(t,e){return new k(t,e)},r.createFilterAction=function(t){return new y},r.createGraphics=function(){return new _},r.clear=function(t){D._context.ctx.clear()},r.cancelLoadByUrl=function(t){},r.clearAtlas=function(t){},r.isAtlas=function(t){return!1},r.addTextureToAtlas=function(t){},r.getTexturePixels=function(t,e,i,n,s){return null},r.skinAniSprite=function(){return null},r.update3DLoop=function(){},h(r,["hanzi",function(){return this.hanzi=new RegExp("^[一-龥]$")}]),r}(),n=(u(1,b,"alertGlobalError",null,function(t){var r=0;B.window.onerror=t?function(t,e,i,n,s){r++<5&&s&&alert("出错啦,请把此信息截图给研发商\n"+t+"\n"+s.stack||s)}:null}),b.init=function(t,e,i){for(var n=[],s=2,r=arguments.length;s<r;s++)n.push(arguments[s]);if(!b._isinit){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=b._arrayBufferSlice),b._isinit=!0,B.__init__(),O.__init__(),_.__init__(),b.timer=new j,b.scaleTimer=new j,b.loader=new ht,J.__init__(),s=0;for(var o=n.length;s<o;s++)n[s].enable&&n[s].enable();return d.__init__(),a.__init__(),N.__init__(),G.beginCheck(),b._currentStage=b.stage=new mt,b.stage.conchModel&&b.stage.conchModel.setRootNode(),b._getUrlPath(),b.render=new D(0,0),b.stage.size(t,e),k.__init__(),c.__init__(),f.instance.__init__(b.stage,D.canvas),xt.__init__(),E.autoStopMusic=!0,S.__init__(),D.canvas}},b._getUrlPath=function(){var t=B.window.location,e=t.pathname;e=":"==e.charAt(2)?e.substring(1):e,R.rootPath=R.basePath=R.getPath("file:"==t.protocol?e:t.protocol+"//"+t.host+t.pathname)},b._arrayBufferSlice=function(t,e){var i=new Uint8Array(this,t,e-t),n=new Uint8Array(i.length);return n.set(i),n.buffer},b._runScript=function(t){return B.window[b._evcode](t)},b.stage=null,b.timer=null,b.scaleTimer=null,b.loader=null,b.version="1.8.0beta",b.render=null,b._currentStage=null,b._isinit=!1,b.MiniAdpter={init:function(){o.navigator&&o.navigator.userAgent&&-1<o.navigator.userAgent.indexOf("MiniGame")&&console.error("请先引用小游戏适配库laya.wxmini.js,详细教程:https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0")}},h(b,["conchMarket",function(){return this.conchMarket=o.conch?conchMarket:null},"PlatformClass",function(){return this.PlatformClass=o.PlatformClass},"_evcode",function(){return this._evcode="e"+String.fromCharCode(118)+"al"}]),function(){function t(){}return p(t,"Config"),t.WebGLTextCacheCount=500,t.atlasEnable=!1,t.showCanvasMark=!1,t.animationInterval=50,t.isAntialias=!1,t.isAlpha=!1,t.premultipliedAlpha=!0,t.isStencil=!0,t.preserveDrawingBuffer=!1,t}()),l=function(){var h;function e(){this._events=null}p(e,"laya.events.EventDispatcher");var t=e.prototype;return t.hasListener=function(t){return!!(this._events&&this._events[t])},t.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 n=0,s=i.length;n<s;n++){var r=i[n];r&&(null!=e?r.runWith(e):r.run()),r&&!r.once||(i.splice(n,1),n--,s--)}0===i.length&&this._events&&delete this._events[t]}return!0},t.on=function(t,e,i,n){return this._createListener(t,e,i,n,!1)},t.once=function(t,e,i,n){return this._createListener(t,e,i,n,!0)},t._createListener=function(t,e,i,n,s,r){void 0===r&&(r=!0),r&&this.off(t,e,i,s);var o=h.create(e||this,i,n,s);this._events||(this._events={});var a=this._events;return a[t]?a[t].run?a[t]=[a[t],o]:a[t].push(o):a[t]=o,this},t.off=function(t,e,i,n){if(void 0===n&&(n=!1),!this._events||!this._events[t])return this;var s=this._events[t];if(null!=s)if(s.run)e&&s.caller!==e||s.method!==i||n&&!s.once||(delete this._events[t],s.recover());else{for(var r=0,o=0,a=s.length;o<a;o++){var h=s[o];h?!h||e&&h.caller!==e||h.method!==i||n&&!h.once||(r++,s[o]=null,h.recover()):r++}r===a&&delete this._events[t]}return this},t.offAll=function(t){var e=this._events;if(!e)return this;if(t)this._recoverHandlers(e[t]),delete e[t];else{for(var i in e)this._recoverHandlers(e[i]);this._events=null}return this},t._recoverHandlers=function(t){if(t)if(t.run)t.recover();else for(var e=t.length-1;-1<e;e--)t[e]&&(t[e].recover(),t[e]=null)},t.isMouseEvent=function(t){return e.MOUSE_EVENTS[t]},e.MOUSE_EVENTS={rightmousedown:!0,rightmouseup:!0,rightclick:!0,mousedown:!0,mouseup:!0,mousemove:!0,mouseover:!0,mouseout:!0,click:!0,doubleclick:!0},e.__init$=function(){h=function(t){function s(t,e,i,n){s.__super.call(this,t,e,i,n)}return p(s,"",v),s.prototype.recover=function(){0<this._id&&(this._id=0,s._pool.push(this.clear()))},s.create=function(t,e,i,n){return void 0===n&&(n=!0),s._pool.length?s._pool.pop().setTo(t,e,i,n):new s(t,e,i,n)},s._pool=[],s}()},e}(),v=function(){function s(t,e,i,n){this.once=!1,void(this._id=0)===n&&(n=!1),this.setTo(t,e,i,n)}p(s,"laya.utils.Handler");var t=s.prototype;return t.setTo=function(t,e,i,n){return this._id=s._gid++,this.caller=t,this.method=e,this.args=i,this.once=n,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(){0<this._id&&(this._id=0,s._pool.push(this.clear()))},s.create=function(t,e,i,n){return void 0===n&&(n=!0),s._pool.length?s._pool.pop().setTo(t,e,i,n):new s(t,e,i,n)},s._pool=[],s._gid=1,s}(),P=function(){function t(){this._texture=null,this._fontCharDic={},this._fontWidthMap={},this._complete=null,this._path=null,this._maxWidth=0,this._spaceWidth=10,this._padding=null,this.fontSize=12,this.autoScaleSize=!1,this.letterSpacing=0}p(t,"laya.display.BitmapFont");var e=t.prototype;return e.loadFont=function(t,e){this._path=t,this._complete=e,b.loader.load([{url:this._path,type:"xml"},{url:this._path.replace(".fnt",".png"),type:"image"}],v.create(this,this.onLoaded))},e.onLoaded=function(){this.parseFont(at.getRes(this._path),at.getRes(this._path.replace(".fnt",".png"))),this._complete&&this._complete.runWith(this._texture?this:null)},e.parseFont=function(t,e){if(null!=t&&null!=e){this._texture=e;var i=t.getElementsByTagName("info");if(!i[0].getAttributeNode)return this.parseFont2(t,e);this.fontSize=parseInt(i[0].getAttributeNode("size").nodeValue);var n,s=i[0].getAttributeNode("padding").nodeValue.split(",");this._padding=[parseInt(s[0]),parseInt(s[1]),parseInt(s[2]),parseInt(s[3])],n=t.getElementsByTagName("char");var r=0;for(r=0;r<n.length;r++){var o=n[r],a=parseInt(o.getAttributeNode("id").nodeValue),h=parseInt(o.getAttributeNode("xoffset").nodeValue)/1,l=parseInt(o.getAttributeNode("yoffset").nodeValue)/1,u=parseInt(o.getAttributeNode("xadvance").nodeValue)/1,c=new M;c.x=parseInt(o.getAttributeNode("x").nodeValue),c.y=parseInt(o.getAttributeNode("y").nodeValue),c.width=parseInt(o.getAttributeNode("width").nodeValue),c.height=parseInt(o.getAttributeNode("height").nodeValue);var _=ut.create(e,c.x,c.y,c.width,c.height,h,l);this._maxWidth=Math.max(this._maxWidth,u+this.letterSpacing),this._fontCharDic[a]=_,this._fontWidthMap[a]=u}}},e.parseFont2=function(t,e){if(null!=t&&null!=e){this._texture=e;var i=t.getElementsByTagName("info");this.fontSize=parseInt(i[0].attributes.size.nodeValue);var n=i[0].attributes.padding.nodeValue.split(",");this._padding=[parseInt(n[0]),parseInt(n[1]),parseInt(n[2]),parseInt(n[3])];var s=t.getElementsByTagName("char"),r=0;for(r=0;r<s.length;r++){var o=s[r].attributes,a=parseInt(o.id.nodeValue),h=parseInt(o.xoffset.nodeValue)/1,l=parseInt(o.yoffset.nodeValue)/1,u=parseInt(o.xadvance.nodeValue)/1,c=new M;c.x=parseInt(o.x.nodeValue),c.y=parseInt(o.y.nodeValue),c.width=parseInt(o.width.nodeValue),c.height=parseInt(o.height.nodeValue);var _=ut.create(e,c.x,c.y,c.width,c.height,h,l);this._maxWidth=Math.max(this._maxWidth,u+this.letterSpacing),this._fontCharDic[a]=_,this._fontWidthMap[a]=u}}},e.getCharTexture=function(t){return this._fontCharDic[t.charCodeAt(0)]},e.destroy=function(){if(this._texture){for(var t in this._fontCharDic){var e=this._fontCharDic[t];e&&e.destroy()}this._texture.destroy(),this._fontCharDic=null,this._fontWidthMap=null,this._texture=null}},e.setSpaceWidth=function(t){this._spaceWidth=t},e.getCharWidth=function(t){var e=t.charCodeAt(0);return this._fontWidthMap[e]?this._fontWidthMap[e]+this.letterSpacing:" "==t?this._spaceWidth+this.letterSpacing:0},e.getTextWidth=function(t){for(var e=0,i=0,n=t.length;i<n;i++)e+=this.getCharWidth(t.charAt(i));return e},e.getMaxWidth=function(){return this._maxWidth},e.getMaxHeight=function(){return this.fontSize},e.drawText=function(t,e,i,n,s,r){var o,a=this.getTextWidth(t),h=0;"center"===s&&(h=(r-a)/2),"right"===s&&(h=r-a);for(var l=0,u=0,c=t.length;u<c;u++)(o=this.getCharTexture(t.charAt(u)))&&(e.graphics.drawTexture(o,i+l+h,n),l+=this.getCharWidth(t.charAt(u)))},t}(),a=function(){function i(){this.alpha=1,this.visible=!0,this.scrollRect=null,this.blendMode=null,this._type=0,this._tf=i._TF_EMPTY}p(i,"laya.display.css.Style");var t=i.prototype;return t.getTransform=function(){return this._tf},t.setTransform=function(t){this._tf="none"!==t&&t?t:i._TF_EMPTY},t.setTranslateX=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.translateX=t},t.setTranslateY=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.translateY=t},t.setScaleX=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.scaleX=t},t.setScale=function(t,e){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.scaleX=t,this._tf.scaleY=e},t.setScaleY=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.scaleY=t},t.setRotate=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.rotate=t},t.setSkewX=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.skewX=t},t.setSkewY=function(t){this._tf===i._TF_EMPTY&&(this._tf=new s),this._tf.skewY=t},t.destroy=function(){this.scrollRect=null},t.render=function(t,e,i,n){},t.getCSSStyle=function(){return et.EMPTY},t._enableLayout=function(){return!1},u(0,t,"scaleX",function(){return this._tf.scaleX},function(t){this.setScaleX(t)}),u(0,t,"transform",function(){return this.getTransform()},function(t){this.setTransform(t)}),u(0,t,"translateX",function(){return this._tf.translateX},function(t){this.setTranslateX(t)}),u(0,t,"translateY",function(){return this._tf.translateY},function(t){this.setTranslateY(t)}),u(0,t,"scaleY",function(){return this._tf.scaleY},function(t){this.setScaleY(t)}),u(0,t,"block",function(){return 0!=(1&this._type)}),u(0,t,"skewY",function(){return this._tf.skewY},function(t){this.setSkewY(t)}),u(0,t,"rotate",function(){return this._tf.rotate},function(t){this.setRotate(t)}),u(0,t,"skewX",function(){return this._tf.skewX},function(t){this.setSkewX(t)}),u(0,t,"paddingLeft",function(){return 0}),u(0,t,"paddingTop",function(){return 0}),u(0,t,"absolute",function(){return!0}),i.__init__=function(){i._TF_EMPTY=new s,i.EMPTY=new i},i.EMPTY=null,i._TF_EMPTY=null,i}(),d=function(){function e(t){this._type=0,this._weight=0,this._decoration=null,this._text=null,this.indent=0,this._color=z.create(e.defaultColor),this.family=e.defaultFamily,this.stroke=e._STROKE,this.size=e.defaultSize,t&&t!==e.EMPTY&&t.copyTo(this)}p(e,"laya.display.css.Font");var t=e.prototype;return t.set=function(t){this._text=null;for(var e=t.split(" "),i=0,n=e.length;i<n;i++){var s=e[i];switch(s){case"italic":this.italic=!0;continue;case"bold":this.bold=!0;continue}0<s.indexOf("px")&&(this.size=parseInt(s),this.family=e[i+1],i++)}},t.toString=function(){return this._text="",this.italic&&(this._text+="italic "),this.bold&&(this._text+="bold "),this._text+=this.size+"px "+this.family},t.copyTo=function(t){t._type=this._type,t._text=this._text,t._weight=this._weight,t._color=this._color,t.family=this.family,t.stroke=this.stroke!=e._STROKE?this.stroke.slice():e._STROKE,t.indent=this.indent,t.size=this.size},u(0,t,"password",function(){return 0!=(1024&this._type)},function(t){t?this._type|=1024:this._type&=-1025}),u(0,t,"color",function(){return this._color.strColor},function(t){this._color=z.create(t)}),u(0,t,"italic",function(){return 0!=(512&this._type)},function(t){t?this._type|=512:this._type&=-513}),u(0,t,"bold",function(){return 0!=(2048&this._type)},function(t){t?this._type|=2048:this._type&=-2049}),u(0,t,"weight",function(){return""+this._weight},function(t){var e=0;switch(t){case"normal":break;case"bold":this.bold=!0,e=700;break;case"bolder":e=800;break;case"lighter":e=100;break;default:e=parseInt(t)}this._weight=e,this._text=null}),u(0,t,"decoration",function(){return this._decoration?this._decoration.value:null},function(t){var e=t.split(" ");switch(this._decoration||(this._decoration={}),e[0]){case"_":this._decoration.type="underline";break;case"-":this._decoration.type="line-through";break;case"overline":this._decoration.type="overline";break;default:this._decoration.type=e[0]}e[1]&&(this._decoration.color=z.create(e)),this._decoration.value=t}),e.__init__=function(){e.EMPTY=new e(null)},e.EMPTY=null,e.defaultColor="#000000",e.defaultSize=12,e.defaultFamily="Arial",e.defaultFont="12px Arial",e._STROKE=[0,"#000000"],e._ITALIC=512,e._PASSWORD=1024,e._BOLD=2048,e}(),s=function(){function t(){this.translateX=0,this.translateY=0,this.scaleX=1,this.scaleY=1,this.rotate=0,this.skewX=0,this.skewY=0}return p(t,"laya.display.css.TransformInfo"),t}(),_=function(){function c(){if(this._one=null,this._cmds=null,this._render=this._renderEmpty,D.isConchNode){this._nativeObj=new o._conchGraphics,this.id=this._nativeObj.conchID}}p(c,"laya.display.Graphics");var t=c.prototype;return t.destroy=function(){this.clear(),this._graphicBounds&&this._graphicBounds.destroy(),this._graphicBounds=null,this._vectorgraphArray=null,this._sp&&(this._sp._renderType=0),this._sp=null},t.clear=function(t){void 0===t&&(t=!1);var e=0,i=0;if(t){var n=this._one;if(this._cmds){for(i=this._cmds.length,e=0;e<i;e++)!(n=this._cmds[e])||n.callee!==D._context._drawTexture&&n.callee!==D._context._drawTextureWithTransform||(n[0]=null,c._cache.push(n));this._cmds.length=0}else n&&(!n||n.callee!==D._context._drawTexture&&n.callee!==D._context._drawTextureWithTransform||(n[0]=null,c._cache.push(n)))}else this._cmds=null;if(this._one=null,this._render=this._renderEmpty,this._sp&&(this._sp._renderType&=-514),this._repaint(),this._vectorgraphArray){for(e=0,i=this._vectorgraphArray.length;e<i;e++)Q.getInstance().deleteShape(this._vectorgraphArray[e]);this._vectorgraphArray.length=0}},t._clearBoundsCache=function(){this._graphicBounds&&this._graphicBounds.reset()},t._initGraphicBounds=function(){this._graphicBounds||(this._graphicBounds=new i,this._graphicBounds._graphics=this)},t._repaint=function(){this._clearBoundsCache(),this._sp&&this._sp.repaint()},t._isOnlyOne=function(){return!this._cmds||0===this._cmds.length},t.getBounds=function(t){return void 0===t&&(t=!1),this._initGraphicBounds(),this._graphicBounds.getBounds(t)},t.getBoundPoints=function(t){return void 0===t&&(t=!1),this._initGraphicBounds(),this._graphicBounds.getBoundPoints(t)},t._addCmd=function(t){this._cmds=this._cmds||[],t.callee=t.shift(),this._cmds.push(t)},t.setFilters=function(t){this._saveToCmd(D._context._setFilters,t)},t.drawTexture=function(t,e,i,n,s,r,o){if(void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),!t||o<.01)return null;n||(n=t.sourceWidth),s||(s=t.sourceHeight),o=o<0?0:1<o?1:o;var a,h=!D.isWebGL&&(B.onFirefox||B.onEdge||B.onIE||B.onSafari)?.5:0,l=n/t.sourceWidth,u=s/t.sourceHeight;return n=t.width*l,s=t.height*u,t.loaded&&(n<=0||s<=0)?null:(e+=t.offsetX*l,i+=t.offsetY*u,this._sp&&(this._sp._renderType|=512),e-=h,i-=h,n+=2*h,s+=2*h,c._cache.length?((a=c._cache.pop())[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=s,a[5]=r,a[6]=o):a=[t,e,i,n,s,r,o],a.callee=r||1!=o?D._context._drawTextureWithTransform:D._context._drawTexture,null!=this._one||r||1!=o?this._saveToCmd(a.callee,a):(this._one=a,this._render=this._renderOneImg),t.loaded||t.once("loaded",this,this._textureLoaded,[t,a]),this._repaint(),a)},t.cleanByTexture=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=0),!t)return this.clear();if(this._one&&this._render===this._renderOneImg){n||(n=t.sourceWidth),s||(s=t.sourceHeight);var r=n/t.sourceWidth,o=s/t.sourceHeight;n=t.width*r,s=t.height*o,e+=t.offsetX*r,i+=t.offsetY*o,this._one[0]=t,this._one[1]=e,this._one[2]=i,this._one[3]=n,this._one[4]=s,this._repaint()}else this.clear(),t&&this.drawTexture(t,e,i,n,s)},t.drawTextures=function(t,e){t&&this._saveToCmd(D._context._drawTextures,[t,e])},t.fillTexture=function(t,e,i,n,s,r,o){if(void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r="repeat"),t){var a=[t,e,i,n,s,r,o||C.EMPTY,{}];t.loaded||t.once("loaded",this,this._textureLoaded,[t,a]),this._saveToCmd(D._context._fillTexture,a)}},t._textureLoaded=function(t,e){e[3]=e[3]||t.width,e[4]=e[4]||t.height,this._repaint()},t.fillCircle=function(t,e,i,n,s,r,o){i.bitmap.enableMerageInAtlas=!1;var a=new Float32Array(2*(o+1)),h=new Float32Array(2*(o+1)),l=new Uint16Array(3*o),u=2*Math.PI/o,c=0;a[0]=n,a[1]=s,h[0]=n/i.width,h[1]=s/i.height;for(var _=2,d=0;d<o;d++){var f=r*Math.cos(c)+n,p=r*Math.sin(c)+s;a[_]=f,a[_+1]=p,h[_]=f/i.width,h[_+1]=p/i.height,c+=u,_+=2}for(d=_=0;d<o;d++)l[_++]=0,l[_++]=d+1,l[_++]=o+1<=d+2?1:d+2;this.drawTriangles(i,t,e,a,h,l)},t.drawTriangles=function(t,e,i,n,s,r,o,a,h,l){void 0===a&&(a=1),this._saveToCmd(D._context.drawTriangles,[t,e,i,n,s,r,o,a,h,l])},t._saveToCmd=function(t,e){return this._sp&&(this._sp._renderType|=512),null==this._one?(this._one=e,this._render=this._renderOne):(this._sp&&(this._sp._renderType&=-2),this._render=this._renderAll,0===(this._cmds||(this._cmds=[])).length&&this._cmds.push(this._one),this._cmds.push(e)),e.callee=t,this._repaint(),e},t.clipRect=function(t,e,i,n){this._saveToCmd(D._context._clipRect,[t,e,i,n])},t.fillText=function(t,e,i,n,s,r,o){void 0===o&&(o=0),this._saveToCmd(D._context._fillText,[t,e,i,n||d.defaultFont,s,r])},t.fillBorderText=function(t,e,i,n,s,r,o,a){this._saveToCmd(D._context._fillBorderText,[t,e,i,n||d.defaultFont,s,r,o,a])},t.strokeText=function(t,e,i,n,s,r,o){this._saveToCmd(D._context._strokeText,[t,e,i,n||d.defaultFont,s,r,o])},t.alpha=function(t){t=t<0?0:1<t?1:t,this._saveToCmd(D._context._alpha,[t])},t.setAlpha=function(t){t=t<0?0:1<t?1:t,this._saveToCmd(D._context._setAlpha,[t])},t.transform=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this._saveToCmd(D._context._transform,[t,e,i])},t.rotate=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this._saveToCmd(D._context._rotate,[t,e,i])},t.scale=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this._saveToCmd(D._context._scale,[t,e,i,n])},t.translate=function(t,e){this._saveToCmd(D._context._translate,[t,e])},t.save=function(){this._saveToCmd(D._context._save,[])},t.restore=function(){this._saveToCmd(D._context._restore,[])},t.replaceText=function(t){this._repaint();var e=this._cmds;if(e){for(var i=e.length-1;-1<i;i--)if(this._isTextCmd(e[i].callee))return e[i][0].toUpperCase?e[i][0]=t:e[i][0].setText(t),!0}else if(this._one&&this._isTextCmd(this._one.callee))return this._one[0].toUpperCase?this._one[0]=t:this._one[0].setText(t),!0;return!1},t._isTextCmd=function(t){return t===D._context._fillText||t===D._context._fillBorderText||t===D._context._strokeText},t.replaceTextColor=function(t){this._repaint();var e=this._cmds;if(e)for(var i=e.length-1;-1<i;i--)this._isTextCmd(e[i].callee)&&(e[i][4]=t,e[i][0].toUpperCase||(e[i][0].changed=!0));else this._one&&this._isTextCmd(this._one.callee)&&(this._one[4]=t,this._one[0].toUpperCase||(this._one[0].changed=!0))},t.loadImage=function(t,e,i,n,s,r){var o=this;void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0);var a=at.getRes(t);function h(t){t&&(o.drawTexture(t,e,i,n,s),null!=r&&r.call(o._sp,t))}a?h(a):b.loader.load(t,v.create(null,h),null,"image")},t._renderEmpty=function(t,e,i,n){},t._renderAll=function(t,e,i,n){for(var s,r=this._cmds,o=0,a=r.length;o<a;o++)(s=r[o]).callee.call(e,i,n,s)},t._renderOne=function(t,e,i,n){this._one.callee.call(e,i,n,this._one)},t._renderOneImg=function(t,e,i,n){this._one.callee.call(e,i,n,this._one),2305!==t._renderType&&(t._renderType|=1)},t.drawLine=function(t,e,i,n,s,r){void 0===r&&(r=1);var o=0;D.isWebGL&&(o=Q.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(o));var a=r%2==0?0:.5,h=[t+a,e+a,i+a,n+a,s,r,o];this._saveToCmd(D._context._drawLine,h)},t.drawLines=function(t,e,i,n,s){void 0===s&&(s=1);var r=0;if(i&&!(i.length<4)){D.isWebGL&&(r=Q.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(r));var o=s%2==0?0:.5,a=[t+o,e+o,i,n,s,r];this._saveToCmd(D._context._drawLines,a)}},t.drawCurves=function(t,e,i,n,s){void 0===s&&(s=1);var r=[t,e,i,n,s];this._saveToCmd(D._context._drawCurves,r)},t.drawRect=function(t,e,i,n,s,r,o){void 0===o&&(o=1);var a=r?o/2:0,h=r?o:0,l=[t+a,e+a,i-h,n-h,s,r,o];this._saveToCmd(D._context._drawRect,l)},t.drawCircle=function(t,e,i,n,s,r){void 0===r&&(r=1);var o=s?r/2:0,a=0;D.isWebGL&&(a=Q.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(a));var h=[t,e,i-o,n,s,r,a];this._saveToCmd(D._context._drawCircle,h)},t.drawPie=function(t,e,i,n,s,r,o,a){void 0===a&&(a=1);var h=o?a/2:0,l=o?a:0,u=0;D.isWebGL&&(u=Q.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(u));var c=[t+h,e+h,i-l,n,s,r,o,a,u];c[3]=q.toRadian(n),c[4]=q.toRadian(s),this._saveToCmd(D._context._drawPie,c)},t.drawPoly=function(t,e,i,n,s,r){void 0===r&&(r=1);var o=0,a=!1;D.isWebGL&&(o=Q.getInstance().getId(),null==this._vectorgraphArray&&(this._vectorgraphArray=[]),this._vectorgraphArray.push(o),a=!(6<i.length));var h=s?r%2==0?0:.5:0,l=[t+h,e+h,i,n,s,r,o,a];this._saveToCmd(D._context._drawPoly,l)},t.drawPath=function(t,e,i,n,s){var r=[t,e,i,n,s];this._saveToCmd(D._context._drawPath,r)},u(0,t,"cmds",function(){return this._cmds},function(t){this._sp&&(this._sp._renderType|=512),this._cmds=t,this._render=this._renderAll,this._repaint()}),c.__init__=function(){if(D.isConchNode){for(var t=laya.display.Graphics.prototype,e=B.window.ConchGraphics.prototype,i=["clear","destroy","alpha","rotate","transform","scale","translate","save","restore","clipRect","blendMode","fillText","fillBorderText","_fands","drawRect","drawCircle","drawPie","drawPoly","drawPath","drawImageM","drawLine","drawLines","_drawPs","drawCurves","replaceText","replaceTextColor","_fillImage","fillTexture","setSkinMesh","drawParticle","drawImageS"],n=0,s=i.length;n<=s;n++){var r=i[n];t[r]=e[r]}t._saveToCmd=null,e.drawImageS&&(t.drawTextures=function(t,e){if(t&&t.loaded&&t.bitmap&&t.source){var i=t.uv,n=t.bitmap.width,s=t.bitmap.height;this.drawImageS(t.bitmap.source,i[0]*n,i[1]*s,(i[2]-i[0])*n,(i[5]-i[3])*s,t.offsetX,t.offsetY,t.width,t.height,e)}}),t.drawTexture=function(t,e,i,n,s,r,o){if(void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),t)if(t.loaded){if(t.loaded&&t.bitmap&&t.source&&(n||(n=t.sourceWidth),s||(s=t.sourceHeight),o=o<0?0:1<o?1:o,n=n-t.sourceWidth+t.width,s=s-t.sourceHeight+t.height,!(n<=0||s<=0))){e+=t.offsetX,i+=t.offsetY;var a=t.uv,h=t.bitmap.width,l=t.bitmap.height;a[4]<a[0]&&a[5]<a[1]?this.drawImageM(t.bitmap.source,a[4]*h,a[5]*l,(a[0]-a[4])*h,(a[1]-a[5])*l,e,i,n,s,r,o):this.drawImageM(t.bitmap.source,a[0]*h,a[1]*l,(a[2]-a[0])*h,(a[5]-a[3])*l,e,i,n,s,r,o),this._repaint()}}else t.once("loaded",this,function(){this.drawTexture(t,e,i,n,s,r)})},t.fillTexture=function(t,e,i,n,s,r,o){if(void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r="repeat"),t&&t.loaded){var a,h=D._context.ctx,l=t.bitmap.width,u=t.bitmap.height,c=t.uv;a=t.uv!=ut.DEF_UV?h.createPattern(t.bitmap.source,r,c[0]*l,c[1]*u,(c[2]-c[0])*l,(c[5]-c[3])*u):h.createPattern(t.bitmap.source,r);var _=0,d=0;o&&(e+=o.x%t.width,i+=o.y%t.height,_-=o.x%t.width,d-=o.y%t.height),this._fillImage(a,e,i,_,d,n,s)}}}},c._cache=[],c}(),i=function(){function y(){this._cacheBoundsType=!1}p(y,"laya.display.GraphicsBounds");var t=y.prototype;return t.destroy=function(){this._graphics=null,this._temp=null,this._rstBoundPoints=null,this._bounds=null},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=M._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=q.copyArray(this._rstBoundPoints,this._temp)},t._getCmdPoints=function(t){void 0===t&&(t=!1);var e,i,n=D._context,s=this._graphics.cmds;if((e=this._temp||(this._temp=[])).length=0,s||null==this._graphics._one||(y._tempCmds.length=0,y._tempCmds.push(this._graphics._one),s=y._tempCmds),!s)return e;(i=y._tempMatrixArrays).length=0;var r=y._initMatrix;r.identity();for(var o,a,h=y._tempMatrix,l=NaN,u=NaN,c=NaN,_=NaN,d=NaN,f=NaN,p=0,g=s.length;p<g;p++)if((o=s[p]).callee)switch(o.callee){case n._save:case 7:i.push(r),r=r.clone();break;case n._restore:case 8:r=i.pop();break;case n._scale:case 5:h.identity(),h.translate(-o[2],-o[3]),h.scale(o[0],o[1]),h.translate(o[2],o[3]),this._switchMatrix(r,h);break;case n._rotate:case 3:h.identity(),h.translate(-o[1],-o[2]),h.rotate(o[0]),h.translate(o[1],o[2]),this._switchMatrix(r,h);break;case n._translate:case 6:h.identity(),h.translate(o[0],o[1]),this._switchMatrix(r,h);break;case n._transform:case 4:h.identity(),h.translate(-o[1],-o[2]),h.concat(o[0]),h.translate(o[1],o[2]),this._switchMatrix(r,h);break;case 16:case 24:y._addPointArrToRst(e,M._getBoundPointS(o[0],o[1],o[2],o[3]),r);break;case 17:r.copyTo(h),h.concat(o[4]),y._addPointArrToRst(e,M._getBoundPointS(o[0],o[1],o[2],o[3]),h);break;case n._drawTexture:a=o[0],t?o[3]&&o[4]?y._addPointArrToRst(e,M._getBoundPointS(o[1],o[2],o[3],o[4]),r):(a=o[0],y._addPointArrToRst(e,M._getBoundPointS(o[1],o[2],a.width,a.height),r)):(l=(o[3]||a.sourceWidth)/a.width,u=(o[4]||a.sourceHeight)/a.height,c=l*a.sourceWidth,_=u*a.sourceHeight,d=0<a.offsetX?a.offsetX:0,f=0<a.offsetY?a.offsetY:0,d*=l,f*=u,y._addPointArrToRst(e,M._getBoundPointS(o[1]-d,o[2]-f,c,_),r));break;case n._fillTexture:o[3]&&o[4]?y._addPointArrToRst(e,M._getBoundPointS(o[1],o[2],o[3],o[4]),r):(a=o[0],y._addPointArrToRst(e,M._getBoundPointS(o[1],o[2],a.width,a.height),r));break;case n._drawTextureWithTransform:var m;m=o[5]?(r.copyTo(h),h.concat(o[5]),h):r,t?o[3]&&o[4]?y._addPointArrToRst(e,M._getBoundPointS(o[1],o[2],o[3],o[4]),m):(a=o[0],y._addPointArrToRst(e,M._getBoundPointS(o[1],o[2],a.width,a.height),m)):(a=o[0],l=(o[3]||a.sourceWidth)/a.width,u=(o[4]||a.sourceHeight)/a.height,c=l*a.sourceWidth,_=u*a.sourceHeight,d=0<a.offsetX?a.offsetX:0,f=0<a.offsetY?a.offsetY:0,d*=l,f*=u,y._addPointArrToRst(e,M._getBoundPointS(o[1]-d,o[2]-f,c,_),m));break;case n._drawRect:case 13:y._addPointArrToRst(e,M._getBoundPointS(o[0],o[1],o[2],o[3]),r);break;case n._drawCircle:case n._fillCircle:case 14:y._addPointArrToRst(e,M._getBoundPointS(o[0]-o[2],o[1]-o[2],o[2]+o[2],o[2]+o[2]),r);break;case n._drawLine:case 20:y._tempPoints.length=0;var v;v=.5*o[5],o[0]==o[2]?y._tempPoints.push(o[0]+v,o[1],o[2]+v,o[3],o[0]-v,o[1],o[2]-v,o[3]):o[1]==o[3]?y._tempPoints.push(o[0],o[1]+v,o[2],o[3]+v,o[0],o[1]-v,o[2],o[3]-v):y._tempPoints.push(o[0],o[1],o[2],o[3]),y._addPointArrToRst(e,y._tempPoints,r);break;case n._drawCurves:case 22:y._addPointArrToRst(e,w.I.getBezierPoints(o[2]),r,o[0],o[1]);break;case n._drawPoly:case n._drawLines:case 18:y._addPointArrToRst(e,o[2],r,o[0],o[1]);break;case n._drawPath:case 19:y._addPointArrToRst(e,this._getPathPoints(o[2]),r,o[0],o[1]);break;case n._drawPie:case 15:y._addPointArrToRst(e,this._getPiePoints(o[0],o[1],o[2],o[3],o[4]),r)}return 200<e.length?e=q.copyArray(e,M._getWrapRec(e)._getBoundPoints()):8<e.length&&(e=x.scanPList(e)),e},t._switchMatrix=function(t,e){e.concat(t),e.copyTo(t)},t._getPiePoints=function(t,e,i,n,s){var r=y._tempPoints;y._tempPoints.length=0,r.push(t,e);var o=(s-n)%(2*Math.PI)/10,a=NaN,h=n;for(a=0;a<=10;a++)r.push(t+i*Math.cos(h),e+i*Math.sin(h)),h+=o;return r},t._getPathPoints=function(t){var e,i,n=0,s=y._tempPoints;for(s.length=0,e=t.length,n=0;n<e;n++)1<(i=t[n]).length&&(s.push(i[1],i[2]),3<i.length&&s.push(i[3],i[4]));return s},y._addPointArrToRst=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=0);var r,o=0;for(r=e.length,o=0;o<r;o+=2)y._addPointToRst(t,e[o]+n,e[o+1]+s,i)},y._addPointToRst=function(t,e,i,n){var s=C.TEMP;s.setTo(e||0,i||0),n.transformPoint(s),t.push(s.x,s.y)},y._tempPoints=[],y._tempMatrixArrays=[],y._tempCmds=[],h(y,["_tempMatrix",function(){return this._tempMatrix=new I},"_initMatrix",function(){return this._initMatrix=new I}]),y}(),r=function(){function t(){}p(t,"laya.events.Event");var e=t.prototype;return e.setTo=function(t,e,i){return this.type=t,this.currentTarget=e,this.target=i,this},e.stopPropagation=function(){this._stoped=!0},u(0,e,"stageY",function(){return b.stage.mouseY}),u(0,e,"charCode",function(){return this.nativeEvent.charCode}),u(0,e,"touches",function(){var t=this.nativeEvent.touches;if(t)for(var e=b.stage,i=0,n=t.length;i<n;i++){var s=t[i],r=C.TEMP;r.setTo(s.clientX,s.clientY),e._canvasTransform.invertTransformPoint(r),e.transform.invertTransformPoint(r),s.stageX=r.x,s.stageY=r.y}return t}),u(0,e,"keyLocation",function(){return this.nativeEvent.keyLocation}),u(0,e,"ctrlKey",function(){return this.nativeEvent.ctrlKey}),u(0,e,"altKey",function(){return this.nativeEvent.altKey}),u(0,e,"shiftKey",function(){return this.nativeEvent.shiftKey}),u(0,e,"stageX",function(){return b.stage.mouseX}),t.EMPTY=new t,t.MOUSE_DOWN="mousedown",t.MOUSE_UP="mouseup",t.CLICK="click",t.RIGHT_MOUSE_DOWN="rightmousedown",t.RIGHT_MOUSE_UP="rightmouseup",t.RIGHT_CLICK="rightclick",t.MOUSE_MOVE="mousemove",t.MOUSE_OVER="mouseover",t.MOUSE_OUT="mouseout",t.MOUSE_WHEEL="mousewheel",t.ROLL_OVER="mouseover",t.ROLL_OUT="mouseout",t.DOUBLE_CLICK="doubleclick",t.CHANGE="change",t.CHANGED="changed",t.RESIZE="resize",t.ADDED="added",t.REMOVED="removed",t.DISPLAY="display",t.UNDISPLAY="undisplay",t.ERROR="error",t.COMPLETE="complete",t.LOADED="loaded",t.PROGRESS="progress",t.INPUT="input",t.RENDER="render",t.OPEN="open",t.MESSAGE="message",t.CLOSE="close",t.KEY_DOWN="keydown",t.KEY_PRESS="keypress",t.KEY_UP="keyup",t.FRAME="enterframe",t.DRAG_START="dragstart",t.DRAG_MOVE="dragmove",t.DRAG_END="dragend",t.ENTER="enter",t.SELECT="select",t.BLUR="blur",t.FOCUS="focus",t.VISIBILITY_CHANGE="visibilitychange",t.FOCUS_CHANGE="focuschange",t.PLAYED="played",t.PAUSED="paused",t.STOPPED="stopped",t.START="start",t.END="end",t.ENABLE_CHANGED="enablechanged",t.ACTIVE_IN_HIERARCHY_CHANGED="activeinhierarchychanged",t.COMPONENT_ADDED="componentadded",t.COMPONENT_REMOVED="componentremoved",t.LAYER_CHANGED="layerchanged",t.HIERARCHY_LOADED="hierarchyloaded",t.RECOVERED="recovered",t.RELEASED="released",t.LINK="link",t.LABEL="label",t.FULL_SCREEN_CHANGE="fullscreenchange",t.DEVICE_LOST="devicelost",t.MESH_CHANGED="meshchanged",t.MATERIAL_CHANGED="materialchanged",t.WORLDMATRIX_NEEDCHANGE="worldmatrixneedchanged",t.ANIMATION_CHANGED="animationchanged",t.TRIGGER_ENTER="triggerenter",t.TRIGGER_STAY="triggerstay",t.TRIGGER_EXIT="triggerexit",t.TRAIL_FILTER_CHANGE="trailfilterchange",t.DOMINO_FILTER_CHANGE="dominofilterchange",t}(),c=(function(){function t(){}p(t,"laya.events.Keyboard"),t.NUMBER_0=48,t.NUMBER_1=49,t.NUMBER_2=50,t.NUMBER_3=51,t.NUMBER_4=52,t.NUMBER_5=53,t.NUMBER_6=54,t.NUMBER_7=55,t.NUMBER_8=56,t.NUMBER_9=57,t.A=65,t.B=66,t.C=67,t.D=68,t.E=69,t.F=70,t.G=71,t.H=72,t.I=73,t.J=74,t.K=75,t.L=76,t.M=77,t.N=78,t.O=79,t.P=80,t.Q=81,t.R=82,t.S=83,t.T=84,t.U=85,t.V=86,t.W=87,t.X=88,t.Y=89,t.Z=90,t.F1=112,t.F2=113,t.F3=114,t.F4=115,t.F5=116,t.F6=117,t.F7=118,t.F8=119,t.F9=120,t.F10=121,t.F11=122,t.F12=123,t.F13=124,t.F14=125,t.F15=126,t.NUMPAD=21,t.NUMPAD_0=96,t.NUMPAD_1=97,t.NUMPAD_2=98,t.NUMPAD_3=99,t.NUMPAD_4=100,t.NUMPAD_5=101,t.NUMPAD_6=102,t.NUMPAD_7=103,t.NUMPAD_8=104,t.NUMPAD_9=105,t.NUMPAD_ADD=107,t.NUMPAD_DECIMAL=110,t.NUMPAD_DIVIDE=111,t.NUMPAD_ENTER=108,t.NUMPAD_MULTIPLY=106,t.NUMPAD_SUBTRACT=109,t.SEMICOLON=186,t.EQUAL=187,t.COMMA=188,t.MINUS=189,t.PERIOD=190,t.SLASH=191,t.BACKQUOTE=192,t.LEFTBRACKET=219,t.BACKSLASH=220,t.RIGHTBRACKET=221,t.QUOTE=222,t.ALTERNATE=18,t.BACKSPACE=8,t.CAPS_LOCK=20,t.COMMAND=15,t.CONTROL=17,t.DELETE=46,t.ENTER=13,t.ESCAPE=27,t.PAGE_UP=33,t.PAGE_DOWN=34,t.END=35,t.HOME=36,t.LEFT=37,t.UP=38,t.RIGHT=39,t.DOWN=40,t.SHIFT=16,t.SPACE=32,t.TAB=9,t.INSERT=45}(),function(){function s(){}return p(s,"laya.events.KeyBoardManager"),s.__init__=function(){s._addEvent("keydown"),s._addEvent("keypress"),s._addEvent("keyup")},s._addEvent=function(e){B.document.addEventListener(e,function(t){laya.events.KeyBoardManager._dispatch(t,e)},!0)},s._dispatch=function(t,e){if(s.enabled){s._event._stoped=!1,s._event.nativeEvent=t,s._event.keyCode=t.keyCode||t.which||t.charCode,"keydown"===e?s._pressKeys[s._event.keyCode]=!0:"keyup"===e&&(s._pressKeys[s._event.keyCode]=null);for(var i=b.stage.focus&&null!=b.stage.focus.event&&b.stage.focus.displayedInStage?b.stage.focus:b.stage,n=i;n;)n.event(e,s._event.setTo(e,n,i)),n=n.parent}},s.hasKeyDown=function(t){return s._pressKeys[t]},s._pressKeys={},s.enabled=!0,h(s,["_event",function(){return this._event=new r}]),s}()),f=(function(){function t(){}p(t,"laya.events.KeyLocation"),t.STANDARD=0,t.LEFT=1,t.RIGHT=2,t.NUM_PAD=3}(),function(){function u(){this.mouseX=0,this.mouseY=0,this.disableMouseEvent=!1,this.mouseDownTime=0,this.mouseMoveAccuracy=2,this._stage=null,this._target=null,this._lastMoveTimer=0,this._isLeftMouse=!1,this._eventList=[],this._touchIDs={},this._id=1,this._tTouchID=0,this._event=new r,this._matrix=new I,this._point=new C,this._rect=new M,this._prePoint=new C,this._curTouchID=NaN}p(u,"laya.events.MouseManager");var t=u.prototype;return t.__init__=function(t,e){var i=this;this._stage=t;var n=this,s=this._eventList;e.oncontextmenu=function(t){if(u.enabled)return!1},e.addEventListener("mousedown",function(t){u.enabled&&(B.onIE||t.preventDefault(),s.push(t),n.mouseDownTime=B.now())}),e.addEventListener("mouseup",function(t){u.enabled&&(t.preventDefault(),s.push(t),n.mouseDownTime=-B.now())},!0),e.addEventListener("mousemove",function(t){if(u.enabled){t.preventDefault();var e=B.now();if(e-n._lastMoveTimer<10)return;n._lastMoveTimer=e,s.push(t)}},!0),e.addEventListener("mouseout",function(t){u.enabled&&s.push(t)}),e.addEventListener("mouseover",function(t){u.enabled&&s.push(t)}),e.addEventListener("touchstart",function(t){u.enabled&&(s.push(t),u._isFirstTouch||xt.isInputting||t.preventDefault(),n.mouseDownTime=B.now())}),e.addEventListener("touchend",function(t){u.enabled?(u._isFirstTouch||xt.isInputting||t.preventDefault(),u._isFirstTouch=!1,s.push(t),n.mouseDownTime=-B.now()):i._curTouchID=NaN},!0),e.addEventListener("touchmove",function(t){u.enabled&&(t.preventDefault(),s.push(t))},!0),e.addEventListener("touchcancel",function(t){u.enabled?(t.preventDefault(),s.push(t)):i._curTouchID=NaN},!0),e.addEventListener("mousewheel",function(t){u.enabled&&s.push(t)}),e.addEventListener("DOMMouseScroll",function(t){u.enabled&&s.push(t)})},t.initEvent=function(t,e){var i,n=this;n._event._stoped=!1,n._event.nativeEvent=e||t,n._target=null,this._point.setTo(t.pageX||t.clientX,t.pageY||t.clientY),this._stage._canvasTransform.invertTransformPoint(this._point),n.mouseX=this._point.x,n.mouseY=this._point.y,n._event.touchId=t.identifier||0,this._tTouchID=n._event.touchId,(i=g.I._event)._stoped=!1,i.nativeEvent=n._event.nativeEvent,i.touchId=n._event.touchId},t.checkMouseWheel=function(t){this._event.delta=t.wheelDelta?.025*t.wheelDelta:-t.detail;for(var e=g.I.getLastOvers(),i=0,n=e.length;i<n;i++){var s=e[i];s.event("mousewheel",this._event.setTo("mousewheel",s,this._target))}},t.onMouseMove=function(t){g.I.onMouseMove(t,this._tTouchID)},t.onMouseDown=function(t){if(xt.isInputting&&b.stage.focus&&b.stage.focus.focus&&!b.stage.focus.contains(this._target)){var e=b.stage.focus._tf||b.stage.focus,i=t._tf||t;i instanceof laya.display.Input&&i.multiline==e.multiline?e._focusOut():e.focus=!1}g.I.onMouseDown(t,this._tTouchID,this._isLeftMouse)},t.onMouseUp=function(t){g.I.onMouseUp(t,this._tTouchID,this._isLeftMouse)},t.check=function(t,e,i,n){this._point.setTo(e,i),t.fromParentPoint(this._point),e=this._point.x,i=this._point.y;var s=t.scrollRect;if(s&&(this._rect.setTo(s.x,s.y,s.width,s.height),!this._rect.contains(e,i)))return!1;if(!this.disableMouseEvent){if(t.hitTestPrior&&!t.mouseThrough&&!this.hitTest(t,e,i))return!1;for(var r=t._childs.length-1;-1<r;r--){var o=t._childs[r];if(!o.destroyed&&o.mouseEnabled&&o.visible&&this.check(o,e,i,n))return!0}}var a=!(!t.hitTestPrior||t.mouseThrough||this.disableMouseEvent)||this.hitTest(t,e,i);return a?(this._target=t,n.call(this,t)):n===this.onMouseUp&&t===this._stage&&(this._target=this._stage,n.call(this,this._target)),a},t.hitTest=function(t,e,i){var n=!1;if(t.scrollRect&&(e-=t.scrollRect.x,i-=t.scrollRect.y),t.hitArea instanceof laya.utils.HitArea)return t.hitArea.isHit(e,i);if(0<t.width&&0<t.height||t.mouseThrough||t.hitArea)if(t.mouseThrough)n=t.getGraphicBounds().contains(e,i);else{var s=this._rect;t.hitArea?s=t.hitArea:s.setTo(0,0,t.width,t.height),n=s.contains(e,i)}return n},t.runEvent=function(){var t=this._eventList.length;if(t){for(var e,i=this,n=0,s=0,r=0;n<t;){var o=this._eventList[n];switch("mousemove"!==o.type&&(this._prePoint.x=this._prePoint.y=-1e6),o.type){case"mousedown":this._touchIDs[0]=this._id++,u._isTouchRespond?u._isTouchRespond=!1:(i._isLeftMouse=0===o.button,i.initEvent(o),i.check(i._stage,i.mouseX,i.mouseY,i.onMouseDown));break;case"mouseup":i._isLeftMouse=0===o.button,i.initEvent(o),i.check(i._stage,i.mouseX,i.mouseY,i.onMouseUp);break;case"mousemove":Math.abs(this._prePoint.x-o.clientX)+Math.abs(this._prePoint.y-o.clientY)>=this.mouseMoveAccuracy&&(this._prePoint.x=o.clientX,this._prePoint.y=o.clientY,i.initEvent(o),i.check(i._stage,i.mouseX,i.mouseY,i.onMouseMove));break;case"touchstart":u._isTouchRespond=!0,i._isLeftMouse=!0;var a=o.changedTouches;for(s=0,r=a.length;s<r;s++)e=a[s],(u.multiTouchEnabled||isNaN(this._curTouchID))&&(this._curTouchID=e.identifier,this._id%200==0&&(this._touchIDs={}),this._touchIDs[e.identifier]=this._id++,i.initEvent(e,o),i.check(i._stage,i.mouseX,i.mouseY,i.onMouseDown));break;case"touchend":case"touchcancel":u._isTouchRespond=!0,i._isLeftMouse=!0;var h=o.changedTouches;for(s=0,r=h.length;s<r;s++)if(e=h[s],u.multiTouchEnabled||e.identifier==this._curTouchID){this._curTouchID=NaN,i.initEvent(e,o);i.check(i._stage,i.mouseX,i.mouseY,i.onMouseUp)||i.onMouseUp(null)}break;case"touchmove":var l=o.changedTouches;for(s=0,r=l.length;s<r;s++)e=l[s],(u.multiTouchEnabled||e.identifier==this._curTouchID)&&(i.initEvent(e,o),i.check(i._stage,i.mouseX,i.mouseY,i.onMouseMove));break;case"wheel":case"mousewheel":case"DOMMouseScroll":i.checkMouseWheel(o);break;case"mouseout":g.I.stageMouseOut();break;case"mouseover":i._stage.event("mouseover",i._event.setTo("mouseover",i._stage,i._stage))}n++}this._eventList.length=0}},u.enabled=!0,u.multiTouchEnabled=!0,u._isTouchRespond=!1,u._isFirstTouch=!0,h(u,["instance",function(){return this.instance=new u}]),u}()),g=function(){function f(){this.preOvers=[],this.preDowns=[],this.preRightDowns=[],this.enable=!0,this._lastClickTime=0,this._event=new r}p(f,"laya.events.TouchManager");var t=f.prototype;return t._clearTempArrs=function(){f._oldArr.length=0,f._newArr.length=0,f._tEleArr.length=0},t.getTouchFromArr=function(t,e){var i,n,s=0;for(i=e.length,s=0;s<i;s++)if((n=e[s]).id==t)return n;return null},t.removeTouchFromArr=function(t,e){var i=0;for(i=e.length-1;0<=i;i--)e[i].id==t&&e.splice(i,1)},t.createTouchO=function(t,e){var i;return(i=$.getItem("TouchData")||{}).id=e,i.tar=t,i},t.onMouseDown=function(t,e,i){var n,s,r,o;(void 0===i&&(i=!1),this.enable)&&(n=this.getTouchFromArr(e,this.preOvers),r=this.getEles(t,null,f._tEleArr),n?n.tar=t:(s=this.createTouchO(t,e),this.preOvers.push(s)),B.onMobile&&this.sendEvents(r,"mouseover"),o=i?this.preDowns:this.preRightDowns,(n=this.getTouchFromArr(e,o))?n.tar=t:(s=this.createTouchO(t,e),o.push(s)),this.sendEvents(r,i?"mousedown":"rightmousedown"),this._clearTempArrs())},t.sendEvents=function(t,e){var i,n,s,r=0;for(i=t.length,this._event._stoped=!1,n=t[0],r=0;r<i;r++){if((s=t[r]).destroyed)return;if(s.event(e,this._event.setTo(e,s,n)),this._event._stoped)break}},t.getEles=function(t,e,i){for(i?i.length=0:i=[];t&&t!=e;)i.push(t),t=t.parent;return i},t.checkMouseOutAndOverOfMove=function(t,e,i){if(void 0===i&&(i=0),e!=t){var n,s,r=0,o=0;if(e.contains(t))s=this.getEles(t,e,f._tEleArr),this.sendEvents(s,"mouseover");else if(t.contains(e))s=this.getEles(e,t,f._tEleArr),this.sendEvents(s,"mouseout");else{var a,h;(s=f._tEleArr).length=0,a=this.getEles(e,null,f._oldArr),h=this.getEles(t,null,f._newArr),o=a.length;var l=0;for(r=0;r<o;r++){if(n=a[r],0<=(l=h.indexOf(n))){h.splice(l,h.length-l);break}s.push(n)}0<s.length&&this.sendEvents(s,"mouseout"),0<h.length&&this.sendEvents(h,"mouseover")}}},t.onMouseMove=function(t,e){var i,n;this.enable&&((i=this.getTouchFromArr(e,this.preOvers))?(this.checkMouseOutAndOverOfMove(t,i.tar),i.tar=t,n=this.getEles(t,null,f._tEleArr)):(n=this.getEles(t,null,f._tEleArr),this.sendEvents(n,"mouseover"),this.preOvers.push(this.createTouchO(t,e))),this.sendEvents(n,"mousemove"),this._clearTempArrs())},t.getLastOvers=function(){return(f._tEleArr.length=0)<this.preOvers.length&&this.preOvers[0].tar?this.getEles(this.preOvers[0].tar,null,f._tEleArr):(f._tEleArr.push(b.stage),f._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 n,s,r,o,a,h,l=0,u=0,c=B.onMobile;if(s=this.getEles(t,null,f._tEleArr),this.sendEvents(s,i?"mouseup":"rightmouseup"),h=i?this.preDowns:this.preRightDowns,n=this.getTouchFromArr(e,h)){var _,d=B.now();if(_=d-this._lastClickTime<300,this._lastClickTime=d,t==n.tar)a=s;else for(r=this.getEles(n.tar,null,f._oldArr),(a=f._newArr).length=0,u=r.length,l=0;l<u;l++)o=r[l],0<=s.indexOf(o)&&a.push(o);0<a.length&&this.sendEvents(a,i?"click":"rightclick"),i&&_&&this.sendEvents(a,"doubleclick"),this.removeTouchFromArr(e,h),n.tar=null,$.recover("TouchData",n)}else;(n=this.getTouchFromArr(e,this.preOvers))&&c&&((a=this.getEles(n.tar,null,a))&&0<a.length&&this.sendEvents(a,"mouseout"),this.removeTouchFromArr(e,this.preOvers),n.tar=null,$.recover("TouchData",n)),this._clearTempArrs()}},f._oldArr=[],f._newArr=[],f._tEleArr=[],h(f,["I",function(){return this.I=new f}]),f}(),m=function(){function t(){this._action=null}p(t,"laya.filters.Filter");var e=t.prototype;return b.imps(e,{"laya.filters.IFilter":!0}),e.callNative=function(t){},u(0,e,"type",function(){return-1}),u(0,e,"action",function(){return this._action}),t.BLUR=16,t.COLOR=32,t.GLOW=8,t._filterStart=null,t._filterEnd=null,t._EndTarget=null,t._recycleScope=null,t._filter=null,t._useSrc=null,t._endSrc=null,t._useOut=null,t._endOut=null,t}(),y=function(){function t(){this.data=null}p(t,"laya.filters.ColorFilterAction");var e=t.prototype;return b.imps(e,{"laya.filters.IFilterAction":!0}),e.apply=function(t){var e=t.ctx.ctx,i=t.ctx.ctx.canvas;if(0==i.width||0==i.height)return i;for(var n,s=e.getImageData(0,0,i.width,i.height),r=s.data,o=0,a=r.length;o<a;o+=4)n=this.getColor(r[o],r[o+1],r[o+2],r[o+3]),0!=r[o+3]&&(r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]);return e.putImageData(s,0,0),t},e.getColor=function(t,e,i,n){var s=[];if(this.data._mat&&this.data._alpha){var r=this.data._mat,o=this.data._alpha;s[0