UNPKG

dragonbones-runtime

Version:

the tools to build dragonbones file for diffrent framework

9 lines 258 kB
function __extends(t,e){function i(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);i.prototype=e.prototype,t.prototype=new i}var __reflect=this&&this.__reflect||function(t,e,i){t.__class__=e,i?i.push(e):i=[e],t.__types__=t.__types__?i.concat(t.__types__):i},__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),__define=this.__define||function(t,e,i,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:i,set:r})},egret;!function(t){t.$hashCount=1;var e=function(){function e(){this.$hashCode=t.$hashCount++}return Object.defineProperty(e.prototype,"hashCode",{get:function(){return this.$hashCode},enumerable:!0,configurable:!0}),e}();t.HashObject=e,__reflect(e.prototype,"egret.HashObject",["egret.IHashObject"])}(egret||(egret={}));var egret;!function(t){var e=[],i=function(i){function r(t){void 0===t&&(t=null);var e=i.call(this)||this;return e.$EventDispatcher={0:t?t:e,1:{},2:{},3:0},e}return __extends(r,i),r.prototype.$getEventMap=function(t){var e=this.$EventDispatcher,i=t?e[2]:e[1];return i},r.prototype.addEventListener=function(t,e,i,r,n){this.$addListener(t,e,i,r,n)},r.prototype.once=function(t,e,i,r,n){this.$addListener(t,e,i,r,n,!0)},r.prototype.$addListener=function(t,e,i,r,n,o){var a=this.$EventDispatcher,s=r?a[2]:a[1],h=s[t];h?0!==a[3]&&(s[t]=h=h.concat()):h=s[t]=[],this.$insertEventBin(h,t,e,i,r,n,o)},r.prototype.$insertEventBin=function(t,e,i,r,n,o,a){o=0|+o;for(var s=-1,h=t.length,l=0;h>l;l++){var u=t[l];if(u.listener==i&&u.thisObject==r&&u.target==this)return!1;-1==s&&u.priority<o&&(s=l)}var c={type:e,listener:i,thisObject:r,priority:o,target:this,useCapture:n,dispatchOnce:!!a};return-1!==s?t.splice(s,0,c):t.push(c),!0},r.prototype.removeEventListener=function(t,e,i,r){var n=this.$EventDispatcher,o=r?n[2]:n[1],a=o[t];a&&(0!==n[3]&&(o[t]=a=a.concat()),this.$removeEventBin(a,e,i),0==a.length&&(o[t]=null))},r.prototype.$removeEventBin=function(t,e,i){for(var r=t.length,n=0;r>n;n++){var o=t[n];if(o.listener==e&&o.thisObject==i&&o.target==this)return t.splice(n,1),!0}return!1},r.prototype.hasEventListener=function(t){var e=this.$EventDispatcher;return!(!e[1][t]&&!e[2][t])},r.prototype.willTrigger=function(t){return this.hasEventListener(t)},r.prototype.dispatchEvent=function(t){return t.$currentTarget=this.$EventDispatcher[0],t.$setTarget(t.$currentTarget),this.$notifyListener(t,!1)},r.prototype.$notifyListener=function(t,i){var r=this.$EventDispatcher,n=i?r[2]:r[1],o=n[t.$type];if(!o)return!0;var a=o.length;if(0==a)return!0;var s=e;r[3]++;for(var h=0;a>h;h++){var l=o[h];if(l.listener.call(l.thisObject,t),l.dispatchOnce&&s.push(l),t.$isPropagationImmediateStopped)break}for(r[3]--;s.length;){var l=s.pop();l.target.removeEventListener(l.type,l.listener,l.thisObject,l.useCapture)}return!t.$isDefaultPrevented},r.prototype.dispatchEventWith=function(e,i,r,n){if(i||this.hasEventListener(e)){var o=t.Event.create(t.Event,e,i,n);o.data=r;var a=this.dispatchEvent(o);return t.Event.release(o),a}return!0},r}(t.HashObject);t.EventDispatcher=i,__reflect(i.prototype,"egret.EventDispatcher",["egret.IEventDispatcher"])}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i.type=null,i.$id=null,i.paddingTop=0,i.paddingBottom=0,i.paddingLeft=0,i.paddingRight=0,i.$targets=[],i.$uniforms={},t.WebAssemblyNode.createFilter(i),i}return __extends(i,e),i.prototype.$toJson=function(){return""},i.prototype.updatePadding=function(){},i.prototype.onPropertyChange=function(){var e=this;e.updatePadding(),t.WebAssemblyNode.setFilterPadding(e.$id,e.paddingTop,e.paddingBottom,e.paddingLeft,e.paddingRight),t.WebAssemblyNode.setDataToFilter(e.$id)},i.prototype.$addTarget=function(t){for(var e=this,i=e.$targets.length,r=0;i>r;r++)if(e.$targets[r].$hashCode==t.$hashCode)return;e.$targets.push(t)},i.prototype.$removeTarget=function(t){for(var e=this,i=e.$targets.length,r=0;i>r;r++)if(e.$targets[r].$hashCode==t.$hashCode)return void e.$targets.splice(r,1)},i.prototype.dispose=function(){for(var e=this,i=e.$targets.length,r=0;i>r;r++){var n=e.$targets[r],o=n.$filters.indexOf(e);n.$filters.splice(o,1),0==n.$filters.length?(n.$filters=null,n.$waNode.setFilters(null)):n.$waNode.setFilters(n.$filters)}t.WebAssemblyNode.disposeFilter(e)},i}(t.HashObject);t.Filter=e,__reflect(e.prototype,"egret.Filter")}(egret||(egret={}));var egret;!function(t){function e(t){return t%=360,t>180?t-=360:-180>t&&(t+=360),t}var i=function(i){function r(){var e=i.call(this)||this;return e.$children=null,e.$name="",e.$parent=null,e.$stage=null,e.$nestLevel=0,e.$matrix=new t.Matrix,e.$matrixDirty=!1,e.$x=0,e.$y=0,e.$scaleX=1,e.$scaleY=1,e.$rotation=0,e.$skewX=0,e.$skewXdeg=0,e.$skewY=0,e.$skewYdeg=0,e.$explicitWidth=0/0,e.$explicitHeight=0/0,e.$anchorOffsetX=0,e.$anchorOffsetY=0,e.$visible=!0,e.$cacheAsBitmap=!1,e.$alpha=1,e.$touchEnabled=r.defaultTouchEnabled,e.$scrollRect=null,e.$blendMode=0,e.$maskedObject=null,e.$mask=null,e.$maskRect=null,e.$renderNode=null,e.$renderDirty=!1,e.createWebAssemblyNode(),e}return __extends(r,i),r.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(0)},Object.defineProperty(r.prototype,"name",{get:function(){return this.$name},set:function(t){this.$name=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"parent",{get:function(){return this.$parent},enumerable:!0,configurable:!0}),r.prototype.$setParent=function(t){this.$parent=t},r.prototype.$onAddToStage=function(e,i){var r=this;r.$stage=e,r.$nestLevel=i,r.$hasAddToStage=!0,t.Sprite.$EVENT_ADD_TO_STAGE_LIST.push(r)},r.prototype.$onRemoveFromStage=function(){var e=this;e.$nestLevel=0,t.Sprite.$EVENT_REMOVE_FROM_STAGE_LIST.push(e)},Object.defineProperty(r.prototype,"stage",{get:function(){return this.$stage},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"matrix",{get:function(){return this.$getMatrix().clone()},set:function(t){this.$setMatrix(t)},enumerable:!0,configurable:!0}),r.prototype.$getMatrix=function(){var t=this;return t.$matrixDirty&&(t.$matrixDirty=!1,t.$matrix.$updateScaleAndRotation(t.$scaleX,t.$scaleY,t.$skewX,t.$skewY)),t.$matrix.tx=t.$x,t.$matrix.ty=t.$y,t.$matrix},r.prototype.$setMatrix=function(t,i){void 0===i&&(i=!0);var r=this,n=r.$matrix;n.a=t.a,n.b=t.b,n.c=t.c,n.d=t.d,r.$x=t.tx,r.$y=t.ty,r.$matrixDirty=!1,i&&(r.$scaleX=n.$getScaleX(),r.$scaleY=n.$getScaleY(),r.$skewX=t.$getSkewX(),r.$skewY=t.$getSkewY(),r.$skewXdeg=e(180*r.$skewX/Math.PI),r.$skewYdeg=e(180*r.$skewY/Math.PI),r.$rotation=e(180*r.$skewY/Math.PI)),r.$waNode.setMatrix(t.a,t.b,t.c,t.d,t.tx,t.ty)},r.prototype.$getConcatenatedMatrix=function(){var e=this,i=e.$concatenatedMatrix;i||(i=e.$concatenatedMatrix=new t.Matrix),e.$parent?e.$parent.$getConcatenatedMatrix().$preMultiplyInto(e.$getMatrix(),i):i.copyFrom(e.$getMatrix());var r=e.$anchorOffsetX,n=e.$anchorOffsetY,o=e.$scrollRect;return o?i.$preMultiplyInto(t.$TempMatrix.setTo(1,0,0,1,-o.x-r,-o.y-n),i):(0!=r||0!=n)&&i.$preMultiplyInto(t.$TempMatrix.setTo(1,0,0,1,-r,-n),i),e.$concatenatedMatrix},r.prototype.$getInvertedConcatenatedMatrix=function(){var e=this;return e.$invertedConcatenatedMatrix||(e.$invertedConcatenatedMatrix=new t.Matrix),e.$getConcatenatedMatrix().$invertInto(e.$invertedConcatenatedMatrix),e.$invertedConcatenatedMatrix},Object.defineProperty(r.prototype,"x",{get:function(){return this.$getX()},set:function(t){this.$setX(t)},enumerable:!0,configurable:!0}),r.prototype.$getX=function(){return this.$x},r.prototype.$setX=function(t){var e=this;e.$x=t,e.$waNode.setX(t)},Object.defineProperty(r.prototype,"y",{get:function(){return this.$getY()},set:function(t){this.$setY(t)},enumerable:!0,configurable:!0}),r.prototype.$getY=function(){return this.$y},r.prototype.$setY=function(t){var e=this;e.$y=t,e.$waNode.setY(t)},Object.defineProperty(r.prototype,"scaleX",{get:function(){return this.$getScaleX()},set:function(t){this.$setScaleX(t)},enumerable:!0,configurable:!0}),r.prototype.$getScaleX=function(){return this.$scaleX},r.prototype.$setScaleX=function(t){var e=this;e.$scaleX=t,e.$matrixDirty=!0,e.$waNode.setScaleX(t)},Object.defineProperty(r.prototype,"scaleY",{get:function(){return this.$getScaleY()},set:function(t){this.$setScaleY(t)},enumerable:!0,configurable:!0}),r.prototype.$getScaleY=function(){return this.$scaleY},r.prototype.$setScaleY=function(t){var e=this;e.$scaleY=t,e.$matrixDirty=!0,e.$waNode.setScaleY(t)},Object.defineProperty(r.prototype,"rotation",{get:function(){return this.$getRotation()},set:function(t){this.$setRotation(t)},enumerable:!0,configurable:!0}),r.prototype.$getRotation=function(){return this.$rotation},r.prototype.$setRotation=function(t){t=e(t);var i=this;if(t!=i.$rotation){var r=t-i.$rotation,n=r/180*Math.PI;i.$skewX+=n,i.$skewY+=n,i.$rotation=t,i.$matrixDirty=!0,i.$waNode.setRotation(t)}},Object.defineProperty(r.prototype,"skewX",{get:function(){return this.$skewXdeg},set:function(t){this.$setSkewX(t)},enumerable:!0,configurable:!0}),r.prototype.$setSkewX=function(t){var i=this;t!=i.$skewXdeg&&(i.$skewXdeg=t,t=e(t),t=t/180*Math.PI,i.$skewX=t,i.$matrixDirty=!0,i.$waNode.setSkewX(i.$skewXdeg))},Object.defineProperty(r.prototype,"skewY",{get:function(){return this.$skewYdeg},set:function(t){this.$setSkewY(t)},enumerable:!0,configurable:!0}),r.prototype.$setSkewY=function(t){var i=this;t!=i.$skewYdeg&&(i.$skewYdeg=t,t=e(t),t=t/180*Math.PI,i.$skewY=t,i.$matrixDirty=!0,i.$waNode.setSkewY(i.$skewYdeg))},Object.defineProperty(r.prototype,"width",{get:function(){return this.$getWidth()},set:function(t){this.$setWidth(t)},enumerable:!0,configurable:!0}),r.prototype.$getWidth=function(){var t=this;return isNaN(t.$explicitWidth)?t.$getOriginalBounds().width:t.$explicitWidth},r.prototype.$setWidth=function(t){t=+t,this.$explicitWidth=isNaN(t)?0/0:t},Object.defineProperty(r.prototype,"height",{get:function(){return this.$getHeight()},set:function(t){this.$setHeight(t)},enumerable:!0,configurable:!0}),r.prototype.$getHeight=function(){var t=this;return isNaN(t.$explicitHeight)?t.$getOriginalBounds().height:t.$explicitHeight},r.prototype.$setHeight=function(t){t=+t,this.$explicitHeight=isNaN(t)?0/0:t},Object.defineProperty(r.prototype,"measuredWidth",{get:function(){return this.$getOriginalBounds().width},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"measuredHeight",{get:function(){return this.$getOriginalBounds().height},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"anchorOffsetX",{get:function(){return this.$anchorOffsetX},set:function(t){this.$setAnchorOffsetX(t)},enumerable:!0,configurable:!0}),r.prototype.$setAnchorOffsetX=function(t){var e=this;e.$anchorOffsetX=t,e.$waNode.setAnchorOffsetX(t)},Object.defineProperty(r.prototype,"anchorOffsetY",{get:function(){return this.$anchorOffsetY},set:function(t){this.$setAnchorOffsetY(t)},enumerable:!0,configurable:!0}),r.prototype.$setAnchorOffsetY=function(t){var e=this;e.$anchorOffsetY=t,e.$waNode.setAnchorOffsetY(t)},Object.defineProperty(r.prototype,"visible",{get:function(){return this.$visible},set:function(t){this.$setVisible(t)},enumerable:!0,configurable:!0}),r.prototype.$setVisible=function(t){t=!!t;var e=this;e.$visible=t,e.$waNode.setVisible(t)},Object.defineProperty(r.prototype,"cacheAsBitmap",{get:function(){return this.$cacheAsBitmap},set:function(t){t=!!t;var e=this;e.$cacheAsBitmap=t,e.$waNode.setCacheAsBitmap(t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"alpha",{get:function(){return this.$alpha},set:function(t){this.$setAlpha(t)},enumerable:!0,configurable:!0}),r.prototype.$setAlpha=function(t){var e=this;e.$alpha=t,e.$waNode.setAlpha(t)},Object.defineProperty(r.prototype,"touchEnabled",{get:function(){return this.$getTouchEnabled()},set:function(t){this.$setTouchEnabled(t)},enumerable:!0,configurable:!0}),r.prototype.$getTouchEnabled=function(){return this.$touchEnabled},r.prototype.$setTouchEnabled=function(t){this.$touchEnabled=t},Object.defineProperty(r.prototype,"scrollRect",{get:function(){return this.$scrollRect},set:function(t){this.$setScrollRect(t)},enumerable:!0,configurable:!0}),r.prototype.$setScrollRect=function(e){var i=this;(e||i.$scrollRect)&&(e?(i.$scrollRect||(i.$scrollRect=new t.Rectangle),i.$scrollRect.copyFrom(e),i.$waNode.setScrollRect(e.x,e.y,e.width,e.height)):(i.$scrollRect=null,i.$waNode.setScrollRect(0,0,0,0)))},Object.defineProperty(r.prototype,"blendMode",{get:function(){return t.sys.numberToBlendMode(this.$blendMode)},set:function(e){var i=this,r=t.sys.blendModeToNumber(e);i.$blendMode=r,i.$waNode.setBlendMode(r)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"mask",{get:function(){var t=this;return t.$mask?t.$mask:t.$maskRect},set:function(e){var i=this;if(e!==i)if(e)if(e instanceof r){if(e==i.$mask)return;e.$maskedObject&&(e.$maskedObject.mask=null),e.$maskedObject=i,i.$mask=e,i.$maskRect&&(i.$waNode.setMaskRect(0,0,0,0),i.$maskRect=null),i.$waNode.setMask(e.$waNode.id)}else i.$maskRect||(i.$maskRect=new t.Rectangle),i.$maskRect.copyFrom(e),i.$waNode.setMaskRect(e.x,e.y,e.width,e.height),i.$mask&&(i.$mask.$maskedObject=null),i.mask&&(i.$waNode.setMask(-1),i.$mask=null);else i.$mask&&(i.$mask.$maskedObject=null),i.mask&&(i.$waNode.setMask(-1),i.$mask=null),i.$maskRect&&(i.$waNode.setMaskRect(0,0,0,0),i.$maskRect=null)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"filters",{get:function(){var t=this;return t.$filters?t.$filters.concat():null},set:function(t){var e=this,i=e.$filters;if(!i&&!t)return e.$filters=null,void e.$waNode.setFilters(null);if(i&&i.length)for(var r=i.length,n=0;r>n;n++)i[n].$removeTarget(e);if(t&&t.length)for(var o=t.length,n=0;o>n;n++)t[n].$addTarget(e);t&&t.length?(t=t.concat(),e.$filters=t,e.$waNode.setFilters(t)):(e.$filters=null,e.$waNode.setFilters(null))},enumerable:!0,configurable:!0}),r.prototype.getTransformedBounds=function(t,e){return t=t||this,this.$getTransformedBounds(t,e)},r.prototype.getBounds=function(t,e){void 0===e&&(e=!0);var i=this;return t=i.$getTransformedBounds(i,t),e&&(0!=i.$anchorOffsetX&&(t.x-=i.$anchorOffsetX),0!=i.$anchorOffsetY&&(t.y-=i.$anchorOffsetY)),t},r.prototype.$getTransformedBounds=function(e,i){var r=this,n=r.$getOriginalBounds();if(i||(i=new t.Rectangle),i.copyFrom(n),e==r)return i;var o;if(e){o=t.$TempMatrix;var a=e.$getInvertedConcatenatedMatrix();a.$preMultiplyInto(r.$getConcatenatedMatrix(),o)}else o=r.$getConcatenatedMatrix();return o.$transformBounds(i),i},r.prototype.globalToLocal=function(e,i,r){void 0===e&&(e=0),void 0===i&&(i=0),t.WebAssembly.update();var n=t.WebAssembly.globalToLocal(this.$waNode.id,e,i),o=n.split(","),a=parseFloat(o[0]),s=parseFloat(o[1]);return r?r.setTo(a,s):r=new t.Point(a,s),r},r.prototype.localToGlobal=function(e,i,r){void 0===e&&(e=0),void 0===i&&(i=0),t.WebAssembly.update();var n=t.WebAssembly.localToGlobal(this.$waNode.id,e,i),o=n.split(","),a=parseFloat(o[0]),s=parseFloat(o[1]);return r?r.setTo(a,s):r=new t.Point(a,s),r},r.prototype.$getOriginalBounds=function(){var t=this,e=t.$getContentBounds();return t.$measureChildBounds(e),e},r.prototype.$measureChildBounds=function(t){},r.prototype.$getContentBounds=function(){var e=t.$TempRectangle;return e.setEmpty(),this.$measureContentBounds(e),e},r.prototype.$measureContentBounds=function(t){},r.prototype.$getRenderNode=function(){var t=this,e=t.$renderNode;return t.$renderDirty&&(e&&e.cleanBeforeRender(),t.$updateRenderNode(),t.$renderDirty=!1,e=t.$renderNode),e},r.prototype.$updateRenderNode=function(){},r.prototype.$hitTest=function(t,e){var i=this;if(!i.$visible||0==i.$scaleX||0==i.$scaleY)return null;var r=i.$getInvertedConcatenatedMatrix();if(0==r.a&&0==r.b&&0==r.c&&0==r.d)return null;var n=i.$getContentBounds(),o=r.a*t+r.c*e+r.tx,a=r.b*t+r.d*e+r.ty;if(n.contains(o,a)){if(!i.$children){var s=i.$scrollRect?i.$scrollRect:i.$maskRect;if(s&&!s.contains(o,a))return null;if(i.$mask&&!i.$mask.$hitTest(t,e))return null}return i}return null},r.prototype.hitTestPoint=function(e,i,r){var n=this;if(r){var o=n.$getInvertedConcatenatedMatrix(),a=o.a*e+o.c*i+o.tx,s=o.b*e+o.d*i+o.ty,h=void 0,l=t.sys.customHitTestBuffer;l.resize(3,3),t.WebAssembly.forHitTest=!0;var u=t.WebAssembly.getCurrentBuffer();t.WebAssembly.activateBuffer(l),t.WebAssembly.update(),t.WebAssembly.renderDisplayObjectWithOffset(n.$waNode.id,1-a,1-s),t.WebAssembly.executeRenderCommand();try{h=t.WebAssembly.getPixels(1,1)}catch(c){throw new Error(t.sys.tr(1039))}return t.WebAssembly.activateBuffer(u),t.WebAssembly.forHitTest=!1,0===h[3]?!1:!0}if(0==n.$scaleX||0==n.$scaleY)return!1;var o=n.$getInvertedConcatenatedMatrix(),d=n.getBounds(null,!1),a=o.a*e+o.c*i+o.tx,s=o.b*e+o.d*i+o.ty;if(d.contains(a,s)){var p=n.$scrollRect?n.$scrollRect:n.$maskRect;return p&&!p.contains(a,s)?!1:!0}return!1},r.prototype.$addListener=function(e,n,o,a,s,h){i.prototype.$addListener.call(this,e,n,o,a,s,h);var l=e==t.Event.ENTER_FRAME;if(l||e==t.Event.RENDER){var u=l?r.$enterFrameCallBackList:r.$renderCallBackList;-1==u.indexOf(this)&&u.push(this)}},r.prototype.removeEventListener=function(e,n,o,a){i.prototype.removeEventListener.call(this,e,n,o,a);var s=e==t.Event.ENTER_FRAME;if((s||e==t.Event.RENDER)&&!this.hasEventListener(e)){var h=s?r.$enterFrameCallBackList:r.$renderCallBackList,l=h.indexOf(this);-1!==l&&h.splice(l,1)}},r.prototype.dispatchEvent=function(t){if(!t.$bubbles)return i.prototype.dispatchEvent.call(this,t);var e=this.$getPropagationList(this),r=.5*e.length;return t.$setTarget(this),this.$dispatchPropagationEvent(t,e,r),!t.$isDefaultPrevented},r.prototype.$getPropagationList=function(t){for(var e=[];t;)e.push(t),t=t.$parent;var i=e.concat();return i.reverse(),e=i.concat(e)},r.prototype.$dispatchPropagationEvent=function(t,e,i){for(var r=e.length,n=i-1,o=0;r>o;o++){var a=e[o];if(t.$currentTarget=a,n>o?t.$eventPhase=1:o==i||o==n?t.$eventPhase=2:t.$eventPhase=3,a.$notifyListener(t,i>o),t.$isPropagationStopped||t.$isPropagationImmediateStopped)return}},r.prototype.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.$parent}return!1},r.prototype.dispose=function(){var t=this,e=t.$parent;e&&e.removeChild(t),t.$filters&&t.$filters.length&&(t.$filters=null,t.$waNode.setFilters(null)),t.$waNode.disposeDisplayObject(),t.$waNode=null},r.defaultTouchEnabled=!1,r.$enterFrameCallBackList=[],r.$renderCallBackList=[],r}(t.EventDispatcher);t.DisplayObject=i,__reflect(i.prototype,"egret.DisplayObject")}(egret||(egret={})),this.DEBUG=!0,this.RELEASE=!1;var egret;!function(t){function e(e){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];return t.sys.tr.apply(t.sys,arguments)}function i(e){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];var n=t.sys.tr.apply(null,arguments);throw new Error("#"+e+": "+n)}function r(e){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];var n=t.sys.tr.apply(null,arguments);t.warn("Warning #"+e+": "+n)}function n(e,i,r){Object.defineProperty(e.prototype,i,{get:function(){return t.$warn(1009,t.getQualifiedClassName(e),i),r},set:function(r){t.$error(1009,t.getQualifiedClassName(e),i)},enumerable:!0,configurable:!0})}t.getString=e,t.$error=i,t.$warn=r,t.$markCannotUse=n}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,i,r,n){var o=t.call(this)||this;return o.$eventPhase=2,o.$currentTarget=null,o.$target=null,o.$isDefaultPrevented=!1,o.$isPropagationStopped=!1,o.$isPropagationImmediateStopped=!1,o.$type=e,o.$bubbles=!!i,o.$cancelable=!!r,o.data=n,o}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return this.$type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bubbles",{get:function(){return this.$bubbles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cancelable",{get:function(){return this.$cancelable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventPhase",{get:function(){return this.$eventPhase},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTarget",{get:function(){return this.$currentTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this.$target},enumerable:!0,configurable:!0}),e.prototype.$setTarget=function(t){return this.$target=t,!0},e.prototype.isDefaultPrevented=function(){return this.$isDefaultPrevented},e.prototype.preventDefault=function(){this.$cancelable&&(this.$isDefaultPrevented=!0)},e.prototype.stopPropagation=function(){this.$bubbles&&(this.$isPropagationStopped=!0)},e.prototype.stopImmediatePropagation=function(){this.$bubbles&&(this.$isPropagationImmediateStopped=!0)},e.prototype.clean=function(){this.data=this.$currentTarget=null,this.$setTarget(null)},e.dispatchEvent=function(t,i,r,n){void 0===r&&(r=!1);var o=e.create(e,i,r),a=e._getPropertyData(e);void 0!=n&&(a.data=n);var s=t.dispatchEvent(o);return e.release(o),s},e._getPropertyData=function(t){var e=t._props;return e||(e=t._props={}),e},e.create=function(t,e,i,r){var n=t.eventPool;if(n||(n=t.eventPool=[]),n.length){var o=n.pop();return o.$type=e,o.$bubbles=!!i,o.$cancelable=!!r,o.$isDefaultPrevented=!1,o.$isPropagationStopped=!1,o.$isPropagationImmediateStopped=!1,o.$eventPhase=2,o}return new t(e,i,r)},e.release=function(t){t.clean();var e=Object.getPrototypeOf(t).constructor;e.eventPool.push(t)},e.ADDED_TO_STAGE="addedToStage",e.REMOVED_FROM_STAGE="removedFromStage",e.ADDED="added",e.REMOVED="removed",e.ENTER_FRAME="enterFrame",e.RENDER="render",e.RESIZE="resize",e.CHANGE="change",e.CHANGING="changing",e.COMPLETE="complete",e.LOOP_COMPLETE="loopComplete",e.FOCUS_IN="focusIn",e.FOCUS_OUT="focusOut",e.ENDED="ended",e.ACTIVATE="activate",e.DEACTIVATE="deactivate",e.CLOSE="close",e.CONNECT="connect",e.LEAVE_STAGE="leaveStage",e.SOUND_COMPLETE="soundComplete",e}(t.HashObject);t.Event=e,__reflect(e.prototype,"egret.Event")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t){var r=e.call(this)||this;return r.$texture=null,r.$bitmapData=null,r.$bitmapX=0,r.$bitmapY=0,r.$bitmapWidth=0,r.$bitmapHeight=0,r.$offsetX=0,r.$offsetY=0,r.$textureWidth=0,r.$textureHeight=0,r.$sourceWidth=0,r.$sourceHeight=0,r.$smoothing=i.defaultSmoothing,r.$explicitBitmapWidth=0/0,r.$explicitBitmapHeight=0/0,r.$scale9Grid=null,r.$fillMode="scale",r._pixelHitTest=!1,r.$setTexture(t),r}return __extends(i,e),i.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(1)},i.prototype.$onAddToStage=function(i,r){e.prototype.$onAddToStage.call(this,i,r);var n=this.$texture;n&&t.BitmapData.$addBitmap(this,n._bitmapData)},i.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this);var i=this.$texture;i&&t.BitmapData.$removeBitmap(this,i._bitmapData)},Object.defineProperty(i.prototype,"texture",{get:function(){var e=this.$texture;return e instanceof t.Texture?e:null},set:function(t){this.$setTexture(t)},enumerable:!0,configurable:!0}),i.prototype.$setTexture=function(e){var i=this.$texture;if(e==i)return!1;if(this.$texture=e,!e)return i&&t.BitmapData.$removeBitmap(this,i._bitmapData),this.setBitmapData(null,0,0,0,0,0,0,0,0,0,0),this.$renderDirty=!0,this.setBitmapDataToWasm(null),!0;if(this.$refreshImageData(),this.$stage){if(i){var r=i._bitmapData.hashCode,n=e._bitmapData.hashCode;if(r==n)return this.$renderDirty=!0,!0;t.BitmapData.$removeBitmap(this,i._bitmapData)}t.BitmapData.$addBitmap(this,e._bitmapData)}return this.$renderDirty=!0,!0},i.prototype.setBitmapDataToWasm=function(t){this.$waNode.setBitmapData(t)},i.prototype.$refreshImageData=function(){var t=this.$texture;t?(this.$waNode&&this.setBitmapDataToWasm(t),this.setBitmapData(t._bitmapData,t._bitmapX,t._bitmapY,t._bitmapWidth,t._bitmapHeight,t._offsetX,t._offsetY,t.$getTextureWidth(),t.$getTextureHeight(),t._sourceWidth,t._sourceHeight)):this.setBitmapDataToWasm(null)},i.prototype.setBitmapData=function(t,e,i,r,n,o,a,s,h,l,u){this.$bitmapData=t,this.$bitmapX=e,this.$bitmapY=i,this.$bitmapWidth=r,this.$bitmapHeight=n,this.$offsetX=o,this.$offsetY=a,this.$textureWidth=s,this.$textureHeight=h,this.$sourceWidth=l,this.$sourceHeight=u},Object.defineProperty(i.prototype,"scale9Grid",{get:function(){return this.$scale9Grid},set:function(t){this.$setScale9Grid(t)},enumerable:!0,configurable:!0}),i.prototype.$setScale9Grid=function(t){var e=this;e.$scale9Grid=t,e.$renderDirty=!0,e.$waNode&&(t?e.$waNode.setScale9Grid(t.x,t.y,t.width,t.height):e.$waNode.setScale9Grid(0,0,-1,-1))},Object.defineProperty(i.prototype,"fillMode",{get:function(){return this.$fillMode},set:function(t){this.$setFillMode(t)},enumerable:!0,configurable:!0}),i.prototype.$setFillMode=function(t){return t==this.$fillMode?!1:(this.$fillMode=t,!0)},Object.defineProperty(i.prototype,"smoothing",{get:function(){return this.$smoothing},set:function(t){t=!!t,this.$smoothing=t},enumerable:!0,configurable:!0}),i.prototype.$setWidth=function(t){var e=this;return 0>t||t==this.$explicitBitmapWidth?!1:(this.$explicitBitmapWidth=t,e.$renderDirty=!0,e.$waNode&&e.$waNode.setWidth(t),!0)},i.prototype.$setHeight=function(t){var e=this;return 0>t||t==this.$explicitBitmapHeight?!1:(this.$explicitBitmapHeight=t,e.$renderDirty=!0,e.$waNode&&e.$waNode.setHeight(t),!0)},i.prototype.$getWidth=function(){return isNaN(this.$explicitBitmapWidth)?this.$getContentBounds().width:this.$explicitBitmapWidth},i.prototype.$getHeight=function(){return isNaN(this.$explicitBitmapHeight)?this.$getContentBounds().height:this.$explicitBitmapHeight},i.prototype.$measureContentBounds=function(t){if(this.$bitmapData){var e=isNaN(this.$explicitBitmapWidth)?this.$textureWidth:this.$explicitBitmapWidth,i=isNaN(this.$explicitBitmapHeight)?this.$textureHeight:this.$explicitBitmapHeight;t.setTo(0,0,e,i)}else{var e=isNaN(this.$explicitBitmapWidth)?0:this.$explicitBitmapWidth,i=isNaN(this.$explicitBitmapHeight)?0:this.$explicitBitmapHeight;t.setTo(0,0,e,i)}},Object.defineProperty(i.prototype,"pixelHitTest",{get:function(){return this._pixelHitTest},set:function(t){this._pixelHitTest=!!t},enumerable:!0,configurable:!0}),i.prototype.$hitTest=function(t,i){var r=e.prototype.$hitTest.call(this,t,i);if(r&&this._pixelHitTest){var n=this.hitTestPoint(t,i,!0);n||(r=null)}return r},i.defaultSmoothing=!0,i}(t.DisplayObject);t.Bitmap=e,__reflect(e.prototype,"egret.Bitmap")}(egret||(egret={}));var egret;!function(t){var e=[],i=Math.PI/180,r=function(r){function n(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var i=r.call(this)||this;return i.x=t,i.y=e,i}return __extends(n,r),n.release=function(t){t&&e.push(t)},n.create=function(t,i){var r=e.pop();return r||(r=new n),r.setTo(t,i)},Object.defineProperty(n.prototype,"length",{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},enumerable:!0,configurable:!0}),n.prototype.setTo=function(t,e){return this.x=t,this.y=e,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.equals=function(t){return this.x==t.x&&this.y==t.y},n.distance=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))},n.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y)},n.interpolate=function(t,e,i){var r=1-i;return new n(t.x*i+e.x*r,t.y*i+e.y*r)},n.prototype.normalize=function(t){if(0!=this.x||0!=this.y){var e=t/this.length;this.x*=e,this.y*=e}},n.prototype.offset=function(t,e){this.x+=t,this.y+=e},n.polar=function(e,r){return new n(e*t.NumberUtils.cos(r/i),e*t.NumberUtils.sin(r/i))},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y)},n.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")"},n}(t.HashObject);t.Point=r,__reflect(r.prototype,"egret.Point"),t.$TempPoint=new r}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var t=e.call(this)||this;return t.$touchChildren=!0,t.$children=[],t}return __extends(i,e),Object.defineProperty(i.prototype,"numChildren",{get:function(){return this.$children.length},enumerable:!0,configurable:!0}),i.prototype.addChild=function(t){var e=this.$children.length;return t.$parent==this&&e--,this.$doAddChild(t,e)},i.prototype.addChildAt=function(t,e){return e=0|+e,(0>e||e>=this.$children.length)&&(e=this.$children.length,t.$parent==this&&e--),this.$doAddChild(t,e)},i.prototype.$doAddChild=function(e,r,n){void 0===n&&(n=!0);var o=this,a=e.$parent;if(a==o)return o.doSetChildIndex(e,r),e;a&&a.removeChild(e),o.$children.splice(r,0,e),e.$setParent(o);var s=o.$stage;if(s&&e.$onAddToStage(s,o.$nestLevel+1),n&&e.dispatchEventWith(t.Event.ADDED,!0),s)for(var h=i.$EVENT_ADD_TO_STAGE_LIST;h.length;){var l=h.shift();l.$stage&&n&&l.dispatchEventWith(t.Event.ADDED_TO_STAGE)}return o.$waNode.addChildAt(e.$waNode.id,r),this.$childAdded(e,r),e},i.prototype.contains=function(t){for(;t;){if(t==this)return!0;t=t.$parent}return!1},i.prototype.getChildAt=function(t){t=0|+t;var e=this.$children;return t>=0&&t<e.length?e[t]:null},i.prototype.getChildIndex=function(t){return this.$children.indexOf(t)},i.prototype.getChildByName=function(t){for(var e,i=this.$children,r=i.length,n=0;r>n;n++)if(e=i[n],e.name==t)return e;return null},i.prototype.removeChild=function(t){var e=this.$children.indexOf(t);return e>=0?this.$doRemoveChild(e):null},i.prototype.removeChildAt=function(t){return t=0|+t,t>=0&&t<this.$children.length?this.$doRemoveChild(t):null},i.prototype.$doRemoveChild=function(e,r){void 0===r&&(r=!0),e=0|+e;var n=this.$children,o=n[e];if(this.$childRemoved(o,e),r&&o.dispatchEventWith(t.Event.REMOVED,!0),this.$stage){o.$onRemoveFromStage();for(var a=i.$EVENT_REMOVE_FROM_STAGE_LIST;a.length>0;){var s=a.shift();r&&s.$hasAddToStage&&(s.$hasAddToStage=!1,s.dispatchEventWith(t.Event.REMOVED_FROM_STAGE)),s.$hasAddToStage=!1,s.$stage=null}}o.$setParent(null);var h=n.indexOf(o);return-1!=h&&n.splice(h,1),this.$waNode.removeChild(o.$waNode.id),o},i.prototype.setChildIndex=function(t,e){e=0|+e,(0>e||e>=this.$children.length)&&(e=this.$children.length-1),this.doSetChildIndex(t,e)},i.prototype.doSetChildIndex=function(t,e){var i=this.$children.indexOf(t);i!=e&&(this.$childRemoved(t,i),this.$children.splice(i,1),this.$children.splice(e,0,t),this.$waNode.removeChild(t.$waNode.id),this.$waNode.addChildAt(t.$waNode.id,e),this.$childAdded(t,e))},i.prototype.swapChildrenAt=function(t,e){t=0|+t,e=0|+e,t>=0&&t<this.$children.length&&e>=0&&e<this.$children.length&&this.doSwapChildrenAt(t,e)},i.prototype.swapChildren=function(t,e){var i=this.$children.indexOf(t),r=this.$children.indexOf(e);-1==i||-1==r||this.doSwapChildrenAt(i,r)},i.prototype.doSwapChildrenAt=function(t,e){if(t>e){var i=e;e=t,t=i}else if(t==e)return;var r=this.$children,n=r[t],o=r[e];this.$childRemoved(n,t),this.$childRemoved(o,e),r[t]=o,r[e]=n,this.$childAdded(o,t),this.$childAdded(n,e),this.$waNode.swapChild(t,e)},i.prototype.removeChildren=function(){for(var t=this.$children,e=t.length-1;e>=0;e--)this.$doRemoveChild(e)},i.prototype.$childAdded=function(t,e){},i.prototype.$childRemoved=function(t,e){},i.prototype.$onAddToStage=function(t,i){e.prototype.$onAddToStage.call(this,t,i);var r=this.$children,n=r.length;i++;for(var o=0;n>o;o++){var a=this.$children[o];a.$onAddToStage(t,i)}},i.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this);for(var t=this.$children,i=t.length,r=0;i>r;r++){var n=t[r];n.$onRemoveFromStage()}},i.prototype.$measureChildBounds=function(e){var i=this.$children,r=i.length;if(0!=r){for(var n=0,o=0,a=0,s=0,h=!1,l=-1;r>l;l++){var u=-1==l?e:i[l].$getTransformedBounds(this,t.$TempRectangle);u.isEmpty()||(h?(n=Math.min(n,u.x),o=Math.max(o,u.x+u.width),a=Math.min(a,u.y),s=Math.max(s,u.y+u.height)):(h=!0,n=u.x,o=n+u.width,a=u.y,s=a+u.height))}e.setTo(n,a,o-n,s-a)}},Object.defineProperty(i.prototype,"touchChildren",{get:function(){return this.$getTouchChildren()
},set:function(t){this.$setTouchChildren(!!t)},enumerable:!0,configurable:!0}),i.prototype.$getTouchChildren=function(){return this.$touchChildren},i.prototype.$setTouchChildren=function(t){return this.$touchChildren==t?!1:(this.$touchChildren=t,!0)},i.prototype.$hitTest=function(t,i){if(!this.$visible)return null;var r=this.$getInvertedConcatenatedMatrix(),n=r.a*t+r.c*i+r.tx,o=r.b*t+r.d*i+r.ty,a=this.$scrollRect?this.$scrollRect:this.$maskRect;if(a&&!a.contains(n,o))return null;if(this.$mask&&!this.$mask.$hitTest(t,i))return null;for(var s=this.$children,h=!1,l=null,u=s.length-1;u>=0;u--){var c=s[u];if(!c.$maskedObject&&(l=c.$hitTest(t,i))){if(h=!0,l.$touchEnabled)break;l=null}}return l?this.$touchChildren?l:this:h?this:e.prototype.$hitTest.call(this,t,i)},i.prototype.dispose=function(){this.removeChildren(),e.prototype.dispose.call(this)},i.$EVENT_ADD_TO_STAGE_LIST=[],i.$EVENT_REMOVE_FROM_STAGE_LIST=[],i}(t.DisplayObject);t.DisplayObjectContainer=e,__reflect(e.prototype,"egret.DisplayObjectContainer")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,i,r,n,o,a,s,h){void 0===e&&(e=16711680),void 0===i&&(i=1),void 0===r&&(r=6),void 0===n&&(n=6),void 0===o&&(o=2),void 0===a&&(a=1),void 0===s&&(s=!1),void 0===h&&(h=!1);var l=t.call(this)||this,u=l;return u.type="glow",u.$color=e,u.$blue=255&e,u.$green=(65280&e)>>8,u.$red=e>>16,u.$alpha=i,u.$blurX=r,u.$blurY=n,u.$strength=o,u.$quality=a,u.$inner=s,u.$knockout=h,u.$uniforms.color={x:l.$red/255,y:l.$green/255,z:l.$blue/255,w:1},u.$uniforms.alpha=i,u.$uniforms.blurX=r,u.$uniforms.blurY=n,u.$uniforms.strength=o,u.$uniforms.inner=s?1:0,u.$uniforms.knockout=h?0:1,u.$uniforms.dist=0,u.$uniforms.angle=0,u.$uniforms.hideObject=0,u.onPropertyChange(),l}return __extends(e,t),Object.defineProperty(e.prototype,"color",{get:function(){return this.$color},set:function(t){this.$color!=t&&(this.$color=t,this.$blue=255&t,this.$green=(65280&t)>>8,this.$red=t>>16,this.$uniforms.color.x=this.$red/255,this.$uniforms.color.y=this.$green/255,this.$uniforms.color.z=this.$blue/255)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.$alpha},set:function(t){this.$alpha!=t&&(this.$alpha=t,this.$uniforms.alpha=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.$blurX},set:function(t){var e=this;e.$blurX!=t&&(e.$blurX=t,e.$uniforms.blurX=t,e.onPropertyChange())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.$blurY},set:function(t){var e=this;e.$blurY!=t&&(e.$blurY=t,e.$uniforms.blurY=t,e.onPropertyChange())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strength",{get:function(){return this.$strength},set:function(t){this.$strength!=t&&(this.$strength=t,this.$uniforms.strength=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.$quality},set:function(t){this.$quality!=t&&(this.$quality=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inner",{get:function(){return this.$inner},set:function(t){this.$inner!=t&&(this.$inner=t,this.$uniforms.inner=t?1:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"knockout",{get:function(){return this.$knockout},set:function(t){this.$knockout!=t&&(this.$knockout=t,this.$uniforms.knockout=t?0:1)},enumerable:!0,configurable:!0}),e.prototype.$toJson=function(){return'{"color": '+this.$color+', "red": '+this.$red+', "green": '+this.$green+', "blue": '+this.$blue+', "alpha": '+this.$alpha+', "blurX": '+this.$blurX+', "blurY": '+this.blurY+', "strength": '+this.$strength+', "quality": '+this.$quality+', "inner": '+this.$inner+', "knockout": '+this.$knockout+"}"},e.prototype.updatePadding=function(){var t=this;t.paddingLeft=t.blurX,t.paddingRight=t.blurX,t.paddingTop=t.blurY,t.paddingBottom=t.blurY},e}(t.Filter);t.GlowFilter=e,__reflect(e.prototype,"egret.GlowFilter")}(egret||(egret={}));var egret;!function(t){t.$locale_strings=t.$locale_strings||{},t.$language="en_US"}(egret||(egret={})),function(t){var e;!function(e){function i(e){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];var n=t.$locale_strings[t.$language][e];if(!n)return"{"+e+"}";for(var o=i.length,a=0;o>a;a++)n=n.replace("{"+a+"}",i[a]);return n}e.tr=i}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.localStorage||(t.localStorage={}))}(egret||(egret={}));var egret;!function(t){function e(t,e,i){var r=t.prototype;r.__class__=e;var n=[e];i&&(n=n.concat(i));var o=r.__types__;if(r.__types__)for(var a=o.length,s=0;a>s;s++){var h=o[s];-1==n.indexOf(h)&&n.push(h)}r.__types__=n}t.registerClass=e}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(){function i(){this.type=0,this.renderAlpha=1,this.renderVisible=!0,this.renderMatrix=new t.Matrix,this.renderRegion=new e.Region,this.drawData=[],this.renderCount=0}return i.prototype.cleanBeforeRender=function(){this.drawData.length=0,this.renderCount=0},i.prototype.$getRenderCount=function(){return this.renderCount},i}();e.RenderNode=i,__reflect(i.prototype,"egret.sys.RenderNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(){function t(){this.type=0,this.$commands=[],this.$data=[],this.commandPosition=0,this.dataPosition=0,this.$lastX=0,this.$lastY=0}return t.prototype.moveTo=function(t,e){this.$commands[this.commandPosition++]=1;var i=this.dataPosition;this.$data[i++]=t,this.$data[i++]=e,this.dataPosition=i},t.prototype.lineTo=function(t,e){this.$commands[this.commandPosition++]=2;var i=this.dataPosition;this.$data[i++]=t,this.$data[i++]=e,this.dataPosition=i},t.prototype.curveTo=function(t,e,i,r){this.$commands[this.commandPosition++]=3;var n=this.dataPosition;this.$data[n++]=t,this.$data[n++]=e,this.$data[n++]=i,this.$data[n++]=r,this.dataPosition=n},t.prototype.cubicCurveTo=function(t,e,i,r,n,o){this.$commands[this.commandPosition++]=4;var a=this.dataPosition;this.$data[a++]=t,this.$data[a++]=e,this.$data[a++]=i,this.$data[a++]=r,this.$data[a++]=n,this.$data[a++]=o,this.dataPosition=a},t.prototype.drawRect=function(t,e,i,r){var n=t+i,o=e+r;this.moveTo(t,e),this.lineTo(n,e),this.lineTo(n,o),this.lineTo(t,o),this.lineTo(t,e)},t.prototype.drawRoundRect=function(t,e,i,r,n,o){var a=.5*n|0,s=o?.5*o|0:a;if(!a||!s)return void this.drawRect(t,e,i,r);var h=.5*i,l=.5*r;if(a>h&&(a=h),s>l&&(s=l),h===a&&l===s)return void(a===s?this.drawCircle(t+a,e+s,a):this.drawEllipse(t,e,2*a,2*s));var u=t+i,c=e+r,d=t+a,p=u-a,f=e+s,g=c-s;this.moveTo(u,g),this.curveTo(u,c,p,c),this.lineTo(d,c),this.curveTo(t,c,t,g),this.lineTo(t,f),this.curveTo(t,e,d,e),this.lineTo(p,e),this.curveTo(u,e,u,f),this.lineTo(u,g)},t.prototype.drawCircle=function(t,e,i){this.arcToBezier(t,e,i,i,0,2*Math.PI)},t.prototype.drawEllipse=function(t,e,i,r){var n=.5*i,o=.5*r;t+=n,e+=o,this.arcToBezier(t,e,n,o,0,2*Math.PI)},t.prototype.drawArc=function(t,e,i,r,n,o){o?n>=r&&(n-=2*Math.PI):r>=n&&(n+=2*Math.PI),this.arcToBezier(t,e,i,i,r,n,o)},t.prototype.arcToBezier=function(t,e,i,r,n,o,a){var s=.5*Math.PI,h=n,l=h;a?(l+=-s-h%s,o>l&&(l=o)):(l+=s-h%s,l>o&&(l=o));var u=t+Math.cos(h)*i,c=e+Math.sin(h)*r;(this.$lastX!=u||this.$lastY!=c)&&this.moveTo(u,c);for(var d=Math.cos(h),p=Math.sin(h),f=0;4>f;f++){var g=l-h,y=4*Math.tan(g/4)/3,v=u-p*y*i,m=c+d*y*r;d=Math.cos(l),p=Math.sin(l),u=t+d*i,c=e+p*r;var b=u+p*y*i,$=c-d*y*r;if(this.cubicCurveTo(v,m,b,$,u,c),l===o)break;h=l,a?(l=h-s,o>l&&(l=o)):(l=h+s,l>o&&(l=o))}},t}();t.Path2D=e,__reflect(e.prototype,"egret.sys.Path2D")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){function e(t,e){var i=null==e.italic?t.italic:e.italic,r=null==e.bold?t.bold:e.bold,n=null==e.size?t.size:e.size,o=e.fontFamily||t.fontFamily,a=i?"italic ":"normal ";return a+=r?"bold ":"normal ",a+=n+"px "+o}function i(t,e){var i=t>>16,r=t>>8&255,n=255&t;return"rgba("+i+","+r+","+n+","+e+")"}function r(e,r,n,o,a,s){var h;h=r==t.GradientType.LINEAR?e.createLinearGradient(-1,0,1,0):e.createRadialGradient(0,0,0,0,0,1);for(var l=n.length,u=0;l>u;u++)h.addColorStop(a[u]/255,i(n[u],o[u]));return h}function n(t,e,i){void 0===i&&(i=0);for(var r=0,n=e.length;n>r;r++)t[r+i]=e[r]}function o(t,e,i,r){for(var n=r[0],o=r[1],a=r[2],s=r[3],h=r[4],l=r[5],u=r[6],c=r[7],d=r[8],p=r[9],f=r[10],g=r[11],y=r[12],v=r[13],m=r[14],b=r[15],$=r[16],x=r[17],T=r[18],_=r[19],E=0,w=e*i*4;w>E;E+=4){var C=t[E+0],S=t[E+1],O=t[E+2],A=t[E+3];t[E+0]=n*C+o*S+a*O+s*A+h,t[E+1]=l*C+u*S+c*O+d*A+p,t[E+2]=f*C+g*S+y*O+v*A+m,t[E+3]=b*C+$*S+x*O+T*A+_}}function a(t,e,i,r,n){s(t,e,i,r),h(t,e,i,n)}function s(t,e,i,r){var o;o=T?new Uint8ClampedArray(4*e):new Array(4*e);for(var a=4*e,s=2*r+1,h=0;i>h;h++){for(var l=h*a,u=0,c=0,d=0,p=0,f=0,g=0,y=4*-r,v=4*r+4;v>y;y+=4){var m=l+y;l>m||m>=l+a||(f=t[m+3],u+=t[m+0]*f,c+=t[m+1]*f,d+=t[m+2]*f,p+=f)}for(var y=l,v=l+a,b=0,$=y-4*r,x=y+4*(r+1);v>y;y+=4,b+=4,x+=4,$+=4)0===p?(o[b+0]=0,o[b+1]=0,o[b+2]=0,o[b+3]=0):(o[b+0]=u/p,o[b+1]=c/p,o[b+2]=d/p,o[b+3]=p/s),f=t[x+3],g=t[$+3],f||0==f?g||0==g?(u+=t[x+0]*f-t[$+0]*g,c+=t[x+1]*f-t[$+1]*g,d+=t[x+2]*f-t[$+2]*g,p+=f-g):(u+=t[x+0]*f,c+=t[x+1]*f,d+=t[x+2]*f,p+=f):(g||0==g)&&(u+=-t[$+0]*g,c+=-t[$+1]*g,d+=-t[$+2]*g,p+=-g);T?t.set(o,l):n(t,o,l)}}function h(t,e,i,r){var n;n=T?new Uint8ClampedArray(4*i):new Array(4*i);for(var o=4*e,a=2*r+1,s=0;e>s;s++){for(var h=4*s,l=0,u=0,c=0,d=0,p=0,f=0,g=-r*o,y=r*o+o;y>g;g+=o){var v=h+g;h>v||v>=h+i*o||(p=t[v+3],l+=t[v+0]*p,u+=t[v+1]*p,c+=t[v+2]*p,d+=p)}for(var g=h,y=h+i*o,m=0,b=h-r*o,$=h+(r+1)*o;y>g;g+=o,m+=4,$+=o,b+=o)0===d?(n[m+0]=0,n[m+1]=0,n[m+2]=0,n[m+3]=0):(n[m+0]=l/d,n[m+1]=u/d,n[m+2]=c/d,n[m+3]=d/a),p=t[$+3],f=t[b+3],p||0==p?f||0==f?(l+=t[$+0]*p-t[b+0]*f,u+=t[$+1]*p-t[b+1]*f,c+=t[$+2]*p-t[b+2]*f,d+=p-f):(l+=t[$+0]*p,u+=t[$+1]*p,c+=t[$+2]*p,d+=p):(f||0==f)&&(l+=-t[b+0]*f,u+=-t[b+1]*f,c+=-t[b+2]*f,d+=-f);for(var x=4*s,y=x+i*o,_=0;y>x;x+=o,_+=4)t[x+0]=n[_+0],t[x+1]=n[_+1],t[x+2]=n[_+2],t[x+3]=n[_+3]}}function l(t,e,i,r,o,s,h,l,f){var g=u(t,r);c(g,e,i,h,l),a(g,e,i,o,s),d(g,f),p(g,t),t.set(g),T?t.set(g):n(t,g)}function u(t,e){e||(e=[0,0,0,0]);var i;T?i=new Uint8ClampedArray(t):(i=new Array(t.length),n(i,t));for(var r=e[0],o=e[1],a=e[2],s=e[3],h=0,l=i.length;l>h;h+=4){var u=i[h+3];i[h+0]=r*u,i[h+1]=o*u,i[h+2]=a*u,i[h+3]=s*u}return i}function c(t,e,i,r,o){var a,s,h=Math.sin(r)*o|0,l=Math.cos(r)*o|0;if(T){a=new Int32Array(t.buffer),s=new Int32Array(a.length);for(var u=0;i>u;u++){var c=u+h;if(!(0>c||c>i))for(var d=0;e>d;d++){var p=d+l;0>p||p>e||(s[c*e+p]=a[u*e+d])}}a.set(s)}else{a=t,s=new Array(a.length);for(var u=0;i>u;u++){var c=u+h;if(!(0>c||c>i))for(var d=0;e>d;d++){var p=d+l;0>p||p>e||(s[4*(c*e+p)+0]=a[4*(u*e+d)+0],s[4*(c*e+p)+1]=a[4*(u*e+d)+1],s[4*(c*e+p)+2]=a[4*(u*e+d)+2],s[4*(c*e+p)+3]=a[4*(u*e+d)+3])}}n(a,s)}}function d(t,e){for(var i=0,r=t.length;r>i;i+=4)t[i+3]*=e}function p(t,e){for(var i=0,r=t.length;r>i;i+=4){var n=t[i+0],o=t[i+1],a=t[i+2],s=t[i+3]/255,h=e[i+0],l=e[i+1],u=e[i+2],c=e[i+3]/255;t[i+0]=h+n*(1-c),t[i+1]=l+o*(1-c),t[i+2]=u+a*(1-c),t[i+3]=255*(c+s*(1-c))}}function f(t,e,i){return t*(1-i)+e*i}function g(t,e,i,r,o,a,s,h,l,u,c,d){var p;p=T?new Uint8ClampedArray(t.length):new Array(t.length);for(var g,y,v=r[3],m=0,b=0,$=h*Math.cos(s),x=h*Math.sin(s),_=7,E=12,w=3.141592653589793,C=o/_,S=a/_,O=0;e>O;O++)for(var A=0;i>A;A++){for(var R=0,F=A*e*4+4*O,L=0,D=0,I=t[F+0]/255,N=t[F+1]/255,P=t[F+2]/255,M=t[F+3]/255,B=0;2*w>=B;B+=2*w/E){g=Math.cos(B+R),y=Math.sin(B+R);for(var k=0;_>k;k++){m=k*C*g,b=k*S*y;var H=Math.round(O+m-$),W=Math.round(A+b-x),U=0;if(H>=e||0>H||0>W||W>=i)U=0;else{var X=W*e*4+4*H;U=t[X+3]/255}L+=(_-k)*U,D+=_-k}}M=Math.max(M,1e-4);var j=L/D*l*v*(1-u)*Math.max(Math.min(d,c),1-M),Y=(D-L)/D*l*v*u*M;M=Math.max(M*c*(1-d),1e-4);var G=Y/(Y+M),V=f(I,r[0],G),z=f(N,r[1],G),q=f(P,r[2],G),Z=j/(Y+M+j),K=f(V,r[0],Z),J=f(z,r[1],Z),Q=f(q,r[2],Z),te=Math.min(M+j+Y,1);p[F+0]=255*K,p[F+1]=255*J,p[F+2]=255*Q,p[F+3]=255*te}T?t.set(p):n(t,p)}var y=["source-over","lighter","destination-out"],v="source-over";t.BLACK_COLOR="#000000";var m={none:"butt",square:"square",round:"round"},b=[],$=[],x=function(){function n(){this.nestLevel=0,this.renderingMask=!1}return n.prototype.render=function(t,e,i,r,n){this.nestLevel++;var o=e.context,a=this.drawDisplayObject(t,o,i,r);if(this.nestLevel--,0===this.nestLevel){b.length>6&&(b.length=6);for(var s=b.length,h=0;s>h;h++)b[h].resize(0,0);$.length>1&&($.length=1,$[0].resize(0,0))}return a},n.prototype.drawDisplayObject=function(t,e,i,r){var n,o=0;n=t.$getRenderNode(),n&&(o+=this.renderNode(n,e));var a=t.$children;if(a)for(var s=a.length,h=0;s>h;h++){var l=a[h];if(!(!l.$visible||l.$alpha<=0||l.$maskedObject)){var u=l.$filters;u&&u.length>0?o+=this.drawWithFilter(l,e,i,r):0!==l.$blendMode||l.$mask?o+=this.drawWithClip(l,e,i,r):l.$scrollRect||l.$maskRect?o+=this.drawWithScrollRect(l,e,i,r):l.isFPS?this.drawDisplayObject(l,e,i,r):o+=this.drawDisplayObject(l,e,i,r)}}return o},n.prototype.drawWithFilter=function(e,i,r,n){if(t.Capabilities.runtimeType==t.RuntimeType.NATIVE){var s,h=0,u=e.$filters,c=0!==e.$blendMode;if(c&&(s=y[e.$blendMode],s||(s=v)),1==u.length&&"colorTransform"==u[0].type&&!e.$children)return c&&(i.globalCompositeOperation=s),i.setGlobalShader(u[0]),h+=e.$mask?this.drawWithClip(e,i,r,n):e.$scrollRect||e.$maskRect?this.drawWithScrollRect(e,i,r,n):this.drawDisplayObject(e,i,r,n),i.setGlobalShader(null),c&&(i.globalCompositeOperation=v),h;var d=t.Matrix.create();d.copyFrom(e.$getConcatenatedMatrix());var p;p=t.sys.Region.create();var f=e.$getOriginalBounds();p.updateRegion(f,d);var m=this.createRenderBuffer(p.width,p.height);return m.context.setTransform(1,0,0,1,-p.minX,-p.minY),h+=e.$mask?this.drawWithClip(e,m.context,r-p.minX,n-p.minY):e.$scrollRect||e.$maskRect?this.drawWithScrollRect(e,m.context,r-p.minX,n-p.minY):this.drawDisplayObject(e,m.context,r-p.minX,n-p.minY),h>0&&(c&&(i.globalCompositeOperation=s),h++,i.globalAlpha=1,i.setTransform(1,0,0,1,p.minX,p.minY),i.setGlobalShader(u[0]),i.drawImage(m.surface,0,0,m.width,m.height,0,0,m.width,m.height),i.setGlobalShader(null),c&&(i.globalCompositeOperation=v)),b.push(m),t.sys.Region.release(p),t.Matrix.release(d),h}var x,T=0,_=e.$filters,E=_.length,w=0!==e.$blendMode;w&&(x=y[e.$blendMode],x||(x=v));var C=t.Matrix.create();C.copyFrom(e.$getConcatenatedMatrix());var S;S=t.sys.Region.create();var O=e.$getOriginalBounds();S.updateRegion(O,C);var A=this.createRenderBuffer(S.width,S.height,!0),R=A.context;if(R.setTransform(1,0,0,1,-S.minX,-S.minY),T+=e.$mask?this.drawWithClip(e,R,r-S.minX,n-S.minY):e.$scrollRect||e.$maskRect?this.drawWithScrollRect(e,R,r-S.minX,n-S.minY):this.drawDisplayObject(e,R,r-S.minX,n-S.minY),T>0){w&&(i.globalCompositeOperation=x),T++,i.globalAlpha=1,i.setTransform(1,0,0,1,S.minX,S.minY);for(var F=R.getImageData(0,0,A.surface.width,A.surface.height),L=0;E>L;L++){var D=_[L];if("colorTransform"==D.type)o(F.data,A.surface.width,A.surface.height,D.$matrix);else if("blur"==D.type)a(F.data,A.surface.width,A.surface.height,D.$blurX,D.$blurY);else if("glow"==D.type){var I=D.$red,N=D.$green,P=D.$blue,M=D.$alpha;D.$inner||D.$knockout||D.$hideObject?g(F.data,A.surface.width,A.surface.height,[I/255,N/255,P/255,M],D.$blurX,D.$blurY,D.$angle?D.$angle/180*Math.PI:0,D.$distance||0,D.$strength,D.$inner?1:0,D.$knockout?0:1,D.$hideObject?1:0):l(F.data,A.surface.width,A.surface.height,[I/255,N/255,P/255,M],D.$blurX,D.$blurY,D.$angle?D.$angle/180*Math.PI:0,D.$distance||0,D.$strength)}else"custom"==D.type}R.putImageData(F,0,0),i.drawImage(A.surface,0,0),w&&(i.globalCompositeOperation=v)}return $.push(A),t.sys.Region.release(S),t.Matrix.release(C),T},n.prototype.drawWithClip=function(e,i,r,n){var o,a=0,s=0!==e.$blendMode;s&&(o=y[e.$blendMode],o||(o=v));var h,l=e.$scrollRect?e.$scrollRect:e.$maskRect,u=e.$mask;if(u&&(h=u.$getRenderNode())){var c=h.renderMatrix;if(0==c.a&&0==c.b||0==c.c&&0==c.d)return a}var d,p=t.Matrix.create();p.copyFrom(e.$getConcatenatedMatrix());var f;if(u){f=u.$getOriginalBounds(),d=t.sys.Region.create();var g=t.Matrix.create();g.copyFrom(u.$getConcatenatedMatrix()),d.updateRegion(f,g),t.Matrix.release(g)}var m;if(l&&(m=t.sys.Region.create(),m.updateRegion(l,p)),m&&d?(m.intersect(d),t.sys.Region.release(d)):!m&&d&&(m=d),m){if(m.isEmpty())return t.sys.Region.release(m),t.Matrix.release(p),a}else m=t.sys.Region.create(),f=e.$getOriginalBounds(),m.updateRegion(f,p);if(!(u||e.$children&&0!=e.$children.length)){if(l){var g=p;i.save(),i.setTransform(g.a,g.b,g.c,g.d,g.tx-m.minX,g.ty-m.minY),i.beginPath(),i.rect(l.x,l.y,l.width,l.height),i.clip()}return s&&(i.globalCompositeOperation=o),a+=this.drawDisplayObject(e,i,r,n),s&&(i.globalCompositeOperation=v),l&&i.restore(),a}if(u&&t.Capabilities.$runtimeType==t.RuntimeType.WEB&&(!u.$children||0==u.$children.length)&&h&&1==h.type&&1==h.drawData.length&&1==h.drawData[0].type&&1==h.drawData[0].fillAlpha){this.renderingMask=!0,i.save();var $=this.drawDisplayObject(u,i,r,n);if(this.renderingMask=!1,l){var g=p;i.setTransform(g.a,g.b,g.c,g.d,g.tx-m.minX,g.ty-m.minY),i.beginPath(),i.rect(l.x,l.y,l.width,l.height),i.clip()}return $+=this.drawDisplayObject(e,i,r,n),i.restore(),$}var x=this.createRenderBuffer(m.width,m.height),T=x.context;if(!T)return a+=this.drawDisplayObject(e,i,r,n),t.sys.Region.release(m),t.Matrix.release(p),a;if(T.setTransform(1,0,0,1,-m.minX,-m.minY),a+=this.drawDisplayObject(e,T,r-m.minX,n-m.minY),u)if(t.Capabilities.$runtimeType==t.RuntimeType.WEB&&h&&1==h.$getRenderCount())T.globalCompositeOperation="destination-in",a+=this.drawDisplayObject(u,T,r-m.minX,n-m.minY);else{var _=this.createRenderBuffer(m.width,m.height),E=_.context;if(!E)return a+=this.drawDisplayObject(e,i,r,n),b.push(x),t.sys.Region.release(m),t.Matrix.release(p),a;E.setTransform(1,0,0,1,-m.minX,-m.minY),a+=this.drawDisplayObject(u,E,r-m.minX,n-m.minY),T.globalCompositeOperation="destination-in",T.setTransform(1,0,0,1,0,0),T.globalAlpha=1,T.drawImage(_.surface,0,0),b.push(_)}if(a>0){if(a++,s&&(i.globalCompositeOperation=o),l){var g=p;i.save(),i.setTransform(g.a,g.b,g.c,g.d,g.tx-m.minX,g.ty-m.minY),i.beginPath(),i.rect(l.x,l.y,l.width,l.height),i.clip()}i.globalAlpha=1,i.setTransform(1,0,0,1,m.minX,m.minY),i.drawImage(x.surface,0,0),l&&i.restore(),s&&(i.globalCompositeOperation=v)}return b.push(x),t.sys.Region.release(m),t.Matrix.release(p),a},n.prototype.drawWithScrollRect=function(e,i,r,n){var o=0,a=e.$scrollRect?e.$scrollRect:e.$maskRect;if(a.isEmpty())return o;var s=t.Matrix.create();s.copyFrom(e.$getConcatenatedMatrix());var h=t.sys.Region.create();return h.updateRegion(a,s),h.isEmpty()?(t.sys.Region.release(h),t.Matrix.release(s),o):(i.save(),i.setTransform(s.a,s.b,s.c,s.d,s.tx,s.ty),i.beginPath(),i.rect(a.x,a.y,a.width,a.height),i.clip(),o+=this.drawDisplayObject(e,i,r,n),i.restore(),t.sys.Region.release(h),t.Matrix.release(s),o)},n.prototype.drawNodeToBuffer=function(t,e,i,r){var n=e.context;n.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),this.renderNode(t,n,r)},n.prototype.drawDisplayToBuffer=function(t,e,i){},n.prototype.renderNode=function(t,e,i){var r=0;switch(t.type){case 0:r=1,this.renderText(t,e,0,0);break;case 1:r=this.renderGraphics(t,e,i);break;case 2:r=this.renderMesh(t,e)}return r},n.prototype.renderMesh=function(e,i){if(t.Capabilities.runtimeType!=t.RuntimeType.NATIVE)return 0;var r=e.image,n=e.drawData,o=n.length,a=0,s=e.matrix;for(s&&(i.saveTransform(),i.transform(s.a,s.b,s.c,s.d,s.tx,s.ty));o>a;)i.drawMesh(r.source,n[a++],n[a++],n[a++],n[a++],n[a++],n[a++],n[a++],n[a++],e.imageWidth,e.imageHeight,e.uvs,e.vertices,e.indices,e.bounds);return s&&i.restoreTransform(),1},n.prototype.renderText=function(i,r,n,o){r.textAlign="left",r.textBaseline="middle",r.lineJoin="round";for(var a=i.drawData,s=a.length,h=0;s>h;){var l=a[h++],u=a[h++],c=a[h++],d=a[h++];r.font=e(i,d);var p=null==d.textColor?i.textColor:d.textColor,f=null==d.strokeColor?i.strokeColor:d.strokeColor,g=null==d.stroke?i.stroke:d.stroke;r.fillStyle=t.toColorString(p),r.strokeStyle=t.toColorString(f),g&&(r.lineWidth=2*g,r.strokeText(c,l+n,u+o)),r.fillText(c,l+n,u+o)}},n.prototype.renderGraphics=function(e,n,o){var a=e.drawData,s=a.length;o=!!o;for(var h=0;s>h;h++){var l=a[h];switch(l.type){case 1:var u=l;n.fillStyle=o?t.BLACK_COLOR:i(u.fillColor,u.fillAlpha),this.renderPath(l,n),this.renderingMask?n.clip():n.fill();break;case 2:var c=l;n.fillStyle=o?t.BLACK_COLOR:r(n,c.gradientType,c.colors,c.alphas,c.ratios,c.matrix),n.save();var d=c.matrix;this.renderPath(l,n),n.transform(d.a,d.b,d.c,d.d,d.tx,d.ty),n.fill(),n.restore();break;case 3:var p=l,f=p.lineWidth;n.lineWidth=f,n.strokeStyle=o?t.BLACK_COLOR:i(p.lineColor,p.lineAlpha),n.lineCap=m[p.caps],n.lineJoin=p.joints,n.miterLimit=p.miterLimit;var g=1===f||3===f;g&&n.translate(.5,.5),this.renderPath(l,n),n.stroke(),g&&n.translate(-.5,-.5)}}return 0==s?0:1},n.prototype.renderPath=function(t,e){e.beginPath();for(var i=t.$data,r=t.$commands,n=r.length,o=0,a=0;n>a;a++){var s=r[a];switch(s){case 4:e.bezierCurveTo(i[o++],i[o++],i[o++],i[o++],i[o++],i[o++]);break;case 3:e.quadraticCurveTo(i[o++],i[o++],i[o++],i[o++]);break;case 2:e.lineTo(i[o++],i[o++]);break;case 1:e.moveTo(i[o++],i[o++])}}},n.prototype.createRenderBuffer=function(e,i,r){var n=r?$.pop():b.pop();return n?n.resize(e,i,!0):n=new t.sys.CanvasRenderBuffer(e,i),n},n}();t.CanvasRenderer=x,__reflect(x.prototype,"egret.CanvasRenderer",["egret.sys.SystemRenderer"]),t.getFontString=e,t.getRGBAString=i;var T=!1;try{T=void 0!==typeof Uint8ClampedArray}catch(_){}}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.WEB="web",t.NATIVE="native"}(e=t.RuntimeType||(t.RuntimeType={}));var i=function(){function t(){}return Object.defineProperty(t,"language",{get:function(){return t.$language},enumerable:!0,configurable:!0}),Object.defineProperty(t,"isMobile",{get:function(){return t.$isMobile},enumerable:!0,configurable:!0}),Object.defineProperty(t,"os",{get:function(){return t.$os},enumerable:!0,configurable:!0}),Object.defineProperty(t,"runtimeType",{get:function(){return t.$runtimeType},enumerable:!0,configurable:!0}),Object.defineProperty(t,"supportVersion",{get:function(){return t.$supportVersion},enumerable:!0,configurable:!0}),Object.defineProperty(t,"engineVersion",{get:function(){return"5.1.0"},enumerable:!0,configurable:!0}),t.$setNativeCapabilities=function(e){var i=e.split("-");if(i.length<=4){var r=i[0];switch(r){case"android":r="Android";break;case"ios":r="iOS"}t.$os=r;var n=i[2].substring(1,i[2].length);t.$supportVersion=n}},Object.defineProperty(t,"renderMode",{get:function(){return t.$renderMode},enumerable:!0,configurable:!0}),Object.defineProperty(t,"boundingClientWidth",{get:function(){return t.$boundingClientWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t,"boundingClientHeight",{get:function(){return t.$boundingClientHeight},enumerable:!0,configurable:!0}),t.$language="zh-CN",t.$os="Unknown",t.$runtimeType="Unknown",t.$supportVersion="Unknown",t.$renderMode="Unknown",t.$boundingClientWidth=0,t.$boundingClientHeight=0,t}();t.Capabilities=i,__reflect(i.prototype,"egret.Capabilities")}(egret||(egret={}));var testDeviceType=function(){if(!this.navigator)return!0;var t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("mobile")||-1!=t.indexOf("android")},testRuntimeType=function(){return this.navigator?!0:!1};egret.Capabilities.$isMobile=testDeviceType(),egret.Capabilities.$runtimeType=testRuntimeType()?egret.RuntimeType.WEB:egret.RuntimeType.NATIVE;var egret;!function(t){function e(e,i){r||(r=document.createElement("canvas"),n=r.getContext("2d"));var o=e.$getTextureWidth(),a=e.$getTextureHeight();null==i&&(i=t.$TempRectangle,i.x=0,i.y=0,i.width=o,i.height=a),i.x=Math.min(i.x,o-1),i.y=Math.min(i.y,a-1),i.width=Math.min(i.width,o-i.x),i.height=Math.min(i.height,a-i.y);var s=i.width,h=i.height,l=r;if(l.style.width=s+"px",l.style.height=h+"px",r.width=s,r.height=h,"webgl"==t.Capabilities.$renderMode){var u=void 0;e.$renderBuffer?u=e:(u=new t.RenderTexture,u.drawToTexture(new t.Bitmap(e)));for(var c=u.$renderBuffer.getPixels(i.x,i.y,s,h),d=new ImageData(s,h),p=0;p<c.length;p++)d.data[p]=c[p];return n.putImageData(d,0,0),e.$renderBuffer||u.dispose(),l}var f=e,g=Math.round(f._offsetX),y=Math.round(f._offsetY),v=f._bitmapWidth,m=f._bitmapHeight;return n.drawImage(f._bitmapData.source,f._bitmapX+i.x/t.$TextureScaleFactor,f._bitmapY+i.y/t.$TextureScaleFactor,v*i.width/o,m*i.height/a,g,y,i.width,i.height),l}t.$TextureScaleFactor=1;var i=function(i){function r(){var t=i.call(this)||this;return t.disposeBitmapData=!0,t._bitmapX=0,t._bitmapY=0,t._bitmapWidth=0,t._bitmapHeight=0,t._offsetX=0,t._offsetY=0,t._textureWidth=0,t._textureHeight=0,t._sourceWidth=0,t._sourceHeight=0,t._bitmapData=null,t}return __extends(r,i),Object.defineProperty(r.prototype,"textureWidth",{get:function(){return this.$getTextureWidth()},enumerable:!0,configurable:!0}),r.prototype.$getTextureWidth=function(){return this._textureWidth},Object.defineProperty(r.prototype,"textureHeight",{get:function(){return this.$getTextureHeight()},enumerable:!0,configurable:!0}),r.prototype.$getTextureHeight=function(){return this._textureHeight},r.prototype.$getScaleBitmapWidth=function(){return this._bitmapWidth*t.$TextureScaleFactor},r.prototype.$getScaleBitmapHeight=function(){return this._bitmapHeight*t.$TextureScaleFactor},Object.defineProperty(r.prototype,"bitmapData",{get:function(){return this._bitmapData},set:function(t){this._setBitmapData(t)},enumerable:!0,configurable:!0}),r.prototype._setBitmapData=function(e){this._bitmapData=e;var i=t.$TextureScaleFactor,r=e.width*i,n=e.height*i;this.$initData(0,0,r,n,0,0,r,n,e.width,e.height)},r.prototype.$initData=function(e,i,r,n,o,a,s,h,l,u){var c=t.$TextureScaleFactor;this._bitmapX=e/c,this._bitmapY=i/c,this._bitmapWidth=r/c,this._bitmapHeight=n/c,this._offsetX=o,this._offsetY=a,this._textureWidth=s,this._textureHeight=h,this._sourceWidth=l,this._sourceHeight=u,t.BitmapData.$invalidate(this._bitmapData)},r.prototype.getPixels=function(i,r,o,a){void 0===o&&(o=1),void 0===a&&(a=1);try{var s=(e(this),n.getImageData(i,r,o,a).data);return s}catch(h){t.$error(1039)}},r.prototype.toDataURL=function(i,r){try{var n=e(this,r),o=n.toDataURL(i);return o}catch(a){t.$error(1033)}return null},r.prototype.saveToFile=function(t,e,i){var r=this.toDataURL(t,i);if(null!=r){var n=r.replace(/^data:image[^;]*/,"data:image/octet-stream"),o=document.createElement("a");o.download=e,o.href=n;var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(a)}},r.prototype.dispose=function(){this._bitmapData&&(this.disposeBitmapData&&this._bitmapData.$dispose(),this._bitmapData=null),t.WebAssemblyNode.disposeTexture(this)},r}(t.HashObject);t.Texture=i,__reflect(i.prototype,"egret.Texture");var r,n}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){function e(){var t=Object.create(null);return t.__v8__=void 0,delete t.__v8__,t}t.createMap=e}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return Object.defineProperty(t,"logLevel",{set:function(t){},enumerable:!0,configurable:!0}),t.ALL="all",t.DEBUG="debug",t.INFO="info",t.WARN="warn",t.ERROR="error",t.OFF="off",t}();t.Logger=e,__reflect(e.prototype,"egret.Logger")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r){return void 0===i&&(i=!1),void 0===r&&(r=!1),e.call(this,t,i,r)||this}return __extends(i,e),i.dispatchStageOrientationEvent=function(e,r){var n=t.Event.create(i,r),o=e.dispatchEvent(n);return t.Event.release(n),o},i.ORIENTATION_CHANGE="orientationChange",i}(t.Event);t.StageOrientationEvent=e,__reflect(e.prototype,"egret.StageOrientationEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(i){var r=e.call(this)||this;return r._bitmapX=0,r._bitmapY=0,r._textureMap=t.createMap(),r.$texture=i,r._bitmapX=i._bitmapX-i._offsetX,r._bitmapY=i._bitmapY-i._offsetY,r}return __extends(i,e),i.prototype.getTexture=function(t){return this._textureMap[t]},i.prototype.createTexture=function(e,i,r,n,o,a,s,h,l){void 0===a&&(a=0),void 0===s&&(s=0),void 0===h&&(h=a+n),void 0===l&&(l=s+o);var u=new t.Texture;return u.disposeBitmapData=!1,u._bitmapData=this.$texture._bitmapData,u.$initData(this._bitmapX+i,this._bitmapY+r,n,o,a,s,h,l,this.$texture._sourceWidth,this.$texture._sourceHeight),this._textureMap[e]=u,u},i.prototype.dispose=function(){this.$texture&&this.$texture.dispose()},i}(t.HashObject);t.SpriteSheet=e,__reflect(e.prototype,"egret.SpriteSheet")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Event);t.MotionEvent=e,__reflect(e.prototype,"egret.MotionEvent")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Event);t.OrientationEvent=e,__reflect(e.prototype,"egret.OrientationEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r,n,o){void 0===i&&(i=!1),void 0===r&&(r=!1),void 0===n&&(n=0),void 0===o&&(o=0);var a=e.call(this,t,i,r)||this;return a.bytesLoaded=0,a.bytesTotal=0,a.bytesLoaded=n,a.bytesTotal=o,a}return __extends(i,e),i.dispatchProgressEvent=function(e,r,n,o){void 0===n&&(n=0),void 0===o&&(o=0);var a=t.Event.create(i,r);a.bytesLoaded=n,a.bytesTotal=o;var s=e.dispatchEvent(a);return t.Event.release(a),s},i.PROGRESS="progress",i.SOCKET_DATA="socketData",i}(t.Event);t.ProgressEvent=e,__reflect(e.prototype,"egret.ProgressEvent")}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){var t=e.call(this)||this;return t.textColor=16777215,t.strokeColor=0,t.size=30,t.stroke=0,t.bold=!1,t.italic=!1,t.fontFamily="Arial",t.dirtyRender=!0,t.type=0,t}return __extends(i,e),i.prototype.drawText=function(t,e,i,r){this.drawData.push(t,e,i,r),this.renderCount++,this.dirtyRender=!0},i.prototype.cleanBeforeRender=function(){e.prototype.cleanBeforeRender.call(this)},i.prototype.clean=function(){this.$texture&&(t.WebGLUtils.deleteWebGLTexture(this.$texture),this.$texture=null,this.dirtyRender=!0)},i}(e.RenderNode);e.TextNode=i,__reflect(i.prototype,"egret.sys.TextNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r,n){void 0===i&&(i=!1),void 0===r&&(r=!1),void 0===n&&(n="");var o=e.call(this,t,i,r)||this;return o.text=n,o}return __extends(i,e),i.dispatchTextEvent=function(e,r,n){var o=t.Event.create(i,r);o.text=n;var a=e.dispatchEvent(o);return t.Event.release(o),a},i.LINK="link",i}(t.Event);t.TextEvent=e,__reflect(e.prototype,"egret.TextEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r){return e.call(this,t,i,r)||this}return __extends(i,e),i.prototype.updateAfterEvent=function(){t.sys.$requestRenderingFlag=!0},i.dispatchTimerEvent=function(e,r,n,o){var a=t.Event.create(i,r,n,o),s=e.dispatchEvent(a);return t.Event.release(a),s},i.TIMER="timer",i.TIMER_COMPLETE="timerComplete",i}(t.Event);t.TimerEvent=e,__reflect(e.prototype,"egret.TimerEvent")}(egret||(egret={}));var egret;!function(t){t.BitmapFillMode={REPEAT:"repeat",SCALE:"scale",CLIP:"clip"}}(egret||(egret={}));var egret;!function(t){var e=new t.Point,i=function(i){function r(t,e,r,n,o,a){var s=i.call(this,t,e,r)||this;return s.targetChanged=!0,s.touchDown=!1,s.$initTo(n,o,a),s}return __extends(r,i),r.prototype.$initTo=function(t,e,i){this.touchPointID=+i||0,this.$stageX=+t||0,this.$stageY=+e||0},Object.defineProperty(r.prototype,"stageX",{get:function(){return this.$stageX},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"stageY",{get:function(){return this.$stageY},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"localX",{get:function(){return this.targetChanged&&this.getLocalXY(),this._localX},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"localY",{get:function(){return this.targetChanged&&this.getLocalXY(),this._localY
},enumerable:!0,configurable:!0}),r.prototype.getLocalXY=function(){this.targetChanged=!1;var t=this.$target.$getInvertedConcatenatedMatrix();t.transformPoint(this.$stageX,this.$stageY,e),this._localX=e.x,this._localY=e.y},r.prototype.$setTarget=function(t){return this.$target=t,this.targetChanged=!!t,!0},r.prototype.updateAfterEvent=function(){t.sys.$requestRenderingFlag=!0},r.dispatchTouchEvent=function(e,i,n,o,a,s,h,l){if(void 0===l&&(l=!1),!n&&!e.hasEventListener(i))return!0;var u=t.Event.create(r,i,n,o);u.$initTo(a,s,h),u.touchDown=l;var c=e.dispatchEvent(u);return t.Event.release(u),c},r.TOUCH_MOVE="touchMove",r.TOUCH_BEGIN="touchBegin",r.TOUCH_END="touchEnd",r.TOUCH_CANCEL="touchCancel",r.TOUCH_TAP="touchTap",r.TOUCH_RELEASE_OUTSIDE="touchReleaseOutside",r.TOUCH_ROLL_OUT="touchRollOut",r.TOUCH_ROLL_OVER="touchRollOver",r}(t.Event);t.TouchEvent=i,__reflect(i.prototype,"egret.TouchEvent")}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.LINEAR="linear",t.RADIAL="radial"}(e=t.GradientType||(t.GradientType={}))}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.call=function(t,e){},t.addCallback=function(t,e){},t}();t.WebExternalInterface=e,__reflect(e.prototype,"egret.WebExternalInterface",["egret.ExternalInterface"]),t.ExternalInterface=e}(egret||(egret={}));var egret;!function(t){var e=function(e){function n(t,n,o){void 0===t&&(t=4),void 0===n&&(n=4),void 0===o&&(o=1);var a=e.call(this)||this,s=a;return s.type="blur",s.$blurX=t,s.$blurY=n,s.$quality=o,s.blurXFilter=new i(t),s.blurYFilter=new r(n),s.onPropertyChange(),a}return __extends(n,e),Object.defineProperty(n.prototype,"blurX",{get:function(){return this.$blurX},set:function(t){var e=this;e.$blurX!=t&&(e.$blurX=t,e.blurXFilter.blurX=t,e.onPropertyChange())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"blurY",{get:function(){return this.$blurY},set:function(t){var e=this;e.$blurY!=t&&(e.$blurY=t,e.blurYFilter.blurY=t,e.onPropertyChange())},enumerable:!0,configurable:!0}),n.prototype.$toJson=function(){return'{"blurX": '+this.$blurX+', "blurY": '+this.$blurY+', "quality": 1}'},n.prototype.updatePadding=function(){var t=this;t.paddingLeft=t.blurX,t.paddingRight=t.blurX,t.paddingTop=t.blurY,t.paddingBottom=t.blurY},n.prototype.onPropertyChange=function(){var e=this;e.updatePadding(),t.WebAssemblyNode.setFilterPadding(e.blurXFilter.$id,0,0,e.paddingLeft,e.paddingRight),t.WebAssemblyNode.setFilterPadding(e.blurYFilter.$id,e.paddingTop,e.paddingBottom,0,0),t.WebAssemblyNode.setDataToFilter(e.$id)},n}(t.Filter);t.BlurFilter=e,__reflect(e.prototype,"egret.BlurFilter");var i=function(t){function e(e){void 0===e&&(e=4);var i=t.call(this)||this;return i.type="blur",i.$uniforms.blur={x:e,y:0},i.onPropertyChange(),i}return __extends(e,t),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.$uniforms.blur.x},set:function(t){this.$uniforms.blur.x=t},enumerable:!0,configurable:!0}),e}(t.Filter);__reflect(i.prototype,"BlurXFilter",["egret.IBlurXFilter"]);var r=function(t){function e(e){void 0===e&&(e=4);var i=t.call(this)||this;return i.type="blur",i.$uniforms.blur={x:0,y:e},i.onPropertyChange(),i}return __extends(e,t),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.$uniforms.blur.y},set:function(t){this.$uniforms.blur.y=t},enumerable:!0,configurable:!0}),e}(t.Filter);__reflect(r.prototype,"BlurYFilter",["egret.IBlurYFilter"])}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e){void 0===e&&(e=null);var i=t.call(this)||this;return i.$matrix=[],i.matrix2=[],i.type="colorTransform",i.$uniforms.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i.$uniforms.colorAdd={x:0,y:0,z:0,w:0},i.setMatrix(e),i.onPropertyChange(),i}return __extends(e,t),Object.defineProperty(e.prototype,"matrix",{get:function(){for(var t=0;20>t;t++)this.matrix2[t]=this.$matrix[t];return this.matrix2},set:function(t){this.setMatrix(t)},enumerable:!0,configurable:!0}),e.prototype.setMatrix=function(t){if(t)for(var e=0;20>e;e++)this.$matrix[e]=t[e];else for(var e=0;20>e;e++)this.$matrix[e]=0==e||6==e||12==e||18==e?1:0;for(var i=this.$matrix,r=this.$uniforms.matrix,n=this.$uniforms.colorAdd,e=0,o=0;e<i.length;e++)4===e?n.x=i[e]/255:9===e?n.y=i[e]/255:14===e?n.z=i[e]/255:19===e?n.w=i[e]/255:(r[o]=i[e],o++)},e.prototype.$toJson=function(){return'{"matrix": ['+this.$matrix.toString()+"]}"},e}(t.Filter);t.ColorMatrixFilter=e,__reflect(e.prototype,"egret.ColorMatrixFilter")}(egret||(egret={}));var egret;!function(t){var e,i={},r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=new Array(36),o=0,a=function(){for(var t=0;36>t;t++)8===t||13===t||18===t||23===t?n[t]="-":14===t?n[t]="4":(2>=o&&(o=33554432+16777216*Math.random()|0),e=15&o,o>>=4,n[t]=r[19===t?3&e|8:e]);return n.join("")},s=function(e){function r(t,r,n){void 0===n&&(n={});var o=e.call(this)||this;o.$padding=0,o.$vertexSrc=t,o.$fragmentSrc=r;var s=t+r;return i[s]||(i[s]=a()),o.$shaderKey=i[s],o.$uniforms=n,o.type="custom",o}return __extends(r,e),Object.defineProperty(r.prototype,"uniforms",{get:function(){return this.$uniforms},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this.$padding},set:function(t){var e=this;e.$padding!=t&&(e.$padding=t,e.onPropertyChange())},enumerable:!0,configurable:!0}),r.prototype.onPropertyChange=function(){var e=this;t.WebAssemblyNode.setFilterPadding(e.$id,e.$padding,e.$padding,e.$padding,e.$padding),t.WebAssemblyNode.setDataToFilter(e.$id)},r}(t.Filter);t.CustomFilter=s,__reflect(s.prototype,"egret.CustomFilter")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r,n,o,a,s,h,l,u,c){void 0===t&&(t=4),void 0===i&&(i=45),void 0===r&&(r=0),void 0===n&&(n=1),void 0===o&&(o=4),void 0===a&&(a=4),void 0===s&&(s=1),void 0===h&&(h=1),void 0===l&&(l=!1),void 0===u&&(u=!1),void 0===c&&(c=!1);var d=e.call(this,r,n,o,a,s,h,l,u)||this,p=d;return p.$distance=t,p.$angle=i,p.$hideObject=c,p.$uniforms.dist=t,p.$uniforms.angle=i/180*Math.PI,p.$uniforms.hideObject=c?1:0,p.onPropertyChange(),d}return __extends(i,e),Object.defineProperty(i.prototype,"distance",{get:function(){return this.$distance},set:function(t){var e=this;e.$distance!=t&&(e.$distance=t,e.$uniforms.dist=t,e.onPropertyChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"angle",{get:function(){return this.$angle},set:function(t){var e=this;e.$angle!=t&&(e.$angle=t,e.$uniforms.angle=t/180*Math.PI,e.onPropertyChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hideObject",{get:function(){return this.$hideObject},set:function(t){this.$hideObject!=t&&(this.$hideObject=t,this.$uniforms.hideObject=t?1:0)},enumerable:!0,configurable:!0}),i.prototype.$toJson=function(){return'{"distance": '+this.$distance+', "angle": '+this.$angle+', "color": '+this.$color+', "red": '+this.$red+', "green": '+this.$green+', "blue": '+this.$blue+', "alpha": '+this.$alpha+', "blurX": '+this.$blurX+', "blurY": '+this.blurY+', "strength": '+this.$strength+', "quality": '+this.$quality+', "inner": '+this.$inner+', "knockout": '+this.$knockout+', "hideObject": '+this.$hideObject+"}"},i.prototype.updatePadding=function(){var e=this;e.paddingLeft=e.blurX,e.paddingRight=e.blurX,e.paddingTop=e.blurY,e.paddingBottom=e.blurY;var i=e.distance||0,r=e.angle||0,n=0,o=0;0!=i&&(n=i*t.NumberUtils.cos(r),n=n>0?Math.ceil(n):Math.floor(n),o=i*t.NumberUtils.sin(r),o=o>0?Math.ceil(o):Math.floor(o),e.paddingLeft+=n,e.paddingRight+=n,e.paddingTop+=o,e.paddingBottom+=o)},i}(t.GlowFilter);t.DropShadowFilter=e,__reflect(e.prototype,"egret.DropShadowFilter")}(egret||(egret={}));var egret;!function(t){function e(t){return t%=2*Math.PI,0>t&&(t+=2*Math.PI),t}var i=function(i){function r(){var e=i.call(this)||this;return e.lastX=0,e.lastY=0,e.fillPath=null,e.strokePath=null,e.topLeftStrokeWidth=0,e.bottomRightStrokeWidth=0,e.minX=1/0,e.minY=1/0,e.maxX=-(1/0),e.maxY=-(1/0),e.includeLastPosition=!0,e.$renderNode=new t.sys.GraphicsNode,e}return __extends(r,i),r.prototype.$setTarget=function(e){this.$targetDisplay&&(this.$targetDisplay.$renderNode=null),e.$renderNode=this.$renderNode,this.$targetDisplay=e,this.$targetIsSprite=e instanceof t.Sprite},r.prototype.setStrokeWidth=function(t){switch(t){case 1:this.topLeftStrokeWidth=0,this.bottomRightStrokeWidth=1;break;case 3:this.topLeftStrokeWidth=1,this.bottomRightStrokeWidth=2;break;default:var e=0|Math.ceil(.5*t);this.topLeftStrokeWidth=e,this.bottomRightStrokeWidth=e}},r.prototype.beginFill=function(t,e){void 0===e&&(e=1),t=+t||0,e=+e||0,this.fillPath=this.$renderNode.beginFill(t,e,this.strokePath),this.$renderNode.drawData.length>1&&this.fillPath.moveTo(this.lastX,this.lastY)},r.prototype.beginGradientFill=function(t,e,i,r,n){void 0===n&&(n=null),this.fillPath=this.$renderNode.beginGradientFill(t,e,i,r,n,this.strokePath),this.$renderNode.drawData.length>1&&this.fillPath.moveTo(this.lastX,this.lastY)},r.prototype.endFill=function(){this.fillPath=null},r.prototype.lineStyle=function(t,e,i,r,n,o,a,s){void 0===t&&(t=0/0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=!1),void 0===n&&(n="normal"),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=3),t=+t||0,0>=t?(this.strokePath=null,this.setStrokeWidth(0)):(e=+e||0,i=+i||0,s=+s||0,this.setStrokeWidth(t),this.strokePath=this.$renderNode.lineStyle(t,e,i,o,a,s),this.$renderNode.drawData.length>1&&this.strokePath.moveTo(this.lastX,this.lastY))},r.prototype.drawRect=function(t,e,i,r){t=+t||0,e=+e||0,i=+i||0,r=+r||0;var n=this.fillPath,o=this.strokePath;n&&n.drawRect(t,e,i,r),o&&o.drawRect(t,e,i,r),this.extendBoundsByPoint(t+i,e+r),this.updatePosition(t,e),this.dirty()},r.prototype.drawRoundRect=function(t,e,i,r,n,o){t=+t||0,e=+e||0,i=+i||0,r=+r||0,n=+n||0,o=+o||0;var a=this.fillPath,s=this.strokePath;a&&a.drawRoundRect(t,e,i,r,n,o),s&&s.drawRoundRect(t,e,i,r,n,o);var h=.5*n|0,l=o?.5*o|0:h,u=t+i,c=e+r,d=c-l;this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(u,c),this.updatePosition(u,d),this.dirty()},r.prototype.drawCircle=function(t,e,i){t=+t||0,e=+e||0,i=+i||0;var r=this.fillPath,n=this.strokePath;r&&r.drawCircle(t,e,i),n&&n.drawCircle(t,e,i),this.extendBoundsByPoint(t-i,e-i),this.extendBoundsByPoint(t+i,e+i),this.updatePosition(t+i,e),this.dirty()},r.prototype.drawEllipse=function(t,e,i,r){t=+t||0,e=+e||0,i=+i||0,r=+r||0;var n=this.fillPath,o=this.strokePath;n&&n.drawEllipse(t,e,i,r),o&&o.drawEllipse(t,e,i,r),this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(t+i,e+r),this.updatePosition(t+i,e+.5*r),this.dirty()},r.prototype.moveTo=function(t,e){t=+t||0,e=+e||0;var i=this.fillPath,r=this.strokePath;i&&i.moveTo(t,e),r&&r.moveTo(t,e),this.includeLastPosition=!1,this.lastX=t,this.lastY=e,this.dirty()},r.prototype.lineTo=function(t,e){t=+t||0,e=+e||0;var i=this.fillPath,r=this.strokePath;i&&i.lineTo(t,e),r&&r.lineTo(t,e),this.updatePosition(t,e),this.dirty()},r.prototype.curveTo=function(t,e,i,r){t=+t||0,e=+e||0,i=+i||0,r=+r||0;var n=this.fillPath,o=this.strokePath;n&&n.curveTo(t,e,i,r),o&&o.curveTo(t,e,i,r),this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(i,r),this.updatePosition(i,r),this.dirty()},r.prototype.cubicCurveTo=function(t,e,i,r,n,o){t=+t||0,e=+e||0,i=+i||0,r=+r||0,n=+n||0,o=+o||0;var a=this.fillPath,s=this.strokePath;a&&a.cubicCurveTo(t,e,i,r,n,o),s&&s.cubicCurveTo(t,e,i,r,n,o),this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(i,r),this.extendBoundsByPoint(n,o),this.updatePosition(n,o),this.dirty()},r.prototype.drawArc=function(t,i,r,n,o,a){if(!(0>r||n===o)){t=+t||0,i=+i||0,r=+r||0,n=+n||0,o=+o||0,a=!!a,n=e(n),o=e(o);var s=this.fillPath,h=this.strokePath;s&&(s.$lastX=this.lastX,s.$lastY=this.lastY,s.drawArc(t,i,r,n,o,a)),h&&(h.$lastX=this.lastX,h.$lastY=this.lastY,h.drawArc(t,i,r,n,o,a)),a?this.arcBounds(t,i,r,o,n):this.arcBounds(t,i,r,n,o);var l=t+Math.cos(o)*r,u=i+Math.sin(o)*r;this.updatePosition(l,u)}},r.prototype.dirty=function(){var e=this;e.$renderNode.dirtyRender=!0,t.WebAssembly.dirtyGraphics(e)},r.prototype.arcBounds=function(t,e,i,r,n){var o=Math.PI;if(Math.abs(r-n)<.01)return this.extendBoundsByPoint(t-i,e-i),void this.extendBoundsByPoint(t+i,e+i);r>n&&(n+=2*o);for(var a=Math.cos(r)*i,s=Math.cos(n)*i,h=Math.min(a,s),l=Math.max(a,s),u=Math.sin(r)*i,c=Math.sin(n)*i,d=Math.min(u,c),p=Math.max(u,c),f=r/(.5*o),g=n/(.5*o),y=Math.ceil(f);g>=y;y++)switch(y%4){case 0:l=i;break;case 1:p=i;break;case 2:h=-i;break;case 3:d=-i}h=Math.floor(h),d=Math.floor(d),l=Math.ceil(l),p=Math.ceil(p),this.extendBoundsByPoint(h+t,d+e),this.extendBoundsByPoint(l+t,p+e)},r.prototype.clear=function(){this.$renderNode.clear(),this.updatePosition(0,0),this.minX=1/0,this.minY=1/0,this.maxX=-(1/0),this.maxY=-(1/0)},r.prototype.extendBoundsByPoint=function(t,e){this.extendBoundsByX(t),this.extendBoundsByY(e)},r.prototype.extendBoundsByX=function(t){this.minX=Math.min(this.minX,t-this.topLeftStrokeWidth),this.maxX=Math.max(this.maxX,t+this.bottomRightStrokeWidth),this.updateNodeBounds()},r.prototype.extendBoundsByY=function(t){this.minY=Math.min(this.minY,t-this.topLeftStrokeWidth),this.maxY=Math.max(this.maxY,t+this.bottomRightStrokeWidth),this.updateNodeBounds()},r.prototype.updateNodeBounds=function(){var t=this.$renderNode;t.x=this.minX,t.y=this.minY,t.width=Math.ceil(this.maxX-this.minX),t.height=Math.ceil(this.maxY-this.minY)},r.prototype.updatePosition=function(t,e){this.includeLastPosition||(this.extendBoundsByPoint(this.lastX,this.lastY),this.includeLastPosition=!0),this.lastX=t,this.lastY=e,this.extendBoundsByPoint(t,e)},r.prototype.$measureContentBounds=function(t){this.minX===1/0?t.setEmpty():t.setTo(this.minX,this.minY,this.maxX-this.minX,this.maxY-this.minY)},r.prototype.$hitTest=function(e,i){var r=this.$targetDisplay,n=r.$getInvertedConcatenatedMatrix(),o=n.a*e+n.c*i+n.tx,a=n.b*e+n.d*i+n.ty,s=t.sys.canvasHitTestBuffer;s.resize(3,3);var h=this.$renderNode,l=t.Matrix.create();l.identity(),l.translate(1-o,1-a),t.sys.canvasRenderer.drawNodeToBuffer(h,s,l,!0),t.Matrix.release(l);try{var u=s.getPixels(1,1);if(0===u[3])return null}catch(c){throw new Error(t.sys.tr(1039))}return r},r.prototype.$onRemoveFromStage=function(){this.$renderNode&&this.$renderNode.clean()},r}(t.HashObject);t.Graphics=i,__reflect(i.prototype,"egret.Graphics")}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.BEVEL="bevel",t.MITER="miter",t.ROUND="round"}(e=t.JointStyle||(t.JointStyle={}))}(egret||(egret={}));var egret;!function(t){var e=Math.PI,i=2*e,r=e/180,n=[],o=function(o){function a(t,e,i,r,n,a){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===a&&(a=0);var s=o.call(this)||this;return s.a=t,s.b=e,s.c=i,s.d=r,s.tx=n,s.ty=a,s}return __extends(a,o),a.release=function(t){t&&n.push(t)},a.create=function(){var t=n.pop();return t||(t=new a),t},a.prototype.clone=function(){return new a(this.a,this.b,this.c,this.d,this.tx,this.ty)},a.prototype.concat=function(t){var e=this.a*t.a,i=0,r=0,n=this.d*t.d,o=this.tx*t.a+t.tx,a=this.ty*t.d+t.ty;(0!==this.b||0!==this.c||0!==t.b||0!==t.c)&&(e+=this.b*t.c,n+=this.c*t.b,i+=this.a*t.b+this.b*t.d,r+=this.c*t.a+this.d*t.c,o+=this.ty*t.c,a+=this.tx*t.b),this.a=e,this.b=i,this.c=r,this.d=n,this.tx=o,this.ty=a},a.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},a.prototype.identity=function(){this.a=this.d=1,this.b=this.c=this.tx=this.ty=0},a.prototype.invert=function(){this.$invertInto(this)},a.prototype.$invertInto=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,o=this.tx,a=this.ty;if(0==i&&0==r)return t.b=t.c=0,void(0==e||0==n?t.a=t.d=t.tx=t.ty=0:(e=t.a=1/e,n=t.d=1/n,t.tx=-e*o,t.ty=-n*a));var s=e*n-i*r;if(0==s)return void t.identity();s=1/s;var h=t.a=n*s;i=t.b=-i*s,r=t.c=-r*s,n=t.d=e*s,t.tx=-(h*o+r*a),t.ty=-(i*o+n*a)},a.prototype.rotate=function(e){if(e=+e,0!==e){e/=r;var i=t.NumberUtils.cos(e),n=t.NumberUtils.sin(e),o=this.a,a=this.b,s=this.c,h=this.d,l=this.tx,u=this.ty;this.a=o*i-a*n,this.b=o*n+a*i,this.c=s*i-h*n,this.d=s*n+h*i,this.tx=l*i-u*n,this.ty=l*n+u*i}},a.prototype.scale=function(t,e){1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e)},a.prototype.setTo=function(t,e,i,r,n,o){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o,this},a.prototype.transformPoint=function(e,i,r){var n=this.a*e+this.c*i+this.tx,o=this.b*e+this.d*i+this.ty;return r?(r.setTo(n,o),r):new t.Point(n,o)},a.prototype.translate=function(t,e){this.tx+=t,this.ty+=e},a.prototype.equals=function(t){return this.a==t.a&&this.b==t.b&&this.c==t.c&&this.d==t.d&&this.tx==t.tx&&this.ty==t.ty},a.prototype.prepend=function(t,e,i,r,n,o){var a=this.tx;if(1!=t||0!=e||0!=i||1!=r){var s=this.a,h=this.c;this.a=s*t+this.b*i,this.b=s*e+this.b*r,this.c=h*t+this.d*i,this.d=h*e+this.d*r}return this.tx=a*t+this.ty*i+n,this.ty=a*e+this.ty*r+o,this},a.prototype.append=function(t,e,i,r,n,o){var a=this.a,s=this.b,h=this.c,l=this.d;return(1!=t||0!=e||0!=i||1!=r)&&(this.a=t*a+e*h,this.b=t*s+e*l,this.c=i*a+r*h,this.d=i*s+r*l),this.tx=n*a+o*h+this.tx,this.ty=n*s+o*l+this.ty,this},a.prototype.deltaTransformPoint=function(e){var i=this,r=i.a*e.x+i.c*e.y,n=i.b*e.x+i.d*e.y;return new t.Point(r,n)},a.prototype.toString=function(){return"(a="+this.a+", b="+this.b+", c="+this.c+", d="+this.d+", tx="+this.tx+", ty="+this.ty+")"},a.prototype.createBox=function(e,i,n,o,a){void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=this;if(0!==n){n/=r;var h=t.NumberUtils.cos(n),l=t.NumberUtils.sin(n);s.a=h*e,s.b=l*i,s.c=-l*e,s.d=h*i}else s.a=e,s.b=0,s.c=0,s.d=i;s.tx=o,s.ty=a},a.prototype.createGradientBox=function(t,e,i,r,n){void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),this.createBox(t/1638.4,e/1638.4,i,r+t/2,n+e/2)},a.prototype.$transformBounds=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,o=this.tx,a=this.ty,s=t.x,h=t.y,l=s+t.width,u=h+t.height,c=e*s+r*h+o,d=i*s+n*h+a,p=e*l+r*h+o,f=i*l+n*h+a,g=e*l+r*u+o,y=i*l+n*u+a,v=e*s+r*u+o,m=i*s+n*u+a,b=0;c>p&&(b=c,c=p,p=b),g>v&&(b=g,g=v,v=b),t.x=Math.floor(g>c?c:g),t.width=Math.ceil((p>v?p:v)-t.x),d>f&&(b=d,d=f,f=b),y>m&&(b=y,y=m,m=b),t.y=Math.floor(y>d?d:y),t.height=Math.ceil((f>m?f:m)-t.y)},a.prototype.getDeterminant=function(){return this.a*this.d-this.b*this.c},a.prototype.$getScaleX=function(){var t=this;if(1==t.a&&0==t.b)return 1;var e=Math.sqrt(t.a*t.a+t.b*t.b);return this.getDeterminant()<0?-e:e},a.prototype.$getScaleY=function(){var t=this;if(0==t.c&&1==t.d)return 1;var e=Math.sqrt(t.c*t.c+t.d*t.d);return this.getDeterminant()<0?-e:e},a.prototype.$getSkewX=function(){return Math.atan2(this.d,this.c)-e/2},a.prototype.$getSkewY=function(){return Math.atan2(this.b,this.a)},a.prototype.$updateScaleAndRotation=function(e,n,o,a){if(!(0!=o&&o!=i||0!=a&&a!=i))return this.a=e,this.b=this.c=0,void(this.d=n);o/=r,a/=r;var s=t.NumberUtils.cos(o),h=t.NumberUtils.sin(o);o==a?(this.a=s*e,this.b=h*e):(this.a=t.NumberUtils.cos(a)*e,this.b=t.NumberUtils.sin(a)*e),this.c=-h*n,this.d=s*n},a.prototype.$preMultiplyInto=function(t,e){var i=t.a*this.a,r=0,n=0,o=t.d*this.d,a=t.tx*this.a+this.tx,s=t.ty*this.d+this.ty;(0!==t.b||0!==t.c||0!==this.b||0!==this.c)&&(i+=t.b*this.c,o+=t.c*this.b,r+=t.a*this.b+t.b*this.d,n+=t.c*this.a+t.d*this.c,a+=t.ty*this.c,s+=t.tx*this.b),e.a=i,e.b=r,e.c=n,e.d=o,e.tx=a,e.ty=s},a}(t.HashObject);t.Matrix=o,__reflect(o.prototype,"egret.Matrix"),t.$TempMatrix=new o}(egret||(egret={}));var egret;!function(t){var e=[],i=function(i){function r(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0);var o=i.call(this)||this;return o.x=t,o.y=e,o.width=r,o.height=n,o}return __extends(r,i),r.release=function(t){t&&e.push(t)},r.create=function(){var t=e.pop();return t||(t=new r),t},Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},set:function(t){this.width=t-this.x},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},set:function(t){this.height=t-this.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return this.x},set:function(t){this.width+=this.x-t,this.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},set:function(t){this.height+=this.y-t,this.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"topLeft",{get:function(){return new t.Point(this.left,this.top)},set:function(t){this.top=t.y,this.left=t.x},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"bottomRight",{get:function(){return new t.Point(this.right,this.bottom)},set:function(t){this.bottom=t.y,this.right=t.x},enumerable:!0,configurable:!0}),r.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},r.prototype.setTo=function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},r.prototype.contains=function(t,e){return this.x<=t&&this.x+this.width>=t&&this.y<=e&&this.y+this.height>=e},r.prototype.intersection=function(t){return this.clone().$intersectInPlace(t)},r.prototype.inflate=function(t,e){this.x-=t,this.width+=2*t,this.y-=e,this.height+=2*e},r.prototype.$intersectInPlace=function(t){var e=this.x,i=this.y,r=t.x,n=t.y,o=Math.max(e,r),a=Math.min(e+this.width,r+t.width);if(a>=o){var s=Math.max(i,n),h=Math.min(i+this.height,n+t.height);if(h>=s)return this.setTo(o,s,a-o,h-s),this}return this.setEmpty(),this},r.prototype.intersects=function(t){return Math.max(this.x,t.x)<=Math.min(this.right,t.right)&&Math.max(this.y,t.y)<=Math.min(this.bottom,t.bottom)},r.prototype.isEmpty=function(){return this.width<=0||this.height<=0},r.prototype.setEmpty=function(){this.x=0,this.y=0,this.width=0,this.height=0},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.containsPoint=function(t){return this.x<=t.x&&this.x+this.width>t.x&&this.y<=t.y&&this.y+this.height>t.y?!0:!1},r.prototype.containsRect=function(t){var e=t.x+t.width,i=t.y+t.height,r=this.x+this.width,n=this.y+this.height;return t.x>=this.x&&t.x<r&&t.y>=this.y&&t.y<n&&e>this.x&&r>=e&&i>this.y&&n>=i},r.prototype.equals=function(t){return this===t?!0:this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},r.prototype.inflatePoint=function(t){this.inflate(t.x,t.y)},r.prototype.offset=function(t,e){this.x+=t,this.y+=e},r.prototype.offsetPoint=function(t){this.offset(t.x,t.y)},r.prototype.toString=function(){return"(x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"},r.prototype.union=function(t){var e=this.clone();if(t.isEmpty())return e;if(e.isEmpty())return e.copyFrom(t),e;var i=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return e.setTo(i,r,Math.max(e.right,t.right)-i,Math.max(e.bottom,t.bottom)-r),e},r.prototype.$getBaseWidth=function(t){var e=Math.abs(Math.cos(t)),i=Math.abs(Math.sin(t));return e*this.width+i*this.height},r.prototype.$getBaseHeight=function(t){var e=Math.abs(Math.cos(t)),i=Math.abs(Math.sin(t));return i*this.width+e*this.height},r}(t.HashObject);t.Rectangle=i,__reflect(i.prototype,"egret.Rectangle"),t.$TempRectangle=new i}(egret||(egret={}));var egret;!function(t){t.$locale_strings=t.$locale_strings||{},t.$locale_strings.en_US=t.$locale_strings.en_US||{};var e=t.$locale_strings.en_US;e[1001]="Could not find Egret entry class: {0}。",e[1002]="Egret entry class '{0}' must inherit from egret.DisplayObject.",e[1003]="Parameter {0} must be non-null.",e[1004]="An object cannot be added as a child to one of it's children (or children's children, etc.).",e[1005]="An object cannot be added as a child of itself.",e[1006]="The supplied DisplayObject must be a child of the caller.",e[1007]="An index specified for a parameter was out of range.",e[1008]="Instantiate singleton error,singleton class {0} can not create multiple instances.",e[1009]='the Class {0} cannot use the property "{1}"',e[1010]='the property "{1}" of the Class "{0}" is readonly',e[1011]="Stream Error. URL: {0}",e[1012]="The type of parameter {0} must be Class.",e[1013]="Variable assignment is NaN, please see the code!",e[1014]='the constant "{1}" of the Class "{0}" is read-only',e[1015]="xml not found!",e[1016]="{0}has been obsoleted",e[1017]="The format of JSON file is incorrect: {0}\ndata: {1}",e[1018]="the scale9Grid is not correct",e[1019]="Network ab:{0}",e[1020]="Cannot initialize Shader",e[1021]="Current browser does not support webgl",e[1022]="{0} ArgumentError",e[1023]="This method is not available in the ScrollView!",e[1025]="end of the file",e[1026]="! EncodingError The code point {0} could not be encoded.",e[1027]="DecodingError",e[1028]=". called injection is not configured rule: {0}, please specify configuration during its initial years of injection rule, and then call the corresponding single case.",e[1029]="Function.prototype.bind - what is trying to be bound is not callable",e[1033]="Photos can not be used across domains toDataURL to convert base64",e[1034]='Music file decoding failed: "{0}", please use the standard conversion tool reconversion under mp3.',e[1035]="Native does not support this feature!",e[1036]="Sound has stopped, please recall Sound.play () to play the sound!",e[1037]="Non-load the correct blob!",e[1038]="XML format error!",e[1039]="Cross domains pictures can not get pixel information!",e[1040]="hitTestPoint can not detect crossOrigin images! Please check if the display object has crossOrigin elements.",e[1041]="{0} is deprecated, please use {1} replace",e[1042]="The parameters passed in the region needs is an integer in drawToTexture method. Otherwise, some browsers will draw abnormal.",e[1043]="Compile errors in {0}, the attribute name: {1}, the attribute value: {2}.",e[1044]="The current version of the Runtime does not support video playback, please use the latest version",e[1045]="The resource url is not found",e[1046]="BitmapText no corresponding characters: {0}, please check the configuration file",e[1047]="egret.localStorage.setItem save failed,key={0}&value={1}",e[1048]="Video loading failed",e[1049]="In the absence of sound is not allowed to play after loading",e[1050]="ExternalInterface calls the method without js registration: {0}",e[3e3]="Theme configuration file failed to load: {0}",e[3001]="Cannot find the skin name which is configured in Theme: {0}",e[3002]='Index:"{0}" is out of the collection element index range',e[3003]="Cannot be available in this component. If this component is container, please continue to use",e[3004]="addChild(){0}addElement() replace",e[3005]="addChildAt(){0}addElementAt() replace",e[3006]="removeChild(){0}removeElement() replace",e[3007]="removeChildAt(){0}removeElementAt() replace",e[3008]="setChildIndex(){0}setElementIndex() replace",e[3009]="swapChildren(){0}swapElements() replace",e[3010]="swapChildrenAt(){0}swapElementsAt() replace",e[3011]='Index:"{0}" is out of the visual element index range',e[3012]="This method is not available in Scroller component!",e[3013]="UIStage is GUI root container, and only one such instant is in the display list!",e[3014]="set fullscreen error",e[3100]="Current browser does not support WebSocket",e[3101]="Please connect Socket firstly",e[3102]="Please set the type of binary type",e[4e3]="An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)",e[4001]="Abstract class can not be instantiated!",e[4002]="Unnamed data!",e[4003]="Nonsupport version!"}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(i){var r=e.call(this,i)||this;return r._verticesDirty=!0,r._bounds=new t.Rectangle,r.$renderNode=new t.sys.MeshNode,r}return __extends(i,e),i.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(12)},i.prototype.setBitmapDataToWasm=function(t){this.$waNode.setBitmapDataToMesh(t)},i.prototype.$updateRenderNode=function(){var e=this.$bitmapData;if(e){var i=(t.$TextureScaleFactor,this.$renderNode);i.smoothing=this.$smoothing,i.image=e,i.imageWidth=this.$sourceWidth,i.imageHeight=this.$sourceHeight;var r=isNaN(this.$explicitBitmapWidth)?this.$textureWidth:this.$explicitBitmapWidth,n=isNaN(this.$explicitBitmapHeight)?this.$textureHeight:this.$explicitBitmapHeight,o=r/this.$textureWidth,a=n/this.$textureHeight,s=this.$bitmapWidth,h=this.$bitmapHeight;i.drawMesh(this.$bitmapX,this.$bitmapY,s,h,this.$offsetX*o,this.$offsetY*a,o*s,a*h)}},i.prototype.$updateVertices=function(){this._verticesDirty=!0,this.$renderDirty=!0;var t=this.$renderNode;this.$waNode.setDataToMesh(t.vertices,t.indices,t.uvs)},i.prototype.$measureContentBounds=function(t){if(this._verticesDirty){this._verticesDirty=!1;var e=this.$renderNode,i=e.vertices;if(i.length){this._bounds.setTo(Number.MAX_VALUE,Number.MAX_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);for(var r=0,n=i.length;n>r;r+=2){var o=i[r],a=i[r+1];this._bounds.x>o&&(this._bounds.x=o),this._bounds.width<o&&(this._bounds.width=o),this._bounds.y>a&&(this._bounds.y=a),this._bounds.height<a&&(this._bounds.height=a)}this._bounds.width-=this._bounds.x,this._bounds.height-=this._bounds.y}else this._bounds.setTo(0,0,0,0);e.bounds.copyFrom(this._bounds)}t.copyFrom(this._bounds)},i}(t.Bitmap);t.Mesh=e,__reflect(e.prototype,"egret.Mesh")}(egret||(egret={}));var egret;!function(t){t.$locale_strings=t.$locale_strings||{},t.$locale_strings.zh_CN=t.$locale_strings.zh_CN||{};var e=t.$locale_strings.zh_CN;e[1001]="找不到Egret入口类: {0}。",e[1002]="Egret入口类 {0} 必须继承自egret.DisplayObject。",e[1003]="参数 {0} 不能为 null。",e[1004]="无法将对象添加为它的一个子对象(或子对象的子对象等)的子对象。",e[1005]="不能将对象添加为其自身的子对象。",e[1006]="提供的 DisplayObject 必须是调用者的子级。",e[1007]="为参数指定的索引不在范围内。",e[1008]="实例化单例出错,不允许实例化多个 {0} 对象。",e[1009]="类 {0} 不可以使用属性 {1}",e[1010]="类 {0} 属性 {1} 是只读的",e[1011]="流错误。URL: {0}",e[1012]="参数 {0} 的类型必须为 Class。",e[1013]="变量赋值为NaN,请查看代码!",e[1014]="类 {0} 常量 {1} 是只读的",e[1015]="xml not found!",e[1016]="{0}已经废弃",e[1017]="JSON文件格式不正确: {0}\ndata: {1}",e[1018]="9宫格设置错误",e[1019]="网络异常:{0}",e[1020]="无法初始化着色器",e[1021]="当前浏览器不支持webgl",e[1022]="{0} ArgumentError",e[1023]="此方法在ScrollView内不可用!",e[1025]="遇到文件尾",e[1026]="EncodingError! The code point {0} could not be encoded.",e[1027]="DecodingError",e[1028]="调用了未配置的注入规则:{0}。 请先在项目初始化里配置指定的注入规则,再调用对应单例。",e[1029]="Function.prototype.bind - what is trying to be bound is not callable",e[1033]="跨域图片不可以使用toDataURL来转换成base64",e[1034]='音乐文件解码失败:"{0}",请使用标准的转换工具重新转换下mp3。',e[1035]="Native 下暂未实现此功能!",e[1036]="声音已停止,请重新调用 Sound.play() 来播放声音!",e[1037]="非正确的blob加载!",e[1038]="XML 格式错误!",e[1039]="跨域图片不能获取像素信息!",e[1040]="hitTestPoint 不能对跨域图片进行检测! 请检查该显示对象内是否含有跨域元素",e[1041]="{0} 已废弃,请使用 {1} 代替",e[1042]="drawToTexture方法传入的区域各个参数需要为整数,否则某些浏览器绘制会出现异常",e[1043]="{0} 中存在编译错误,属性名 : {1},属性值 : {2}",e[1044]="当前的 runtime 版本不支持视频播放,请使用最新的版本",e[1045]="没有设置要加载的资源地址",e[1046]="BitmapText 找不到对应字符:{0},请检查配置文件",e[1047]="egret.localStorage.setItem保存失败,key={0}&value={1}",e[1048]="视频加载失败",e[1049]="声音在没有加载完之前不允许播放",e[1050]="ExternalInterface调用了js没有注册的方法: {0}",e[3e3]="主题配置文件加载失败: {0}",e[3001]="找不到主题中所配置的皮肤类名: {0}",e[3002]='索引:"{0}"超出集合元素索引范围',e[3003]="在此组件中不可用,若此组件为容器类,请使用",e[3004]="addChild(){0}addElement()代替",e[3005]="addChildAt(){0}addElementAt()代替",e[3006]="removeChild(){0}removeElement()代替",e[3007]="removeChildAt(){0}removeElementAt()代替",e[3008]="setChildIndex(){0}setElementIndex()代替",e[3009]="swapChildren(){0}swapElements()代替",e[3010]="swapChildrenAt(){0}swapElementsAt()代替",e[3011]='索引:"{0}"超出可视元素索引范围',e[3012]="此方法在Scroller组件内不可用!",e[3013]="UIStage是GUI根容器,只能有一个此实例在显示列表中!",e[3014]="设置全屏模式失败",e[3100]="当前浏览器不支持WebSocket",e[3101]="请先连接WebSocket",e[3102]="请先设置type为二进制类型",e[4e3]="An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)",e[4001]="Abstract class can not be instantiated!",e[4002]="Unnamed data!",e[4003]="Nonsupport version!"}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.AUTO="auto",t.PORTRAIT="portrait",t.LANDSCAPE="landscape",t.LANDSCAPE_FLIPPED="landscapeFlipped"}(e=t.OrientationMode||(t.OrientationMode={}))}(egret||(egret={}));var egret;!function(t){var e;
!function(e){var i;!function(i){function r(t){return window.localStorage.getItem(t)}function n(e,i){try{return window.localStorage.setItem(e,i),!0}catch(r){return t.$warn(1047,e,i),!1}}function o(t){window.localStorage.removeItem(t)}function a(){window.localStorage.clear()}e.getItem=r,e.setItem=n,e.removeItem=o,e.clear=a}(i=e.web||(e.web={}))}(e=t.localStorage||(t.localStorage={}))}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.GET="GET",t.POST="POST",t}();t.HttpMethod=e,__reflect(e.prototype,"egret.HttpMethod")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._url="",t._method="",t}return __extends(i,e),Object.defineProperty(i.prototype,"response",{get:function(){if(!this._xhr)return null;if(void 0!=this._xhr.response)return this._xhr.response;if("text"==this._responseType)return this._xhr.responseText;if("arraybuffer"==this._responseType&&/msie 9.0/i.test(navigator.userAgent)){var t=window;return t.convertResponseBodyToText(this._xhr.responseBody)}return"document"==this._responseType?this._xhr.responseXML:null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"responseType",{get:function(){return this._responseType},set:function(t){this._responseType=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"withCredentials",{get:function(){return this._withCredentials},set:function(t){this._withCredentials=t},enumerable:!0,configurable:!0}),i.prototype.getXHR=function(){return window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP")},i.prototype.open=function(t,e){void 0===e&&(e="GET"),this._url=t,this._method=e,this._xhr&&(this._xhr.abort(),this._xhr=null),this._xhr=this.getXHR(),this._xhr.onreadystatechange=this.onReadyStateChange.bind(this),this._xhr.onprogress=this.updateProgress.bind(this),this._xhr.open(this._method,this._url,!0)},i.prototype.send=function(t){if(null!=this._responseType&&(this._xhr.responseType=this._responseType),null!=this._withCredentials&&(this._xhr.withCredentials=this._withCredentials),this.headerObj)for(var e in this.headerObj)this._xhr.setRequestHeader(e,this.headerObj[e]);this._xhr.send(t)},i.prototype.abort=function(){this._xhr&&this._xhr.abort()},i.prototype.getAllResponseHeaders=function(){if(!this._xhr)return null;var t=this._xhr.getAllResponseHeaders();return t?t:""},i.prototype.setRequestHeader=function(t,e){this.headerObj||(this.headerObj={}),this.headerObj[t]=e},i.prototype.getResponseHeader=function(t){if(!this._xhr)return null;var e=this._xhr.getResponseHeader(t);return e?e:""},i.prototype.onReadyStateChange=function(){var e=this._xhr;if(4==e.readyState){var i=e.status>=400||0==e.status,r=(this._url,this);window.setTimeout(function(){i?r.dispatchEventWith(t.IOErrorEvent.IO_ERROR):r.dispatchEventWith(t.Event.COMPLETE)},0)}},i.prototype.updateProgress=function(e){e.lengthComputable&&t.ProgressEvent.dispatchProgressEvent(this,t.ProgressEvent.PROGRESS,e.loaded,e.total)},i}(t.EventDispatcher);t.HttpRequest=e,__reflect(e.prototype,"egret.HttpRequest")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.TEXT="text",t.ARRAY_BUFFER="arraybuffer",t}();t.HttpResponseType=e,__reflect(e.prototype,"egret.HttpResponseType")}(egret||(egret={}));var egret;!function(t){var e=window.URL||window.webkitURL,i=function(i){function r(){var t=null!==i&&i.apply(this,arguments)||this;return t.data=null,t._crossOrigin=null,t._hasCrossOriginSet=!1,t.currentImage=null,t.request=null,t}return __extends(r,i),Object.defineProperty(r.prototype,"crossOrigin",{get:function(){return this._crossOrigin},set:function(t){this._hasCrossOriginSet=!0,this._crossOrigin=t},enumerable:!0,configurable:!0}),r.prototype.load=function(e){if(t.Html5Capatibility._canUseBlob&&0!=e.indexOf("wxLocalResource:")&&0!=e.indexOf("data:")&&0!=e.indexOf("http:")&&0!=e.indexOf("https:")){var i=this.request;i||(i=this.request=new t.HttpRequest,i.addEventListener(t.Event.COMPLETE,this.onBlobLoaded,this),i.addEventListener(t.IOErrorEvent.IO_ERROR,this.onBlobError,this),i.responseType="blob"),i.open(e),i.send()}else this.loadImage(e)},r.prototype.onBlobLoaded=function(t){var i=this.request.response;this.loadImage(e.createObjectURL(i))},r.prototype.onBlobError=function(t){this.dispatchIOError(this.currentURL)},r.prototype.loadImage=function(t){var e=new Image;this.data=null,this.currentImage=e,this._hasCrossOriginSet?this._crossOrigin&&(e.crossOrigin=this._crossOrigin):r.crossOrigin&&(e.crossOrigin=r.crossOrigin),e.onload=this.onImageComplete.bind(this),e.onerror=this.onLoadError.bind(this),e.src=t},r.prototype.onImageComplete=function(e){var i=this.getImage(e);if(i){this.data=new t.BitmapData(i);var r=this;window.setTimeout(function(){r.dispatchEventWith(t.Event.COMPLETE)},0)}},r.prototype.onLoadError=function(t){var e=this.getImage(t);e&&this.dispatchIOError(e.src)},r.prototype.dispatchIOError=function(e){var i=this;window.setTimeout(function(){i.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},0)},r.prototype.getImage=function(i){var r=i.target,n=r.src;if(0==n.indexOf("blob:"))try{e.revokeObjectURL(r.src)}catch(o){t.$warn(1037)}return r.onerror=null,r.onload=null,this.currentImage!==r?null:(this.currentImage=null,r)},r.crossOrigin=null,r}(t.EventDispatcher);t.ImageLoader=i,__reflect(i.prototype,"egret.ImageLoader")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=e.call(this)||this;i.$renderBuffer=new t.sys.RenderBuffer;var r=new t.BitmapData(i.$renderBuffer.surface);return r.$deleteSource=!1,i._setBitmapData(r),i}return __extends(i,e),i.prototype.drawToTexture=function(e,i,r){if(void 0===r&&(r=1),i&&(0==i.width||0==i.height))return!1;var n=i||e.$getOriginalBounds();if(0==n.width||0==n.height)return!1;r/=t.$TextureScaleFactor;var o=(n.x+n.width)*r,a=(n.y+n.height)*r;i&&(o=n.width*r,a=n.height*r);var s=this.$renderBuffer;if(!s)return!1;s.resize(o,a),this._bitmapData.width=o,this._bitmapData.height=a;var h=t.WebAssembly.getCurrentBuffer();t.WebAssembly.activateBuffer(this.$renderBuffer);var l=!1,u=0,c=0,d=0,p=0;return i&&(l=!0,u=i.x,c=i.y,d=i.width,p=i.height),t.WebAssembly.update(),t.WebAssembly.renderDisplayObject(e.$waNode.id,r,l,u,c,d,p),t.WebAssembly.executeRenderCommand(),t.WebAssembly.activateBuffer(h),this.$initData(0,0,o,a,0,0,o,a,o,a),!0},i.prototype.getPixel32=function(e,i){var r;if(this.$renderBuffer){var n=t.$TextureScaleFactor;e=Math.round(e/n),i=Math.round(i/n),r=this.$renderBuffer.getPixels(e,i,1,1)}return r},i.prototype.dispose=function(){e.prototype.dispose.call(this),this.$renderBuffer=null},i}(t.Texture);t.RenderTexture=e,__reflect(e.prototype,"egret.RenderTexture")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(e,i,r,n,o){if(this.showPanle=!0,this.fpsHeight=0,this.WIDTH=103,this.HEIGHT=20,this.bgCanvasColor="#18304b",this.fpsFrontColor="#18fefe",this.WIDTH_COST=25,this.cost1Color="#18fefe",this.cost2Color="#ffff00",this.cost3Color="#ff0000",this.cost4Color="#00ff00",this.arrFps=[],this.arrCost=[],this.arrLog=[],i||r){"canvas"==t.Capabilities.renderMode?this.renderMode="Canvas":this.renderMode="WebGL",this.panelX=void 0===o.x?0:parseInt(o.x),this.panelY=void 0===o.y?0:parseInt(o.y),this.fontColor=void 0===o.textColor?"#ffffff":o.textColor.replace("0x","#"),this.fontSize=void 0===o.size?12:parseInt(o.size),t.Capabilities.isMobile&&(this.fontSize-=2);var a=document.createElement("div");a.style.position="absolute",a.style.background="rgba(0,0,0,"+o.bgAlpha+")",a.style.left=this.panelX+"px",a.style.top=this.panelY+"px",a.style.pointerEvents="none",document.body.appendChild(a);var s=document.createElement("div");s.style.color=this.fontColor,s.style.fontSize=this.fontSize+"px",s.style.lineHeight=this.fontSize+"px",s.style.margin="4px 4px 4px 4px",this.container=s,a.appendChild(s),i&&this.addFps(),r&&this.addLog()}}return e.prototype.addFps=function(){var t=document.createElement("div");t.style.display="inline-block",this.containerFps=t,this.container.appendChild(t);var e=document.createElement("div");e.style.paddingBottom="2px",this.fps=e,this.containerFps.appendChild(e),e.innerHTML="0 FPS "+this.renderMode+"<br/>min0 max0 avg0";var i=document.createElement("canvas");this.containerFps.appendChild(i),i.width=this.WIDTH,i.height=this.HEIGHT,this.canvasFps=i;var r=i.getContext("2d");this.contextFps=r,r.fillStyle=this.bgCanvasColor,r.fillRect(0,0,this.WIDTH,this.HEIGHT);var n=document.createElement("div");this.divDatas=n,this.containerFps.appendChild(n);var o=document.createElement("div");o.style["float"]="left",o.innerHTML="Draw<br/>Cost",n.appendChild(o);var a=document.createElement("div");a.style.paddingLeft=o.offsetWidth+20+"px",n.appendChild(a);var s=document.createElement("div");this.divDraw=s,s.innerHTML="0<br/>",a.appendChild(s);var h=document.createElement("div");this.divCost=h,h.innerHTML='<font  style="color:'+this.cost1Color+'">0<font/> <font  style="color:'+this.cost2Color+'">0<font/> <font  style="color:'+this.cost3Color+'">0<font/> <font  style="color:'+this.cost4Color+'">0<font/>',a.appendChild(h),i=document.createElement("canvas"),this.canvasCost=i,this.containerFps.appendChild(i),i.width=this.WIDTH,i.height=this.HEIGHT,r=i.getContext("2d"),this.contextCost=r,r.fillStyle=this.bgCanvasColor,r.fillRect(0,0,this.WIDTH,this.HEIGHT),r.fillStyle="#000000",r.fillRect(this.WIDTH_COST,0,1,this.HEIGHT),r.fillRect(2*this.WIDTH_COST+1,0,1,this.HEIGHT),r.fillRect(3*this.WIDTH_COST+2,0,1,this.HEIGHT),this.fpsHeight=this.container.offsetHeight},e.prototype.addLog=function(){var t=document.createElement("div");t.style.maxWidth=document.body.clientWidth-8-this.panelX+"px",t.style.wordWrap="break-word",this.log=t,this.container.appendChild(t)},e.prototype.update=function(t,e){void 0===e&&(e=!1);var i,r,n,o,a;e?(i=this.arrFps[this.arrFps.length-1],r=this.arrCost[this.arrCost.length-1][0],n=this.arrCost[this.arrCost.length-1][1],o=this.arrCost[this.arrCost.length-1][2],a=this.arrCost[this.arrCost.length-1][3]):(i=t.fps,r=t.costTicker,n=t.costUpdate,o=t.costRender,a=t.costDraw,this.lastNumDraw=t.draw,this.arrFps.push(i),this.arrCost.push([r,n,o,a]));var s=0,h=this.arrFps.length;h>101&&(h=101,this.arrFps.shift(),this.arrCost.shift());for(var l=this.arrFps[0],u=this.arrFps[0],c=0;h>c;c++){var d=this.arrFps[c];s+=d,l>d?l=d:d>u&&(u=d)}var p=this.WIDTH,f=this.HEIGHT,g=this.contextFps;g.drawImage(this.canvasFps,1,0,p-1,f,0,0,p-1,f),g.fillStyle=this.bgCanvasColor,g.fillRect(p-1,0,1,f);var y=Math.floor(i/60*20);1>y&&(y=1),g.fillStyle=this.fpsFrontColor,g.fillRect(p-1,20-y,1,y);var v=this.WIDTH_COST;g=this.contextCost,g.drawImage(this.canvasCost,1,0,v-1,f,0,0,v-1,f),g.drawImage(this.canvasCost,v+2,0,v-1,f,v+1,0,v-1,f),g.drawImage(this.canvasCost,2*v+3,0,v-1,f,2*v+2,0,v-1,f),g.drawImage(this.canvasCost,3*v+4,0,v-1,f,3*v+3,0,v-1,f);var m=Math.floor(r/2);1>m?m=1:m>20&&(m=20);var b=Math.floor(n/2);1>b?b=1:b>20&&(b=20);var $=Math.floor(o/2);1>$?$=1:$>20&&($=20);var x=Math.floor(a/2);1>x?x=1:x>20&&(x=20),g.fillStyle=this.bgCanvasColor,g.fillRect(v-1,0,1,f),g.fillRect(2*v,0,1,f),g.fillRect(3*v+1,0,1,f),g.fillRect(4*v+2,0,1,f),g.fillStyle=this.cost1Color,g.fillRect(v-1,20-m,1,m),g.fillStyle=this.cost2Color,g.fillRect(2*v,20-b,1,b),g.fillStyle=this.cost3Color,g.fillRect(3*v+1,20-$,1,$),g.fillStyle=this.cost4Color,g.fillRect(4*v+2,20-x,1,x);var T=Math.floor(s/h),_=i+" FPS "+this.renderMode;this.showPanle&&(_+="<br/>min"+l+" max"+u+" avg"+T,this.divDraw.innerHTML=this.lastNumDraw+"<br/>",this.divCost.innerHTML='<font  style="color:#18fefe">'+r+'<font/> <font  style="color:#ffff00">'+n+'<font/> <font  style="color:#ff0000">'+o+'<font/> <font  style="color:#00ff00">'+a+"<font/>"),this.fps.innerHTML=_},e.prototype.updateInfo=function(t){for(this.arrLog.push(t),this.log.innerHTML=this.arrLog.join("<br/>");document.body.clientHeight<this.log.offsetHeight+this.fpsHeight+this.panelY+2*this.fontSize;)this.arrLog.shift(),this.log.innerHTML=this.arrLog.join("<br/>")},e}();t.FPSDisplay=e,__reflect(e.prototype,"egret.FPSDisplay")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i.$graphics=new t.Graphics,i.$graphics.$setTarget(i),i}return __extends(i,e),i.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(9)},Object.defineProperty(i.prototype,"graphics",{get:function(){return this.$graphics},enumerable:!0,configurable:!0}),i.prototype.$hitTest=function(e,i){if(!this.$visible)return null;var r=this.$getInvertedConcatenatedMatrix(),n=r.a*e+r.c*i+r.tx,o=r.b*e+r.d*i+r.ty,a=this.$scrollRect?this.$scrollRect:this.$maskRect;if(a&&!a.contains(n,o))return null;if(this.$mask&&!this.$mask.$hitTest(e,i))return null;for(var s=this.$children,h=!1,l=null,u=s.length-1;u>=0;u--){var c=s[u];if(!c.$maskedObject&&(l=c.$hitTest(e,i))){if(h=!0,l.$touchEnabled)break;l=null}}return l?this.$touchChildren?l:this:h?this:(l=t.DisplayObject.prototype.$hitTest.call(this,e,i),l&&(l=this.$graphics.$hitTest(e,i)),l)},i.prototype.$measureContentBounds=function(t){this.$graphics.$measureContentBounds(t)},i.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),this.$graphics&&this.$graphics.$onRemoveFromStage()},i}(t.DisplayObjectContainer);t.Sprite=e,__reflect(e.prototype,"egret.Sprite")}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e}var r=function(r){function h(e,i,n){var o=r.call(this)||this;return o.isPlaying=!1,o.entryClassName=n,o.stage=i,o.renderBuffer=e,o.showFPS=!1,o.showLog=!1,t.WebAssembly.setRootBuffer(e),o}return __extends(h,r),h.prototype.start=function(){!this.isPlaying&&this.stage&&(e.$TempStage=e.$TempStage||this.stage,this.isPlaying=!0,this.root||this.initialize(),t.ticker.$addPlayer(this))},h.prototype.initialize=function(){var e;if(this.entryClassName&&(e=t.getDefinitionByName(this.entryClassName)),e){var i=new e;this.root=i,i instanceof t.DisplayObject&&this.stage.addChild(i)}},h.prototype.stop=function(){this.pause(),this.stage=null},h.prototype.pause=function(){this.isPlaying&&(this.isPlaying=!1,t.ticker.$removePlayer(this))},h.prototype.$render=function(e,i){this.showFPS||this.showLog;var r,n=(this.stage,t.getTimer());t.WebAssembly.update();var o=t.getTimer();t.WebAssembly.render();var a=t.getTimer();r=t.WebAssembly.executeRenderCommand();var s=t.getTimer();e&&this.showFPS&&this.fps.update(r,i,o-n,a-o,s-a)},h.prototype.updateStageSize=function(e,i){var r=this.stage;r.$stageWidth=e,r.$stageHeight=i,Module.isNative?t.WebAssembly.resize(e,i):this.renderBuffer.resize(e,i),r.dispatchEventWith(t.Event.RESIZE)},h.prototype.displayFPS=function(r,h,l,u){if(h&&(t.log=function(){for(var t=arguments.length,r="",n=0;t>n;n++)r+=arguments[n]+" ";e.$logToFPS(r),console.log.apply(console,i(arguments))}),o=u?u:{},h=!!h,this.showFPS=!!r,this.showLog=h,!this.fps){n=this.fps=new s(this.stage,r,h,l,o);for(var c=a.length,d=0;c>d;d++)n.updateInfo(a[d]);a=null}},h}(t.HashObject);e.Player=r,__reflect(r.prototype,"egret.sys.Player");var n,o,a=[];e.$logToFPS=function(t){return n?void n.updateInfo(t):void a.push(t)};var s=function(){function e(e,i,r,n,o){this.infoLines=[],this.totalTime=0,this.totalTick=0,this.lastTime=0,this.drawCalls=0,this.costTicker=0,this.costUpdate=0,this.costRender=0,this.costDraw=0,this._stage=e,this.showFPS=i,this.showLog=r,this.logFilter=n,this.styles=o,this.fpsDisplay=new t.FPSDisplay(e,i,r,n,o);var a;try{a=n?new RegExp(n):null}catch(s){t.log(s)}this.filter=function(t){return a?a.test(t):!n||0==t.indexOf(n)}}return e.prototype.update=function(e,i,r,n,o){var a=t.getTimer();if(this.totalTime+=a-this.lastTime,this.lastTime=a,this.totalTick++,this.drawCalls+=e,this.costTicker+=i,this.costUpdate+=r,this.costRender+=n,this.costDraw+=o,this.totalTime>=1e3){var s=Math.min(Math.ceil(1e3*this.totalTick/this.totalTime),t.ticker.$frameRate),h=Math.round(this.drawCalls/this.totalTick),l=Math.round(this.costTicker/this.totalTick),u=Math.round(this.costUpdate/this.totalTick),c=Math.round(this.costRender/this.totalTick),d=Math.round(this.costDraw/this.totalTick);this.fpsDisplay.update({fps:s,draw:h,costTicker:l,costUpdate:u,costRender:c,costDraw:d}),this.totalTick=0,this.totalTime=this.totalTime%1e3,this.drawCalls=0,this.costRender=0,this.costTicker=0,this.costUpdate=0,this.costDraw=0}},e.prototype.updateInfo=function(t){t&&this.showLog&&this.filter(t)&&this.fpsDisplay.updateInfo(t)},e}();__reflect(s.prototype,"FPS"),t.warn=function(){console.warn.apply(console,i(arguments))},t.error=function(){console.error.apply(console,i(arguments))},t.assert=function(){console.assert.apply(console,i(arguments))},t.log=function(){console.log.apply(console,i(arguments))}}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=[],i=function(){function t(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.width=0,this.height=0,this.area=0,this.moved=!1}return t.release=function(t){e.push(t)},t.create=function(){var i=e.pop();return i||(i=new t),i},t.prototype.setTo=function(t,e,i,r){return this.minX=t,this.minY=e,this.maxX=i,this.maxY=r,this.updateArea(),this},t.prototype.intValues=function(){this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this.updateArea()},t.prototype.updateArea=function(){this.width=this.maxX-this.minX,this.height=this.maxY-this.minY,this.area=this.width*this.height},t.prototype.union=function(t){this.minX>t.minX&&(this.minX=t.minX),this.minY>t.minY&&(this.minY=t.minY),this.maxX<t.maxX&&(this.maxX=t.maxX),this.maxY<t.maxY&&(this.maxY=t.maxY),this.updateArea()},t.prototype.intersect=function(t){return this.minX<t.minX&&(this.minX=t.minX),this.maxX>t.maxX&&(this.maxX=t.maxX),this.minX>=this.maxX?void this.setEmpty():(this.minY<t.minY&&(this.minY=t.minY),this.maxY>t.maxY&&(this.maxY=t.maxY),this.minY>=this.maxY?void this.setEmpty():void this.updateArea())},t.prototype.setEmpty=function(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.width=0,this.height=0,this.area=0},t.prototype.isEmpty=function(){return this.width<=0||this.height<=0},t.prototype.intersects=function(t){if(this.isEmpty())return!1;var e=this.minX>t.minX?this.minX:t.minX,i=this.maxX<t.maxX?this.maxX:t.maxX;return e>i?!1:(e=this.minY>t.minY?this.minY:t.minY,i=this.maxY<t.maxY?this.maxY:t.maxY,i>=e)},t.prototype.updateRegion=function(t,e){if(0==t.width||0==t.height)return void this.setEmpty();var i,r,n,o,a=e,s=a.a,h=a.b,l=a.c,u=a.d,c=a.tx,d=a.ty,p=t.x,f=t.y,g=p+t.width,y=f+t.height;if(1==s&&0==h&&0==l&&1==u)i=p+c-1,r=f+d-1,n=g+c+1,o=y+d+1;else{var v=s*p+l*f+c,m=h*p+u*f+d,b=s*g+l*f+c,$=h*g+u*f+d,x=s*g+l*y+c,T=h*g+u*y+d,_=s*p+l*y+c,E=h*p+u*y+d,w=0;v>b&&(w=v,v=b,b=w),x>_&&(w=x,x=_,_=w),i=(x>v?v:x)-1,n=(b>_?b:_)+1,m>$&&(w=m,m=$,$=w),T>E&&(w=T,T=E,E=w),r=(T>m?m:T)-1,o=($>E?$:E)+1}this.minX=i,this.minY=r,this.maxX=n,this.maxY=o,this.width=n-i,this.height=o-r,this.area=this.width*this.height},t}();t.Region=i,__reflect(i.prototype,"egret.sys.Region")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){return e.call(this)||this}return __extends(i,e),i.prototype.calculateStageSize=function(e,i,r,n,o){var a=i,s=r,h=n,l=o,u=i/h||0,c=r/l||0;switch(e){case t.StageScaleMode.EXACT_FIT:break;case t.StageScaleMode.FIXED_HEIGHT:h=Math.round(i/c);break;case t.StageScaleMode.FIXED_WIDTH:l=Math.round(r/u);break;case t.StageScaleMode.NO_BORDER:u>c?s=Math.round(l*u):a=Math.round(h*c);break;case t.StageScaleMode.SHOW_ALL:u>c?a=Math.round(h*c):s=Math.round(l*u);break;case t.StageScaleMode.FIXED_NARROW:u>c?h=Math.round(i/c):l=Math.round(r/u);break;case t.StageScaleMode.FIXED_WIDE:u>c?l=Math.round(r/u):h=Math.round(i/c);break;default:h=i,l=r}return a%2!=0&&(a+=1),s%2!=0&&(s+=1),{stageWidth:h,stageHeight:l,displayWidth:a,displayHeight:s}},i}(t.HashObject);e.DefaultScreenAdapter=i,__reflect(i.prototype,"egret.sys.DefaultScreenAdapter",["egret.sys.IScreenAdapter"])}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.NO_SCALE="noScale",t.SHOW_ALL="showAll",t.NO_BORDER="noBorder",t.EXACT_FIT="exactFit",t.FIXED_WIDTH="fixedWidth",t.FIXED_HEIGHT="fixedHeight",t.FIXED_NARROW="fixedNarrow",t.FIXED_WIDE="fixedWide"}(e=t.StageScaleMode||(t.StageScaleMode={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){e.$START_TIME=0,e.$invalidateRenderFlag=!1,e.$requestRenderingFlag=!1;var i=function(){function i(){this.playerList=[],this.callBackList=[],this.thisObjectList=[],this.$frameRate=30,this.lastTimeStamp=0,this.costEnterFrame=0,this.isPaused=!1,e.$START_TIME=Date.now(),this.frameDeltaTime=1e3/this.$frameRate,this.lastCount=this.frameInterval=Math.round(6e4/this.$frameRate)}return i.prototype.$addPlayer=function(t){-1==this.playerList.indexOf(t)&&(this.playerList=this.playerList.concat(),this.playerList.push(t))},i.prototype.$removePlayer=function(t){var e=this.playerList.indexOf(t);if(-1!==e){this.playerList=this.playerList.concat(),this.playerList.splice(e,1)}},i.prototype.$startTick=function(t,e){var i=this.getTickIndex(t,e);-1==i&&(this.concatTick(),this.callBackList.push(t),this.thisObjectList.push(e))},i.prototype.$stopTick=function(t,e){var i=this.getTickIndex(t,e);-1!=i&&(this.concatTick(),this.callBackList.splice(i,1),this.thisObjectList.splice(i,1))},i.prototype.getTickIndex=function(t,e){for(var i=this.callBackList,r=this.thisObjectList,n=i.length-1;n>=0;n--)if(i[n]==t&&r[n]==e)return n;return-1},i.prototype.concatTick=function(){this.callBackList=this.callBackList.concat(),this.thisObjectList=this.thisObjectList.concat()},i.prototype.$setFrameRate=function(t){return t=+t||0,0>=t?!1:this.$frameRate==t?!1:(this.$frameRate=t,t>60&&(t=60),this.frameDeltaTime=1e3/t,this.lastCount=this.frameInterval=Math.round(6e4/t),!0)},i.prototype.pause=function(){this.isPaused=!0},i.prototype.resume=function(){this.isPaused=!1},i.prototype.update=function(){var i=t.getTimer(),r=this.callBackList,n=this.thisObjectList,o=r.length,a=e.$requestRenderingFlag,s=t.getTimer();if(this.isPaused)return void(this.lastTimeStamp=s);this.callLaterAsyncs();for(var h=0;o>h;h++)r[h].call(n[h],s)&&(a=!0);var l=t.getTimer(),u=s-this.lastTimeStamp;if(this.lastTimeStamp=s,u>=this.frameDeltaTime)this.lastCount=this.frameInterval;else{if(this.lastCount-=1e3,this.lastCount>0)return void(a&&this.render(!1,this.costEnterFrame+l-i));this.lastCount+=this.frameInterval}this.render(!0,this.costEnterFrame+l-i);var c=t.getTimer();this.broadcastEnterFrame();var d=t.getTimer();this.costEnterFrame=d-c},i.prototype.render=function(t,i){var r=this.playerList,n=r.length;if(0!=n){this.callLaters(),e.$invalidateRenderFlag&&(this.broadcastRender(),e.$invalidateRenderFlag=!1);for(var o=0;n>o;o++)r[o].$render(t,i);e.$requestRenderingFlag=!1}},i.prototype.broadcastEnterFrame=function(){var e=t.DisplayObject.$enterFrameCallBackList,i=e.length;if(0!=i){e=e.concat();for(var r=0;i>r;r++)e[r].dispatchEventWith(t.Event.ENTER_FRAME)}},i.prototype.broadcastRender=function(){var e=t.DisplayObject.$renderCallBackList,i=e.length;if(0!=i){e=e.concat();for(var r=0;i>r;r++)e[r].dispatchEventWith(t.Event.RENDER)}},i.prototype.callLaters=function(){var e,i,r;if(t.$callLaterFunctionList.length>0&&(e=t.$callLaterFunctionList,t.$callLaterFunctionList=[],i=t.$callLaterThisList,t.$callLaterThisList=[],r=t.$callLaterArgsList,t.$callLaterArgsList=[]),e)for(var n=e.length,o=0;n>o;o++){var a=e[o];null!=a&&a.apply(i[o],r[o])}},i.prototype.callLaterAsyncs=function(){if(t.$callAsyncFunctionList.length>0){var e=t.$callAsyncFunctionList,i=t.$callAsyncThisList,r=t.$callAsyncArgsList;t.$callAsyncFunctionList=[],t.$callAsyncThisList=[],t.$callAsyncArgsList=[];for(var n=0;n<e.length;n++){var o=e[n];null!=o&&o.apply(i[n],r[n])}}},i}();e.SystemTicker=i,__reflect(i.prototype,"egret.sys.SystemTicker")}(e=t.sys||(t.sys={}))}(egret||(egret={})),function(t){t.ticker=new t.sys.SystemTicker}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(t){var i=e.call(this)||this;return i.maxTouches=0,i.useTouchesCount=0,i.touchDownTarget={},i.lastTouchX=-1,i.lastTouchY=-1,i.stage=t,i}return __extends(i,e),i.prototype.$initMaxTouches=function(){this.maxTouches=this.stage.$maxTouches},i.prototype.onTouchBegin=function(e,i,r){if(!(this.useTouchesCount>=this.maxTouches)){this.lastTouchX=e,this.lastTouchY=i;var n=this.findTarget(e,i);null==this.touchDownTarget[r]&&(this.touchDownTarget[r]=n,this.useTouchesCount++),t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_BEGIN,!0,!0,e,i,r,!0)}},i.prototype.onTouchMove=function(e,i,r){if(null!=this.touchDownTarget[r]&&(this.lastTouchX!=e||this.lastTouchY!=i)){this.lastTouchX=e,this.lastTouchY=i;var n=this.findTarget(e,i);t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_MOVE,!0,!0,e,i,r,!0)}},i.prototype.onTouchEnd=function(e,i,r){if(null!=this.touchDownTarget[r]){var n=this.findTarget(e,i),o=this.touchDownTarget[r];delete this.touchDownTarget[r],this.useTouchesCount--,t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_END,!0,!0,e,i,r,!1),o==n?t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_TAP,!0,!0,e,i,r,!1):t.TouchEvent.dispatchTouchEvent(o,t.TouchEvent.TOUCH_RELEASE_OUTSIDE,!0,!0,e,i,r,!1)}},i.prototype.findTarget=function(t,e){var i=this.stage.$hitTest(t,e);return i||(i=this.stage),i},i}(t.HashObject);e.TouchHandler=i,__reflect(i.prototype,"egret.sys.TouchHandler")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=["none","round","square"],r=["bevel","miter","round"],n=function(n){function o(){var t=n.call(this)||this;return t.dirtyRender=!0,t.type=1,t}return __extends(o,n),o.prototype.beginFill=function(t,i,r){void 0===i&&(i=1);var n=new e.FillPath;if(n.fillColor=t,n.fillAlpha=i,r){var o=this.drawData.lastIndexOf(r);this.drawData.splice(o,0,n)}else this.drawData.push(n);return n},o.prototype.beginGradientFill=function(i,r,n,o,a,s){var h=new t.Matrix;a?(h.a=819.2*a.a,h.b=819.2*a.b,h.c=819.2*a.c,h.d=819.2*a.d,h.tx=a.tx,h.ty=a.ty):(h.a=100,h.d=100);var l=new e.GradientFillPath;if(l.gradientType=i,l.colors=r,l.alphas=n,l.ratios=o,l.matrix=h,s){var u=this.drawData.lastIndexOf(s);this.drawData.splice(u,0,l)}else this.drawData.push(l);return l},o.prototype.lineStyle=function(n,o,a,s,h,l){void 0===a&&(a=1),void 0===l&&(l=3),-1==i.indexOf(s)&&(s="round"),-1==r.indexOf(h)&&(h="round");var u=new e.StrokePath;return u.lineWidth=n,u.lineColor=o,u.lineAlpha=a,u.caps=s||t.CapsStyle.ROUND,u.joints=h,u.miterLimit=l,this.drawData.push(u),u},o.prototype.clear=function(){this.drawData.length=0,this.dirtyRender=!0},o.prototype.cleanBeforeRender=function(){},o.prototype.clean=function(){this.$texture&&(t.WebGLUtils.deleteWebGLTexture(this.$texture),this.$texture=null,this.dirtyRender=!0)},o}(e.RenderNode);e.GraphicsNode=n,__reflect(n.prototype,"egret.sys.GraphicsNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){var i=e.call(this)||this;return i.image=null,i.smoothing=!0,i.bounds=new t.Rectangle,i.type=2,i.vertices=[],i.uvs=[],i.indices=[],i}return __extends(i,e),i.prototype.drawMesh=function(t,e,i,r,n,o,a,s){this.drawData.push(t,e,i,r,n,o,a,s),this.renderCount++},i.prototype.cleanBeforeRender=function(){e.prototype.cleanBeforeRender.call(this),this.image=null,this.matrix=null},i}(e.RenderNode);e.MeshNode=i,__reflect(i.prototype,"egret.sys.MeshNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i.$graphics=new t.Graphics,i.$graphics.$setTarget(i),i}return __extends(i,e),i.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(8)},Object.defineProperty(i.prototype,"graphics",{get:function(){return this.$graphics},enumerable:!0,configurable:!0}),i.prototype.$measureContentBounds=function(t){this.$graphics.$measureContentBounds(t)},i.prototype.$hitTest=function(t,i){var r=e.prototype.$hitTest.call(this,t,i);return r==this&&(r=this.$graphics.$hitTest(t,i)),r},i.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),this.$graphics&&this.$graphics.$onRemoveFromStage()},i}(t.DisplayObject);t.Shape=e,__reflect(e.prototype,"egret.Shape")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r){return void 0===i&&(i=!1),void 0===r&&(r=!1),e.call(this,t,i,r)||this}return __extends(i,e),i.dispatchIOErrorEvent=function(e){var r=t.Event.create(i,i.IO_ERROR),n=e.dispatchEvent(r);return t.Event.release(r),n},i.IO_ERROR="ioError",i}(t.Event);t.IOErrorEvent=e,__reflect(e.prototype,"egret.IOErrorEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t){var i=e.call(this)||this;return i.format="image",i.$deleteSource=!0,i.source=t,i.width=t.width,i.height=t.height,i}return __extends(i,e),i.prototype.$dispose=function(){"webgl"==t.Capabilities.renderMode&&this.webGLTexture&&(t.WebGLUtils.deleteWebGLTexture(this.webGLTexture),this.webGLTexture=null),this.source&&this.source.dispose&&this.source.dispose(),this.source=null,i.$dispose(this)},i.$addBitmap=function(t,e){var r=e.hashCode;if(r){if(!i._bitmapList[r])return void(i._bitmapList[r]=[t]);var n=i._bitmapList[r];n.indexOf(t)<0&&n.push(t)}},i.$removeBitmap=function(t,e){var r=e.hashCode;if(r&&i._bitmapList[r]){var n=i._bitmapList[r],o=n.indexOf(t);o>=0&&n.splice(o)}},i.$invalidate=function(t){var e=t.hashCode;if(e&&i._bitmapList[e])for(var r=i._bitmapList[e],n=0;n<r.length;n++)r[n].$refreshImageData(),r[n].$renderDirty=!0},i.$dispose=function(e){var r=e.hashCode;if(r&&i._bitmapList[r]){for(var n=i._bitmapList[r],o=0,a=n;o<a.length;o++){var s=a[o];s.texture=null}t.WebAssemblyNode.disposeBitmapData(e),delete i._bitmapList[r]}},i._bitmapList=t.createMap(),i}(t.HashObject);t.BitmapData=e,__reflect(e.prototype,"egret.BitmapData")}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=1,e}return __extends(e,t),e}(t.Path2D);t.FillPath=e,__reflect(e.prototype,"egret.sys.FillPath")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=2,e}return __extends(e,t),e}(t.Path2D);t.GradientFillPath=e,__reflect(e.prototype,"egret.sys.GradientFillPath")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=3,e}return __extends(e,t),e}(t.Path2D);t.StrokePath=e,__reflect(e.prototype,"egret.sys.StrokePath")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.NORMAL="normal",t.ADD="add",t.ERASE="erase"}(e=t.BlendMode||(t.BlendMode={}))}(egret||(egret={})),function(t){var e;!function(t){function e(t){var e=n[t];return void 0===e?0:e}function i(t){var e=r[t];return void 0===e?"normal":e}for(var r=["normal","add","erase"],n={},o=r.length,a=0;o>a;a++){var s=r[a];n[s]=a}t.blendModeToNumber=e,t.numberToBlendMode=i}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.onChange=function(e){var r=new t.OrientationEvent(t.Event.CHANGE);r.beta=e.beta,r.gamma=e.gamma,r.alpha=e.alpha,i.dispatchEvent(r)},i}return __extends(i,e),i.prototype.start=function(){window.addEventListener("deviceorientation",this.onChange)},i.prototype.stop=function(){window.removeEventListener("deviceorientation",this.onChange)},i}(t.EventDispatcher);t.DeviceOrientation=e,__reflect(e.prototype,"egret.DeviceOrientation")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i.$stageWidth=0,i.$stageHeight=0,i.$scaleMode=t.StageScaleMode.SHOW_ALL,i.$orientation=t.OrientationMode.AUTO,i.$maxTouches=99,i.$stage=i,i.$nestLevel=1,i
}return __extends(i,e),Object.defineProperty(i.prototype,"frameRate",{get:function(){return t.ticker.$frameRate},set:function(e){t.ticker.$setFrameRate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stageWidth",{get:function(){return this.$stageWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stageHeight",{get:function(){return this.$stageHeight},enumerable:!0,configurable:!0}),i.prototype.invalidate=function(){t.sys.$invalidateRenderFlag=!0},i.prototype.registerImplementation=function(e,i){t.registerImplementation(e,i)},i.prototype.getImplementation=function(e){return t.getImplementation(e)},Object.defineProperty(i.prototype,"scaleMode",{get:function(){return this.$scaleMode},set:function(t){this.$scaleMode!=t&&(this.$scaleMode=t,this.$screen.updateScreenSize())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"orientation",{get:function(){return this.$orientation},set:function(t){this.$orientation!=t&&(this.$orientation=t,this.$screen.updateScreenSize())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"textureScaleFactor",{get:function(){return t.$TextureScaleFactor},set:function(e){t.$TextureScaleFactor=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxTouches",{get:function(){return this.$maxTouches},set:function(t){this.$maxTouches!=t&&(this.$maxTouches=t,this.$screen.updateMaxTouches())},enumerable:!0,configurable:!0}),i.prototype.setContentSize=function(t,e){this.$screen.setContentSize(t,e)},i}(t.DisplayObjectContainer);t.Stage=e,__reflect(e.prototype,"egret.Stage")}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.NONE="none",t.ROUND="round",t.SQUARE="square"}(e=t.CapsStyle||(t.CapsStyle={}))}(egret||(egret={}));var egret;!function(t){t.DirtyRegionPolicy={OFF:"off",ON:"on"}}(egret||(egret={}));var egret;!function(t){function e(t,e){r[t]=e}function i(t){return r[t]}var r={};t.registerImplementation=e,t.getImplementation=i}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i,r,n,o,a,s,h,l,u,c,d,p,f,g,y,v,m,b,$,x;e.forHitTest=!1;var T=[],_=[],E=!1;e.addModuleCallback=function(t,e){T.push(t),_.push(e)},e.init=function(e,l){function v(){var t=document.createElement("script");t.src=1==l?"./libs/egret.webassembly.js":"./libs/egret.asm.js",document.body.appendChild(t),Module={},Module.wasmBinary=1==l?O.response:null,Module.postRun=[],Module.postRun.push(m)}function m(){Module.isNative=4===l,Module.isNative&&(Module.__bitmapDataMap=re,Module.__textFieldDataMap=ne,Module.__customFilterDataMap=oe,g=Module.getPixels),Module.customInit(),Module.downloadBuffers(function(e,l,g,v){if(i=e,r=l,n=g,t.WebAssemblyNode.init(v,Module.isNative,re,se,oe),o=Module.update,a=Module.render,s=Module.resize,h=Module.setRenderMode,u=Module.updateCallbackList,c=Module.renderDisplayObject,d=Module.renderDisplayObject2,p=Module.localToGlobal,f=Module.globalToLocal,y=Module.activateBuffer,S=t.getTimer(),T.length>0)for(var m=T,b=_,$=0;$<m.length;$++){var x=m[$];null!=x&&x.apply(b[$])}t.startTick(C.updatePreCallback,C)})}if(void 0===e&&(e=134217728),void 0===l&&(l=1),E){if(T.length>0)for(var b=T,$=_,x=0;x<b.length;x++){var w=b[x];null!=w&&w.apply($[x])}}else{E=!0;var C=this;__global.egret_native&&(l=4);var O;switch(l){case 1:O=new XMLHttpRequest,O.open("GET","./libs/egret.webassembly.wasm",!0);break;case 2:O=new XMLHttpRequest,Module.buffer=new ArrayBuffer(e);var A="./libs/egret.asm.js.mem";Module.memoryInitializerRequest=O,O.open("GET",A,!0);break;case 3:v();break;case 4:m()}O&&(O.responseType="arraybuffer",O.addEventListener("load",v),O.send(null))}};var w=null,C=null;e.initBlendMode=function(){w={},C={},w[0]=[1,771],w[1]=[1,1],w[2]=[0,771],w[3]=[0,770],C[0]="source-over",C[1]="lighter",C[2]="destination-out",C[3]="destination-in"},e.setRootBuffer=function(t){l?b=t:($=t,q(t))},e.setRenderMode=function(t){l="webgl"==t,h(Module.isNative?2:l?1:0),e.initBlendMode()},e.renderDisplayObject=function(t,e,i,r,n,o,a){c(t,e,i,r,n,o,a)},e.renderDisplayObjectWithOffset=function(t,i,r){d(t,i,r,e.forHitTest)},e.localToGlobal=function(t,e,i){return p(t,e,i)},e.globalToLocal=function(t,e,i){return f(t,e,i)},e.resize=function(t,e){s(t,e)},e.update=function(){O(),A(),t.WebAssemblyNode.update(),o&&o()},e.dirtyTextField=function(t){le.push(t),ee[t.$waNode.id]=t},e.dirtyGraphics=function(t){ue.push(t),ie[t.$targetDisplay.$waNode.id]=t};var S,O=function(){var t=Module.isNative,e=le.length;if(e>0){var i=le;le=[];for(var r=0;e>r;r++){var n=i[r];n.$getRenderNode();var o=n.$renderNode,a=o.width-o.x,s=o.height-o.y;0==o.drawData.length?n.$waNode.setTextRect(0,0,0,0):n.$waNode.setTextRect(o.x,o.y,a,s),t&&B(n.$waNode.id)}}},A=function(){var t=Module.isNative,e=ue.length;if(e>0){var i=ue;ue=[];for(var r=0;e>r;r++){var n=i[r],o=n.$renderNode,a=o.width,s=o.height;0>=a||0>=s||!a||!s||0==o.drawData.length?n.$targetDisplay.$waNode.setGraphicsRect(0,0,0,0,n.$targetIsSprite):n.$targetDisplay.$waNode.setGraphicsRect(o.x,o.y,o.width,o.height,n.$targetIsSprite),t&&k(n.$targetDisplay.$waNode.id,o)}}};e.updatePreCallback=function(t){var e=t-S;return S=t,u&&u(e),!1};var R=!1;e.render=function(){if(!m&&l&&!Module.isNative){m=t.WebGLRenderContext.getInstance(3,3),v=m.context,m.uploadIndicesArray(m.vao.getIndices()),R=!0;var e=w[0];v.blendFunc(e[0],e[1]),v.bindFramebuffer(v.FRAMEBUFFER,null)}a&&a()},e.executeRenderCommand=function(){if(Module.isNative)return 0;for(var o=0,a=0,s=i,h=s[0],l=0,u=1,c=!1;h>l;){switch(s[u]){case 0:v.clear(v.COLOR_BUFFER_BIT),u+=3;break;case 1:a+=U(s[u+1],s[u+2],a),u+=3,o++;break;case 2:var d=w[s[u+1]];d&&v.blendFunc(d[0],d[1]),u+=2;break;case 3:var p=new t.WebGLRenderBuffer(s[u+2],s[u+3]);te[s[u+1]]=p,u+=4;break;case 4:e.activateWebGLBuffer(te[s[u+1]]),u+=2;break;case 5:var f=te[s[u+1]];f.resize(s[u+2],s[u+3]),u+=4;break;case 6:v.enable(v.SCISSOR_TEST),v.scissor(s[u+1],s[u+2],s[u+3],s[u+4]),u+=5;break;case 7:v.disable(v.SCISSOR_TEST),u+=1;break;case 8:var g=e.currentWebGLBuffer;g&&g.rootRenderTarget&&g.rootRenderTarget.enabledStencil(),v.enable(v.STENCIL_TEST),u+=1;break;case 9:v.disable(v.STENCIL_TEST),u+=1;break;case 10:X(s[u+1],a),a+=6,u+=2;break;case 11:j(s[u+1],a),a+=6,u+=2;break;case 12:s[u+1]&&v.clear(v.COLOR_BUFFER_BIT),s[u+2]&&v.clear(v.DEPTH_BUFFER_BIT),s[u+3]&&v.clear(v.STENCIL_BUFFER_BIT),u+=4;break;case 14:var y=r.subarray(s[u+1],s[u+2]);v.bufferData(v.ARRAY_BUFFER,y,v.STREAM_DRAW),u+=3,a=0;break;case 15:var b=te[s[u+1]],$=s[u+2];Z(b.rootRenderTarget.texture,$,a),a+=3*$,u+=3,o++;break;case 19:a+=Y(s[u+1],s[u+2],a,s[u+3]),u+=4,o++;break;case 20:a+=G(s[u+1],s[u+2],a,s[u+3]),u+=4,o++;break;case 21:a+=I(s[u+1],s[u+2],a),u+=3,o++;break;case 22:a+=W(s[u+1],s[u+2],a),u+=3,o++;break;case 23:a+=D(s[u+1],s[u+2],a,s[u+2]),u+=4,o++;break;case 24:a+=H(s[u+1],s[u+2],a,s[u+2]),u+=4,o++;break;case 25:c=1===s[u+1],u+=2;break;case 26:if(c){var T=n.subarray(s[u+1],s[u+2]);v.bufferData(v.ELEMENT_ARRAY_BUFFER,T,v.STATIC_DRAW),R=!1}else R||m.uploadIndicesArray(m.vao.getIndices());u+=3,a=0;break;case 500:x.clearRect(0,0,e.currentCanvasBuffer.width,e.currentCanvasBuffer.height),u+=1;break;case 501:var _=re[s[u+1]];_.isTexture||(_=_.source),x.drawImage(_,s[u+2],s[u+3],s[u+4],s[u+5],s[u+6],s[u+7],s[u+8],s[u+9]),u+=10,o++;break;case 502:x.save(),u+=1;break;case 503:x.restore(),u+=1;break;case 504:x.setTransform(s[u+1],s[u+2],s[u+3],s[u+4],s[u+5],s[u+6]),u+=7;break;case 505:x.globalAlpha=s[u+1],u+=2;break;case 506:x.globalCompositeOperation=C[s[u+1]],u+=2;break;case 507:x.beginPath(),x.rect(s[u+1],s[u+2],s[u+3],s[u+4]),x.clip(),u+=5;break;case 508:var E=new t.CanvasRenderBuffer(s[u+2],s[u+3]);te[s[u+1]]=E,u+=4;break;case 509:q(te[s[u+1]]),u+=2;break;case 510:var S=te[s[u+1]];S.resize(s[u+2],s[u+3]),u+=4;break;case 511:var O=te[s[u+1]];x.drawImage(O.surface,s[u+2],s[u+3],s[u+4],s[u+5],s[u+6],s[u+7],s[u+8],s[u+9]),u+=10;break;case 512:F(s[u+1],s[u+2],s[u+3]),u+=4,o++;break;case 513:L(s[u+1],s[u+2],s[u+3]),u+=4,o++;break;default:return void console.log("no cmds="+s[u])}l++}return o};var F=function(t,e,i){var r=ee[t];r.$graphicsNode&&(x.translate(e,i),he.renderGraphics(r.$graphicsNode,x,!1),x.translate(-e,-i)),he.renderText(r.$renderNode,x,e,i)},L=function(t,i,r){var n=ie[t];x.translate(i,r),he.renderGraphics(n.$renderNode,x,e.forHitTest),x.translate(-i,-r)},D=function(t,e,i,r){var n=ee[t];N(t);var o=n.$renderNode,a=se[r];return K(o.$texture,e,i,a,a.type,null,null),3*e},I=function(t,e,i){var r=ee[t];N(t);var n=r.$renderNode;return Z(n.$texture,e,i),3*e},N=function(e){var i=ee[e],r=i.$renderNode,n=r.width-r.x,o=r.height-r.y;if(z&&z.context?r.dirtyRender&&z.resize(n,o):z=new t.CanvasRenderBuffer(n,o),r.dirtyRender){var a=z.surface;i.$graphicsNode&&(z.context.translate(-r.x,-r.y),he.renderGraphics(i.$graphicsNode,z.context,!1),z.context.translate(r.x,r.y)),he.renderText(r,z.context,-r.x,-r.y);var s=r.$texture;s?m.updateTexture(s,a):(s=m.createTexture(a),r.$texture=s),r.$textureWidth=a.width,r.$textureHeight=a.height}r.dirtyRender=!1},P=function(t,e){if(-1==t.indexOf("r"))t=t.replace(/#/,""),e.color=parseInt(t,16);else{t=t.replace(/rgba\(/,""),t=t.replace(/\)/,"");var i=t.split(",");e.color=Number(i[0])<<16|Number(i[1])<<8|Number(i[2]),e.alpha=Number(i[3])}},M=function(t,e){e.push(1023);for(var i=t.$data,r=t.$commands,n=r.length,o=0,a=0;n>a;a++){var s=r[a];switch(s){case 4:e.push(1024),e.push(i[o++]),e.push(i[o++]),e.push(i[o++]),e.push(i[o++]),e.push(i[o++]),e.push(i[o++]);break;case 3:e.push(1025),e.push(i[o++]),e.push(i[o++]),e.push(i[o++]),e.push(i[o++]);break;case 2:e.push(1026),e.push(i[o++]),e.push(i[o++]);break;case 1:e.push(1027),e.push(i[o++]),e.push(i[o++])}}},B=function(e){var i=ee[e],r=i.$renderNode,n=r.width-r.x,o=r.height-r.y;if(!ne[e]){var a={x:r.x,y:r.y,width:r.width,height:r.height,renderCmds:[],renderParms:""};ne[e]=a}var s=-r.x,h=-r.y,l=ne[e],u=l.renderCmds;if(r.dirtyRender){u.length=0,l.renderParms="",u.push(1010),u.push(1),l.x=r.x,l.y=r.y,l.width=r.width,l.height=r.height,u.push(1011),u.push(n),u.push(o),i.$graphicsNode&&(u.push(1020),u.push(-r.x),u.push(-r.y),u.push(1015),k(e,i.$graphicsNode,u),u.push(1016),u.push(1020),u.push(r.x),u.push(r.y));for(var c=r.drawData,d=c.length,p=0;d>p;){var f=c[p++],g=c[p++],y=c[p++],v=c[p++],m=null==v.textColor?r.textColor:v.textColor,b=null==v.strokeColor?r.strokeColor:v.strokeColor,$=null==v.stroke?r.stroke:v.stroke;u.push(1012);var x=t.getFontString(r,v),T="",_=-1,E=x.split(",");if(E.length>0){for(var w=E[0].split(" "),C=0;C<w.length;C++)if(-1!=w[C].indexOf("px")){_=Number(w[C].replace(/px/,"")),T=x.substring(x.indexOf(w[C])+w[C].length+1);break}u.push(_),l.renderParms+=T,-1==x.indexOf("bold")?u.push(0):u.push(1),-1==x.indexOf("italic")?u.push(0):u.push(1),l.renderParms+=";";var S=0,O=void 0,A=void 0,R=t.toColorString(m);if(-1==R.indexOf("r"))R=R.replace(/#/,""),S=parseInt(R,16);else{R=R.replace(/rgba\(/,""),R=R.replace(/\)/,"");var F=R.split(",");O=Number(F[0])<<16|Number(F[1])<<8|Number(F[2]),A=Number(w[3])}u.push(S);var L=t.toColorString(b),D=0,I=void 0;if(-1==L.indexOf("r"))L=L.replace(/#/,""),D=parseInt(L,16);else{L=L.replace(/rgba\(/,""),L=L.replace(/\)/,"");var N=L.split(",");D=Number(N[0])<<16|Number(N[1])<<8|Number(N[2]),I=Number(w[3])}u.push(D),l.renderParms+=y,l.renderParms+=";",$&&(u.push(1013),u.push(2*$)),u.push(1014),u.push(f+s),u.push(g+h)}}i.$waNode.setDataToTextField(e,u),r.dirtyRender=!1}},k=function(i,r,n){void 0===n&&(n=null);var o=r.width,a=r.height,s=!1;if(null===n){if(!ae[i]){var h={x:r.x,y:r.y,width:r.width,height:r.height,renderCmds:[]};ae[i]=h}var l=ae[i];l.x=r.x,l.y=r.y,l.width=r.width,l.height=r.height,l.renderCmds.length=0,n=l.renderCmds,s=!0}if(r.dirtyRender||e.forHitTest){n.push(1010),n.push(1),n.push(1011),n.push(o),n.push(a),(r.x||r.y)&&(n.push(1020),n.push(-r.x),n.push(-r.y));for(var u=r.drawData,c=u.length,d={color:0,alpha:1},p=0;c>p;p++){var f=u[p];switch(d.color=0,d.alpha=1,f.type){case 1:var g=f;P(e.forHitTest?t.BLACK_COLOR:t.getRGBAString(g.fillColor,g.fillAlpha),d),n.push(1021),n.push(d.color),n.push(d.alpha),M(f,n),n.push(1028);break;case 2:break;case 3:var y=f,v=y.lineWidth;P(e.forHitTest?t.BLACK_COLOR:t.getRGBAString(y.lineColor,y.lineAlpha),d),n.push(1022),n.push(d.color),n.push(d.alpha),n.push(v);var m=1===v||3===v;m&&(n.push(1020),n.push(.5),n.push(.5)),M(f,n),n.push(1029),m&&(n.push(1020),n.push(-.5),n.push(-.5))}}(r.x||r.y)&&(n.push(1020),n.push(r.x),n.push(r.y)),s&&ie[i].$targetDisplay.$waNode.setGraphicsRenderData(n),e.forHitTest||(r.dirtyRender=!1)}},H=function(i,r,n,o){var a=ie[i].$renderNode,s=a.width,h=a.height;z&&z.context?(a.dirtyRender||e.forHitTest)&&z.resize(s,h):z=new t.CanvasRenderBuffer(s,h),(a.x||a.y)&&(a.dirtyRender||e.forHitTest)&&z.context.translate(-a.x,-a.y);var l=z.surface;if(a.dirtyRender){he.renderGraphics(a,z.context);var u=a.$texture;u?m.updateTexture(u,l):(u=m.createTexture(l),a.$texture=u),a.$textureWidth=l.width,a.$textureHeight=l.height}var c=se[o];return K(a.$texture,r,n,c,c.type,null,null),(a.x||a.y)&&(a.dirtyRender||e.forHitTest)&&z.context.translate(a.x,a.y),e.forHitTest||(a.dirtyRender=!1),3*r},W=function(i,r,n){if(!ie[i])return 3*r;var o=ie[i].$renderNode,a=o.width,s=o.height;z&&z.context?(o.dirtyRender||e.forHitTest)&&z.resize(a,s):z=new t.CanvasRenderBuffer(a,s),(o.x||o.y)&&(o.dirtyRender||e.forHitTest)&&z.context.translate(-o.x,-o.y);var h=z.surface;if(e.forHitTest){he.renderGraphics(o,z.context,!0),t.WebGLUtils.deleteWebGLTexture(h);var l=m.getWebGLTexture(h);Z(l,r,n)}else{if(o.dirtyRender){he.renderGraphics(o,z.context);var l=o.$texture;l?m.updateTexture(l,h):(l=m.createTexture(h),o.$texture=l),o.$textureWidth=h.width,o.$textureHeight=h.height}Z(o.$texture,r,n)}return(o.x||o.y)&&(o.dirtyRender||e.forHitTest)&&z.context.translate(o.x,o.y),e.forHitTest||(o.dirtyRender=!1),3*r},U=function(t,e,i){var r=re[t];if(r){var n=void 0;n=r.isTexture?r:m.getWebGLTexture(r),Z(n,e,i)}return 3*e};e.activateWebGLBuffer=function(t){return t||(t=b),Module.isNative?void y(t.bufferIdForWasm,t.width,t.height):(e.currentWebGLBuffer=t,t.rootRenderTarget.activate(),void m.onResize(t.width,t.height))};var X=function(t,e){v.colorMask(!1,!1,!1,!1),v.stencilFunc(v.EQUAL,t,255),v.stencilOp(v.KEEP,v.KEEP,v.INCR),v.drawElements(v.TRIANGLES,6,v.UNSIGNED_SHORT,2*e),v.stencilFunc(v.EQUAL,t+1,255),v.colorMask(!0,!0,!0,!0),v.stencilOp(v.KEEP,v.KEEP,v.KEEP)},j=function(t,e){v.colorMask(!1,!1,!1,!1),v.stencilFunc(v.EQUAL,t+1,255),v.stencilOp(v.KEEP,v.KEEP,v.DECR),v.drawElements(v.TRIANGLES,6,v.UNSIGNED_SHORT,2*e),v.stencilFunc(v.EQUAL,t,255),v.colorMask(!0,!0,!0,!0),v.stencilOp(v.KEEP,v.KEEP,v.KEEP)},Y=function(t,e,i,r){var n=re[t];if(n){var o=void 0;o=n.isTexture?n:m.getWebGLTexture(n);var a=se[r];K(o,e,i,a,a.type,null,null)}return 3*e},G=function(t,e,i,r){var n=te[t],o=se[r];return K(n.rootRenderTarget.texture,e,i,o,o.type,n.width,n.height),3*e};e.getCurrentBuffer=function(){return l?e.currentWebGLBuffer:e.currentCanvasBuffer},e.getPixels=function(t,i,r,n){if(void 0===r&&(r=1),void 0===n&&(n=1),Module.isNative){var o=new Uint8Array(4*r*n);return g(t,i,r,n,o),o}return e.getCurrentBuffer().getPixels(t,i,r,n)},e.activateBuffer=function(t){l?e.activateWebGLBuffer(t):q(t)};var V,z,q=function(t){t||(t=$),e.currentCanvasBuffer=t,x=t.context},Z=function(e,i,r){var n=t.EgretWebGLProgram.getProgram(v,t.EgretShaderLib.default_vert,t.EgretShaderLib.texture_frag,"texture");J(n),Q(n,null,null,null),v.bindTexture(v.TEXTURE_2D,e),v.drawElements(v.TRIANGLES,3*i,v.UNSIGNED_SHORT,2*r)},K=function(e,i,r,n,o,a,s){var h,l=t.EgretShaderLib.default_vert;"colorTransform"==o?h=t.EgretShaderLib.colorTransform_frag:"blur"==o?h=t.EgretShaderLib.blur_frag:"glow"==o?h=t.EgretShaderLib.glow_frag:"custom"==o&&(l=n.$vertexSrc,h=n.$fragmentSrc);var u=t.EgretWebGLProgram.getProgram(v,l,h,o);J(u),Q(u,n,a,s),v.bindTexture(v.TEXTURE_2D,e),v.drawElements(v.TRIANGLES,3*i,v.UNSIGNED_SHORT,2*r)},J=function(t){if(t!=V){v.useProgram(t.id);var e=t.attributes;for(var i in e)"aVertexPosition"===i?(v.vertexAttribPointer(e.aVertexPosition.location,2,v.FLOAT,!1,20,0),v.enableVertexAttribArray(e.aVertexPosition.location)):"aTextureCoord"===i?(v.vertexAttribPointer(e.aTextureCoord.location,2,v.FLOAT,!1,20,8),v.enableVertexAttribArray(e.aTextureCoord.location)):"aColor"===i&&(v.vertexAttribPointer(e.aColor.location,1,v.FLOAT,!1,20,16),v.enableVertexAttribArray(e.aColor.location));V=t}},Q=function(t,e,i,r){var n=t.uniforms;e&&"custom"===e.type;for(var o in n)if("projectionVector"===o)n[o].setValue({x:m.projectionX,y:m.projectionY});else if("uTextureSize"===o)n[o].setValue({x:i,y:r});else if("uSampler"===o);else{var a=e.$uniforms[o];void 0!==a&&n[o].setValue(a)}},te={},ee=t.createMap(),ie=t.createMap(),re={},ne={},oe={},ae={},se=t.createMap(),he=new t.CanvasRenderer,le=[],ue=[]}(e=t.WebAssembly||(t.WebAssembly={}))}(egret||(egret={}));var egret;!function(t){var e,i,r,n=0,o=1,a=1,s={},h={},l=2,u=0,c=!1,d=function(){function t(t){this.id=n,u=r[0],l=r[1],r[l++]=0,r[l++]=n,r[l++]=t,u++,r[0]=u,r[1]=l,n++}return t.init=function(t,n,o,a,h){r=t,c=n,r[0]=0,r[1]=2,e=o,i=a,s=h},t.update=function(){},t.prototype.addChildAt=function(t,e){u=r[0],l=r[1],r[l++]=3,r[l++]=this.id,r[l++]=t,r[l++]=e,u++,r[0]=u,r[1]=l},t.prototype.removeChild=function(t){u=r[0],l=r[1],r[l++]=2,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.swapChild=function(t,e){u=r[0],l=r[1],r[l++]=4,r[l++]=this.id,r[l++]=t,r[l++]=e,u++,r[0]=u,r[1]=l},t.prototype.setX=function(t){u=r[0],l=r[1],r[l++]=101,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setY=function(t){u=r[0],l=r[1],r[l++]=102,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setRotation=function(t){u=r[0],l=r[1],r[l++]=103,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setScaleX=function(t){u=r[0],l=r[1],r[l++]=104,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setScaleY=function(t){u=r[0],l=r[1],r[l++]=105,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setSkewX=function(t){u=r[0],l=r[1],r[l++]=106,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setSkewY=function(t){u=r[0],l=r[1],r[l++]=107,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setAlpha=function(t){u=r[0],l=r[1],r[l++]=108,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setAnchorOffsetX=function(t){u=r[0],l=r[1],r[l++]=116,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setAnchorOffsetY=function(t){u=r[0],l=r[1],r[l++]=117,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setVisible=function(t){u=r[0],l=r[1],r[l++]=118,r[l++]=this.id,r[l++]=t?1:0,u++,r[0]=u,r[1]=l},t.prototype.setBlendMode=function(t){u=r[0],l=r[1],r[l++]=126,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setMaskRect=function(t,e,i,n){u=r[0],l=r[1],r[l++]=127,r[l++]=this.id,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,u++,r[0]=u,r[1]=l},t.prototype.setScrollRect=function(t,e,i,n){u=r[0],l=r[1],r[l++]=128,r[l++]=this.id,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,u++,r[0]=u,r[1]=l},t.prototype.setFilters=function(t){if(u=r[0],l=r[1],!t)return r[l++]=134,r[l++]=this.id,r[l++]=0,u++,r[0]=u,void(r[1]=l);r[l++]=134,r[l++]=this.id;for(var e=l++,i=t.length,n=i,o=0;i>o;o++){var a=t[o];if("blur"==a.type){var s=a;0!=s.$blurX&&0!=s.$blurY?(n++,r[l++]=s.blurXFilter.$id,r[l++]=s.blurYFilter.$id):0!=s.$blurX?r[l++]=s.blurXFilter.$id:0!=s.$blurY?r[l++]=s.blurYFilter.$id:n--}else r[l++]=a.$id}r[e]=n,u++,r[0]=u,r[1]=l},t.createFilter=function(t){u=r[0],l=r[1],t.$id=a,i[a]=t,a++,r[l++]=0,r[l++]=t.$id,r[l++]=6,u++,r[0]=u,r[1]=l},t.setFilterPadding=function(t,e,i,n,o){u=r[0],l=r[1],r[l++]=136,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,r[l++]=o,u++,r[0]=u,r[1]=l},t.prototype.setMask=function(t){u=r[0],l=r[1],r[l++]=131,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.setValuesToBitmapData=function(t){u=r[0],l=r[1];var i=t.bitmapData;i.$bitmapDataId||(i.$bitmapDataId=o,e[o]=i,o++),t.$textureId||(t.$textureId=o,r[l++]=0,r[l++]=o,r[l++]=2,u++,r[l++]=122,r[l++]=t.$textureId,r[l++]=t._bitmapX,r[l++]=t._bitmapY,r[l++]=t._bitmapWidth,r[l++]=t._bitmapHeight,r[l++]=t._offsetX,r[l++]=t._offsetY,r[l++]=t.$getTextureWidth(),r[l++]=t.$getTextureHeight(),r[l++]=t._sourceWidth,r[l++]=t._sourceHeight,u++,r[l++]=123,r[l++]=t.$textureId,r[l++]=i.$bitmapDataId,u++,o++),r[0]=u,r[1]=l},t.setValuesToRenderBuffer=function(t){u=r[0],l=r[1];var i;return t.rootRenderTarget?i=t.rootRenderTarget.texture:t.texture?i=t.texture:(i={},t.texture=i),i.$bitmapDataId||(i.isTexture=!0,i.$bitmapDataId=o,e[o]=i,r[l++]=0,r[l++]=i.$bitmapDataId,r[l++]=2,u++,r[l++]=123,r[l++]=i.$bitmapDataId,r[l++]=i.$bitmapDataId,u++,o++,t.bufferIdForWasm=o),r[0]=u,r[1]=l,i.$bitmapDataId},t.prototype.setBitmapData=function(i){if(u=r[0],l=r[1],!i)return r[l++]=121,r[l++]=this.id,r[l++]=-1,u++,r[0]=u,void(r[1]=l);if(i.$renderBuffer){var n=void 0;n=i.$renderBuffer.rootRenderTarget?i.$renderBuffer.rootRenderTarget.texture:i.$renderBuffer.texture?i.$renderBuffer.texture:i.$renderBuffer.surface,n.$bitmapDataId||(n.isTexture=!0,n.$bitmapDataId=o,e[o]=n,r[l++]=0,r[l++]=n.$bitmapDataId,r[l++]=2,u++,r[l++]=123,r[l++]=n.$bitmapDataId,r[l++]=n.$bitmapDataId,u++,o++),r[l++]=122,r[l++]=n.$bitmapDataId,r[l++]=i._bitmapX,r[l++]=i._bitmapY,r[l++]=i._bitmapWidth,r[l++]=i._bitmapHeight,r[l++]=i._offsetY,r[l++]=i._offsetX,r[l++]=i.textureHeight,r[l++]=i.textureWidth,r[l++]=i._sourceWidth,r[l++]=i._sourceHeight,u++,r[l++]=121,r[l++]=this.id,r[l++]=n.$bitmapDataId,u++}else t.setValuesToBitmapData(i),r[l++]=121,r[l++]=this.id,r[l++]=i.$textureId,u++;r[0]=u,r[1]=l},t.prototype.setBitmapDataToMesh=function(e){return u=r[0],l=r[1],e?(t.setValuesToBitmapData(e),r[l++]=147,r[l++]=this.id,r[l++]=e.$textureId,u++,r[0]=u,void(r[1]=l)):(r[l++]=147,r[l++]=this.id,r[l++]=-1,u++,r[0]=u,void(r[1]=l))},t.prototype.setBitmapDataToParticle=function(e){u=r[0],l=r[1],t.setValuesToBitmapData(e),r[l++]=902,r[l++]=this.id,r[l++]=e.$textureId,u++,r[0]=u,r[1]=l},t.prototype.setStopToParticle=function(t){u=r[0],l=r[1],r[l++]=903,r[l++]=this.id,r[l++]=t?1:0,u++,r[0]=u,r[1]=l},t.prototype.setCustomData=function(t){u=r[0],l=r[1],r[l++]=901,r[l++]=this.id;t.length;r[l++]=t.length;for(var e=0;e<t.length;e++)r[l++]=t[e];u++,r[0]=u,r[1]=l},t.prototype.setWidth=function(t){u=r[0],l=r[1],r[l++]=114,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setHeight=function(t){u=r[0],l=r[1],r[l++]=115,r[l++]=this.id,r[l++]=t,u++,r[0]=u,r[1]=l},t.prototype.setCacheAsBitmap=function(t){u=r[0],l=r[1],r[l++]=135,r[l++]=this.id,r[l++]=t?1:0,u++,r[0]=u,r[1]=l},t.prototype.setScale9Grid=function(t,e,i,n){u=r[0],l=r[1],r[l++]=124,r[l++]=this.id,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,u++,r[0]=u,r[1]=l},t.prototype.setMatrix=function(t,e,i,n,o,a){u=r[0],l=r[1],r[l++]=125,r[l++]=this.id,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,r[l++]=o,r[l++]=a,u++,r[0]=u,r[1]=l},t.prototype.setIsTyping=function(t){u=r[0],l=r[1],r[l++]=137,r[l++]=this.id,r[l++]=t?1:0,u++,r[0]=u,r[1]=l},t.prototype.setTextRect=function(t,e,i,n){u=r[0],l=r[1],r[l++]=138,r[l++]=this.id,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,u++,r[0]=u,r[1]=l},t.prototype.setGraphicsRect=function(t,e,i,n,o){u=r[0],l=r[1],o?r[l++]=143:r[l++]=139,r[l++]=this.id,r[l++]=t,r[l++]=e,r[l++]=i,r[l++]=n,u++,r[0]=u,r[1]=l},t.prototype.setGraphicsRenderData=function(t){u=r[0],l=r[1],r[l++]=1003,r[l++]=this.id;var e=t.length;r[l++]=e;for(var i=0;e>i;i++)r[l++]=t[i];u++,r[0]=u,r[1]=l},t.prototype.setDataToBitmapNode=function(e,i,n){u=r[0],l=r[1],t.setValuesToBitmapData(i),r[l++]=1001,r[l++]=e,r[l++]=i._bitmapData.$bitmapDataId;var o=n.length;r[l++]=o/10;for(var a=0;o>a;a++)r[l++]=n[a];u++,r[0]=u,r[1]=l},t.prototype.setDataToMesh=function(t,e,i){u=r[0],l=r[1],r[l++]=144,r[l++]=this.id;var n=t.length;r[l++]=n;for(var o=0;n>o;o++)r[l++]=t[o];r[l++]=146,r[l++]=this.id,n=e.length,r[l++]=n;for(var o=0;n>o;o++)r[l++]=e[o];r[l++]=145,r[l++]=this.id,n=i.length,r[l++]=n;for(var o=0;n>o;o++)r[l++]=i[o];u+=3,r[0]=u,r[1]=l},t.setDataToFilter=function(t){if(c!==!1){u=r[0],l=r[1];var e,n=i[t],o=[];h[n.$id]||(h[n.$id]=[]);var a=h[n.$id],d="",p="";"custom"==n.type?(d=n.$vertexSrc,p=n.$fragmentSrc,e=4):"colorTransform"==n.type?e=1:"blur"==n.type?e=2:"glow"==n.type&&(e=3);var f="",g=0,y=n.$uniforms;for(var v in y)f+=v,f+=" ",a[g]=v,g++;s[n.$id]={vertexSrc:d,fragmentSrc:p,uniformsSrc:f};for(var m=0;m<a.length;m++){var b=y[a[m]],$=typeof b;if("number"==$)o.push(1),o.push(b);else if(b instanceof Array){o.push(b.length);for(var x=0;x<b.length;x++)o.push(b[x])}else if("object"==$){o.push(1);var T=1;null!==b.x&&void 0!==b.x&&(T++,o.push(b.x)),null!==b.y&&void 0!==b.y&&(T++,o.push(b.y)),null!==b.z&&void 0!==b.z&&(T++,o.push(b.z)),null!==b.w&&void 0!==b.w&&(T++,o.push(b.w)),o[o.length-T]=T-1}}r[l++]=1004,r[l++]=t,r[l++]=e;var _=o.length;r[l++]=_;for(var m=0;_>m;m++)r[l++]=o[m];u++,r[0]=u,r[1]=l}},t.prototype.setDataToTextField=function(t,e){u=r[0],l=r[1],r[l++]=1002,r[l++]=t;var i=e.length;r[l++]=i;for(var n=0;i>n;n++)r[l++]=e[n];u++,r[0]=u,r[1]=l},t.prototype.disposeDisplayObject=function(){u=r[0],l=r[1],r[l++]=140,r[l++]=this.id,u++,r[0]=u,r[1]=l},t.disposeTexture=function(t){u=r[0],l=r[1],r[l++]=141,r[l++]=t.$textureId,u++,r[0]=u,r[1]=l},t.disposeBitmapData=function(t){t.$bitmapDataId&&delete e[t.$bitmapDataId]},t.disposeFilter=function(t){u=r[0],l=r[1],r[l++]=142,r[l++]=t.$id,u++,r[0]=u,r[1]=l,delete i[t.$id];var e=t;e.blurXFilter&&delete i[e.blurXFilter.$id],e.blurYFilter&&delete i[e.blurYFilter.$id]},t}();t.WebAssemblyNode=d,__reflect(d.prototype,"egret.WebAssemblyNode")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,i){var r=t.call(this,e)||this;return r.firstCharHeight=0,"string"==typeof i?r.charList=r.parseConfig(i):i&&i.hasOwnProperty("frames")?r.charList=i.frames:r.charList={},r}return __extends(e,t),e.prototype.getTexture=function(t){var e=this._textureMap[t];if(!e){var i=this.charList[t];if(!i)return null;e=this.createTexture(t,i.x,i.y,i.w,i.h,i.offX,i.offY,i.sourceW,i.sourceH),this._textureMap[t]=e}return e},e.prototype.getConfig=function(t,e){return this.charList[t]?this.charList[t][e]:0},e.prototype._getFirstCharHeight=function(){if(0==this.firstCharHeight)for(var t in this.charList){var e=this.charList[t];if(e){var i=e.sourceH;if(void 0===i){var r=e.h;void 0===r&&(r=0);var n=e.offY;void 0===n&&(n=0),i=r+n}if(0>=i)continue;this.firstCharHeight=i;break}}return this.firstCharHeight},e.prototype.parseConfig=function(t){t=t.split("\r\n").join("\n");for(var e=t.split("\n"),i=this.getConfigByKey(e[3],"count"),r={},n=4;4+i>n;n++){var o=e[n],a=String.fromCharCode(this.getConfigByKey(o,"id")),s={};r[a]=s,s.x=this.getConfigByKey(o,"x"),s.y=this.getConfigByKey(o,"y"),s.w=this.getConfigByKey(o,"width"),s.h=this.getConfigByKey(o,"height"),s.offX=this.getConfigByKey(o,"xoffset"),s.offY=this.getConfigByKey(o,"yoffset"),s.xadvance=this.getConfigByKey(o,"xadvance")}return r},e.prototype.getConfigByKey=function(t,e){for(var i=t.split(" "),r=0,n=i.length;n>r;r++){var o=i[r];if(e==o.substring(0,e.length)){var a=o.substring(e.length+1);return parseInt(a)}}return 0},e}(t.SpriteSheet);t.BitmapFont=e,__reflect(e.prototype,"egret.BitmapFont")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i.$smoothing=t.Bitmap.defaultSmoothing,i.$text="",i.$textFieldWidth=0/0,i.$textLinesChanged=!1,i.$textFieldHeight=0/0,i.$font=null,i.$fontStringChanged=!1,i.$lineSpacing=0,i.$letterSpacing=0,i.$textAlign=t.HorizontalAlign.LEFT,i.$verticalAlign=t.VerticalAlign.TOP,i.$textWidth=0/0,i.$textHeight=0/0,i.$textOffsetX=0,i.$textOffsetY=0,i.$textStartX=0,i.$textStartY=0,i.$lineHeights=[],i}return __extends(i,e),i.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(11)},Object.defineProperty(i.prototype,"smoothing",{get:function(){return this.$smoothing},set:function(t){var e=this;t!=e.$smoothing&&(e.$smoothing=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this.$text},set:function(t){this.$setText(t)},enumerable:!0,configurable:!0}),i.prototype.$setText=function(t){null==t&&(t=""),t=String(t);var e=this;return t==e.$text?!1:(e.$text=t,e.$invalidateContentBounds(),!0)},i.prototype.$getWidth=function(){var t=this,e=t.$textFieldWidth;return isNaN(e)?t.$getContentBounds().width:e},i.prototype.$setWidth=function(t){var e=this;return 0>t||t==e.$textFieldWidth?!1:(e.$textFieldWidth=t,e.$invalidateContentBounds(),!0)},i.prototype.$invalidateContentBounds=function(){this.$renderDirty=!0,this.$textLinesChanged=!0,this.$updateRenderNode()},i.prototype.$getHeight=function(){var t=this,e=t.$textFieldHeight;return isNaN(e)?t.$getContentBounds().height:e},i.prototype.$setHeight=function(t){var e=this;return 0>t||t==e.$textFieldHeight?!1:(e.$textFieldHeight=t,e.$invalidateContentBounds(),!0)},Object.defineProperty(i.prototype,"font",{get:function(){return this.$font},set:function(t){this.$setFont(t)},enumerable:!0,configurable:!0}),i.prototype.$setFont=function(t){var e=this;return e.$font==t?!1:(e.$font=t,e.$fontStringChanged=!0,this.$invalidateContentBounds(),!0)},Object.defineProperty(i.prototype,"lineSpacing",{get:function(){return this.$lineSpacing},set:function(t){this.$setLineSpacing(t)},enumerable:!0,configurable:!0}),i.prototype.$setLineSpacing=function(t){var e=this;return e.$lineSpacing==t?!1:(e.$lineSpacing=t,e.$invalidateContentBounds(),!0)},Object.defineProperty(i.prototype,"letterSpacing",{get:function(){return this.$letterSpacing},set:function(t){this.$setLetterSpacing(t)},enumerable:!0,configurable:!0}),i.prototype.$setLetterSpacing=function(t){var e=this;return e.$letterSpacing==t?!1:(e.$letterSpacing=t,e.$invalidateContentBounds(),!0)},Object.defineProperty(i.prototype,"textAlign",{get:function(){return this.$textAlign},set:function(t){this.$setTextAlign(t)},enumerable:!0,configurable:!0}),i.prototype.$setTextAlign=function(t){var e=this;return e.$textAlign==t?!1:(e.$textAlign=t,e.$invalidateContentBounds(),!0)},Object.defineProperty(i.prototype,"verticalAlign",{get:function(){return this.$verticalAlign},set:function(t){this.$setVerticalAlign(t)},enumerable:!0,configurable:!0}),i.prototype.$setVerticalAlign=function(t){var e=this;return e.$verticalAlign==t?!1:(e.$verticalAlign=t,e.$invalidateContentBounds(),!0)},i.prototype.$updateRenderNode=function(){var e=this,r=this.$getTextLines(),n=r.length;if(0!=n){for(var o=[],a=this.$textLinesWidth,s=e.$font,h=s._getFirstCharHeight(),l=Math.ceil(h*i.EMPTY_FACTOR),u=!isNaN(e.$textFieldHeight),c=e.$textWidth,d=e.$textFieldWidth,p=e.$textFieldHeight,f=e.$textAlign,g=this.$textOffsetY+this.$textStartY,y=this.$lineHeights,v=0;n>v;v++){var m=y[v];if(u&&v>0&&g+m>p)break;var b=r[v],$=b.length,x=this.$textOffsetX;if(f!=t.HorizontalAlign.LEFT){var T=d>c?d:c;f==t.HorizontalAlign.RIGHT?x+=T-a[v]:f==t.HorizontalAlign.CENTER&&(x+=Math.floor((T-a[v])/2))}for(var _=0;$>_;_++){var E=b.charAt(_),w=s.getTexture(E);if(w){var C=w._bitmapWidth,S=w._bitmapHeight;o.push(w._bitmapX,w._bitmapY,C,S,x+w._offsetX,g+w._offsetY,w.$getScaleBitmapWidth(),w.$getScaleBitmapHeight(),w._sourceWidth,w._sourceHeight),x+=(s.getConfig(E,"xadvance")||w.$getTextureWidth())+e.$letterSpacing}else" "==E?x+=l:t.$warn(1046,E)}g+=m+e.$lineSpacing}e.$waNode.setDataToBitmapNode(e.$waNode.id,s.$texture,o);var O=e.$getContentBounds();e.$waNode.setWidth(O.width),e.$waNode.setHeight(O.height)}},i.prototype.$measureContentBounds=function(t){var e=this.$getTextLines();0==e.length?t.setEmpty():t.setTo(this.$textOffsetX+this.$textStartX,this.$textOffsetY+this.$textStartY,this.$textWidth-this.$textOffsetX,this.$textHeight-this.$textOffsetY)},Object.defineProperty(i.prototype,"textWidth",{get:function(){return this.$getTextLines(),this.$textWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"textHeight",{get:function(){return this.$getTextLines(),this.$textHeight},enumerable:!0,configurable:!0}),i.prototype.$getTextLines=function(){function e(t){return b&&n.length>0&&f>b?!1:(f+=l+c,s||h||(u-=d),n.push(t),a.push(l),o.push(u),p=Math.max(u,p),!0)}var r=this;if(!r.$textLinesChanged)return r.textLines;var n=[];r.textLines=n;var o=[];r.$textLinesWidth=o,r.$textLinesChanged=!1;var a=[];
if(r.$lineHeights=a,!r.$text||!r.$font)return n;for(var s,h,l,u,c=r.$lineSpacing,d=r.$letterSpacing,p=0,f=0,g=0,y=0,v=!isNaN(r.$textFieldWidth),m=r.$textFieldWidth,b=r.$textFieldHeight,$=r.$font,x=$._getFirstCharHeight(),T=Math.ceil(x*i.EMPTY_FACTOR),_=r.$text,E=_.split(/(?:\r\n|\r|\n)/),w=E.length,C=!0,S=0;w>S;S++){var O=E[S],A=O.length;l=0,u=0,s=!0,h=!1;for(var R=0;A>R;R++){s||(u+=d);var F=O.charAt(R),L=void 0,D=void 0,I=0,N=0,P=$.getTexture(F);if(P)L=P.$getTextureWidth(),D=P.$getTextureHeight(),I=P._offsetX,N=P._offsetY;else{if(" "!=F){t.$warn(1046,F),s&&(s=!1);continue}L=T,D=x}if(s&&(s=!1,g=Math.min(I,g)),C&&(C=!1,y=Math.min(N,y)),v&&R>0&&u+L>m){if(!e(O.substring(0,R)))break;O=O.substring(R),A=O.length,R=0,u=R==A-1?L:$.getConfig(F,"xadvance")||L,l=D}else u+=R==A-1?L:$.getConfig(F,"xadvance")||L,l=Math.max(D,l)}if(b&&S>0&&f>b)break;if(h=!0,!e(O))break}f-=c,r.$textWidth=p,r.$textHeight=f,this.$textOffsetX=g,this.$textOffsetY=y,this.$textStartX=0,this.$textStartY=0;var M;return m>p&&(M=r.$textAlign,M==t.HorizontalAlign.RIGHT?this.$textStartX=m-p:M==t.HorizontalAlign.CENTER&&(this.$textStartX=Math.floor((m-p)/2))),b>f&&(M=r.$verticalAlign,M==t.VerticalAlign.BOTTOM?this.$textStartY=b-f:M==t.VerticalAlign.MIDDLE&&(this.$textStartY=Math.floor((b-f)/2))),n},i.EMPTY_FACTOR=.33,i}(t.DisplayObject);t.BitmapText=e,__reflect(e.prototype,"egret.BitmapText")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.LEFT="left",t.RIGHT="right",t.CENTER="center",t.JUSTIFY="justify",t.CONTENT_JUSTIFY="contentJustify",t}();t.HorizontalAlign=e,__reflect(e.prototype,"egret.HorizontalAlign")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){this.replaceArr=[],this.resutlArr=[],this.initReplaceArr()}return e.prototype.initReplaceArr=function(){this.replaceArr=[],this.replaceArr.push([/&lt;/g,"<"]),this.replaceArr.push([/&gt;/g,">"]),this.replaceArr.push([/&amp;/g,"&"]),this.replaceArr.push([/&quot;/g,'"']),this.replaceArr.push([/&apos;/g,"'"])},e.prototype.replaceSpecial=function(t){for(var e=0;e<this.replaceArr.length;e++){var i=this.replaceArr[e][0],r=this.replaceArr[e][1];t=t.replace(i,r)}return t},e.prototype.parse=function(e){this.stackArray=[],this.resutlArr=[];for(var i=0,r=e.length;r>i;){var n=e.indexOf("<",i);if(0>n)this.addToResultArr(e.substring(i)),i=r;else{this.addToResultArr(e.substring(i,n));var o=e.indexOf(">",n);-1==o?(t.$error(1038),o=n):"/"==e.charAt(n+1)?this.stackArray.pop():this.addToArray(e.substring(n+1,o)),i=o+1}}return this.resutlArr},e.prototype.parser=function(t){return this.parse(t)},e.prototype.addToResultArr=function(t){""!=t&&(t=this.replaceSpecial(t),this.stackArray.length>0?this.resutlArr.push({text:t,style:this.stackArray[this.stackArray.length-1]}):this.resutlArr.push({text:t}))},e.prototype.changeStringToObject=function(t){t=t.trim();var e={},i=[];if("i"==t.charAt(0)||"b"==t.charAt(0)||"u"==t.charAt(0))this.addProperty(e,t,"true");else if(i=t.match(/^(font|a)\s/)){t=t.substring(i[0].length).trim();for(var r=0,n=void 0;n=t.match(this.getHeadReg());){var o=n[0],a="";t=t.substring(o.length).trim(),'"'==t.charAt(0)?(r=t.indexOf('"',1),a=t.substring(1,r),r+=1):"'"==t.charAt(0)?(r=t.indexOf("'",1),a=t.substring(1,r),r+=1):(a=t.match(/(\S)+/)[0],r=a.length),this.addProperty(e,o.substring(0,o.length-1).trim(),a.trim()),t=t.substring(r).trim()}}return e},e.prototype.getHeadReg=function(){return/^(color|textcolor|strokecolor|stroke|b|bold|i|italic|u|size|fontfamily|href|target)(\s)*=/},e.prototype.addProperty=function(t,e,i){switch(e.toLowerCase()){case"color":case"textcolor":i=i.replace(/#/,"0x"),t.textColor=parseInt(i);break;case"strokecolor":i=i.replace(/#/,"0x"),t.strokeColor=parseInt(i);break;case"stroke":t.stroke=parseInt(i);break;case"b":case"bold":t.bold="true"==i;break;case"u":t.underline="true"==i;break;case"i":case"italic":t.italic="true"==i;break;case"size":t.size=parseInt(i);break;case"fontfamily":t.fontFamily=i;break;case"href":t.href=this.replaceSpecial(i);break;case"target":t.target=this.replaceSpecial(i)}},e.prototype.addToArray=function(t){var e=this.changeStringToObject(t);if(0==this.stackArray.length)this.stackArray.push(e);else{var i=this.stackArray[this.stackArray.length-1];for(var r in i)null==e[r]&&(e[r]=i[r]);this.stackArray.push(e)}},e}();t.HtmlTextParser=e,__reflect(e.prototype,"egret.HtmlTextParser")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var t=e.call(this)||this;return t.stageTextAdded=!1,t._text=null,t._isFocus=!1,t}return __extends(i,e),i.prototype.init=function(e){this._text=e,this.stageText=new t.StageText,this.stageText.$setTextField(this._text)},i.prototype._addStageText=function(){this.stageTextAdded||(this._text.$inputEnabled||(this._text.$touchEnabled=!0),this.tempStage=this._text.stage,this.stageText.$addToStage(),this.stageText.addEventListener("updateText",this.updateTextHandler,this),this._text.addEventListener(t.TouchEvent.TOUCH_BEGIN,this.onMouseDownHandler,this),this.stageText.addEventListener("blur",this.blurHandler,this),this.stageText.addEventListener("focus",this.focusHandler,this),this.stageTextAdded=!0)},i.prototype._removeStageText=function(){this.stageTextAdded&&(this._text.$inputEnabled||(this._text.$touchEnabled=!1),this.stageText.$removeFromStage(),this.stageText.removeEventListener("updateText",this.updateTextHandler,this),this._text.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onMouseDownHandler,this),this.tempStage.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onStageDownHandler,this),this.stageText.removeEventListener("blur",this.blurHandler,this),this.stageText.removeEventListener("focus",this.focusHandler,this),this.stageTextAdded=!1)},i.prototype._getText=function(){return this.stageText.$getText()},i.prototype._setText=function(t){this.stageText.$setText(t)},i.prototype._setColor=function(t){this.stageText.$setColor(t)},i.prototype.focusHandler=function(e){this._isFocus||(this._isFocus=!0,e.showing||this._text.$setIsTyping(!0),this._text.$invalidateTextField(),this._text.dispatchEvent(new t.FocusEvent(t.FocusEvent.FOCUS_IN,!0)))},i.prototype.blurHandler=function(e){this._isFocus&&(this._isFocus=!1,this.tempStage.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onStageDownHandler,this),this._text.$setIsTyping(!1),this._text.$invalidateTextField(),this.stageText.$onBlur(),this._text.dispatchEvent(new t.FocusEvent(t.FocusEvent.FOCUS_OUT,!0)))},i.prototype.onMouseDownHandler=function(t){this.$onFocus()},i.prototype.$onFocus=function(){this._text.visible&&(this._isFocus||(this.tempStage.addEventListener(t.TouchEvent.TOUCH_BEGIN,this.onStageDownHandler,this),this.stageText.$show()))},i.prototype.onStageDownHandler=function(t){t.$target!=this._text&&this.stageText.$hide()},i.prototype.updateTextHandler=function(e){var i,r,n=this._text.$TextField,o=this.stageText.$getText(),a=!1;null!=n[35]&&(i=new RegExp("["+n[35]+"]","g"),r=o.match(i),o=r?r.join(""):"",a=!0),null!=n[36]&&(i=new RegExp("[^"+n[36]+"]","g"),r=o.match(i),o=r?r.join(""):"",a=!0),a&&this.stageText.$getText()!=o&&this.stageText.$setText(o),this.resetText(),this._text.dispatchEvent(new t.Event(t.Event.CHANGE,!0))},i.prototype.resetText=function(){this._text.$setBaseText(this.stageText.$getText())},i.prototype._hideInput=function(){this.stageText.$removeFromStage()},i.prototype.updateInput=function(){!this._text.$visible&&this.stageText&&this._hideInput()},i.prototype._updateProperties=function(){if(this._isFocus)return this.stageText.$resetStageText(),void this.updateInput();var t=this._text.$stage;if(null==t);else for(var e=this._text,i=e.$visible;;){if(!i)break;if(e=e.parent,e==t)break;i=e.$visible}this.stageText.$setText(this._text.$TextField[13]),this.stageText.$resetStageText(),this.updateInput()},i}(t.HashObject);t.InputController=e,__reflect(e.prototype,"egret.InputController")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.blur_frag="precision mediump float;\nuniform vec2 blur;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\nuniform vec2 uTextureSize;\nvoid main()\n{\n    const int sampleRadius = 5;\n    const int samples = sampleRadius * 2 + 1;\n    vec2 blurUv = blur / uTextureSize;\n    vec4 color = vec4(0, 0, 0, 0);\n    vec2 uv = vec2(0.0, 0.0);\n    blurUv /= float(sampleRadius);\n    for (int i = -sampleRadius; i <= sampleRadius; i++) {\n        uv.x = vTextureCoord.x + float(i) * blurUv.x;\n        uv.y = vTextureCoord.y + float(i) * blurUv.y;\n        color += texture2D(uSampler, uv);\n    }\n    color /= float(samples);\n    gl_FragColor = color;\n}",t.colorTransform_frag="precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\n    vec4 texColor = texture2D(uSampler, vTextureCoord);\n    if(texColor.a > 0.) {\n        texColor = vec4(texColor.rgb / texColor.a, texColor.a);\n    }\n    vec4 locColor = clamp(texColor * matrix + colorAdd, 0., 1.);\n    gl_FragColor = vColor * vec4(locColor.rgb * locColor.a, locColor.a);\n}",t.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n   gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n   vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",t.glow_frag="precision mediump float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float dist;\nuniform float angle;\nuniform vec4 color;\nuniform float alpha;\nuniform float blurX;\nuniform float blurY;\nuniform float strength;\nuniform float inner;\nuniform float knockout;\nuniform float hideObject;\nuniform vec2 uTextureSize;\nfloat random(vec3 scale, float seed)\n{\n    return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\nvoid main(void) {\n    vec2 px = vec2(1.0 / uTextureSize.x, 1.0 / uTextureSize.y);\n    const float linearSamplingTimes = 7.0;\n    const float circleSamplingTimes = 12.0;\n    vec4 ownColor = texture2D(uSampler, vTextureCoord);\n    vec4 curColor;\n    float totalAlpha = 0.0;\n    float maxTotalAlpha = 0.0;\n    float curDistanceX = 0.0;\n    float curDistanceY = 0.0;\n    float offsetX = dist * cos(angle) * px.x;\n    float offsetY = dist * sin(angle) * px.y;\n    const float PI = 3.14159265358979323846264;\n    float cosAngle;\n    float sinAngle;\n    float offset = PI * 2.0 / circleSamplingTimes * random(vec3(12.9898, 78.233, 151.7182), 0.0);\n    float stepX = blurX * px.x / linearSamplingTimes;\n    float stepY = blurY * px.y / linearSamplingTimes;\n    for (float a = 0.0; a <= PI * 2.0; a += PI * 2.0 / circleSamplingTimes) {\n        cosAngle = cos(a + offset);\n        sinAngle = sin(a + offset);\n        for (float i = 1.0; i <= linearSamplingTimes; i++) {\n            curDistanceX = i * stepX * cosAngle;\n            curDistanceY = i * stepY * sinAngle;\n            \n            curColor = texture2D(uSampler, vec2(vTextureCoord.x + curDistanceX - offsetX, vTextureCoord.y + curDistanceY + offsetY));\n            totalAlpha += (linearSamplingTimes - i) * curColor.a;\n            maxTotalAlpha += (linearSamplingTimes - i);\n        }\n    }\n    ownColor.a = max(ownColor.a, 0.0001);\n    ownColor.rgb = ownColor.rgb / ownColor.a;\n    float outerGlowAlpha = (totalAlpha / maxTotalAlpha) * strength * alpha * (1. - inner) * max(min(hideObject, knockout), 1. - ownColor.a);\n    float innerGlowAlpha = ((maxTotalAlpha - totalAlpha) / maxTotalAlpha) * strength * alpha * inner * ownColor.a;\n    ownColor.a = max(ownColor.a * knockout * (1. - hideObject), 0.0001);\n    vec3 mix1 = mix(ownColor.rgb, color.rgb, innerGlowAlpha / (innerGlowAlpha + ownColor.a));\n    vec3 mix2 = mix(mix1, color.rgb, outerGlowAlpha / (innerGlowAlpha + ownColor.a + outerGlowAlpha));\n    float resultAlpha = min(ownColor.a + outerGlowAlpha + innerGlowAlpha, 1.);\n    gl_FragColor = vec4(mix2 * resultAlpha, resultAlpha);\n}",t.primitive_frag="precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvoid main(void) {\n    gl_FragColor = vColor;\n}",t.texture_frag="precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor;\n}",t}();t.EgretShaderLib=e,__reflect(e.prototype,"egret.EgretShaderLib")}(egret||(egret={}));var egret;!function(t){function e(e,i,n){n=n||{};var o=null==n.italic?i[16]:n.italic,a=null==n.bold?i[15]:n.bold,s=null==n.size?i[0]:n.size,h=n.fontFamily||i[8]||r.default_fontFamily;return t.sys.measureText(e,h,s,a,o)}var i=new RegExp("(?=[\\u00BF-\\u1FFF\\u2C00-\\uD7FF]|\\b|\\s)(?![。,!、》…))}”】\\.\\,\\!\\?\\]\\:])"),r=function(r){function n(){var e=r.call(this)||this;e.$inputEnabled=!1,e.inputUtils=null,e.$graphicsNode=null,e.isFlow=!1,e.textArr=[],e.linesArr=[],e.$isTyping=!1;var i=new t.sys.TextNode;return i.fontFamily=n.default_fontFamily,e.textNode=i,e.$renderNode=i,e.$TextField={0:n.default_size,1:0,2:n.default_textColor,3:0/0,4:0/0,5:0,6:0,7:0,8:n.default_fontFamily,9:"left",10:"top",11:"#ffffff",12:"",13:"",14:[],15:!1,16:!1,17:!0,18:!1,19:!1,20:!1,21:0,22:0,23:0,24:t.TextFieldType.DYNAMIC,25:0,26:"#000000",27:0,28:-1,29:0,30:!1,31:!1,32:0,33:!1,34:16777215,35:null,36:null,37:t.TextFieldInputType.TEXT},e}return __extends(n,r),n.prototype.createWebAssemblyNode=function(){this.$waNode=new t.WebAssemblyNode(7)},n.prototype.isInput=function(){return this.$TextField[24]==t.TextFieldType.INPUT},n.prototype.$setTouchEnabled=function(t){r.prototype.$setTouchEnabled.call(this,t),this.isInput()&&(this.$inputEnabled=!0)},Object.defineProperty(n.prototype,"fontFamily",{get:function(){return this.$TextField[8]},set:function(t){this.$setFontFamily(t)},enumerable:!0,configurable:!0}),n.prototype.$setFontFamily=function(t){var e=this.$TextField;return e[8]==t?!1:(e[8]=t,this.invalidateFontString(),!0)},Object.defineProperty(n.prototype,"size",{get:function(){return this.$TextField[0]},set:function(t){this.$setSize(t)},enumerable:!0,configurable:!0}),n.prototype.$setSize=function(t){t=+t||0;var e=this.$TextField;return e[0]==t?!1:(e[0]=t,this.invalidateFontString(),!0)},Object.defineProperty(n.prototype,"bold",{get:function(){return this.$TextField[15]},set:function(t){this.$setBold(t)},enumerable:!0,configurable:!0}),n.prototype.$setBold=function(t){t=!!t;var e=this.$TextField;return t==e[15]?!1:(e[15]=t,this.invalidateFontString(),!0)},Object.defineProperty(n.prototype,"italic",{get:function(){return this.$TextField[16]},set:function(t){this.$setItalic(t)},enumerable:!0,configurable:!0}),n.prototype.$setItalic=function(t){t=!!t;var e=this.$TextField;return t==e[16]?!1:(e[16]=t,this.invalidateFontString(),!0)},n.prototype.invalidateFontString=function(){this.$TextField[17]=!0,this.$invalidateTextField()},Object.defineProperty(n.prototype,"textAlign",{get:function(){return this.$TextField[9]},set:function(t){this.$setTextAlign(t)},enumerable:!0,configurable:!0}),n.prototype.$setTextAlign=function(t){var e=this.$TextField;return e[9]==t?!1:(e[9]=t,this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"verticalAlign",{get:function(){return this.$TextField[10]},set:function(t){this.$setVerticalAlign(t)},enumerable:!0,configurable:!0}),n.prototype.$setVerticalAlign=function(t){var e=this.$TextField;return e[10]==t?!1:(e[10]=t,this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"lineSpacing",{get:function(){return this.$TextField[1]},set:function(t){this.$setLineSpacing(t)},enumerable:!0,configurable:!0}),n.prototype.$setLineSpacing=function(t){t=+t||0;var e=this.$TextField;return e[1]==t?!1:(e[1]=t,this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"textColor",{get:function(){return this.$TextField[2]},set:function(t){this.$setTextColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setTextColor=function(t){t=0|+t;var e=this.$TextField;return e[2]==t?!1:(e[2]=t,this.inputUtils&&this.inputUtils._setColor(this.$TextField[2]),this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"wordWrap",{get:function(){return this.$TextField[19]},set:function(t){this.$setWordWrap(t)},enumerable:!0,configurable:!0}),n.prototype.$setWordWrap=function(t){t=!!t;var e=this.$TextField;t!=e[19]&&(e[20]||(e[19]=t,this.$invalidateTextField()))},Object.defineProperty(n.prototype,"type",{get:function(){return this.$TextField[24]},set:function(t){this.$setType(t)},enumerable:!0,configurable:!0}),n.prototype.$setType=function(e){var i=this.$TextField;return i[24]!=e?(i[24]=e,e==t.TextFieldType.INPUT?(isNaN(i[3])&&this.$setWidth(100),isNaN(i[4])&&this.$setHeight(30),this.$setTouchEnabled(!0),null==this.inputUtils&&(this.inputUtils=new t.InputController),this.inputUtils.init(this),this.$invalidateTextField(),this.$stage&&this.inputUtils._addStageText()):(this.inputUtils&&(this.inputUtils._removeStageText(),this.inputUtils=null),this.$setTouchEnabled(!1)),!0):!1},Object.defineProperty(n.prototype,"inputType",{get:function(){return this.$TextField[37]},set:function(t){this.$TextField[37]=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"text",{get:function(){return this.$getText()},set:function(t){this.$setText(t)},enumerable:!0,configurable:!0}),n.prototype.$getText=function(){return this.$TextField[24]==t.TextFieldType.INPUT?this.inputUtils._getText():this.$TextField[13]},n.prototype.$setBaseText=function(t){null==t&&(t=""),t=t.toString(),this.isFlow=!1;var e=this.$TextField;if(e[13]!=t){this.$invalidateTextField(),e[13]=t;var i="";return i=e[20]?this.changeToPassText(t):t,this.setMiddleStyle([{text:i}]),!0}return!1},n.prototype.$setText=function(t){null==t&&(t="");var e=this.$setBaseText(t);return this.inputUtils&&this.inputUtils._setText(this.$TextField[13]),e},Object.defineProperty(n.prototype,"displayAsPassword",{get:function(){return this.$TextField[20]},set:function(t){this.$setDisplayAsPassword(t)},enumerable:!0,configurable:!0}),n.prototype.$setDisplayAsPassword=function(t){var e=this.$TextField;if(e[20]!=t){e[20]=t,this.$invalidateTextField();var i="";return i=t?this.changeToPassText(e[13]):e[13],this.setMiddleStyle([{text:i}]),!0}return!1},Object.defineProperty(n.prototype,"strokeColor",{get:function(){return this.$TextField[25]},set:function(t){t=+t||0,this.$setStrokeColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setStrokeColor=function(e){var i=this.$TextField;return i[25]!=e?(this.$invalidateTextField(),i[25]=e,i[26]=t.toColorString(e),!0):!1},Object.defineProperty(n.prototype,"stroke",{get:function(){return this.$TextField[27]},set:function(t){this.$setStroke(t)},enumerable:!0,configurable:!0}),n.prototype.$setStroke=function(t){return this.$TextField[27]!=t?(this.$invalidateTextField(),this.$TextField[27]=t,!0):!1},Object.defineProperty(n.prototype,"maxChars",{get:function(){return this.$TextField[21]},set:function(t){this.$setMaxChars(t)},enumerable:!0,configurable:!0}),n.prototype.$setMaxChars=function(t){return this.$TextField[21]!=t?(this.$TextField[21]=t,!0):!1},Object.defineProperty(n.prototype,"scrollV",{get:function(){return Math.min(Math.max(this.$TextField[28],1),this.maxScrollV)},set:function(t){this.$TextField[28]=Math.max(t,1),this.$invalidateTextField()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxScrollV",{get:function(){return this.$getLinesArr(),Math.max(this.$TextField[29]-t.TextFieldUtils.$getScrollNum(this)+1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectionBeginIndex",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectionEndIndex",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"caretIndex",{get:function(){return 0},enumerable:!0,configurable:!0}),n.prototype.$setSelection=function(t,e){return!1},n.prototype.$getLineHeight=function(){return this.$TextField[1]+this.$TextField[0]},Object.defineProperty(n.prototype,"numLines",{get:function(){return this.$getLinesArr(),this.$TextField[29]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"multiline",{get:function(){return this.$TextField[30]},set:function(t){this.$setMultiline(t)},enumerable:!0,configurable:!0}),n.prototype.$setMultiline=function(t){return this.$TextField[30]=t,this.$invalidateTextField(),!0},Object.defineProperty(n.prototype,"restrict",{get:function(){var t=this.$TextField,e=null;return null!=t[35]&&(e=t[35]),null!=t[36]&&(null==e&&(e=""),e+="^"+t[36]),e},set:function(t){var e=this.$TextField;if(null==t)e[35]=null,e[36]=null;else{for(var i=-1;i<t.length&&(i=t.indexOf("^",i),0!=i)&&i>0&&"\\"==t.charAt(i-1);)i++;0==i?(e[35]=null,e[36]=t.substring(i+1)):i>0?(e[35]=t.substring(0,i),e[36]=t.substring(i+1)):(e[35]=t,e[36]=null)}},enumerable:!0,configurable:!0}),n.prototype.$setWidth=function(t){var e=this.$TextField;if(isNaN(t)){if(isNaN(e[3]))return!1;e[3]=0/0}else{if(e[3]==t)return!1;e[3]=t}return t=+t,0>t?!1:(this.$invalidateTextField(),!0)},n.prototype.$setHeight=function(t){var e=this.$TextField;if(isNaN(t)){if(isNaN(e[4]))return!1;e[4]=0/0}else{if(e[4]==t)return!1;e[4]=t}return t=+t,0>t?!1:(this.$invalidateTextField(),!0)},n.prototype.$getWidth=function(){var t=this.$TextField;return isNaN(t[3])?this.$getContentBounds().width:t[3]},n.prototype.$getHeight=function(){var t=this.$TextField;return isNaN(t[4])?this.$getContentBounds().height:t[4]},Object.defineProperty(n.prototype,"border",{get:function(){return this.$TextField[31]},set:function(t){this.$setBorder(t)},enumerable:!0,configurable:!0}),n.prototype.$setBorder=function(t){this.$TextField[31]=!!t,this.$invalidateTextField()},Object.defineProperty(n.prototype,"borderColor",{get:function(){return this.$TextField[32]},set:function(t){this.$setBorderColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setBorderColor=function(t){this.$TextField[32]=+t||0,this.$invalidateTextField()},Object.defineProperty(n.prototype,"background",{get:function(){return this.$TextField[33]},set:function(t){this.$setBackground(t)},enumerable:!0,configurable:!0}),n.prototype.$setBackground=function(t){this.$TextField[33]=t,this.$invalidateTextField()},Object.defineProperty(n.prototype,"backgroundColor",{get:function(){return this.$TextField[34]},set:function(t){this.$setBackgroundColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setBackgroundColor=function(t){this.$TextField[34]=t,this.$invalidateTextField()},n.prototype.fillBackground=function(e){var i=this.$graphicsNode;i&&i.clear();var r=this.$TextField;if(r[33]||r[31]||e&&e.length>0){i||(i=this.$graphicsNode=new t.sys.GraphicsNode);var n=void 0,o=void 0;if(r[33]&&(n=i.beginFill(r[34]),n.drawRect(0,0,this.$getWidth(),this.$getHeight())),r[31]&&(o=i.lineStyle(1,r[32]),o.drawRect(0,0,this.$getWidth()-1,this.$getHeight()-1)),e&&e.length>0)for(var a=r[2],s=-1,h=e.length,l=0;h>l;l+=4){var u=e[l],c=e[l+1],d=e[l+2],p=e[l+3]||a;(0>s||s!=p)&&(s=p,o=i.lineStyle(2,p,1,t.CapsStyle.NONE)),o.moveTo(u,c),o.lineTo(u+d,c)}}if(i){var f=this.$getRenderBounds();i.x=f.x,i.y=f.y,i.width=f.width,i.height=f.height,t.Rectangle.release(f)}},n.prototype.setFocus=function(){this.type==t.TextFieldType.INPUT&&this.$stage&&this.inputUtils.$onFocus()},n.prototype.$onRemoveFromStage=function(){r.prototype.$onRemoveFromStage.call(this),this.removeEvent(),this.$TextField[24]==t.TextFieldType.INPUT&&this.inputUtils._removeStageText(),this.textNode&&this.textNode.clean()},n.prototype.$onAddToStage=function(e,i){r.prototype.$onAddToStage.call(this,e,i),this.addEvent(),this.$TextField[24]==t.TextFieldType.INPUT&&this.inputUtils._addStageText(),this.$invalidateTextField()},n.prototype.$invalidateTextField=function(){this.$renderDirty=!0,this.$TextField[18]=!0,t.WebAssembly.dirtyTextField(this)},n.prototype.$getRenderBounds=function(){var e=this.$getContentBounds(),i=t.Rectangle.create();i.copyFrom(e),this.$TextField[31]&&(i.width+=2,i.height+=2);var r=2*this.$TextField[27];return r>0&&(i.width+=2*r,i.height+=2*r),i.x-=r+2,i.y-=r+2,i.width=Math.ceil(i.width)+4,i.height=Math.ceil(i.height)+4,i},n.prototype.$measureContentBounds=function(e){this.$getLinesArr();var i=isNaN(this.$TextField[3])?this.$TextField[5]:this.$TextField[3],r=isNaN(this.$TextField[4])?t.TextFieldUtils.$getTextHeight(this):this.$TextField[4];e.setTo(0,0,i,r)},n.prototype.$updateRenderNode=function(){if(this.$TextField[24]==t.TextFieldType.INPUT){if(this.inputUtils._updateProperties(),this.$isTyping)return void this.fillBackground()}else if(0==this.$TextField[3])return;var e=this.drawText();this.fillBackground(e);var i=this.$getRenderBounds(),r=this.textNode;r.x=i.x,r.y=i.y,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),t.Rectangle.release(i)},Object.defineProperty(n.prototype,"textFlow",{get:function(){return this.textArr},set:function(t){this.isFlow=!0;var e="";null==t&&(t=[]);for(var i=0;i<t.length;i++){var r=t[i];e+=r.text}this.$TextField[20]?this.$setBaseText(e):(this.$TextField[13]=e,this.setMiddleStyle(t))},enumerable:!0,configurable:!0}),n.prototype.changeToPassText=function(t){if(this.$TextField[20]){for(var e="",i=0,r=t.length;r>i;i++)switch(t.charAt(i)){case"\n":e+="\n";break;case"\r":break;default:e+="*"}return e}return t},n.prototype.setMiddleStyle=function(t){this.$TextField[18]=!0,this.textArr=t,this.$invalidateTextField()},Object.defineProperty(n.prototype,"textWidth",{get:function(){return this.$getLinesArr(),this.$TextField[5]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"textHeight",{get:function(){return this.$getLinesArr(),t.TextFieldUtils.$getTextHeight(this)},enumerable:!0,configurable:!0}),n.prototype.appendText=function(t){this.appendElement({text:t})},n.prototype.appendElement=function(t){var e=this.$TextField[13]+t.text;this.$TextField[20]?this.$setBaseText(e):(this.$TextField[13]=e,this.textArr.push(t),this.setMiddleStyle(this.textArr))},n.prototype.$getLinesArr=function(){var r=this.$TextField;if(!r[18])return this.linesArr;r[18]=!1;var n=this.textArr;this.linesArr.length=0,r[6]=0,r[5]=0;var o=r[3];if(!isNaN(o)&&0==o)return r[29]=0,[{width:0,height:0,charNum:0,elements:[],hasNextLine:!1}];for(var a,s=this.linesArr,h=0,l=0,u=0,c=0,d=0,p=n.length;p>d;d++){var f=n[d];if(f.text){f.style=f.style||{};for(var g=f.text.toString(),y=g.split(/(?:\r\n|\r|\n)/),v=0,m=y.length;m>v;v++){null==s[c]&&(a={width:0,height:0,elements:[],charNum:0,hasNextLine:!1},s[c]=a,h=0,u=0,l=0),u=r[24]==t.TextFieldType.INPUT?r[0]:Math.max(u,f.style.size||r[0]);var b=!0;if(""==y[v])v==m-1&&(b=!1);else{var $=e(y[v],r,f.style);if(isNaN(o))h+=$,l+=y[v].length,a.elements.push({width:$,text:y[v],style:f.style}),v==m-1&&(b=!1);else if(o>=h+$)a.elements.push({width:$,text:y[v],style:f.style}),h+=$,l+=y[v].length,v==m-1&&(b=!1);else{var x=0,T=0,_=y[v],E=void 0;E=r[19]?_.split(i):_.match(/./g);for(var w=E.length,C=0;w>x;x++){var S=E[x].length,O=!1;if(1==S&&w-1>x){var A=E[x].charCodeAt(0),R=E[x+1].charCodeAt(0);if(A>=55296&&56319>=A&&56320==(64512&R)){var F=E[x]+E[x+1];S=2,O=!0,$=e(F,r,f.style)}else $=e(E[x],r,f.style)}else $=e(E[x],r,f.style);if(0!=h&&h+$>o&&h+x!=0)break;if(T+$>o)for(var L=E[x].match(/./g),D=0,I=L.length;I>D;D++){var S=L[D].length,N=!1;if(1==S&&I-1>D){var A=L[D].charCodeAt(0),R=L[D+1].charCodeAt(0);if(A>=55296&&56319>=A&&56320==(64512&R)){var F=L[D]+L[D+1];S=2,N=!0,$=e(F,r,f.style)}else $=e(L[D],r,f.style)}else $=e(L[D],r,f.style);if(D>0&&h+$>o)break;C+=S,T+=$,h+=$,l+=C,N&&D++}else C+=S,T+=$,h+=$,l+=C;O&&x++}if(x>0){a.elements.push({width:T,text:_.substring(0,C),style:f.style});var P=_.substring(C),M=void 0,B=P.length;for(M=0;B>M&&" "==P.charAt(M);M++);y[v]=P.substring(M)}""!=y[v]&&(v--,b=!1)}}b&&(l++,a.hasNextLine=!0),v<y.length-1&&(a.width=h,a.height=u,a.charNum=l,r[5]=Math.max(r[5],h),r[6]+=u,c++)}d==n.length-1&&a&&(a.width=h,a.height=u,a.charNum=l,r[5]=Math.max(r[5],h),r[6]+=u)}else a&&(a.width=h,a.height=u,a.charNum=l,r[5]=Math.max(r[5],h),r[6]+=u)}return r[29]=s.length,s},n.prototype.$setIsTyping=function(t){this.$isTyping=t,this.$waNode.setIsTyping(t),this.$invalidateTextField()},n.prototype.drawText=function(){var e=this.textNode,i=this.$TextField;e.bold=i[15],e.fontFamily=i[8]||n.default_fontFamily,e.italic=i[16],e.size=i[0],e.stroke=i[27],e.strokeColor=i[25],e.textColor=i[2];var r=this.$getLinesArr();if(0==i[5])return[];var o=isNaN(i[3])?i[5]:i[3],a=t.TextFieldUtils.$getTextHeight(this),s=0,h=t.TextFieldUtils.$getStartLine(this),l=i[4];if(!isNaN(l)&&l>a){var u=t.TextFieldUtils.$getValign(this);s+=u*(l-a)}s=Math.round(s);for(var c=t.TextFieldUtils.$getHalign(this),d=0,p=[],f=h,g=i[29];g>f;f++){var y=r[f],v=y.height;if(s+=v/2,f!=h){if(i[24]==t.TextFieldType.INPUT&&!i[30])break;if(!isNaN(l)&&s>l)break}d=Math.round((o-y.width)*c);for(var m=0,b=y.elements.length;b>m;m++){var $=y.elements[m],x=$.style.size||i[0];e.drawText(d,s+(v-x)/2,$.text,$.style),$.style.underline&&p.push(d,s+v/2,$.width,$.style.textColor),d+=$.width}s+=v/2+i[1]}return p},n.prototype.addEvent=function(){this.addEventListener(t.TouchEvent.TOUCH_TAP,this.onTapHandler,this)},n.prototype.removeEvent=function(){this.removeEventListener(t.TouchEvent.TOUCH_TAP,this.onTapHandler,this)},n.prototype.onTapHandler=function(e){if(this.$TextField[24]!=t.TextFieldType.INPUT){var i=t.TextFieldUtils.$getTextElement(this,e.localX,e.localY);if(null!=i){var r=i.style;if(r&&r.href)if(r.href.match(/^event:/)){var n=r.href.match(/^event:/)[0];t.TextEvent.dispatchTextEvent(this,t.TextEvent.LINK,r.href.substring(n.length))}else open(r.href,r.target||"_blank")}}},n.default_fontFamily="Arial",n.default_size=30,n.default_textColor=16777215,n}(t.DisplayObject);t.TextField=r,__reflect(r.prototype,"egret.TextField")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.TEXT="text",t.TEL="tel",t.PASSWORD="password",t}();t.TextFieldInputType=e,__reflect(e.prototype,"egret.TextFieldInputType")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.DYNAMIC="dynamic",t.INPUT="input",t}();t.TextFieldType=e,__reflect(e.prototype,"egret.TextFieldType")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){}return e.$getStartLine=function(t){var i=t.$TextField,r=e.$getTextHeight(t),n=0,o=i[4];return isNaN(o)||(o>r||r>o&&(n=Math.max(i[28]-1,0),n=Math.min(i[29]-1,n)),i[30]||(n=Math.max(i[28]-1,0),i[29]>0&&(n=Math.min(i[29]-1,n)))),n},e.$getHalign=function(e){var i=e.$getLinesArr(),r=0;return e.$TextField[9]==t.HorizontalAlign.CENTER?r=.5:e.$TextField[9]==t.HorizontalAlign.RIGHT&&(r=1),e.$TextField[24]==t.TextFieldType.INPUT&&!e.$TextField[30]&&i.length>1&&(r=0),r},e.$getTextHeight=function(e){var i=t.TextFieldType.INPUT!=e.$TextField[24]||e.$TextField[30]?e.$TextField[6]+(e.$TextField[29]-1)*e.$TextField[1]:e.$TextField[0];return i},e.$getValign=function(i){var r=e.$getTextHeight(i),n=i.$TextField[4];if(!isNaN(n)&&n>r){var o=0;return i.$TextField[10]==t.VerticalAlign.MIDDLE?o=.5:i.$TextField[10]==t.VerticalAlign.BOTTOM&&(o=1),o}return 0},e.$getTextElement=function(t,i,r){var n=e.$getHit(t,i,r),o=t.$getLinesArr();return n&&o[n.lineIndex]&&o[n.lineIndex].elements[n.textElementIndex]?o[n.lineIndex].elements[n.textElementIndex]:null},e.$getHit=function(t,i,r){var n=t.$getLinesArr();if(0==t.$TextField[3])return null;var o=0,a=e.$getTextHeight(t),s=0,h=t.$TextField[4];if(!isNaN(h)&&h>a){var l=e.$getValign(t);s=l*(h-a),0!=s&&(r-=s)}for(var u=e.$getStartLine(t),c=0,d=u;d<n.length;d++){var p=n[d];if(c+p.height>=r){r>c&&(o=d+1);break}if(c+=p.height,c+t.$TextField[1]>r)return null;c+=t.$TextField[1]}if(0==o)return null;var f=n[o-1],g=t.$TextField[3];isNaN(g)&&(g=t.textWidth);var y=e.$getHalign(t);i-=y*(g-f.width);for(var v=0,d=0;d<f.elements.length;d++){var m=f.elements[d];if(v+m.width<=i)v+=m.width;else if(i>v)return{lineIndex:o-1,textElementIndex:d}}return null},e.$getScrollNum=function(t){var e=1;if(t.$TextField[30]){var i=t.height,r=t.size,n=t.lineSpacing;
e=Math.floor(i/(r+n));var o=i-(r+n)*e;o>r/2&&e++}return e},e}();t.TextFieldUtils=e,__reflect(e.prototype,"egret.TextFieldUtils")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.TOP="top",t.BOTTOM="bottom",t.MIDDLE="middle",t.JUSTIFY="justify",t.CONTENT_JUSTIFY="contentJustify",t}();t.VerticalAlign=e,__reflect(e.prototype,"egret.VerticalAlign")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._isNeedShow=!1,t.inputElement=null,t.inputDiv=null,t._gscaleX=0,t._gscaleY=0,t._isNeesHide=!1,t.textValue="",t.colorValue=16777215,t._styleInfoes={},t}return __extends(i,e),i.prototype.$setTextField=function(t){return this.$textfield=t,!0},i.prototype.$addToStage=function(){this.htmlInput=t.$getTextAdapter(this.$textfield)},i.prototype._initElement=function(){var e=this.$textfield.localToGlobal(0,0),i=e.x,r=e.y,n=this.htmlInput.$scaleX,o=this.htmlInput.$scaleY;this.inputDiv.style.left=i*n+"px",this.inputDiv.style.top=r*o+"px",this.$textfield.multiline&&this.$textfield.height>this.$textfield.size?(this.inputDiv.style.top=r*o+"px",this.inputElement.style.top=-this.$textfield.lineSpacing/2*o+"px"):(this.inputDiv.style.top=r*o+"px",this.inputElement.style.top="0px");for(var a=this.$textfield,s=1,h=1,l=0;a.parent;)s*=a.scaleX,h*=a.scaleY,l+=a.rotation,a=a.parent;var u=t.getPrefixStyleName("transform");this.inputDiv.style[u]="rotate("+l+"deg)",this._gscaleX=n*s,this._gscaleY=o*h},i.prototype.$show=function(){this.htmlInput.isCurrentStageText(this)?this.inputElement.onblur=null:(this.inputElement=this.htmlInput.getInputElement(this),this.$textfield.multiline?this.inputElement.type="text":this.inputElement.type=this.$textfield.inputType,this.inputDiv=this.htmlInput._inputDIV),this.htmlInput._needShow=!0,this._isNeedShow=!0,this._initElement()},i.prototype.onBlurHandler=function(){this.htmlInput.clearInputElement(),window.scrollTo(0,0)},i.prototype.executeShow=function(){this.inputElement.value=this.$getText(),null==this.inputElement.onblur&&(this.inputElement.onblur=this.onBlurHandler.bind(this)),this.$resetStageText(),this.$textfield.maxChars>0?this.inputElement.setAttribute("maxlength",this.$textfield.maxChars):this.inputElement.removeAttribute("maxlength"),this.inputElement.selectionStart=this.inputElement.value.length,this.inputElement.selectionEnd=this.inputElement.value.length,this.inputElement.focus()},i.prototype.$hide=function(){this._isNeesHide=!0,this.htmlInput&&t.Html5Capatibility._System_OS==t.SystemOSType.IOS&&this.htmlInput.disconnectStageText(this)},i.prototype.$getText=function(){return this.textValue||(this.textValue=""),this.textValue},i.prototype.$setText=function(t){return this.textValue=t,this.resetText(),!0},i.prototype.resetText=function(){this.inputElement&&(this.inputElement.value=this.textValue)},i.prototype.$setColor=function(t){return this.colorValue=t,this.resetColor(),!0},i.prototype.resetColor=function(){this.inputElement&&this.setElementStyle("color",t.toColorString(this.colorValue))},i.prototype.$onBlur=function(){t.Html5Capatibility._System_OS==t.SystemOSType.WPHONE&&t.Event.dispatchEvent(this,"updateText",!1)},i.prototype._onInput=function(){var e=this;if(t.Html5Capatibility._System_OS==t.SystemOSType.WPHONE){var i=this.$textfield.$TextField;null==i[35]&&null==i[36]?(e.textValue=e.inputElement.value,t.Event.dispatchEvent(e,"updateText",!1)):window.setTimeout(function(){e.inputElement&&e.inputElement.selectionStart&&e.inputElement.selectionEnd&&e.inputElement.selectionStart==e.inputElement.selectionEnd&&(e.textValue=e.inputElement.value,t.Event.dispatchEvent(e,"updateText",!1))},0)}else window.setTimeout(function(){e.inputElement&&e.inputElement.selectionStart==e.inputElement.selectionEnd&&(e.textValue=e.inputElement.value,t.Event.dispatchEvent(e,"updateText",!1))},0)},i.prototype.setAreaHeight=function(){var e=this.$textfield;if(e.multiline){var i=t.TextFieldUtils.$getTextHeight(e);if(e.height<=e.size)this.setElementStyle("height",e.size*this._gscaleY+"px"),this.setElementStyle("padding","0px"),this.setElementStyle("lineHeight",e.size*this._gscaleY+"px");else if(e.height<i)this.setElementStyle("height",e.height*this._gscaleY+"px"),this.setElementStyle("padding","0px"),this.setElementStyle("lineHeight",(e.size+e.lineSpacing)*this._gscaleY+"px");else{this.setElementStyle("height",(i+e.lineSpacing)*this._gscaleY+"px");var r=(e.height-i)*this._gscaleY,n=t.TextFieldUtils.$getValign(e),o=r*n,a=r-o;this.setElementStyle("padding",o+"px 0px "+a+"px 0px"),this.setElementStyle("lineHeight",(e.size+e.lineSpacing)*this._gscaleY+"px")}}},i.prototype._onClickHandler=function(e){this._isNeedShow&&(e.stopImmediatePropagation(),this._isNeedShow=!1,this.executeShow(),this.dispatchEvent(new t.Event("focus")))},i.prototype._onDisconnect=function(){this.inputElement=null,this.dispatchEvent(new t.Event("blur"))},i.prototype.setElementStyle=function(t,e){this.inputElement&&this._styleInfoes[t]!=e&&(this.inputElement.style[t]=e)},i.prototype.$removeFromStage=function(){this.inputElement&&this.htmlInput.disconnectStageText(this)},i.prototype.$resetStageText=function(){if(this.inputElement){var e=this.$textfield;this.setElementStyle("fontFamily",e.fontFamily),this.setElementStyle("fontStyle",e.italic?"italic":"normal"),this.setElementStyle("fontWeight",e.bold?"bold":"normal"),this.setElementStyle("textAlign",e.textAlign),this.setElementStyle("fontSize",e.size*this._gscaleY+"px"),this.setElementStyle("color",t.toColorString(e.textColor));var i=void 0;if(e.stage?(i=e.localToGlobal(0,0).x,i=Math.min(e.width,e.stage.stageWidth-i)):i=e.width,this.setElementStyle("width",i*this._gscaleX+"px"),this.setElementStyle("verticalAlign",e.verticalAlign),e.multiline)this.setAreaHeight();else if(this.setElementStyle("lineHeight",e.size*this._gscaleY+"px"),e.height<e.size){this.setElementStyle("height",e.size*this._gscaleY+"px");var r=e.size/2*this._gscaleY;this.setElementStyle("padding","0px 0px "+r+"px 0px")}else{this.setElementStyle("height",e.size*this._gscaleY+"px");var n=(e.height-e.size)*this._gscaleY,o=t.TextFieldUtils.$getValign(e),a=n*o,r=n-a;r<e.size/2*this._gscaleY&&(r=e.size/2*this._gscaleY),this.setElementStyle("padding",a+"px 0px "+r+"px 0px")}this.inputDiv.style.clip="rect(0px "+e.width*this._gscaleX+"px "+e.height*this._gscaleY+"px 0px)",this.inputDiv.style.height=e.height*this._gscaleY+"px",this.inputDiv.style.width=i*this._gscaleX+"px"}},i}(t.EventDispatcher);t.HTML5StageText=e,__reflect(e.prototype,"egret.HTML5StageText",["egret.StageText"]),t.StageText=e}(egret||(egret={})),function(t){var e=function(){function e(){this._needShow=!1,this.$scaleX=1,this.$scaleY=1}return e.prototype.isInputOn=function(){return null!=this._stageText},e.prototype.isCurrentStageText=function(t){return this._stageText==t},e.prototype.initValue=function(t){t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.border="none",t.style.padding="0"},e.prototype.$updateSize=function(){if(this.canvas){var e=this.canvas.width,i=this.canvas.height,r=this.canvas.style.width.split("px")[0],n=this.canvas.style.height.split("px")[0];this.$scaleX=r/e,this.$scaleY=n/i,this.StageDelegateDiv.style.left=this.canvas.style.left,this.StageDelegateDiv.style.top=this.canvas.style.top;var o=t.getPrefixStyleName("transform");this.StageDelegateDiv.style[o]=this.canvas.style[o],this.StageDelegateDiv.style[t.getPrefixStyleName("transformOrigin")]="0% 0% 0px"}},e.prototype._initStageDelegateDiv=function(e,i){this.canvas=i;var r,n=this;r||(r=document.createElement("div"),this.StageDelegateDiv=r,r.id="StageDelegateDiv",e.appendChild(r),n.initValue(r),n._inputDIV=document.createElement("div"),n.initValue(n._inputDIV),n._inputDIV.style.width="0px",n._inputDIV.style.height="0px",n._inputDIV.style.left="0px",n._inputDIV.style.top="-100px",n._inputDIV.style[t.getPrefixStyleName("transformOrigin")]="0% 0% 0px",r.appendChild(n._inputDIV),this.canvas.addEventListener("click",function(t){n._needShow?(n._needShow=!1,n._stageText._onClickHandler(t),n.show()):n._inputElement&&(n.clearInputElement(),n._inputElement.blur(),n._inputElement=null)}),n.initInputElement(!0),n.initInputElement(!1))},e.prototype.initInputElement=function(t){var e,i=this;t?(e=document.createElement("textarea"),e.style.resize="none",i._multiElement=e,e.id="egretTextarea"):(e=document.createElement("input"),i._simpleElement=e,e.id="egretInput"),e.type="text",i._inputDIV.appendChild(e),e.setAttribute("tabindex","-1"),e.style.width="1px",e.style.height="12px",i.initValue(e),e.style.outline="thin",e.style.background="none",e.style.overflow="hidden",e.style.wordBreak="break-all",e.style.opacity=0,e.oninput=function(){i._stageText&&i._stageText._onInput()}},e.prototype.show=function(){var e=this,i=e._inputElement;t.$callAsync(function(){i.style.opacity=1},e)},e.prototype.disconnectStageText=function(t){(null==this._stageText||this._stageText==t)&&(this.clearInputElement(),this._inputElement&&this._inputElement.blur())},e.prototype.clearInputElement=function(){var t=this;if(t._inputElement){t._inputElement.value="",t._inputElement.onblur=null,t._inputElement.style.width="1px",t._inputElement.style.height="12px",t._inputElement.style.left="0px",t._inputElement.style.top="0px",t._inputElement.style.opacity=0;var e=void 0;e=t._simpleElement==t._inputElement?t._multiElement:t._simpleElement,e.style.display="block",t._inputDIV.style.left="0px",t._inputDIV.style.top="-100px",t._inputDIV.style.height="0px",t._inputDIV.style.width="0px"}t._stageText&&(t._stageText._onDisconnect(),t._stageText=null,this.canvas.userTyping=!1)},e.prototype.getInputElement=function(t){var e=this;e.clearInputElement(),e._stageText=t,this.canvas.userTyping=!0,e._stageText.$textfield.multiline?e._inputElement=e._multiElement:e._inputElement=e._simpleElement;var i;return i=e._simpleElement==e._inputElement?e._multiElement:e._simpleElement,i.style.display="none",e._inputElement},e}();t.HTMLInput=e,__reflect(e.prototype,"egret.HTMLInput")}(egret||(egret={})),function(t){function e(t){var e=t.stage?t.stage.$hashCode:0,i=r[e],a=n[e],s=o[e];return a&&s&&(delete n[e],delete o[e]),i}function i(t,e,i,a){t._initStageDelegateDiv(i,a),r[e.$hashCode]=t,n[e.$hashCode]=a,o[e.$hashCode]=i}var r={},n={},o={};t.$getTextAdapter=e,t.$cacheTextAdapter=i}(egret||(egret={}));var egret;!function(t){function e(t,e,n,o,a){r||i();var s="";return a&&(s+="italic "),o&&(s+="bold "),s+=(n||12)+"px ",s+=e||"Arial",r.font=s,r.measureText(t).width}function i(){r=t.sys.canvasHitTestBuffer.context,r.textAlign="left",r.textBaseline="middle"}var r=null;t.sys.measureText=e}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.encode=function(t){for(var e=new Uint8Array(t),i=e.length,r="",n=0;i>n;n+=3)r+=chars[e[n]>>2],r+=chars[(3&e[n])<<4|e[n+1]>>4],r+=chars[(15&e[n+1])<<2|e[n+2]>>6],r+=chars[63&e[n+2]];return i%3===2?r=r.substring(0,r.length-1)+"=":i%3===1&&(r=r.substring(0,r.length-2)+"=="),r},t.decode=function(t){var e=.75*t.length,i=t.length,r=0,n=0,o=0,a=0,s=0;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);for(var h=new ArrayBuffer(e),l=new Uint8Array(h),u=0;i>u;u+=4)n=lookup[t.charCodeAt(u)],o=lookup[t.charCodeAt(u+1)],a=lookup[t.charCodeAt(u+2)],s=lookup[t.charCodeAt(u+3)],l[r++]=n<<2|o>>4,l[r++]=(15&o)<<4|a>>2,l[r++]=(3&a)<<6|63&s;return h},t}();t.Base64Util=e,__reflect(e.prototype,"egret.Base64Util")}(egret||(egret={}));for(var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup=new Uint8Array(256),i=0;i<chars.length;i++)lookup[chars.charCodeAt(i)]=i;var egret;!function(t){var e=function(){function t(){}return t.LITTLE_ENDIAN="littleEndian",t.BIG_ENDIAN="bigEndian",t}();t.Endian=e,__reflect(e.prototype,"egret.Endian");var i=function(){function i(t){this.BUFFER_EXT_SIZE=0,this.EOF_byte=-1,this.EOF_code_point=-1,this._setArrayBuffer(t||new ArrayBuffer(this.BUFFER_EXT_SIZE)),this.endian=e.BIG_ENDIAN}return i.prototype._setArrayBuffer=function(t){this.write_position=t.byteLength,this.data=new DataView(t),this._position=0},i.prototype.setArrayBuffer=function(t){},Object.defineProperty(i.prototype,"buffer",{get:function(){return this.data.buffer},set:function(t){this.data=new DataView(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"dataView",{get:function(){return this.data},set:function(t){this.data=t,this.write_position=t.byteLength},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bufferOffset",{get:function(){return this.data.byteOffset},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._position},set:function(t){this._position=t,this.write_position=t>this.write_position?t:this.write_position},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){return this.write_position},set:function(t){this.write_position=t;var e=new Uint8Array(new ArrayBuffer(t)),i=this.data.buffer.byteLength;i>t&&(this._position=t);var r=Math.min(i,t);e.set(new Uint8Array(this.data.buffer,0,r)),this.buffer=e.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bytesAvailable",{get:function(){return this.data.byteLength-this._position},enumerable:!0,configurable:!0}),i.prototype.clear=function(){this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))},i.prototype.readBoolean=function(){return this.validate(i.SIZE_OF_BOOLEAN)?0!=this.data.getUint8(this.position++):null},i.prototype.readByte=function(){return this.validate(i.SIZE_OF_INT8)?this.data.getInt8(this.position++):null},i.prototype.readBytes=function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=0),0==r)r=this.bytesAvailable;else if(!this.validate(r))return null;t?t.validateBuffer(e+r):t=new i(new ArrayBuffer(e+r));for(var n=0;r>n;n++)t.data.setUint8(n+e,this.data.getUint8(this.position++))},i.prototype.readDouble=function(){if(!this.validate(i.SIZE_OF_FLOAT64))return null;var t=this.data.getFloat64(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_FLOAT64,t},i.prototype.readFloat=function(){if(!this.validate(i.SIZE_OF_FLOAT32))return null;var t=this.data.getFloat32(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_FLOAT32,t},i.prototype.readInt=function(){if(!this.validate(i.SIZE_OF_INT32))return null;var t=this.data.getInt32(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_INT32,t},i.prototype.readShort=function(){if(!this.validate(i.SIZE_OF_INT16))return null;var t=this.data.getInt16(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_INT16,t},i.prototype.readUnsignedByte=function(){return this.validate(i.SIZE_OF_UINT8)?this.data.getUint8(this.position++):null},i.prototype.readUnsignedInt=function(){if(!this.validate(i.SIZE_OF_UINT32))return null;var t=this.data.getUint32(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_UINT32,t},i.prototype.readUnsignedShort=function(){if(!this.validate(i.SIZE_OF_UINT16))return null;var t=this.data.getUint16(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_UINT16,t},i.prototype.readUTF=function(){if(!this.validate(i.SIZE_OF_UINT16))return null;var t=this.data.getUint16(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_UINT16,t>0?this.readUTFBytes(t):""},i.prototype.readUTFBytes=function(t){if(!this.validate(t))return null;var e=new Uint8Array(this.buffer,this.bufferOffset+this.position,t);return this.position+=t,this.decodeUTF8(e)},i.prototype.writeBoolean=function(t){this.validateBuffer(i.SIZE_OF_BOOLEAN),this.data.setUint8(this.position++,t?1:0)},i.prototype.writeByte=function(t){this.validateBuffer(i.SIZE_OF_INT8),this.data.setInt8(this.position++,t)},i.prototype.writeBytes=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var r;if(!(0>e)&&!(0>i)&&(r=0==i?t.length-e:Math.min(t.length-e,i),r>0)){this.validateBuffer(r);for(var n=new DataView(t.buffer),o=r,a=4;o>a;o-=a)this.data.setUint32(this._position,n.getUint32(e)),this.position+=a,e+=a;for(;o>0;o--)this.data.setUint8(this.position++,n.getUint8(e++))}},i.prototype.writeDouble=function(t){this.validateBuffer(i.SIZE_OF_FLOAT64),this.data.setFloat64(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_FLOAT64},i.prototype.writeFloat=function(t){this.validateBuffer(i.SIZE_OF_FLOAT32),this.data.setFloat32(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_FLOAT32},i.prototype.writeInt=function(t){this.validateBuffer(i.SIZE_OF_INT32),this.data.setInt32(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_INT32},i.prototype.writeShort=function(t){this.validateBuffer(i.SIZE_OF_INT16),this.data.setInt16(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_INT16},i.prototype.writeUnsignedInt=function(t){this.validateBuffer(i.SIZE_OF_UINT32),this.data.setUint32(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_UINT32},i.prototype.writeUnsignedShort=function(t){this.validateBuffer(i.SIZE_OF_UINT16),this.data.setUint16(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_UINT16},i.prototype.writeUTF=function(t){var r=this.encodeUTF8(t),n=r.length;this.validateBuffer(i.SIZE_OF_UINT16+n),this.data.setUint16(this.position,n,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_UINT16,this._writeUint8Array(r,!1)},i.prototype.writeUTFBytes=function(t){this._writeUint8Array(this.encodeUTF8(t))},i.prototype.toString=function(){return"[ByteArray] length:"+this.length+", bytesAvailable:"+this.bytesAvailable},i.prototype._writeUint8Array=function(t,e){void 0===e&&(e=!0),e&&this.validateBuffer(this.position+t.length);for(var i=0;i<t.length;i++)this.data.setUint8(this.position++,t[i])},i.prototype.validate=function(e){return this.data.byteLength>0&&this._position+e<=this.data.byteLength?!0:void t.$error(1025)},i.prototype.validateBuffer=function(t,e){if(void 0===e&&(e=!1),this.write_position=t>this.write_position?t:this.write_position,t+=this._position,this.data.byteLength<t||e){var i=new Uint8Array(new ArrayBuffer(t+this.BUFFER_EXT_SIZE)),r=Math.min(this.data.buffer.byteLength,t+this.BUFFER_EXT_SIZE);i.set(new Uint8Array(this.data.buffer,0,r)),this.buffer=i.buffer}},i.prototype.encodeUTF8=function(t){for(var e=0,i=this.stringToCodePoints(t),r=[];i.length>e;){var n=i[e++];if(this.inRange(n,55296,57343))this.encoderError(n);else if(this.inRange(n,0,127))r.push(n);else{var o=void 0,a=void 0;for(this.inRange(n,128,2047)?(o=1,a=192):this.inRange(n,2048,65535)?(o=2,a=224):this.inRange(n,65536,1114111)&&(o=3,a=240),r.push(this.div(n,Math.pow(64,o))+a);o>0;){var s=this.div(n,Math.pow(64,o-1));r.push(128+s%64),o-=1}}}return new Uint8Array(r)},i.prototype.decodeUTF8=function(t){for(var e,i=!1,r=0,n="",o=0,a=0,s=0,h=0;t.length>r;){var l=t[r++];if(l==this.EOF_byte)e=0!=a?this.decoderError(i):this.EOF_code_point;else if(0==a)this.inRange(l,0,127)?e=l:(this.inRange(l,194,223)?(a=1,h=128,o=l-192):this.inRange(l,224,239)?(a=2,h=2048,o=l-224):this.inRange(l,240,244)?(a=3,h=65536,o=l-240):this.decoderError(i),o*=Math.pow(64,a),e=null);else if(this.inRange(l,128,191))if(s+=1,o+=(l-128)*Math.pow(64,a-s),s!==a)e=null;else{var u=o,c=h;o=0,a=0,s=0,h=0,e=this.inRange(u,c,1114111)&&!this.inRange(u,55296,57343)?u:this.decoderError(i,l)}else o=0,a=0,s=0,h=0,r--,e=this.decoderError(i,l);null!==e&&e!==this.EOF_code_point&&(65535>=e?e>0&&(n+=String.fromCharCode(e)):(e-=65536,n+=String.fromCharCode(55296+(e>>10&1023)),n+=String.fromCharCode(56320+(1023&e))))}return n},i.prototype.encoderError=function(e){t.$error(1026,e)},i.prototype.decoderError=function(e,i){return e&&t.$error(1027),i||65533},i.prototype.inRange=function(t,e,i){return t>=e&&i>=t},i.prototype.div=function(t,e){return Math.floor(t/e)},i.prototype.stringToCodePoints=function(t){for(var e=[],i=0,r=t.length;i<t.length;){var n=t.charCodeAt(i);if(this.inRange(n,55296,57343))if(this.inRange(n,56320,57343))e.push(65533);else if(i==r-1)e.push(65533);else{var o=t.charCodeAt(i+1);if(this.inRange(o,56320,57343)){var a=1023&n,s=1023&o;i+=1,e.push(65536+(a<<10)+s)}else e.push(65533)}else e.push(n);i+=1}return e},i.SIZE_OF_BOOLEAN=1,i.SIZE_OF_INT8=1,i.SIZE_OF_INT16=2,i.SIZE_OF_INT32=4,i.SIZE_OF_UINT8=1,i.SIZE_OF_UINT16=2,i.SIZE_OF_UINT32=4,i.SIZE_OF_FLOAT32=4,i.SIZE_OF_FLOAT64=8,i}();t.ByteArray=i,__reflect(i.prototype,"egret.ByteArray")}(egret||(egret={}));var egret;!function(t){function e(e,i){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];t.$callLaterFunctionList.push(e),t.$callLaterThisList.push(i),t.$callLaterArgsList.push(r)}function i(e,i){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];t.$callAsyncFunctionList.push(e),t.$callAsyncThisList.push(i),t.$callAsyncArgsList.push(r)}t.$callLaterFunctionList=[],t.$callLaterThisList=[],t.$callLaterArgsList=[],t.callLater=e,t.$callAsyncFunctionList=[],t.$callAsyncThisList=[],t.$callAsyncArgsList=[],t.$callAsync=i}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,i,r){return void 0===i&&(i=!1),void 0===r&&(r=!1),t.call(this,e,i,r)||this}return __extends(e,t),e.FOCUS_IN="focusIn",e.FOCUS_OUT="focusOut",e}(t.Event);t.FocusEvent=e,__reflect(e.prototype,"egret.FocusEvent")}(egret||(egret={}));var egret;!function(t){function e(t,e,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];var o,a=t.prototype;t.hasOwnProperty("__sets__")||Object.defineProperty(t,"__sets__",{value:{}}),o=t.__sets__;var s=o[i];if(s)return s.apply(e,r);var h=Object.getPrototypeOf(a);if(null!=h){for(;!h.hasOwnProperty(i);)if(h=Object.getPrototypeOf(h),null==h)return;s=Object.getOwnPropertyDescriptor(h,i).set,o[i]=s,s.apply(e,r)}}function i(t,e,i){var r,n=t.prototype;t.hasOwnProperty("__gets__")||Object.defineProperty(t,"__gets__",{value:{}}),r=t.__gets__;var o=r[i];if(o)return o.call(e);var a=Object.getPrototypeOf(n);if(null!=a){for(;!a.hasOwnProperty(i);)if(a=Object.getPrototypeOf(a),null==a)return;return o=Object.getOwnPropertyDescriptor(a,i).get,r[i]=o,o.call(e)}}t.superSetter=e,t.superGetter=i}(egret||(egret={}));var egret;!function(t){function e(e,i){t.useFontMapping=!0,t.fontMapping[e]=i}t.fontMapping={},t.useFontMapping=!1,t.registerFontMapping=e}(egret||(egret={}));var egret;!function(t){function e(t){if(!t)return null;var e=i[t];if(e)return e;var r=t.split("."),n=r.length;e=__global;for(var o=0;n>o;o++){var a=r[o];if(e=e[a],!e)return null}return i[t]=e,e}var i={};t.getDefinitionByName=e}(egret||(egret={}));var __global=this.__global||this,egret;!function(t){t.getOption=function(t){if(window.location){var e=location.search;if(""==e)return"";e=e.slice(1);for(var i=e.split("&"),r=i.length,n=0;r>n;n++){var o=i[n],a=o.split("=");if(a[0]==t)return a[1]}}return""}}(egret||(egret={}));var egret;!function(t){function e(t){var e=typeof t;if(!t||"object"!=e&&!t.prototype)return e;var i=t.prototype?t.prototype:Object.getPrototypeOf(t);if(i.hasOwnProperty("__class__"))return i.__class__;var r=i.constructor.toString().trim(),n=r.indexOf("("),o=r.substring(9,n);return Object.defineProperty(i,"__class__",{value:o,enumerable:!1,writable:!0}),o}t.getQualifiedClassName=e}(egret||(egret={}));var egret;!function(t){function e(e){if(!e||"object"!=typeof e&&!e.prototype)return null;var i=e.prototype?e.prototype:Object.getPrototypeOf(e),r=Object.getPrototypeOf(i);if(!r)return null;var n=t.getQualifiedClassName(r.constructor);return n?n:null}t.getQualifiedSuperclassName=e}(egret||(egret={}));var egret;!function(t){function e(){return Date.now()-t.sys.$START_TIME}t.getTimer=e}(egret||(egret={}));var egret;!function(t){function e(e){var i=t.getDefinitionByName(e);return i?!0:!1}t.hasDefinition=e}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.PERMISSION_DENIED="permissionDenied",e.UNAVAILABLE="unavailable",e}(t.Event);t.GeolocationEvent=e,__reflect(e.prototype,"egret.GeolocationEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i,r){void 0===i&&(i=!1),void 0===r&&(r=!1);var n=e.call(this,t,i,r)||this;return n._status=0,n}return __extends(i,e),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),i.dispatchHTTPStatusEvent=function(e,r){var n=t.Event.create(i,i.HTTP_STATUS);n._status=r;var o=e.dispatchEvent(n);return t.Event.release(n),o},i.HTTP_STATUS="httpStatus",i}(t.Event);t.HTTPStatusEvent=e,__reflect(e.prototype,"egret.HTTPStatusEvent")}(egret||(egret={}));var egret;!function(t){function e(t,e){if(!t||"object"!=typeof t)return!1;var i=Object.getPrototypeOf(t),r=i?i.__types__:null;return r?-1!==r.indexOf(e):!1}t.is=e}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.isNumber=function(t){return"number"==typeof t&&!isNaN(t)},t.sin=function(e){var i=Math.floor(e),r=i+1,n=t.sinInt(i);if(i==e)return n;var o=t.sinInt(r);return(e-i)*o+(r-e)*n},t.sinInt=function(t){return t%=360,0>t&&(t+=360),egret_sin_map[t]},t.cos=function(e){var i=Math.floor(e),r=i+1,n=t.cosInt(i);if(i==e)return n;var o=t.cosInt(r);return(e-i)*o+(r-e)*n},t.cosInt=function(t){return t%=360,0>t&&(t+=360),egret_cos_map[t]},t}();t.NumberUtils=e,__reflect(e.prototype,"egret.NumberUtils")}(egret||(egret={}));for(var egret_sin_map={},egret_cos_map={},DEG_TO_RAD=Math.PI/180,NumberUtils_i=0;360>NumberUtils_i;NumberUtils_i++)egret_sin_map[NumberUtils_i]=Math.sin(NumberUtils_i*DEG_TO_RAD),egret_cos_map[NumberUtils_i]=Math.cos(NumberUtils_i*DEG_TO_RAD);egret_sin_map[90]=1,egret_cos_map[90]=0,egret_sin_map[180]=0,egret_cos_map[180]=-1,egret_sin_map[270]=-1,egret_cos_map[270]=0,Function.prototype.bind||(Function.prototype.bind=function(t){"function"!=typeof this&&egret.$error(1029);var e=Array.prototype.slice.call(arguments,1),i=this,r=function(){},n=function(){return i.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,n.prototype=new r,n});var egret;!function(t){function e(e,i){t.ticker.$startTick(e,i)}t.startTick=e}(egret||(egret={}));var egret;!function(t){function e(e,i){t.ticker.$stopTick(e,i)}t.stopTick=e}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i){void 0===i&&(i=0);var r=e.call(this)||this;return r._delay=0,r._currentCount=0,r._running=!1,r.updateInterval=1e3,r.lastCount=1e3,r.lastTimeStamp=0,r.delay=t,r.repeatCount=0|+i,r}return __extends(i,e),Object.defineProperty(i.prototype,"delay",{get:function(){return this._delay},set:function(t){1>t&&(t=1),this._delay!=t&&(this._delay=t,this.lastCount=this.updateInterval=Math.round(60*t))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentCount",{get:function(){return this._currentCount},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"running",{get:function(){return this._running},enumerable:!0,configurable:!0}),i.prototype.reset=function(){this.stop(),this._currentCount=0},i.prototype.start=function(){this._running||(this.lastCount=this.updateInterval,this.lastTimeStamp=t.getTimer(),t.ticker.$startTick(this.$update,this),this._running=!0)},i.prototype.stop=function(){this._running&&(t.stopTick(this.$update,this),this._running=!1)},i.prototype.$update=function(e){var i=e-this.lastTimeStamp;if(i>=this._delay)this.lastCount=this.updateInterval;else{if(this.lastCount-=1e3,this.lastCount>0)return!1;this.lastCount+=this.updateInterval}this.lastTimeStamp=e,this._currentCount++;var r=this.repeatCount>0&&this._currentCount>=this.repeatCount;return t.TimerEvent.dispatchTimerEvent(this,t.TimerEvent.TIMER),r&&(this.stop(),t.TimerEvent.dispatchTimerEvent(this,t.TimerEvent.TIMER_COMPLETE)),!1},i}(t.EventDispatcher);t.Timer=e,__reflect(e.prototype,"egret.Timer")}(egret||(egret={}));var egret;!function(t){function e(t){0>t&&(t=0),t>16777215&&(t=16777215);for(var e=t.toString(16).toUpperCase();e.length>6;)e=e.slice(1,e.length);for(;e.length<6;)e="0"+e;return"#"+e}t.toColorString=e}(egret||(egret={}));var egret;!function(t){function e(t,i){if("parsererror"==t.localName)throw new Error(t.textContent);for(var o=new r(t.localName,i,t.prefix,t.namespaceURI,t.nodeName),a=t.attributes,s=o.attributes,h=a.length,l=0;h>l;l++){var u=a[l],c=u.name;0!=c.indexOf("xmlns:")&&(s[c]=u.value,o["$"+c]=u.value)}var d=t.childNodes;h=d.length;for(var p=o.children,l=0;h>l;l++){var f=d[l],g=f.nodeType,y=null;if(1==g)y=e(f,o);else if(3==g){var v=f.textContent.trim();v&&(y=new n(v,o))}y&&p.push(y)}return o}var i=function(){function t(t,e){this.nodeType=t,this.parent=e}return t}();t.XMLNode=i,__reflect(i.prototype,"egret.XMLNode");var r=function(t){function i(e,i,r,n,o){var a=t.call(this,1,i)||this;return a.attributes={},a.children=[],a.localName=e,a.prefix=r,a.namespace=n,a.name=o,a}return __extends(i,t),i.parse=function(t){for(var i=o.parseFromString(t,"text/xml"),r=i.childNodes.length,n=0;r>n;n++){var a=i.childNodes[n];if(1==a.nodeType)return e(a,null)}return null},i}(i);t.XML=r,__reflect(r.prototype,"egret.XML");var n=function(t){function e(e,i){var r=t.call(this,3,i)||this;return r.text=e,r}return __extends(e,t),e}(i);t.XMLText=n,__reflect(n.prototype,"egret.XMLText");var o=new DOMParser}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){function e(t){t.onStart(h),s=t}function i(){if(l)for(var t=document.querySelectorAll(".egret-player"),e=t.length,i=0;e>i;i++){var r=t[i],n=r["egret-player"];n.updateScreenSize()}}function r(e){l||(l=!0,e||(e={}),t.WebAssembly.addModuleCallback(function(){if(t.Html5Capatibility.$init(),"webgl"==e.renderMode){var i=e.antialias;t.WebGLRenderContext.antialias=!!i}t.sys.CanvasRenderBuffer=t.CanvasRenderBuffer,n(e.renderMode);var r=t.ticker;o(r),e.screenAdapter?t.sys.screenAdapter=e.screenAdapter:t.sys.screenAdapter||(t.sys.screenAdapter=new t.sys.DefaultScreenAdapter);for(var s=document.querySelectorAll(".egret-player"),h=s.length,l=0;h>l;l++){var c=s[l],d=new t.WebPlayer(c,e);c["egret-player"]=d}window.addEventListener("resize",function(){isNaN(u)&&(u=window.setTimeout(a,300))})},null),t.WebAssembly.init(e.wasmSize,e.isWasm))}function n(e){"webgl"==e&&t.WebGLUtils.checkCanUseWebGL()?(t.sys.RenderBuffer=t.WebGLRenderBuffer,t.sys.systemRenderer=new t.WebGLRenderer,t.sys.canvasRenderer=new t.CanvasRenderer,t.sys.customHitTestBuffer=new t.WebGLRenderBuffer(3,3),t.sys.canvasHitTestBuffer=new t.CanvasRenderBuffer(3,3),t.Capabilities.$renderMode="webgl"):(t.sys.RenderBuffer=t.CanvasRenderBuffer,t.sys.systemRenderer=new t.CanvasRenderer,t.sys.canvasRenderer=t.sys.systemRenderer,t.sys.customHitTestBuffer=new t.CanvasRenderBuffer(3,3),t.sys.canvasHitTestBuffer=t.sys.customHitTestBuffer,t.Capabilities.$renderMode="canvas"),t.WebAssembly.setRenderMode(t.Capabilities.$renderMode)}function o(t){function e(){s&&s.onRender(h),t.update(),i.call(window,e)}var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;i||(i=function(t){return window.setTimeout(t,1e3/60)}),i.call(window,e)}function a(){u=0/0,t.updateAllScreens(),s&&s.onResize(h)}var s,h={setAutoClear:function(e){t.WebGLRenderBuffer.autoClear=e},save:function(){},restore:function(){var e=t.WebGLRenderContext.getInstance(0,0),i=e.context;i.bindBuffer(i.ARRAY_BUFFER,e.vertexBuffer),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.indexBuffer),i.activeTexture(i.TEXTURE0),e.bindIndices=!1,i.enable(i.BLEND),e.setBlendMode("source-over")}};t.setRendererContext=e;var l=!1;window.isNaN=function(t){return t=+t,t!==t},t.runEgret=r,t.updateAllScreens=i;var u=0/0}(egret||(egret={}));var language,egret;!function(t){function e(t,e){var r="";if(null!=e)r=i(t,e);else{if(null==a){var n=document.createElement("div").style;a=i("transform",n)}r=a}return""==r?t:r+t.charAt(0).toUpperCase()+t.substring(1,t.length)}function i(t,e){if(t in e)return"";t=t.charAt(0).toUpperCase()+t.substring(1,t.length);for(var i=["webkit","ms","Moz","O"],r=0;r<i.length;r++){var n=i[r]+t;
if(n in e)return i[r]}return""}var r=function(){function t(){}return t.QQ_AUDIO=1,t.WEB_AUDIO=2,t.HTML5_AUDIO=3,t}();t.AudioType=r,__reflect(r.prototype,"egret.AudioType");var n=function(){function t(){}return t.WPHONE=1,t.IOS=2,t.ADNROID=3,t}();t.SystemOSType=n,__reflect(n.prototype,"egret.SystemOSType");var o=function(e){function i(){return e.call(this)||this}return __extends(i,e),i.$init=function(){var e=navigator.userAgent.toLowerCase();i.ua=e,t.Capabilities.$isMobile=-1!=e.indexOf("mobile")||-1!=e.indexOf("android"),i._canUseBlob=!1;window.AudioContext||window.webkitAudioContext||window.mozAudioContext;if(e.indexOf("windows phone")>=0)i._System_OS=n.WPHONE,t.Capabilities.$os="Windows Phone";else if(e.indexOf("android")>=0){if(t.Capabilities.$os="Android",i._System_OS=n.ADNROID,window.hasOwnProperty("QZAppExternal")&&e.indexOf("qzone")>=0){var r=document.getElementsByTagName("base");if(r&&r.length>0);else{var o=window.location.href.indexOf("?");-1==o&&(o=window.location.href.length);var a=window.location.href.substring(0,o);a=a.substring(0,a.lastIndexOf("/"))}}}else e.indexOf("iphone")>=0||e.indexOf("ipad")>=0||e.indexOf("ipod")>=0?(t.Capabilities.$os="iOS",i._System_OS=n.IOS,i.getIOSVersion()>=7&&(i._canUseBlob=!0)):-1!=e.indexOf("windows nt")?t.Capabilities.$os="Windows PC":-1!=e.indexOf("mac os")&&(t.Capabilities.$os="Mac OS");var s=window.URL||window.webkitURL;s||(i._canUseBlob=!1),Module.isNative&&(i._canUseBlob=!0)},i.getIOSVersion=function(){var t=i.ua.toLowerCase().match(/cpu [^\d]*\d.*like mac os x/)[0];return parseInt(t.match(/\d+(_\d)*/)[0])||0},i.checkHtml5Support=function(){var e=(navigator.language||navigator.browserLanguage).toLowerCase(),i=e.split("-");i.length>1&&(i[1]=i[1].toUpperCase()),t.Capabilities.$language=i.join("-")},i._canUseBlob=!1,i._System_OS=0,i.ua="",i}(t.HashObject);t.Html5Capatibility=o,__reflect(o.prototype,"egret.Html5Capatibility");var a=null;t.getPrefixStyleName=e,t.getPrefix=i}(egret||(egret={}));var egret;!function(t){var e="egret.BitmapData";t.registerClass(HTMLImageElement,e),t.registerClass(HTMLCanvasElement,e),t.registerClass(HTMLVideoElement,e)}(egret||(egret={})),function(t){function e(e){return e.hashCode=e.$hashCode=t.$hashCount++,e}t.$toBitmapData=e}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){}return e.detect=function(){var i=t.Capabilities,r=navigator.userAgent.toLowerCase();i.$isMobile=-1!=r.indexOf("mobile")||-1!=r.indexOf("android"),i.$isMobile?r.indexOf("windows")<0&&(-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad")||-1!=r.indexOf("ipod"))?i.$os="iOS":-1!=r.indexOf("android")&&-1!=r.indexOf("linux")?i.$os="Android":-1!=r.indexOf("windows")&&(i.$os="Windows Phone"):-1!=r.indexOf("windows nt")?i.$os="Windows PC":-1!=r.indexOf("mac os")&&(i.$os="Mac OS");var n=(navigator.language||navigator.browserLanguage).toLowerCase(),o=n.split("-");o.length>1&&(o[1]=o[1].toUpperCase()),i.$language=o.join("-"),e.injectUIntFixOnIE9()},e.injectUIntFixOnIE9=function(){if(/msie 9.0/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)){var t="<!-- IEBinaryToArray_ByteStr -->\r\n<script type='text/vbscript' language='VBScript'>\r\nFunction IEBinaryToArray_ByteStr(Binary)\r\n   IEBinaryToArray_ByteStr = CStr(Binary)\r\nEnd Function\r\nFunction IEBinaryToArray_ByteStr_Last(Binary)\r\n   Dim lastIndex\r\n   lastIndex = LenB(Binary)\r\n   if lastIndex mod 2 Then\r\n       IEBinaryToArray_ByteStr_Last = Chr( AscB( MidB( Binary, lastIndex, 1 ) ) )\r\n   Else\r\n       IEBinaryToArray_ByteStr_Last = \"\"\r\n   End If\r\nEnd Function\r\n</script>\r\n<!-- convertResponseBodyToText -->\r\n<script>\r\nlet convertResponseBodyToText = function (binary) {\r\n   let byteMapping = {};\r\n   for ( let i = 0; i < 256; i++ ) {\r\n       for ( let j = 0; j < 256; j++ ) {\r\n           byteMapping[ String.fromCharCode( i + j * 256 ) ] =\r\n           String.fromCharCode(i) + String.fromCharCode(j);\r\n       }\r\n   }\r\n   let rawBytes = IEBinaryToArray_ByteStr(binary);\r\n   let lastChr = IEBinaryToArray_ByteStr_Last(binary);\r\n   return rawBytes.replace(/[\\s\\S]/g,                           function( match ) { return byteMapping[match]; }) + lastChr;\r\n};\r\n</script>\r\n";document.write(t)}},e}();t.WebCapability=e,__reflect(e.prototype,"egret.WebCapability"),e.detect()}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t){var i=e.call(this)||this;return i.isActivate=!0,i.stage=t,i.registerListener(),i}return __extends(i,e),i.prototype.registerListener=function(){var e=this,i=function(){e.isActivate&&(e.isActivate=!1,e.stage.dispatchEvent(new t.Event(t.Event.DEACTIVATE)))},r=function(){e.isActivate||(e.isActivate=!0,e.stage.dispatchEvent(new t.Event(t.Event.ACTIVATE)))},n=function(){document[o]?i():r()};window.addEventListener("focus",r,!1),window.addEventListener("blur",i,!1);var o,a;"undefined"!=typeof document.hidden?(o="hidden",a="visibilitychange"):"undefined"!=typeof document.mozHidden?(o="mozHidden",a="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(o="msHidden",a="msvisibilitychange"):"undefined"!=typeof document.webkitHidden?(o="webkitHidden",a="webkitvisibilitychange"):"undefined"!=typeof document.oHidden&&(o="oHidden",a="ovisibilitychange"),"onpageshow"in window&&"onpagehide"in window&&(window.addEventListener("pageshow",r,!1),window.addEventListener("pagehide",i,!1)),o&&a&&document.addEventListener(a,n,!1);var s=navigator.userAgent,h=/micromessenger/gi.test(s),l=/mqq/gi.test(s),u=/mobile.*qq/gi.test(s);if((u||h)&&(l=!1),l){var c=window.browser||{};c.execWebFn=c.execWebFn||{},c.execWebFn.postX5GamePlayerMessage=function(t){var e=t.type;"app_enter_background"==e?i():"app_enter_foreground"==e&&r()},window.browser=c}},i}(t.HashObject);t.WebHideHandler=e,__reflect(e.prototype,"egret.WebHideHandler")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(t,i){var r=e.call(this)||this;return r.init(t,i),r.initOrientation(),r}return __extends(i,e),i.prototype.init=function(e,i){var r=this.parseOption(e,i),n=new t.Stage;n.$screen=this,n.$scaleMode=r.scaleMode,n.$orientation=r.orientation,n.$maxTouches=r.maxTouches,n.frameRate=r.frameRate,n.textureScaleFactor=r.textureScaleFactor;var o=new t.sys.RenderBuffer(void 0,void 0,!0),a=o.surface;this.attachCanvas(e,a);var s=new t.WebTouchHandler(n,a),h=new t.sys.Player(o,n,r.entryClassName),l=new t.WebHideHandler(n),u=new t.HTMLInput;(r.showFPS||r.showLog)&&h.displayFPS(r.showFPS,r.showLog,r.logFilter,r.fpsStyles),this.playerOption=r,this.container=e,this.canvas=a,this.stage=n,this.player=h,this.webTouchHandler=s,this.webInput=u,this.webHide=l,t.$cacheTextAdapter(u,n,e,a),this.updateScreenSize(),this.updateMaxTouches(),h.start()},i.prototype.initOrientation=function(){var e=this;window.addEventListener("orientationchange",function(){window.setTimeout(function(){t.StageOrientationEvent.dispatchStageOrientationEvent(e.stage,t.StageOrientationEvent.ORIENTATION_CHANGE)},350)})},i.prototype.parseOption=function(e,i){var r={};r.entryClassName=e.getAttribute("data-entry-class"),r.scaleMode=e.getAttribute("data-scale-mode")||t.StageScaleMode.NO_SCALE,r.frameRate=+e.getAttribute("data-frame-rate")||30,r.contentWidth=+e.getAttribute("data-content-width")||480,r.contentHeight=+e.getAttribute("data-content-height")||800,r.orientation=e.getAttribute("data-orientation")||t.OrientationMode.AUTO,r.maxTouches=+e.getAttribute("data-multi-fingered")||2,r.textureScaleFactor=+e.getAttribute("texture-scale-factor")||1,"webgl"==i.renderMode?r.showPaintRect=!1:r.showPaintRect="true"==e.getAttribute("data-show-paint-rect"),r.showFPS="true"==e.getAttribute("data-show-fps");for(var n=e.getAttribute("data-show-fps-style")||"",o=n.split(","),a={},s=0;s<o.length;s++){var h=o[s].split(":");a[h[0]]=h[1]}return r.fpsStyles=a,r.showLog="true"==e.getAttribute("data-show-log"),r.logFilter=e.getAttribute("data-log-filter"),r},i.prototype.attachCanvas=function(t,e){var i=e.style;i.cursor="inherit",i.position="absolute",i.top="0",i.bottom="0",i.left="0",i.right="0",t.appendChild(e),i=t.style,i.overflow="hidden",i.position="relative",i.webkitTransform="translateZ(0)"},i.prototype.updateScreenSize=function(){var e=this.canvas;if(!e.userTyping){var i=this.playerOption,r=this.container.getBoundingClientRect(),n=0,o=r.width,a=r.height;r.top<0&&(a+=r.top,n=-r.top);var s=!1,h=this.stage.$orientation;h!=t.OrientationMode.AUTO&&(s=h!=t.OrientationMode.PORTRAIT&&a>o||h==t.OrientationMode.PORTRAIT&&o>a);var l=s?a:o,u=s?o:a;t.Capabilities.$boundingClientWidth=l,t.Capabilities.$boundingClientHeight=u;var c=t.sys.screenAdapter.calculateStageSize(this.stage.$scaleMode,l,u,i.contentWidth,i.contentHeight),d=c.stageWidth,p=c.stageHeight,f=c.displayWidth,g=c.displayHeight;e.width!==d&&(e.width=d),e.height!==p&&(e.height=p),e.style[t.getPrefixStyleName("transformOrigin")]="0% 0% 0px",e.style.width=f+"px",e.style.height=g+"px";var y=0;s?h==t.OrientationMode.LANDSCAPE?(y=90,e.style.top=n+(a-f)/2+"px",e.style.left=(o+g)/2+"px"):(y=-90,e.style.top=n+(a+f)/2+"px",e.style.left=(o-g)/2+"px"):(e.style.top=n+(a-g)/2+"px",e.style.left=(o-f)/2+"px");var v="rotate("+y+"deg)";e.style[t.getPrefixStyleName("transform")]=v;var m=f/d,b=g/p;this.webTouchHandler.updateScaleMode(m,b,y),this.webInput.$updateSize(),this.player.updateStageSize(d,p)}},i.prototype.setContentSize=function(t,e){var i=this.playerOption;i.contentWidth=t,i.contentHeight=e,this.updateScreenSize()},i.prototype.updateMaxTouches=function(){this.webTouchHandler.$updateMaxTouches()},i}(t.HashObject);t.WebPlayer=e,__reflect(e.prototype,"egret.WebPlayer",["egret.sys.Screen"])}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(i,r){var n=e.call(this)||this;return n.onTouchBegin=function(t){var e=n.getLocation(t);n.touch.onTouchBegin(e.x,e.y,t.identifier)},n.onTouchMove=function(t){var e=n.getLocation(t);n.touch.onTouchMove(e.x,e.y,t.identifier)},n.onTouchEnd=function(t){var e=n.getLocation(t);n.touch.onTouchEnd(e.x,e.y,t.identifier)},n.scaleX=1,n.scaleY=1,n.rotation=0,n.canvas=r,n.touch=new t.sys.TouchHandler(i),n.addListeners(),n}return __extends(i,e),i.prototype.addListeners=function(){var e=this;window.navigator.msPointerEnabled?(this.canvas.addEventListener("MSPointerDown",function(t){t.identifier=t.pointerId,e.onTouchBegin(t),e.prevent(t)},!1),this.canvas.addEventListener("MSPointerMove",function(t){t.identifier=t.pointerId,e.onTouchMove(t),e.prevent(t)},!1),this.canvas.addEventListener("MSPointerUp",function(t){t.identifier=t.pointerId,e.onTouchEnd(t),e.prevent(t)},!1)):(t.Capabilities.$isMobile||this.addMouseListener(),this.addTouchListener())},i.prototype.addMouseListener=function(){this.canvas.addEventListener("mousedown",this.onTouchBegin),this.canvas.addEventListener("mousemove",this.onTouchMove),this.canvas.addEventListener("mouseup",this.onTouchEnd)},i.prototype.addTouchListener=function(){var t=this;this.canvas.addEventListener("touchstart",function(e){for(var i=e.changedTouches.length,r=0;i>r;r++)t.onTouchBegin(e.changedTouches[r]);t.prevent(e)},!1),this.canvas.addEventListener("touchmove",function(e){for(var i=e.changedTouches.length,r=0;i>r;r++)t.onTouchMove(e.changedTouches[r]);t.prevent(e)},!1),this.canvas.addEventListener("touchend",function(e){for(var i=e.changedTouches.length,r=0;i>r;r++)t.onTouchEnd(e.changedTouches[r]);t.prevent(e)},!1),this.canvas.addEventListener("touchcancel",function(e){for(var i=e.changedTouches.length,r=0;i>r;r++)t.onTouchEnd(e.changedTouches[r]);t.prevent(e)},!1)},i.prototype.prevent=function(t){t.stopPropagation(),1==t.isScroll||this.canvas.userTyping||t.preventDefault()},i.prototype.getLocation=function(e){e.identifier=+e.identifier||0;var i=document.documentElement,r=this.canvas.getBoundingClientRect(),n=r.left+window.pageXOffset-i.clientLeft,o=r.top+window.pageYOffset-i.clientTop,a=e.pageX-n,s=a,h=e.pageY-o,l=h;return 90==this.rotation?(s=h,l=r.width-a):-90==this.rotation&&(s=r.height-h,l=a),s/=this.scaleX,l/=this.scaleY,t.$TempPoint.setTo(Math.round(s),Math.round(l))},i.prototype.updateScaleMode=function(t,e,i){this.scaleX=t,this.scaleY=e,this.rotation=i},i.prototype.$updateMaxTouches=function(){this.touch.$initMaxTouches()},i}(t.HashObject);t.WebTouchHandler=e,__reflect(e.prototype,"egret.WebTouchHandler")}(egret||(egret={}));var egret;!function(t){function e(t,e){var i=document.createElement("canvas");isNaN(t)||isNaN(e)||(i.width=t,i.height=e);var r=i.getContext("2d");if(void 0===r.imageSmoothingEnabled){for(var n,o=["webkitImageSmoothingEnabled","mozImageSmoothingEnabled","msImageSmoothingEnabled"],a=o.length-1;a>=0&&(n=o[a],void 0===r[n]);a--);try{Object.defineProperty(r,"imageSmoothingEnabled",{get:function(){return this[n]},set:function(t){this[n]=t}})}catch(s){r.imageSmoothingEnabled=r[n]}}return i}var i=function(){function t(t,i,r){this.surface=e(t,i),this.context=this.surface.getContext("2d")}return Object.defineProperty(t.prototype,"width",{get:function(){return this.surface.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.surface.height},enumerable:!0,configurable:!0}),t.prototype.resize=function(t,e,i){var r=this.surface;if(i){var n=!1;r.width<t&&(r.width=t,n=!0),r.height<e&&(r.height=e,n=!0),n||(this.context.globalCompositeOperation="source-over",this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1)}else r.width!=t&&(r.width=t),r.height!=e&&(r.height=e);this.clear()},t.prototype.getPixels=function(t,e,i,r){return void 0===i&&(i=1),void 0===r&&(r=1),this.context.getImageData(t,e,i,r).data},t.prototype.toDataURL=function(t,e){return this.surface.toDataURL(t,e)},t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.surface.width,this.surface.height)},t.prototype.destroy=function(){this.surface.width=this.surface.height=0},t}();t.CanvasRenderBuffer=i,__reflect(i.prototype,"egret.CanvasRenderBuffer",["egret.sys.RenderBuffer"])}(egret||(egret={}));var egret;!function(t){var e;!function(t){t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.FLOAT=5126]="FLOAT",t[t.BYTE=65535]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT"}(e=t.WEBGL_ATTRIBUTE_TYPE||(t.WEBGL_ATTRIBUTE_TYPE={}));var i=function(){function t(t,e,i){this.gl=t,this.name=i.name,this.type=i.type,this.size=i.size,this.location=t.getAttribLocation(e,this.name),this.count=0,this.initCount(t),this.format=t.FLOAT,this.initFormat(t)}return t.prototype.initCount=function(t){var i=this.type;switch(i){case e.FLOAT:case e.BYTE:case e.UNSIGNED_BYTE:case e.UNSIGNED_SHORT:this.count=1;break;case e.FLOAT_VEC2:this.count=2;break;case e.FLOAT_VEC3:this.count=3;break;case e.FLOAT_VEC4:this.count=4}},t.prototype.initFormat=function(t){var i=this.type;switch(i){case e.FLOAT:case e.FLOAT_VEC2:case e.FLOAT_VEC3:case e.FLOAT_VEC4:this.format=t.FLOAT;break;case e.UNSIGNED_BYTE:this.format=t.UNSIGNED_BYTE;break;case e.UNSIGNED_SHORT:this.format=t.UNSIGNED_SHORT;break;case e.BYTE:this.format=t.BYTE}},t}();t.EgretWebGLAttribute=i,__reflect(i.prototype,"egret.EgretWebGLAttribute")}(egret||(egret={}));var egret;!function(t){function e(t,e,i){var r=t.createShader(e);t.shaderSource(r,i),t.compileShader(r);var n=t.getShaderParameter(r,t.COMPILE_STATUS);return n||(console.log("shader not compiled!"),console.log(t.getShaderInfoLog(r))),r}function i(t,e,i){var r=t.createProgram();return t.attachShader(r,e),t.attachShader(r,i),t.linkProgram(r),r}function r(e,i){for(var r={},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES),o=0;n>o;o++){var a=e.getActiveAttrib(i,o),s=a.name,h=new t.EgretWebGLAttribute(e,i,a);r[s]=h}return r}function n(e,i){for(var r={},n=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),o=0;n>o;o++){var a=e.getActiveUniform(i,o),s=a.name,h=new t.EgretWebGLUniform(e,i,a);r[s]=h}return r}var o=function(){function t(t,o,a){this.vshaderSource=o,this.fshaderSource=a,this.vertexShader=e(t,t.VERTEX_SHADER,this.vshaderSource),this.fragmentShader=e(t,t.FRAGMENT_SHADER,this.fshaderSource),this.id=i(t,this.vertexShader,this.fragmentShader),this.uniforms=n(t,this.id),this.attributes=r(t,this.id)}return t.getProgram=function(e,i,r,n){return this.programCache[n]||(this.programCache[n]=new t(e,i,r)),this.programCache[n]},t.deleteProgram=function(t,e,i,r){},t.programCache={},t}();t.EgretWebGLProgram=o,__reflect(o.prototype,"egret.EgretWebGLProgram")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(t,e,i){this.gl=t,this.name=i.name,this.type=i.type,this.size=i.size,this.location=t.getUniformLocation(e,this.name),this.setDefaultValue(),this.generateSetValue(),this.generateUpload()}return t.prototype.setDefaultValue=function(){var t=this.type;switch(t){case 5126:case 35678:case 35680:case 35670:case 5124:this.value=0;break;case 35664:case 35671:case 35667:this.value=[0,0];break;case 35665:case 35672:case 35668:this.value=[0,0,0];break;case 35666:case 35673:case 35669:this.value=[0,0,0,0];break;case 35674:this.value=new Float32Array([1,0,0,1]);break;case 35675:this.value=new Float32Array([1,0,0,0,1,0,0,0,1]);break;case 35676:this.value=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}},t.prototype.generateSetValue=function(){var t=this.type;switch(t){case 5126:case 35678:case 35680:case 35670:case 5124:this.setValue=function(t){var e=this.value!==t;this.value=t,e&&this.upload()};break;case 35664:case 35671:case 35667:this.setValue=function(t){var e=this.value[0]!==t.x||this.value[1]!==t.y;this.value[0]=t.x,this.value[1]=t.y,e&&this.upload()};break;case 35665:case 35672:case 35668:this.setValue=function(t){this.value[0]=t.x,this.value[1]=t.y,this.value[2]=t.z,this.upload()};break;case 35666:case 35673:case 35669:this.setValue=function(t){this.value[0]=t.x,this.value[1]=t.y,this.value[2]=t.z,this.value[3]=t.w,this.upload()};break;case 35674:case 35675:case 35676:this.setValue=function(t){this.value.set(t),this.upload()}}},t.prototype.generateUpload=function(){var t=this.gl,e=this.type,i=this.location;switch(e){case 5126:this.upload=function(){var e=this.value;t.uniform1f(i,e)};break;case 35664:this.upload=function(){var e=this.value;t.uniform2f(i,e[0],e[1])};break;case 35665:this.upload=function(){var e=this.value;t.uniform3f(i,e[0],e[1],e[2])};break;case 35666:this.upload=function(){var e=this.value;t.uniform4f(i,e[0],e[1],e[2],e[3])};break;case 35678:case 35680:case 35670:case 5124:this.upload=function(){var e=this.value;t.uniform1i(i,e)};break;case 35671:case 35667:this.upload=function(){var e=this.value;t.uniform2i(i,e[0],e[1])};break;case 35672:case 35668:this.upload=function(){var e=this.value;t.uniform3i(i,e[0],e[1],e[2])};break;case 35673:case 35669:this.upload=function(){var e=this.value;t.uniform4i(i,e[0],e[1],e[2],e[3])};break;case 35674:this.upload=function(){var e=this.value;t.uniformMatrix2fv(i,!1,e)};break;case 35675:this.upload=function(){var e=this.value;t.uniformMatrix3fv(i,!1,e)};break;case 35676:this.upload=function(){var e=this.value;t.uniformMatrix4fv(i,!1,e)}}},t}();t.EgretWebGLUniform=e,__reflect(e.prototype,"egret.EgretWebGLUniform")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){this.drawData=[],this.drawDataLen=0}return t.prototype.pushDrawRect=function(){if(0==this.drawDataLen||1!=this.drawData[this.drawDataLen-1].type){var t=this.drawData[this.drawDataLen]||{};t.type=1,t.count=0,this.drawData[this.drawDataLen]=t,this.drawDataLen++}this.drawData[this.drawDataLen-1].count+=2},t.prototype.pushDrawTexture=function(t,e,i,r,n){if(void 0===e&&(e=2),i){var o=this.drawData[this.drawDataLen]||{};o.type=0,o.texture=t,o.filter=i,o.count=e,o.textureWidth=r,o.textureHeight=n,this.drawData[this.drawDataLen]=o,this.drawDataLen++}else{if(0==this.drawDataLen||0!=this.drawData[this.drawDataLen-1].type||t!=this.drawData[this.drawDataLen-1].texture||this.drawData[this.drawDataLen-1].filter){var o=this.drawData[this.drawDataLen]||{};o.type=0,o.texture=t,o.count=0,this.drawData[this.drawDataLen]=o,this.drawDataLen++}this.drawData[this.drawDataLen-1].count+=e}},t.prototype.pushPushMask=function(t){void 0===t&&(t=1);var e=this.drawData[this.drawDataLen]||{};e.type=2,e.count=2*t,this.drawData[this.drawDataLen]=e,this.drawDataLen++},t.prototype.pushPopMask=function(t){void 0===t&&(t=1);var e=this.drawData[this.drawDataLen]||{};e.type=3,e.count=2*t,this.drawData[this.drawDataLen]=e,this.drawDataLen++},t.prototype.pushSetBlend=function(t){for(var e=this.drawDataLen,i=!1,r=e-1;r>=0;r--){var n=this.drawData[r];if(n){if((0==n.type||1==n.type)&&(i=!0),!i&&4==n.type){this.drawData.splice(r,1),this.drawDataLen--;continue}if(4==n.type){if(n.value==t)return;break}}}var o=this.drawData[this.drawDataLen]||{};o.type=4,o.value=t,this.drawData[this.drawDataLen]=o,this.drawDataLen++},t.prototype.pushResize=function(t,e,i){var r=this.drawData[this.drawDataLen]||{};r.type=5,r.buffer=t,r.width=e,r.height=i,this.drawData[this.drawDataLen]=r,this.drawDataLen++},t.prototype.pushClearColor=function(){var t=this.drawData[this.drawDataLen]||{};t.type=6,this.drawData[this.drawDataLen]=t,this.drawDataLen++},t.prototype.pushActivateBuffer=function(t){for(var e=this.drawDataLen,i=!1,r=e-1;r>=0;r--){var n=this.drawData[r];!n||(4!=n.type&&7!=n.type&&(i=!0),i||7!=n.type)||(this.drawData.splice(r,1),this.drawDataLen--)}var o=this.drawData[this.drawDataLen]||{};o.type=7,o.buffer=t,o.width=t.rootRenderTarget.width,o.height=t.rootRenderTarget.height,this.drawData[this.drawDataLen]=o,this.drawDataLen++},t.prototype.pushEnableScissor=function(t,e,i,r){var n=this.drawData[this.drawDataLen]||{};n.type=8,n.x=t,n.y=e,n.width=i,n.height=r,this.drawData[this.drawDataLen]=n,this.drawDataLen++},t.prototype.pushDisableScissor=function(){var t=this.drawData[this.drawDataLen]||{};t.type=9,this.drawData[this.drawDataLen]=t,this.drawDataLen++},t.prototype.clear=function(){for(var t=0;t<this.drawDataLen;t++){var e=this.drawData[t];e.type=0,e.count=0,e.texture=null,e.filter=null,e.uv=null,e.value="",e.buffer=null,e.width=0,e.height=0}this.drawDataLen=0},t}();t.WebGLDrawCmdManager=e,__reflect(e.prototype,"egret.WebGLDrawCmdManager")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(i,r,n){var o=e.call(this)||this;if(o.context=t.WebGLRenderContext.getInstance(i,r),Module.isNative)return o.$width=i,o.$height=r,o.surface=o.context.surface,o.rootRenderTarget=null,n?o.bufferIdForWasm=0:o.bufferIdForWasm=t.WebAssemblyNode.setValuesToRenderBuffer(o),o;if(o.rootRenderTarget=new t.WebGLRenderTarget(o.context.context,3,3),i&&r&&o.resize(i,r),o.root=n,o.root)o.surface=o.context.surface;else{var a=o.context.activatedBuffer;a&&a.rootRenderTarget.activate(),o.rootRenderTarget.initFrameBuffer(),o.surface=o.rootRenderTarget}return o}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.$width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.$height},enumerable:!0,configurable:!0}),i.prototype.resize=function(e,i,r){e=e||1,i=i||1,this.$width=e,this.$height=i,null!==this.rootRenderTarget&&((e!=this.rootRenderTarget.width||i!=this.rootRenderTarget.height)&&(this.rootRenderTarget.resize(e,i),this.context.onResize(e,i),this.rootRenderTarget.width=e,this.rootRenderTarget.height=i),this.root&&(this.context.resize(e,i,r),t.WebAssembly.resize(e,i)))},i.prototype.getPixels=function(e,i,r,n){void 0===r&&(r=1),void 0===n&&(n=1);var o=new Uint8Array(4*r*n),a=t.WebAssembly.currentWebGLBuffer,s=this.rootRenderTarget.useFrameBuffer;return this.rootRenderTarget.useFrameBuffer=!0,t.WebAssembly.activateWebGLBuffer(this),this.context.getPixels(e,i,r,n,o),this.rootRenderTarget.useFrameBuffer=s,this.rootRenderTarget.activate(),t.WebAssembly.activateWebGLBuffer(a),o},i.prototype.toDataURL=function(t,e){return this.context.surface.toDataURL(t,e)},i.prototype.destroy=function(){this.context.destroy()},i.prototype.clear=function(){},i.autoClear=!0,i}(t.HashObject);t.WebGLRenderBuffer=e,__reflect(e.prototype,"egret.WebGLRenderBuffer",["egret.sys.RenderBuffer"])}(egret||(egret={}));var egret;!function(t){function e(t,e){var i=document.createElement("canvas");return isNaN(t)||isNaN(e)||(i.width=t,i.height=e),i}var i=function(){function i(i,r){if(this.glID=null,this.projectionX=0/0,this.projectionY=0/0,this.contextLost=!1,this.surface=e(i,r),!Module.isNative){this.initWebGL();var n=this.context;this.indexBuffer=n.createBuffer(),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.indexBuffer),n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),this.drawCmdManager=new t.WebGLDrawCmdManager,this.vao=new t.WebGLVertexArrayObject}}return i.getInstance=function(t,e){return this.instance?this.instance:(this.instance=new i(t,e),this.instance)},i.prototype.uploadIndicesArray=function(t){var e=this.context;e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW),this.bindIndices=!0},i.prototype.destroy=function(){this.surface.width=this.surface.height=0},i.prototype.onResize=function(t,e){t=t||this.surface.width,e=e||this.surface.height,this.projectionX=t/2,this.projectionY=-e/2,this.context&&this.context.viewport(0,0,t,e)},i.prototype.resize=function(t,e,i){var r=this.surface;i?(r.width<t&&(r.width=t),r.height<e&&(r.height=e)):(r.width!=t&&(r.width=t),r.height!=e&&(r.height=e)),this.onResize()},i.prototype.initWebGL=function(){this.onResize(),this.surface.addEventListener("webglcontextlost",this.handleContextLost.bind(this),!1),this.surface.addEventListener("webglcontextrestored",this.handleContextRestored.bind(this),!1),this.getWebGLContext()},i.prototype.handleContextLost=function(){this.contextLost=!0},i.prototype.handleContextRestored=function(){this.initWebGL(),this.contextLost=!1},i.prototype.getWebGLContext=function(){for(var e,r={antialias:i.antialias,stencil:!0},n=["webgl","experimental-webgl"],o=0;o<n.length;o++){try{e=this.surface.getContext(n[o],r)}catch(a){}if(e)break}e||t.$error(1021),this.setContext(e)},i.prototype.setContext=function(t){this.context=t,t.id=i.glContextId++,this.glID=t.id,t.disable(t.DEPTH_TEST),t.disable(t.CULL_FACE),t.enable(t.BLEND),t.colorMask(!0,!0,!0,!0),t.activeTexture(t.TEXTURE0)},i.prototype.getPixels=function(t,e,i,r,n){var o=this.context;o.readPixels(t,e,i,r,o.RGBA,o.UNSIGNED_BYTE,n)},i.prototype.createTexture=function(t){var e=this.context,i=e.createTexture();return i?(i.glContext=e,e.bindTexture(e.TEXTURE_2D,i),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i):void(this.contextLost=!0)},i.prototype.createTextureFromCompressedData=function(t,e,i,r,n){return null},i.prototype.updateTexture=function(t,e){var i=this.context;i.bindTexture(i.TEXTURE_2D,t),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e)},i.prototype.getWebGLTexture=function(t){return t.webGLTexture||("image"==t.format?t.webGLTexture=this.createTexture(t.source):"pvr"==t.format&&(t.webGLTexture=this.createTextureFromCompressedData(t.source.pvrtcData,t.width,t.height,t.source.mipmapsCount,t.source.format)),t.$deleteSource&&t.webGLTexture&&(t.source=null)),t.webGLTexture},i.prototype.$drawWebGL=function(){if(0!=this.drawCmdManager.drawDataLen&&!this.contextLost){this.vao.isMesh()&&this.uploadIndicesArray(this.vao.getMeshIndices());for(var t=this.drawCmdManager.drawDataLen,e=0,i=0;t>i;i++){var r=this.drawCmdManager.drawData[i];e=this.drawData(r,e),7==r.type&&(this.activatedBuffer=r.buffer)}this.vao.isMesh()&&this.uploadIndicesArray(this.vao.getIndices()),this.drawCmdManager.clear(),this.vao.clear()}},i.prototype.drawData=function(t,e){if(t){this.context,t.filter;switch(t.type){case 5:t.buffer.rootRenderTarget.resize(t.width,t.height),this.onResize(t.width,t.height);break;case 6:if(this.activatedBuffer){var i=this.activatedBuffer.rootRenderTarget;(0!=i.width||0!=i.height)&&i.clear()}}return e}},i.glContextId=0,i}();t.WebGLRenderContext=i,__reflect(i.prototype,"egret.WebGLRenderContext")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.prototype.render=function(t,e,i,r,n){return 0},t.prototype.drawNodeToBuffer=function(t,e,i,r){},t.prototype.drawDisplayToBuffer=function(t,e,i){return 0},t}();t.WebGLRenderer=e,__reflect(e.prototype,"egret.WebGLRenderer",["egret.sys.SystemRenderer"])}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,i,r){var n=t.call(this)||this;return n.clearColor=[0,0,0,0],n.useFrameBuffer=!0,n.gl=e,n.width=i||1,n.height=r||1,n}return __extends(e,t),e.prototype.resize=function(t,e){var i=this.gl;this.width=t,this.height=e,this.frameBuffer&&(i.bindTexture(i.TEXTURE_2D,this.texture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),this.stencilBuffer&&(i.deleteRenderbuffer(this.stencilBuffer),this.stencilBuffer=null)},e.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.getFrameBuffer())},e.prototype.getFrameBuffer=function(){return this.useFrameBuffer?this.frameBuffer:null},e.prototype.initFrameBuffer=function(){if(!this.frameBuffer){var t=this.gl;this.texture=this.createTexture(),this.frameBuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}},e.prototype.createTexture=function(){var t=this.gl,e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e},e.prototype.clear=function(t){var e=this.gl;t&&this.activate(),e.colorMask(!0,!0,!0,!0),e.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),e.clear(e.COLOR_BUFFER_BIT)},e.prototype.enabledStencil=function(){if(this.frameBuffer&&!this.stencilBuffer){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer)}},e}(t.HashObject);t.WebGLRenderTarget=e,__reflect(e.prototype,"egret.WebGLRenderTarget")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){}return e.compileProgram=function(i,r,n){var o=e.compileFragmentShader(i,n),a=e.compileVertexShader(i,r),s=i.createProgram();return i.attachShader(s,a),i.attachShader(s,o),i.linkProgram(s),i.getProgramParameter(s,i.LINK_STATUS)||t.$warn(1020),s},e.compileFragmentShader=function(t,i){return e._compileShader(t,i,t.FRAGMENT_SHADER)},e.compileVertexShader=function(t,i){return e._compileShader(t,i,t.VERTEX_SHADER)},e._compileShader=function(t,e,i){var r=t.createShader(i);return t.shaderSource(r,e),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)?r:null},e.checkCanUseWebGL=function(){if(void 0==e.canUseWebGL)try{var t=document.createElement("canvas");e.canUseWebGL=!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(i){e.canUseWebGL=!1}return e.canUseWebGL},e.deleteWebGLTexture=function(t){if(t){var e=t.glContext;e&&e.deleteTexture(t)}},e}();t.WebGLUtils=e,__reflect(e.prototype,"egret.WebGLUtils")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){this.size=4096,this.vertexMaxSize=4*this.size,this.indicesMaxSize=6*this.size,this.vertSize=5,this.indices=null,this.indicesForMesh=null,this.vertexIndex=0,this.indexIndex=0,this.hasMesh=!1;var t=(this.vertexMaxSize*this.vertSize,this.indicesMaxSize);this.indices=new Uint16Array(t),this.indicesForMesh=new Uint16Array(t);
for(var e=0,i=0;t>e;e+=6,i+=4)this.indices[e+0]=i+0,this.indices[e+1]=i+1,this.indices[e+2]=i+2,this.indices[e+3]=i+0,this.indices[e+4]=i+2,this.indices[e+5]=i+3}return t.prototype.getIndices=function(){return this.indices},t.prototype.getMeshIndices=function(){return this.indicesForMesh},t.prototype.changeToMeshIndices=function(){if(!this.hasMesh){for(var t=0,e=this.indexIndex;e>t;++t)this.indicesForMesh[t]=this.indices[t];this.hasMesh=!0}},t.prototype.isMesh=function(){return this.hasMesh},t.prototype.cacheArrays=function(t,e,i,r,n,o,a,s,h,l,u,c,d,p){},t.prototype.clear=function(){this.hasMesh=!1,this.vertexIndex=0,this.indexIndex=0},t}();t.WebGLVertexArrayObject=e,__reflect(e.prototype,"egret.WebGLVertexArrayObject")}(egret||(egret={}));