diff --git a/dist/rexgameobjectshellplugin.js b/dist/rexgameobjectshellplugin.js index 349bf96265..68ee4faea1 100644 --- a/dist/rexgameobjectshellplugin.js +++ b/dist/rexgameobjectshellplugin.js @@ -38536,7 +38536,7 @@ var selectedFile = files[0]; return canvas.loadFromFilePromise(selectedFile).then(function () { imageBox.scaleImage(); - parent.emit('select', selectedFile, self); + parent.emit('select', selectedFile, parent); }); }; @@ -38576,6 +38576,14 @@ } }; + var GetFileName = function GetFileName(file) { + if (!file) { + return null; + } + var name = file.name; + return name.substr(0, name.lastIndexOf('.')); + }; + var SaveTexture = function SaveTexture(key) { var canvas = this.childrenMap.canvas; canvas.generateTexture(key); @@ -38583,6 +38591,7 @@ }; var methods$i = { + getFileName: GetFileName, saveTexture: SaveTexture }; Object.assign(methods$i, OpenMethods); @@ -38613,7 +38622,7 @@ } _this.clickTarget = GetClickTarget(_assertThisInitialized(_this), config); if (_this.clickTarget) { - if (!GetValue$1o(config, 'domButton', false)) { + if (!GetValue$1o(config, 'domButton', true)) { _this.clickBehavior = CreateClickBehavior(_assertThisInitialized(_this), config); } else { _this.fileChooser = CreateFileChooser(_assertThisInitialized(_this)); diff --git a/dist/rexgameobjectshellplugin.min.js b/dist/rexgameobjectshellplugin.min.js index 6fce045e57..2b0d6a72c1 100644 --- a/dist/rexgameobjectshellplugin.min.js +++ b/dist/rexgameobjectshellplugin.min.js @@ -19,4 +19,4 @@ var Mn=Phaser.Renderer.WebGL.Utils,En={renderWebGL:function(t,e,i,n){if(0!==e.wi * @author Richard Davey * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(Cs.prototype,Nn,xs);var ws=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"freeLine",value:function(t){if(t)return this.push(t),this}},{key:"freeLines",value:function(t){if(t)return this.pushMultiple(t),this}},{key:"getLine",value:function(t,e,i){var n=this.pop();return null===n&&(n={}),n.text=t,n.width=e,n.newLineMode=i,n}}]),i}(ui),Ss=Phaser.Utils.Objects.IsPlainObject,Os=Phaser.Utils.Objects.GetValue,Ps=function(t,e){Ss(t)?t=(e=t).key:void 0===e&&(e={key:t}),e.hasOwnProperty("key")||(e.key=t);var i=e.key,n=e.frame,s=e.width,r=e.height;if(void 0===s||void 0===r){var o=this.textureManager.getFrame(i,n),a=o?o.cutWidth:0,h=o?o.cutHeight:0;void 0===s&&void 0===r?(s=a,r=h):void 0===s?s=a*(r/h):void 0===r&&(r=h*(s/a));}this.images[t]={key:i,frame:n,width:s,height:r,y:Os(e,"y",0),left:Os(e,"left",0),right:Os(e,"right",0),originX:Os(e,"originX",0),originY:Os(e,"originY",0)};},Ts=function(){function t(e){r(this,t),this.textureManager=e.sys.textures,this.images={};}return a(t,[{key:"destroy",value:function(){this.textureManager=void 0,this.images=void 0;}},{key:"add",value:function(t,e){if("string"==typeof t)Ps.call(this,t,e);else if(Array.isArray(t))for(var i=0,n=(s=t).length;i0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(vr);Object.assign(Dr.prototype,Lr);var Ar=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Ir=Phaser.Utils.Objects.GetValue,zr=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Ir(n,"color",null),Ir(n,"color2",null),Ir(n,"horizontalGradient",!0)),s.setStroke(Ir(n,"stroke",null),Ir(n,"strokeThickness",2)),s.setCornerRadius(Ir(n,"cornerRadius",0),Ir(n,"cornerIteration",null)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,Ar("color2",t,this),Ar("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Ar("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Ar("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return g(u(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){Tn(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Dr),Fr=Phaser.Utils.Objects.GetValue,Yr=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(Fr(n,"color",null),Fr(n,"color2",null),Fr(n,"horizontalGradient",!0)),s.setStroke(Fr(n,"stroke",null),Fr(n,"strokeThickness",2)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){g(u(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Fr(t,"color2",null),Fr(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Fr(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(Dr),Vr=Phaser.Utils.Objects.GetValue,Wr=function(){function t(e,i){r(this,t),this.parent=e,this.set(i);}return a(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(Vr(t,"bold",!1)),this.setItalic(Vr(t,"italic",!1)),this.setFontSize(Vr(t,"fontSize","16px")),this.setFontFamily(Vr(t,"fontFamily","Courier")),this.setColor(Vr(t,"color","#fff")),this.setStrokeStyle(Vr(t,"stroke",null),Vr(t,"strokeThickness",0)),this.setShadow(Vr(t,"shadowColor",null),Vr(t,"shadowOffsetX",0),Vr(t,"shadowOffsetY",0),Vr(t,"shadowBlur",0)),this.setOffset(Vr(t,"offsetX",0),Vr(t,"offsetY",0)),this.setSpace(Vr(t,"leftSpace",0),Vr(t,"rightSpace",0)),this.setAlign(Vr(t,"align",void 0)),this.setBackgroundColor(Vr(t,"backgroundColor",null)),this.setBackgroundHeight(Vr(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Vr(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle(Ar("stroke",t,this),Ar("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Ar("shadowOffsetX",t,this),Ar("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=Cn(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=Cn(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=Cn(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=Cn(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),Xr=Phaser.Utils.Array.Remove,Gr=Phaser.Utils.Array.Remove,Hr="text",Ur="image",Nr="drawer",Kr="space",Jr="command",Zr=function(t){return t.type===Hr&&"\n"===t.text},qr=function(t){return t.type===Hr&&"\f"===t.text},$r=function(t){return t.type===Hr},Qr=function(t){return t.type===Jr},to=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,Hr)).updateTextFlag=!1,o.style=new Wr(d(o),s),o.setText(n),o}return a(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),k(u(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),k(u(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),g(u(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&g(u(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(Dr),eo=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},io=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,Ur)).setTexture(n,s),o}return a(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(Dr),no=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},so=function(t){l(i,t);var e=p(i);function i(t,n,s,o){var a;return r(this,i),(a=e.call(this,t,Nr)).setRenderCallback(n),a.setDrawerSize(s,o),a}return a(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(Dr),ro=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,Kr)).setSpaceWidth(n),s}return a(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(Dr),oo=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},ao=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;return r(this,i),(h=e.call(this,t,Jr)).setName(n).setParameter(o).setCallback(s,a),h}return a(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(vr),ho=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},lo=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},uo=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=po.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=po.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=go(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=go(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=go(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=go(t,"letterSpacing",0),f=go(t,"hAlign",0),p=go(t,"vAlign",0),v=go(t,"charWrap",!1),g=lo({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=!R&&g.start===P,g.maxLineWidth=L,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,Y=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=mo(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=mo(t,"maxLines",0);var a=0===i,h=mo(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=mo(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=mo(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=mo(t,"letterSpacing",0),f=mo(t,"rtl",!0),p=mo(t,"hAlign",f?2:0),v=mo(t,"vAlign",0),g=lo({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=g.start===P,g.maxLineHeight=L,g.linesWidth=M.length*r;var I=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,z=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return pr(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return fr(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),Xr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return Gr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,C(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(C(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,C(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Hr);return null===i?i=new to(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),_r(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(ea(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},sa=function(t){return t>>16&255},ra=function(t){return t>>8&255},oa=function(t){return 255&t},aa=Phaser.Events.EventEmitter,ha=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=la),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},la={},ua=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=ha),function(t){if(t.events)return t;var e=new aa,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},ca=Phaser.Utils.Array.Remove,da={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=sa(e),n=ra(e),s=oa(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=sa(e=r),n=ra(e),s=oa(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&ua(e,this.viewport),this.effectPropertiesConfig&&ea(e,this.effectPropertiesConfig),e.once("destroy",(function(){ca(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?Va:Ya,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=Fa,this}},{key:"update",value:function(t,e){this.state!==Fa&&this.state!==Xa&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=Wa)):(this.nowTime=this.duration,this.state=Xa):this.nowTime>=0&&(this.state=Va));}},{key:"t",get:function(){var t;switch(this.state){case Fa:case Ya:case Wa:t=0;break;case Va:t=this.nowTime/this.duration;break;case Xa:t=1;}return Ia(t,0,1)},set:function(t){(t=Ia(t,-1,1))<0?(this.state=Ya,this.nowTime=-this.delay*t):(this.state=Va,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++);}},{key:"setT",value:function(t){return this.t=t,this}},{key:"isIdle",get:function(){return this.state===Fa}},{key:"isDelay",get:function(){return this.state===Ya}},{key:"isCountDown",get:function(){return this.state===Va}},{key:"isRunning",get:function(){return this.state===Ya||this.state===Va}},{key:"isDone",get:function(){return this.state===Xa}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),Fa=0,Ya=1,Va=2,Wa=3,Xa=-1,Ga=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).timer=new za,s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(g(u(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),g(u(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),g(u(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),g(u(i.prototype),"complete",this).call(this),this}}]),i}(ja),Ha=Phaser.Utils.Objects.GetValue,Ua=Phaser.Utils.Objects.GetAdvancedValue,Na=Phaser.Tweens.Builders.GetEaseFunction,Ka=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Ha(t,"timer")),this.setEnable(Ha(t,"enable",!0)),this.setTarget(Ha(t,"target",this.parent)),this.setDelay(Ua(t,"delay",0)),this.setDuration(Ua(t,"duration",1e3)),this.setEase(Ha(t,"ease","Linear")),this.setRepeat(Ha(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setTarget",value:function(t){return void 0===t&&(t=this.parent),this.target=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=Na(t),this}},{key:"start",value:function(){return this.timer.isRunning||g(u(i.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"stop",value:function(t){return void 0===t&&(t=!1),g(u(i.prototype),"stop",this).call(this),t&&(this.timer.setT(1),this.updateGameObject(this.target,this.timer),this.complete()),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable||!this.parent.active)return this;var i=this.target,n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),i}(Ga),Ja=Phaser.Sound.BaseSound,Za=function(t){return t instanceof Ja},qa=Phaser.Utils.Objects.GetValue,$a=Phaser.Utils.Objects.GetAdvancedValue,Qa=Phaser.Math.Linear,th=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),Za(t)&&(s=n,n=t,t=void 0),n.active=!0,n.scene=t,n.game=n.manager.game,(o=e.call(this,n,s)).volume={},o.resetFromJSON(s),o}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(qa(t,"mode",0)),this.setEnable(qa(t,"enable",!0)),this.setVolumeRange($a(t,"volume.start",this.parent.volume),$a(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=eh[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),g(u(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Qa(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(g(u(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(Ka),eh={stop:1,destroy:2},ih=function(t,e,i,n,s){Za(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new th(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},nh=function(t,e,i,n){Za(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new th(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},sh=Phaser.Utils.Objects.GetValue,rh={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:sh(e,"loop",this.backgroundMusicLoop),mute:sh(e,"mute",this.backgroundMusicMute),volume:sh(e,"volume",this.backgroundMusicVolume),detune:sh(e,"detune",0),rate:sh(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&ih(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&nh(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},oh=Phaser.Utils.Objects.GetValue,ah={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:oh(e,"loop",this.backgroundMusicLoop),mute:oh(e,"mute",this.backgroundMusic2Mute),volume:oh(e,"volume",this.backgroundMusic2Volume),detune:oh(e,"detune",0),rate:oh(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&ih(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&nh(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},hh=Phaser.Utils.Array.Remove,lh=Phaser.Utils.Objects.GetValue,uh={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:lh(e,"mute",this.soundEffectsMute),volume:lh(e,"volume",this.soundEffectsVolume),detune:lh(e,"detune",0),rate:lh(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&hh(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&hh(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&ih(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&nh(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)nh(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&ih(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&nh(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)nh(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(Si(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return a(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=qs(this.delimiterLeft),e=qs(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=zh:t||(t=Yh),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return n.setDelimiters(s[0],s[1]),n}return a(i,[{key:"setTagExpression",value:function(t){return t||(t=Wh),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=Wh),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){g(u(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==Wh||this.valueExpression!==Wh){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=qs(this.delimiterLeft),e=qs(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=zh);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Nl,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===Hr&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else Qr(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),$l(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Nl),i=0,n=e.length;i0&&o.chainAnimation(i,n);},cu=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,C(i));},du=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,C(i));},fu=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,C(i));},pu=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(lu(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(C(s))):a.setProperty(i,n,s[0]);}},Cu={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},xu=function(t){var e,i,n,s,r,o,a,h,l=m(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},wu=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(gu(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return zu.length=0,!0;return zu.length=0,!1},zu=[],Fu=void 0,Yu=Phaser.Utils.Objects.GetValue,Vu=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=Yu(e,r,n[1]))&&(i[n[0]]=s);return i},Wu=function(t){t.addEventListener("touchstart",Xu,!1),t.addEventListener("touchmove",Xu,!1),t.addEventListener("touchend",Xu,!1),t.addEventListener("mousedown",Xu,!1),t.addEventListener("mouseup",Xu,!1),t.addEventListener("mousemove",Xu,!1);},Xu=function(t){t.stopPropagation();},Gu=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Hu=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Gu,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this);},Uu=function(){this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this);},Nu=Phaser.Utils.Objects.GetValue,Ku=function(t,e){var i,n=Nu(e,"inputType",void 0);void 0===n&&(n=Nu(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Nu(e,"style",void 0),r=i.style;Vu(ju,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",Vu(Bu,e,i),Wu(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i.addEventListener("focus",(function(e){Hu.call(t);})),i.addEventListener("blur",(function(e){Uu.call(t);})),i},Ju={open:function(){return this.isOpened||this.readOnly||((t=this)!==Fu&&(void 0!==Fu&&Fu.close(),Fu=t),this.node||(this.node=Ku(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===Fu&&(Fu=void 0),this.setBlur(),this):this}},Zu=Phaser.Utils.Objects.GetValue,qu=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),s=e.call(this,t);var o=Zu(n,"inputType",void 0);void 0===o&&(o=Zu(n,"type","text")),s.setEnterCloseEnable(Zu(n,"enterClose","textarea"!==o));var a=Zu(n,"onOpen",void 0);a||(a=Zu(n,"onFocus",void 0)),s.onOpenCallback=a;var h=Zu(n,"onClose",void 0);return h||(h=Zu(n,"onBlur",void 0)),s.onCloseCallback=h,s.onUpdateCallback=Zu(n,"onUpdate",void 0),s.isOpened=!1,t.on("pointerdown",(function(){this.open();}),d(s)).setInteractive(),s.nodeConfig=function(t){void 0===t&&(t={});var e={};return Du(t,e,"inputType"),Du(t,e,"type"),Du(t,e,"style"),Du(t,e,ju),Du(t,e,Bu),e}(n),s.node=void 0,s}return a(i,[{key:"destroy",value:function(){this.close(),g(u(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){Au(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(Ea);Object.assign(qu.prototype,Ju);var $u=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},Qu=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(Qu(this),tc(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=$u,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(qu),nc=Phaser.Utils.Objects.GetValue,sc=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],rc=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}cc.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(dc(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=pd(t,"tl",0),this.radiusTR=pd(t,"tr",0),this.radiusBL=pd(t,"bl",0),this.radiusBR=pd(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Ni(e,e,e,e,180,270,!1,r,t):Ni(0,0,e,e,90,0,!0,r,t):Hi(0,0,t);(e=this.radiusTR)>0?this._convexTR?Ni(n-e,e,e,e,270,360,!1,r,t):Ni(n,0,e,e,180,90,!0,r,t):Hi(n,0,t);(e=this.radiusBR)>0?this._convexBR?Ni(n-e,s-e,e,e,0,90,!1,r,t):Ni(n,s,e,e,270,180,!0,r,t):Hi(n,s,t);(e=this.radiusBL)>0?this._convexBL?Ni(e,s-e,e,e,90,180,!1,r,t):Ni(0,s,e,e,360,270,!0,r,t):Hi(0,s,t);return t.push(t[0],t[1]),Zc(this.x,this.y,t),g(u(i.prototype),"updateData",this).call(this),this}}]),i}(zc),gd=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,yd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),void 0===t&&(t=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,n),l.setP1(s,o),l.setP2(a,h),l}return a(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),g(u(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=gd(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&qi(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&(Qi(t,this),t.fill()),this.isStroked&&(tn(t,this),t.stroke());}}]),i}(Ac),kd={buildShapes:function(){this.addShape((new vd).setName("box")).addShape((new cd).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},md=Phaser.Utils.Objects.GetValue,bd=Phaser.Math.Linear,Cd=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).resetFromJSON(),s.boot(),s}return a(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=md(t,"key","value");var n=e[this.propertyKey];return this.fromValue=md(t,"from",n),this.toValue=md(t,"to",n),this.setEase(md(t,"ease",this.ease)),this.setDuration(md(t,"duration",this.duration)),this.setRepeat(md(t,"repeat",0)),this.setDelay(md(t,"delay",0)),this.setRepeatDelay(md(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,g(u(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=bd(this.fromValue,this.toValue,i);}}]),i}(Ka),xd={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new Cd(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},wd={};Object.assign(wd,jc,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},kd,xd);var Sd=Phaser.Utils.Objects.GetValue,Od=Phaser.Utils.Objects.IsPlainObject,Pd=23730,Td=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),Od(n)?(n=Sd(l=n,"x",0),s=Sd(l,"y",0),o=Sd(l,"width",2),a=Sd(l,"height",2),h=Sd(l,"color",Pd)):Od(h)&&(h=Sd(l=h,"color",Pd)),(u=e.call(this,t,n,s,o,a)).type="rexCheckbox",void 0===h&&(h=Pd),u.setBoxShape(Sd(l,"circleBox",!1)),u.setBoxFillStyle(h,Sd(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(Sd(l,"uncheckedColor",null),Sd(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(Sd(l,"boxLineWidth",4),Sd(l,"boxStrokeColor",h),Sd(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,Sd(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),Sd(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(Sd(l,"checkerColor",16777215),Sd(l,"checkerAlpha",1)),u.setBoxSize(Sd(l,"boxSize",1)),u.setCheckerSize(Sd(l,"checkerSize",1)),u.setCheckerAnimationDuration(Sd(l,"animationDuration",150)),u.buildShapes();var c=Sd(l,"checked");return void 0===c&&(c=Sd(l,"value",!1)),u.setValue(c),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(Bc);Object.assign(Td.prototype,wd);var Md=Phaser.Utils.Objects.GetValue,Ed=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(Md(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(Md(t,"enable",!0)),this.setMode(Md(t,"mode",1)),this.setClickInterval(Md(t,"clickInterval",100)),this.setDragThreshold(Md(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=_d[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,i,n){void 0===this.pointer&&(this.pointer=t,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&t.getDistance()>=this.dragThreshold&&this.cancel();}},{key:"click",value:function(t,e,i){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.parent,e,i),this;this.pointer=void 0;var n=this.lastClickTime;return void 0!==n&&t-n<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(Ea),_d={press:0,pointerdown:0,release:1,pointerup:1},Ld=Phaser.Utils.Objects.GetValue,Rd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new Ed(d(u),Ld(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(Ld(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Td),Bd={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},jd={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},Dd={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},Ad=function(t,e,i){return (e-t)*i+t},Id=Phaser.Math.Linear,zd={buildShapes:function(){this.addShape((new vd).setName("track")).addShape((new vd).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Ad(sa(l),sa(u),c))<<16|(255&Ad(ra(l),ra(u),c))<<8|255&Ad(oa(l),oa(u),c)),f=Id(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=Id(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},Fd={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new Cd(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Yd={};Object.assign(Yd,Bd,jd,Dd,zd,Fd);var Vd=Phaser.Utils.Objects.GetValue,Wd=Phaser.Utils.Objects.IsPlainObject,Xd=23730,Gd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),Wd(n)?(n=Vd(l=n,"x",0),s=Vd(l,"y",0),o=Vd(l,"width",2),a=Vd(l,"height",2),h=Vd(l,"color",Xd)):Wd(h)&&(h=Vd(l=h,"color",Xd)),(u=e.call(this,t,n,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=Xd),u.setTrackFillStyle(h,Vd(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Vd(l,"falseValueTrackColor",function(t){var e=.3*sa(t)+.59*ra(t)+.11*oa(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Vd(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Vd(l,"thumbColor",16777215),Vd(l,"thumbAlpha",1)),u.setTrackSize(Vd(l,"trackWidth",.9),Vd(l,"trackHeight",.5)),u.setTrackRadius(Vd(l,"trackRadius",.5*u.trackHeight));var c=Vd(l,"thumbHeight",void 0),d=Vd(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Vd(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Vd(l,"thumbLeft",.3),Vd(l,"thumbRight",void 0)),u.setRTL(Vd(l,"rtl",!1)),u.setToggleAnimationDuration(Vd(l,"animationDuration",150)),u.buildShapes(),u.setValue(Vd(l,"value",!1),0),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(Bc);Object.assign(Gd.prototype,Yd);var Hd=Phaser.Utils.Objects.GetValue,Ud=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new Ed(d(u),Hd(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(Hd(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Gd),Nd={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Kd=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i)}(kn);Object.assign(Kd.prototype,Nd),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var Jd=Phaser.Math.Linear,Zd=Phaser.Math.Percent,qd={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Zd(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Zd(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Jd(t,e,i)),i}},$d=Phaser.Math.Percent,Qd={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=$d(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new Cd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new Cd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},tf=Phaser.Utils.Objects.GetValue,ef=Phaser.Math.Clamp;function nf(t){var e=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=tf(t,"eventEmitter",this);var e=tf(t,"valuechangeCallback",null);if(null!==e){var i=tf(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(tf(t,"easeValue.duration",0)).setEaseValueFunction(tf(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=ef(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,qd,Qd),e}var sf=Phaser.Math.RadToDeg,rf=Phaser.Math.DegToRad,of=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=rf(r),u=rf(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},af={buildShapes:function(){this.addShape((new cd).setName("track")).addShape((new cd).setName("bar")).addShape((new Vc).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),of(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=sf(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),of(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},hf=Phaser.Utils.Objects.GetValue,lf=Phaser.Utils.Objects.IsPlainObject,uf=Phaser.Math.Clamp,cf=Phaser.Math.DegToRad(270),df=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),lf(n)&&(n=hf(l=n,"x",0),s=hf(l,"y",0),o=hf(l,"radius",1),a=hf(l,"barColor",void 0),h=hf(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,n,s,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(hf(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(hf(l,"centerColor",void 0)),u.setThickness(hf(l,"thickness",.2)),u.setStartAngle(hf(l,"startAngle",cf)),u.setAnticlockwise(hf(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return a(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(g(u(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=uf(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(nf(Bc));Object.assign(df.prototype,af);Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.IsPlainObject,Phaser.Math.Clamp,Phaser.Math.DegToRad(270);nf(kn);var ff=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},pf=Phaser.Utils.Objects.GetValue,vf=Phaser.Utils.Objects.IsPlainObject,gf=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),vf(n)?(n=pf(u=n,"x",0),s=pf(u,"y",0),o=pf(u,"width",2),a=pf(u,"height",2),h=pf(u,"barColor",void 0),l=pf(u,"value",0)):vf(o)?(o=pf(u=o,"width",2),a=pf(u,"height",2),h=pf(u,"barColor",void 0),l=pf(u,"value",0)):vf(h)&&(h=pf(u=h,"barColor",void 0),l=pf(u,"value",0)),(c=e.call(this,t,n,s,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new cd).setName("trackFill")).addShape((new cd).setName("bar")).addShape((new cd).setName("trackStroke")),c.setTrackColor(pf(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(pf(u,"trackStrokeThickness",2),pf(u,"trackStrokeColor",void 0)),c.setSkewX(pf(u,"skewX",0)),c.setRTL(pf(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(nf(Bc)),yf={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&ff(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),ff(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&ff(a,0,0,e,i,t).end();}};Object.assign(gf.prototype,yf);var kf=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),kf(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},bf=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},Cf=Phaser.Utils.Objects.GetValue,xf=Phaser.Utils.Objects.IsPlainObject,wf=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),xf(n)?(n=Cf(u=n,"x",0),s=Cf(u,"y",0),o=Cf(u,"width",2),a=Cf(u,"height",2),h=Cf(u,"barColor",void 0),l=Cf(u,"value",0)):xf(o)?(o=Cf(u=o,"width",2),a=Cf(u,"height",2),h=Cf(u,"barColor",void 0),l=Cf(u,"value",0)):xf(h)&&(h=Cf(u=h,"barColor",void 0),l=Cf(u,"value",0)),(c=e.call(this,t,n,s,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(Cf(u,"trackColor",void 0)),c.setBarColor(h,Cf(u,"barColor2",void 0),Cf(u,"isHorizontalGradient",void 0)),c.setTrackStroke(Cf(u,"trackStrokeThickness",2),Cf(u,"trackStrokeColor",void 0)),c.setSkewX(Cf(u,"skewX",0)),c.setRTL(Cf(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),mf.call(this),g(u(i.prototype),"updateTexture",this).call(this),this}}]),i}(nf(kn));Phaser.Math.Wrap;var Sf=Phaser.Math.Linear,Of=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],C=this.easeDirectionProgress;t=Sf(m.a.x,b.a.x,C),e=Sf(m.a.y,b.a.y,C),i=Sf(m.b.x,b.b.x,C),n=Sf(m.b.y,b.b.y,C),s=Sf(m.c.x,b.c.x,C),r=Sf(m.c.y,b.c.y,C);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Pf=(0, Phaser.Math.DegToRad)(120),Tf=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+Pf),i+n*Math.sin(s+Pf)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Pf),i+n*Math.sin(s-Pf)),this.arrowOnly?t.end():t.close();},Mf={buildShapes:function(){this.addShape((new cd).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?Of.call(this):Tf.call(this);}},Ef={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new Cd(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},_f=Phaser.Utils.Objects.GetValue,Lf=Phaser.Utils.Objects.IsPlainObject,Rf=Phaser.Math.DegToRad,Bf=Phaser.Math.RadToDeg,jf=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(r(this,i),Lf(n)){var m=n;n=m.x,s=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,n,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return a(i,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Af(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,i,s){if("object"===n(t)){var r=t,o=_f(r,"x",null);null!==o?(t=o,i=o):(t=_f(r,"left",0),i=_f(r,"right",t));var a=_f(r,"y",null);null!==a?(e=a,s=a):(e=_f(r,"top",0),s=_f(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=i||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Bf(this.verticeRotation)},set:function(t){this.verticeRotation=Rf(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),i}(Bc),Df={right:0,down:1,left:2,up:3},Af=function(t){return "string"==typeof t&&(t=Df[t]),t%=4};Object.assign(jf.prototype,Mf,Ef);var If=function(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer};var zf=Phaser.Display.Align,Ff={center:zf.CENTER,left:zf.LEFT_CENTER,right:zf.RIGHT_CENTER,top:zf.TOP_CENTER,bottom:zf.BOTTOM_CENTER,"left-top":zf.TOP_LEFT,"top-left":zf.TOP_LEFT,"left-center":zf.LEFT_CENTER,"center-left":zf.LEFT_CENTER,"left-bottom":zf.BOTTOM_LEFT,"bottom-left":zf.BOTTOM_LEFT,"center-top":zf.TOP_CENTER,"top-center":zf.TOP_CENTER,"center-center":zf.CENTER,"center-bottom":zf.BOTTOM_CENTER,"bottom-center":zf.BOTTOM_CENTER,"right-top":zf.TOP_RIGHT,"top-right":zf.TOP_RIGHT,"right-center":zf.RIGHT_CENTER,"center-right":zf.RIGHT_CENTER,"right-bottom":zf.BOTTOM_RIGHT,"bottom-right":zf.BOTTOM_RIGHT},Yf=new Phaser.GameObjects.Zone({sys:{queueDepthSort:We,events:{once:We}}},0,0,1,1);Yf.setOrigin(0);var Vf=0,Wf=1,Xf=2,Gf=4,Hf=6,Uf=8,Nf=10,Kf=12,Jf=function(t){var e=Mt(t);return t.y+e-e*t.originY},Zf=function(t){var e=Tt(t);return t.x-e*t.originX+.5*e},qf=function(t,e){var i=Mt(t);return t.y=e-i+i*t.originY,t},$f=function(t,e){var i=Tt(t),n=i*t.originX;return t.x=e+n-.5*i,t},Qf=function(t){var e=Tt(t);return t.x-e*t.originX},tp=function(t,e){var i=Tt(t);return t.x=e+i*t.originX,t},ep=function(t){var e=Tt(t);return t.x+e-e*t.originX},ip=function(t,e){var i=Tt(t);return t.x=e-i+i*t.originX,t},np=function(t,e){var i=Mt(t),n=i*t.originY;return t.y=e+n-.5*i,t},sp=function(t){var e=Mt(t);return t.y-e*t.originY+.5*e},rp=function(t){var e=Mt(t);return t.y-e*t.originY},op=function(t,e){var i=Mt(t);return t.y=e+i*t.originY,t},ap=[];ap[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,Zf(e)+i),qf(t,Jf(e)+n),t},ap[Nf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)-i),qf(t,Jf(e)+n),t},ap[Kf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ip(t,ep(e)+i),qf(t,Jf(e)+n),t},ap[Hf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){$f(t,e),np(t,i);}(t,Zf(e)+i,sp(e)+n),t},ap[Gf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)-i),np(t,sp(e)+n),t},ap[Uf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ip(t,ep(e)+i),np(t,sp(e)+n),t},ap[Wf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,Zf(e)+i),op(t,rp(e)-n),t},ap[Vf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)-i),op(t,rp(e)-n),t},ap[Xf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ip(t,ep(e)+i),op(t,rp(e)-n),t};var hp=function(t,e,i,n,s){return ap[i](t,e,n,s)},lp=function(t,e,i,n,s,r){Yf.setPosition(e,i).setSize(n,s),hp(t,Yf,r);},up=Phaser.Utils.Objects.GetValue,cp=Phaser.GameObjects.Group,dp=function(t,e,i){return t.add.text(0,0,"")},fp=void 0,pp=Phaser.Utils.Objects.GetValue,vp=function(t,e){return void 0===t&&(t=0),void 0===e&&(e={}),"number"==typeof t?(e.left=t,e.right=t,e.top=t,e.bottom=t):(e.left=pp(t,"left",0),e.right=pp(t,"right",0),e.top=pp(t,"top",0),e.bottom=pp(t,"bottom",0)),e},gp=se.prototype.add,yp=function(t){return gp.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this},kp={addBackground:function(t,e,i){return void 0===this.backgroundChildren&&(this.backgroundChildren=[]),"string"==typeof e&&(i=e,e=void 0),void 0===e&&(e=0),yp.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=vp(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},mp=function t(e,i){var n=null;if(void 0===i)e.hasOwnProperty("rexContainer")&&((n=e.rexContainer.parent)?n.isRexSizer||(n=t(n)):n=null);else for(n=t(e);n&&n.name!==i;)n=t(n);return n},bp={getParentSizer:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),mp(t,e)},getTopmostSizer:function(t){return void 0===t&&(t=this),function(t){for(var e=mp(t);e;)t=e,e=mp(e);return t}(t)},hasParentSizer:function(t,e){void 0===e&&(e=this);for(var i=mp(e);i;){if(i===t)return !0;i=mp(i);}return !1},hasChild:function(t,e){return void 0===e&&(e=this),this.hasParentSizer(e,t)}},Cp=Phaser.Utils.Array.Remove,xp=se.prototype.remove,wp=bp.getParentSizer,Sp=function(t,e){for(var i=wp(t);i;)i.removeChildCallback&&i.removeChildCallback(t,e),i=wp(i);return this.isBackground(t)&&Cp(this.backgroundChildren,t),xp.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this},Op=Phaser.Utils.Array.Remove,Pp=bp.getParentSizer,Tp={removeFromParentSizer:function(){var t=Pp(gameObject);return t&&t.remove(this),this},removeBackground:function(t,e){return void 0===this.backgroundChildren||this.getParentSizer(t)!==this||(Op(this.backgroundChildren,t),Sp.call(this,t,e)),this},removeAllBackgrounds:function(t){if(void 0===this.backgroundChildren)return this;for(var e=this.backgroundChildren.length-1;e>=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Mp={getInnerPadding:function(t){return fr(this.space,t)},setInnerPadding:function(t,e){return pr(this.space,t,e),this},getOuterPadding:function(t){return fr(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return pr(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),fr(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),pr(this.getSizerConfig(t).padding,e,i),this}},Ep=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},_p=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Lp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,C(i.children)));}return t}},Rp=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(Dv),Iv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=Ta(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},zv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=We),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=We),this.transitOutCallback=t,this}},Fv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Yv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},Vv={};Object.assign(Vv,Iv,zv,Fv,Yv);var Wv=Phaser.Utils.Objects.GetValue,Xv=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).setTransitInTime(Wv(n,"duration.in",200)),s.setTransitOutTime(Wv(n,"duration.out",200)),s.setTransitInCallback(Wv(n,"transitIn")),s.setTransitOutCallback(Wv(n,"transitOut")),s.oneShotMode=Wv(n,"destroy",!1),s.delayCallTimer=void 0,s._state=new Av(d(s),{eventEmitter:!1,initState:Wv(n,"initState","IDLE")}),s.openEventData=void 0,s.closeEventData=void 0,s}return a(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),g(u(i.prototype),"shutdown",this).call(this,t));}}]),i}(Ea);Object.assign(Xv.prototype,Vv);var Gv=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,0,0,2,2,n,1)).setAlpha(s),o.setScrollFactor(0),o.boot(),o}return a(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),Hv=Phaser.Utils.Objects.GetValue,Uv=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,{eventEmitter:!1})).resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Hv(t,"hitAreaMode",0)),this.setEnable(Hv(t,"enable",!0)),this.setStopMode(Hv(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=Nv[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(Ea),Nv={default:0,fullWindow:1},Kv=Phaser.Utils.Objects.GetValue,Jv=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=Kv(n,"color",0),a=Kv(n,"alpha",.8);return (s=e.call(this,t,o,a)).touchEventStop=new Uv(d(s),{hitAreaMode:1}),s}return a(i)}(Gv),Zv=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Yp(t,e);},qv=function(t,e){Vp(t,e,void 0,void 0,!1);},$v=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,qp(t,e);},Qv=function(t,e){$p(t,e,!1);},tg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,qp(t,e,t.alpha);},eg=function(t,e){$p(t,e,!1);},ig=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!Rt(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},ng=Phaser.Utils.Objects.GetValue,sg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=rg.popUp),null==n.transitOut&&(n.transitOut=rg.scaleDown),n.destroy=ng(n,"destroy",!0),s=e.call(this,t,n);var o=ng(n,"cover");s.cover=!1!==o?function(t,e){var i=t.scene,n=new Jv(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,s.cover&&(s.setCoverTransitInCallback(ng(o,"transitIn",tg)),s.setCoverTransitOutCallback(ng(o,"transitOut",eg)));var a=ng(n,"touchOutsideClose",!1),h=ng(n,"duration.hold",-1),l=ng(n,"timeOutClose",h>=0),u=ng(n,"anyTouchClose",!1);return ng(n,"manualClose",!1)&&(a=!1,u=!1,l=!1),u&&(a=!1),l?s.setDisplayTime(h):s.setDisplayTime(-1),u?s.once("open",s.anyTouchClose,d(s)):a&&s.once("open",s.touchOutsideClose,d(s)),ng(n,"openOnStart",!0)&&s.delayCall(0,s.requestOpen,d(s)),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ig(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=g(u(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=g(u(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),g(u(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=rg[t]),t){case rg.popUp:t=Zv;break;case rg.fadeIn:t=$v;}return g(u(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=rg[t]),t){case rg.scaleDown:t=qv;break;case rg.fadeOut:t=Qv;}return g(u(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(Xv),rg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},og={modal:function(t,e){return Oe(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=function(t,e){var i=new sg(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i}(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return function(t,e){t.emit("modal.requestClose",e);}(this,t),this}},ag=function(t,e,i,n){if(e)return ig(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(Ea),Sg={press:0,pointerdown:0,release:1,pointerup:1},Og={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new wg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Pg=function(t){l(i,t);var e=p(i);function i(){var t;return r(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return a(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(Dv),Tg=Phaser.Utils.Objects.GetValue,Mg=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,s.cooldown=new Pg,s.parent.setInteractive(Tg(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Tg(t,"enable",!0)),this.setCooldown(Tg(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(Ea),Eg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&ag(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Mg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Mg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},_g=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=Ug,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===Ng&&this.onDragEnd(),this.pointer=void 0,this.tracerState=Ug,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){g(u(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){g(u(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Kg,this}}]),i}(La),Ug=0,Ng=1,Kg="IDLE",Jg=Phaser.Utils.Objects.GetValue,Zg=Phaser.Math.Distance.Between,qg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=$g;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(Jg(t,"time",250)),this.setTapInterval(Jg(t,"tapInterval",200)),this.setDragThreshold(Jg(t,"threshold",9)),this.setTapOffset(Jg(t,"tapOffset",10));var e=Jg(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(Jg(t,"maxTaps",void 0)),this.setMinTaps(Jg(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case $g:this.state=Qg;break;case Qg:var t=this.lastPointer;Zg(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=ty,this.state=Qg);break;case ty:this.state=Qg;}}},{key:"onDragEnd",value:function(){this.state===Qg&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=ty));}},{key:"onDrag",value:function(){this.state!==$g&&this.pointer.getDistance()>this.dragThreshold&&(this.state=$g);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===Qg){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=$g);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=ty:this.state=$g);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===ty&&(this.state=$g);}},{key:"isTapped",get:function(){return this.state===ty}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(Hg),$g="IDLE",Qg="BEGIN",ty="RECOGNIZED",ey=Phaser.Utils.Objects.GetValue,iy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=ny;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(ey(t,"threshold",9)),this.setHoldTime(ey(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=sy,0===this.holdTime&&(this.state=ry);}},{key:"onDragEnd",value:function(){this.state=ny;}},{key:"onDrag",value:function(){this.state!==ny&&this.pointer.getDistance()>this.dragThreshold&&(this.state=ny);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===sy&&t-this.pointer.downTime>=this.holdTime&&(this.state=ry));}},{key:"isPressed",get:function(){return this.state===ry}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Hg),ny="IDLE",sy="BEGIN",ry="RECOGNIZED";Phaser.Utils.Objects.GetValue;var oy=Phaser.Math.Distance.Between,ay=Phaser.Math.Angle.Between,hy={getDt:function(){return Tc(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return oy(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return ay(e.x,e.y,t.x,t.y)}},ly={"up&down":0,"left&right":1,"4dir":2,"8dir":3},uy={},cy=Phaser.Utils.Objects.GetValue,dy=Phaser.Math.RadToDeg,fy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=py;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s.clearDirectionStates(),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(cy(t,"threshold",10)),this.setVelocityThreshold(cy(t,"velocityThreshold",1e3)),this.setDirectionMode(cy(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=vy;}},{key:"onDragEnd",value:function(){this.state=py;}},{key:"onDrag",value:function(){this.state===vy&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=gy));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===gy&&(this.state=py);}},{key:"isSwiped",get:function(){return this.state===gy}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=ly[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=uy),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(dy(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(Hg);Object.assign(fy.prototype,hy);var py="IDLE",vy="BEGIN",gy="RECOGNIZED",yy=Phaser.Utils.Objects.GetValue,ky=Phaser.Utils.Array.SpliceOne,my=Phaser.Math.Distance.Between,by=Phaser.Math.Angle.Between,Cy=function(){function t(e,i){r(this,t);var n=e.input.manager.pointersTotal-1;n<2&&e.input.addPointer(2-n),this.scene=e,this.setEventEmitter(yy(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return a(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(yy(t,"enable",!0)),this.bounds=yy(t,"bounds",void 0),this.tracerState=wy,this.pointers.length=0,Wt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,Wt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case wy:this.tracerState=Sy,this.onDrag1Start();break;case Sy:this.tracerState=Oy,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],ky(this.pointers,e),this.tracerState){case Sy:this.tracerState=wy,this.onDrag1End();break;case Oy:this.tracerState=Sy,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case Sy:this.onDrag1();break;case Oy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Oy&&this.onDrag2End(),this.pointers.length=0,Wt(this.movedState),this.tracerState=wy,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0],e=this.pointers[1];return my(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0],e=this.pointers[1];return by(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;xy.x=e.x-i.x,xy.y=e.y-i.y;}else xy.x=0,xy.y=0;return xy}},{key:"centerX",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==Oy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==Oy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Py,this}}]),t}();Object.assign(Cy.prototype,Ho);var xy={},wy=0,Sy=1,Oy=2,Py="IDLE";Phaser.Utils.Objects.GetValue;var Ty=Phaser.Math.RotateAround,My=function(t,e,i,n){return Ty(t,e,i,n),t.rotation+=n,t},Ey={},_y=Phaser.Utils.Objects.GetValue,Ly=Phaser.Math.Angle.WrapDegrees,Ry=Phaser.Math.Angle.ShortestBetween,By=Phaser.Math.RadToDeg,jy=Phaser.Math.DegToRad,Dy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=Iy;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(_y(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Ly(By(this.angleBetween)),this.state=zy,0===this.dragThreshold&&(this.state=Fy);}},{key:"onDrag2End",value:function(){this.state=Iy;}},{key:"onDrag2",value:function(){switch(this.state){case zy:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Ly(By(this.angleBetween));this.angle=Ry(this.prevAngle,t),this.prevAngle=t,this.state=Fy;}break;case Fy:t=Ly(By(this.angleBetween));this.angle=Ry(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===Fy}},{key:"rotation",get:function(){return jy(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Cy),Ay={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Ey),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?u.pop().setTexture(d,M):s(c,d,M),h&&c.add.existing(T),l){var E=b+w*P+o*w,_=C+S*O+a*S;T.setOrigin(o,a).setPosition(E,_).setScale(g,y).setRotation(k),am(T,b,C,k);}x.push(T);}return x}(t,e,i,n),o=0,a=r.length;ol?(n.width=a*l,n.height=a):(n.width=o,n.height=a);}else n.width=s,n.height=r;else {var l=s/r;n.width=Math.min(s,o),n.height=Math.min(r,a);var u=n.width/n.height;ul&&(n.width=n.height*l);}return n}(t,{width:this.width,height:this.height},this.scaleUp,!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return g(u(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(se);Object.assign(xm.prototype,lm);var wm=Phaser.Math.Wrap,Sm=function(t){l(i,t);var e=p(i);function i(t){var n;return r(this,i),(n=e.call(this,t,0,0,1,1)).isRexSpace=!0,n}return a(i)}(Phaser.GameObjects.Zone),Om=function(t,e){var i=this.sizerChildren;if(0===i.length)return -1;for(var n=-1,s=1/0,r=0,o=i.length;r(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},Pm=Phaser.Utils.Objects.IsPlainObject,Tm=Phaser.Utils.Objects.GetValue,Mm=Phaser.Display.Align.CENTER,Em={min:0,full:-1},_m=function(t,e,i,s,r,o,a,h,l,u){yp.call(this,t);var c=t.isRexSpace,d=n(e);if(null===e)return this;if("number"===d);else if("string"===d)e=Em[e];else if(Pm(e)){var f;e=Tm(f=e,"proportion",void 0),i=Tm(f,"align",Mm),s=Tm(f,"padding",0),r=Tm(f,"expand",!1),o=Tm(f,"key",void 0),a=Tm(f,"index",void 0),t.isRexSizer||(h=Tm(f,"minWidth",void 0),l=Tm(f,"minHeight",void 0)),u=Tm(f,"fitRatio",0);}return "string"==typeof i&&(i=Ff[i]),void 0===e&&(e=c?1:0),void 0===i&&(i=Mm),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=i,f.padding=vp(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?Tt(t):h:t.minHeight=void 0===l?Mt(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},Lm={add:_m,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),_m.call(this,new Sm(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return Pm(i)&&(i.index=t),_m.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=Om.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Rm=Phaser.Utils.Array.Remove,Bm={remove:function(t,e){return this.getParentSizer(t)!==this||(Rm(this.sizerChildren,t),Sp.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,sk.call(this,t),this}},jm={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Ff[e]),this.getSizerConfig(t).align=e,this}},Dm={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=_p.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(Dm,Lm,Bm,jm,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var Am=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},Im={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},zm=function(t){return "string"==typeof t&&(t=Im[t]),t},Fm=Phaser.Utils.Objects.IsPlainObject,Ym=Phaser.Utils.Objects.GetValue,Vm=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),Fm(n)?(n=Ym(l=n,"x",0),s=Ym(l,"y",0),o=Ym(l,"width",void 0),a=Ym(l,"height",void 0),h=Ym(l,"orientation",0)):Fm(o)?(o=Ym(l=o,"width",void 0),a=Ym(l,"height",void 0),h=Ym(l,"orientation",0)):Fm(h)&&(h=Ym(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,n,s,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(Ym(l,"space.item",0)),u.setStartChildIndex(Ym(l,"startChildIndex",0)),u.setRTL(Ym(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return a(i,[{key:"setOrientation",value:function(t){return this.orientation=zm(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=Am.call(this)),this._childrenProportion}}]),i}(Zy);Object.assign(Vm.prototype,Dm);var Wm=function(t,e,i){if(t){var n=null==e,s=null==i;return n&&s||(n||(t.displayWidth=e),s||(t.displayHeight=i),n&&(t.scaleX=t.scaleY),s&&(t.scaleY=t.scaleX)),t}},Xm={appendText:Es,resetDisplayContent:function(t){void 0===t?t={}:"string"==typeof t&&(t={text:t});var e=t.text||"";this.setText(e);var i=this.childrenMap.icon;if(i){t.icon?this.show(i):this.hide(i);var n=t.iconSize;n&&(this.setChildDisplaySize(i,n,n),void 0!==this.iconWidth&&this.setIconSize(n)),!0!==t.icon&&this.setIconTexture(t.icon,t.iconFrame);}var s=this.childrenMap.action;if(s){t.action?this.show(s):this.hide(s);var r=t.actionSize;r&&(this.setChildDisplaySize(s,r,r),void 0!==this.actionWidth&&this.setActionSize(r)),!0!==t.action&&this.setActionTexture(t.action,t.actionFrame);}return this}},Gm=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"text",get:function(){var t=this.childrenMap.text;return t?t.text:""},set:function(t){var e=this.childrenMap.text;e&&e.setText(t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"setIconTexture",value:function(t,e){var i=this.childrenMap.icon;return i?(i.setTexture(t,e),void 0!==this.iconWidth&&void 0!==this.iconHeight&&(Wm(i,this.iconWidth,this.iconHeight),this.resetChildScaleState(i)),this):this}},{key:"setTexture",value:function(t,e){return this.setIconTexture(t,e),this}},{key:"setIconSize",value:function(t,e){return void 0===e&&(e=t),this.iconWidth=t,this.iconHeight=e,this}},{key:"texture",get:function(){var t=this.childrenMap.icon;if(t)return t.texture}},{key:"frame",get:function(){var t=this.childrenMap.icon;if(t)return t.frame}},{key:"setActionTexture",value:function(t,e){var i=this.childrenMap.action;return void 0===i||(i.setTexture(t,e),void 0!==this.actionWidth&&void 0!==this.actionHeight&&(Wm(i,this.actionWidth,this.actionHeight),this.resetChildScaleState(i))),this}},{key:"actionTexture",get:function(){var t=this.childrenMap.action;if(t)return t.texture}},{key:"actionFrame",get:function(){var t=this.childrenMap.action;if(t)return t.frame}},{key:"setActionSize",value:function(t,e){return void 0===e&&(e=t),this.actionWidth=t,this.actionHeight=e,this}},{key:"preLayout",value:function(){var t=this.childrenMap.icon;t&&void 0!==this.iconWidth&&void 0!==this.iconHeight&&Wm(t,this.iconWidth,this.iconHeight);var e=this.childrenMap.action;e&&void 0!==this.actionWidth&&void 0!==this.actionHeight&&Wm(e,this.actionWidth,this.actionHeight),g(u(i.prototype),"preLayout",this).call(this);}},{key:"postLayout",value:function(t,e,i){var n=this.childrenMap.iconMask;n&&(n.setPosition(),this.resetChildPositionState(n));var s=this.childrenMap.actionMask;return s&&(s.setPosition(),this.resetChildPositionState(s)),this}},{key:"resize",value:function(t,e){g(u(i.prototype),"resize",this).call(this,t,e);var n=this.childrenMap.iconMask;n&&n.resize();var s=this.childrenMap.actionMask;return s&&s.resize(),this}}]),i}(Vm);Object.assign(Gm.prototype,Xm);var Hm=function(t,e,i,n){var s=new tm(e,i,n);if(t&&!t.isRexSizer){var r=s.createGeometryMask();t.setMask(r),this.once("destroy",(function(){t.setMask(),r.destroy();}));}return this.pin(s),s},Um=Phaser.Utils.Objects.GetValue,Nm=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexLabel";var o=Um(n,"background",void 0),a=Um(n,"icon",void 0),h=Um(n,"iconMask",void 0),l=Um(n,"text",void 0),u=Um(n,"action",void 0),c=Um(n,"actionMask",void 0),f=Um(n,"align",void 0);if(o&&s.addBackground(o),"right"!==f&&"bottom"!==f&&"center"!==f||s.addSpace(),a){0===s.orientation?(l||u)&&(C={right:Um(n,"space.icon",0),top:Um(n,"space.iconTop",0),bottom:Um(n,"space.iconBottom",0),left:Um(n,"space.iconLeft",0)}):(l||u)&&(C={bottom:Um(n,"space.icon",0),left:Um(n,"space.iconLeft",0),right:Um(n,"space.iconRight",0),top:Um(n,"space.iconTop",0)});var p=Um(n,"squareFitIcon",!1)?1:0;if(s.add(a,{proportion:0,padding:C,fitRatio:p}),h&&(h=Hm.call(d(s),a,a,1)),!p){var v=Um(n,"iconSize",void 0);s.setIconSize(Um(n,"iconWidth",v),Um(n,"iconHeight",v));}}if(l){var g,y,k=Um(n,"space.text",0),m=Um(n,"expandTextWidth",!1),b=Um(n,"expandTextHeight",!1);0===s.orientation?(g=m?1:0,u&&(C={right:k}),y=b):(g=b?1:0,u&&(C={bottom:k}),y=m),s.add(l,{proportion:g,expand:y,padding:C});}if(u){var C;C=0===s.orientation?{top:Um(n,"space.actionTop",0),bottom:Um(n,"space.actionBottom",0),right:Um(n,"space.actionRight",0)}:{left:Um(n,"space.actionLeft",0),right:Um(n,"space.actionRight",0),bottom:Um(n,"space.actionBottom",0)};p=Um(n,"squareFitAction",!1)?1:0;if(s.add(u,{proportion:0,padding:C,fitRatio:p}),c&&(c=Hm.call(d(s),u,u,1)),!p){var x=Um(n,"actionSize");s.setActionSize(Um(n,"actionWidth",x),Um(n,"actionHeight",x));}}return "center"===f&&s.addSpace(),s.addChildrenMap("background",o),s.addChildrenMap("icon",a),s.addChildrenMap("iconMask",h),s.addChildrenMap("text",l),s.addChildrenMap("action",u),s.addChildrenMap("actionMask",c),s}return a(i)}(Gm),Km=Phaser.Utils.Objects.GetValue,Jm=function(t,e){var i=Km(e,"canvas"),n=Km(i,"width",128),s=Km(i,"height",128),r=new Kd(t,0,0,n,s);t.add.existing(r);var o=Km(i,"key"),a=Km(i,"frame"),h=Km(i,"fill");return void 0!==h?r.fill(h):void 0!==o&&r.loadTexture(o,a),r.setTexture=r.loadTexture.bind(r),r},Zm=Phaser.Utils.Objects.GetValue,qm=function(t,e){var i=Zm(e,"clickTarget",t);return "string"==typeof i&&(i=t.getElement(i)),i},$m=Phaser.Utils.Objects.GetValue,Qm=Phaser.Utils.Objects.GetValue,tb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Hl(qe(e).events,"focus").then((function(){return void 0===(t=n)&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}));var t,e;})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},eb=Phaser.Utils.Objects.GetValue,ib=Phaser.DOM.RemoveFromDOM,nb=function(t,e){var i=eb(e,"closeDelay",200),n=function(t,e){var i=document.createElement("input");i.type="file";var n=Qm(e,"accept",""),s=Qm(e,"multiple",!1);return i.setAttribute("accept",n),s?i.setAttribute("multiple",""):i.removeAttribute("multiple"),i}(0,e);return n.click(),tb({game:t,fileInput:n,closeDelay:i}).then((function(t){return ib(n),n.remove(),Promise.resolve(t)}))},sb=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},rb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},ob=function(t,e,i,n,s,r){if(null===s||!1===s);else if(Oe(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=qe(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),Oe(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},ab={loadFile:function(t,e,i,n,s){var r=this.scene;return ob(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){ob(s,t,e,i,n,(function(t){r(t);}));}))}},hb=Phaser.GameObjects.DOMElement,lb=Phaser.Utils.Objects.IsPlainObject,ub=Phaser.Utils.Objects.GetValue,cb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),lb(n)?(n=ub(h=n,"x",0),s=ub(h,"y",0),o=ub(h,"width",0),a=ub(h,"height",0)):lb(o)&&(o=ub(h=o,"width",0),a=ub(h,"height",0));var u=document.createElement("input");u.type="file",u.style.display="none";var c=document.createElement("label");c.appendChild(u);var f=ub(h,"style",void 0);(l=e.call(this,t,n,s,c,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=d(l);return u.onchange=function(){p.emit("change",p);},l.setCloseDelay(ub(h,"closeDelay",200)),u.onclick=function(){tb({game:t,fileInput:u,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return a(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(ub(t,"accept","")),this.setMultiple(ub(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(hb),db={resize:sb,syncTo:rb};Object.assign(cb.prototype,db,ab);var fb={accept:"image/*",multiple:!1},pb=function(t,e){if(0!==e.length){var i=t.childrenMap.icon,n=i.image,s=e[0];return n.loadFromFilePromise(s).then((function(){i.scaleImage(),t.emit("select",s,self);}))}},vb={openPromise:function(){var t,e=this;return (t=i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e,t.abrupt("return",nb(e.scene.game,fb).then((function(t){return pb(n,t.files)})));case 2:case"end":return t.stop()}}),t)})),function(){var e=this,i=arguments;return new Promise((function(n,r){var o=t.apply(e,i);function a(t){s(o,n,r,a,h,"next",t);}function h(t){s(o,n,r,a,h,"throw",t);}a(void 0);}))})()},open:function(){return this.openPromise(),this}},gb={saveTexture:function(t){return this.childrenMap.canvas.generateTexture(t),this}};Object.assign(gb,vb);var yb=Phaser.Utils.Objects.GetValue,kb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=function(t,e){var i=new xm(t,{scaleUp:Km(e,"scaleUpIcon",!0),image:Jm(t,e)});return t.add.existing(i),i}(t,n);n.icon=o,(s=e.call(this,t,n)).type="rexImageFileInputLabel";var a=s.iconWidth,h=s.iconWidth;return void 0!==a&&void 0!==h&&o.resize(a,h),s.clickTarget=qm(d(s),n),s.clickTarget&&(yb(n,"domButton",!1)?s.fileChooser=function(t,e){var i=t.scene,n=new cb(i,fb);return i.add.existing(n),t.pin(n),n.on("change",(function(){pb(t,n.files);})),n}(d(s)):s.clickBehavior=function(t,e){var i=qm(t,e);if(i){var n=$m(e,"click"),s=new Ed(i,n);return s.on("click",t.open,t),s}}(d(s),n)),s.addChildrenMap("canvas",o.image),s.addChildrenMap("fileChooser",s.fileChooser),s}return a(i,[{key:"postLayout",value:function(){this.fileChooser&&(this.fileChooser.syncTo(this.clickTarget),this.resetChildState(this.fileChooser));}}]),i}(Nm);Object.assign(kb.prototype,gb);var mb={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},bb={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},Cb={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},xb=Phaser.Utils.Objects.GetValue,wb=function(t,e,i,n){var s=xb(n,"preventDefault",!1),r=xb(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},Sb=Phaser.GameObjects.DOMElement,Ob=Phaser.Utils.Objects.IsPlainObject,Pb=Phaser.Utils.Objects.GetValue,Tb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l,u;r(this,i),Ob(n)?(n=Pb(h=n,"x",0),s=Pb(h,"y",0),o=Pb(h,"width",0),a=Pb(h,"height",0)):Ob(o)&&(o=Pb(h=o,"width",0),a=Pb(h,"height",0)),void 0===h&&(h={});var c=Pb(h,"inputType",void 0);void 0===c&&(c=Pb(h,"type","text")),"textarea"===c?(u=document.createElement("textarea")).style.resize="none":(u=document.createElement("input")).type=c,Vu(mb,h,u);var f=Pb(h,"style",void 0);f=Vu(bb,h,f);var p=u.style;for(var v in h)v in mb||v in bb||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,n,s,u,f)).type="rexInputText",l.resize(o,a),wb(d(l),u,Cb),Wu(u),Pb(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),d(l)).on("blur",(function(){this._isFocused=!1;}),d(l)),l}return a(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(Sb),Mb={resize:sb};Object.assign(Tb.prototype,Mb);var Eb={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},_b={resize:sb,syncTo:rb};Object.assign(_b,Eb,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},ab);var Lb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Rb=Phaser.GameObjects.DOMElement,Bb=Phaser.Utils.Objects.IsPlainObject,jb=Phaser.Utils.Objects.GetValue,Db=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),Bb(n)?(n=jb(h=n,"x",0),s=jb(h,"y",0),o=jb(h,"width",0),a=jb(h,"height",0)):Bb(o)&&(o=jb(h=o,"width",0),a=jb(h,"height",0)),void 0===h&&(h={});var u=document.createElement("div"),c=jb(h,"style",void 0);(l=e.call(this,t,n,s,u,c)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(jb(h,"dropEnable",!0));var f=jb(h,"filters");return f&&l.addFilters(f),wb(d(l),u,Lb,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),d(l)),l}return a(i,[{key:"files",get:function(){return this._files}}]),i}(Rb);Object.assign(Db.prototype,_b);var Ab=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(Zo(t,e))return t[e];var i=t.parent;return Zo(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Zo(t,e)?t[e]=i:Zo(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(Ea),Ib=Phaser.Utils.Objects.GetValue,zb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).style=Ib(n,"style",d(s));var o=Ib(n,"propertiesMap");return s.activeStyle=Fb(n,"active",o),s.hoverStyle=Fb(n,"hover",o),s.disableStyle=Fb(n,"disable",o),s.onModifyStyle=Ib(n,"onModifyStyle"),s}return a(i,[{key:"getStyle",value:function(t){return ac(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return hc(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return Yb.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return Yb.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return Yb.call(this,"disable",t),this}}]),i}(Ea),Fb=function(t,e,i){var n=oc(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},Yb=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Vb={addStyleManager:function(t){return this.styleManager=new zb(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},Wb=Phaser.GameObjects.Image,Xb=Phaser.Utils.Objects.GetValue,Gb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Xb(n,"x",0),a=Xb(n,"y",0),h=Xb(n,"key",""),l=Xb(n,"frame",void 0);(s=e.call(this,t,o,a,h,l)).type="rexStatesImage";var u=Xb(n,"effects",!0);return u&&ea(d(s),u),s.style=new Ab(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Wb);Object.assign(Gb.prototype,Vb);var Hb=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(Zo(t,e))return t[e];var i=t.parent;return Zo(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Zo(t,e)?t[e]=i:Zo(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(Ea),Ub=Phaser.GameObjects.NineSlice,Nb=Phaser.Utils.Objects.GetValue,Kb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Nb(n,"x",0),a=Nb(n,"y",0),h=Nb(n,"key",null),l=Nb(n,"frame",null),u=Nb(n,"width",0),c=Nb(n,"height",0),f=Nb(n,"leftWidth",0),p=Nb(n,"rightWidth",0),v=Nb(n,"topHeight",0),g=Nb(n,"bottomHeight",0);(s=e.call(this,t,o,a,h,l,u,c,f,p,v,g)).type="rexStatesNineSlice";var y=Nb(n,"effects",!0);return y&&ea(d(s),y),s.style=new Hb(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Ub);Object.assign(Kb.prototype,Vb);var Jb=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexStatesRoundRectangleShape",n.style=d(s),n.propertiesMap=Zb,s.addStyleManager(n),delete n.style,delete n.propertiesMap,s}return a(i)}(hn),Zb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Jb.prototype,Vb);var qb=Phaser.GameObjects.Text,$b=Phaser.Utils.Objects.GetValue,Qb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=$b(n,"x",0),a=$b(n,"y",0),h=$b(n,"text","");return (s=e.call(this,t,o,a,h,n)).type="rexStatesText",n.style=s.style,n.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},s.addStyleManager(n),delete n.style,s}return a(i)}(qb);Object.assign(Qb.prototype,Vb);var tC=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},eC=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return a(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(g(u(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Kd),iC={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,tC(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return uC(this.sizerChildren,null),sk.call(this,t),this}},dC={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)uC(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},gC={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=_p.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,uC(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)uC(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},kC=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},mC=Phaser.Utils.Objects.IsPlainObject,bC=Phaser.Utils.Objects.GetValue,CC=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u,c,d){var f;return r(this,i),mC(n)?(n=bC(d=n,"x",0),s=bC(d,"y",0),o=bC(d,"width",void 0),a=bC(d,"height",void 0),h=bC(d,"column",d.col||0),l=bC(d,"row",0),u=bC(d,"columnProportions",0),c=bC(d,"rowProportions",0)):mC(o)?(o=bC(d=o,"width",void 0),a=bC(d,"height",void 0),h=bC(d,"column",d.col||0),l=bC(d,"row",0),u=bC(d,"columnProportions",0),c=bC(d,"rowProportions",0)):mC(h)?(h=bC(d=h,"column",d.col||0),l=bC(d,"row",0),u=bC(d,"columnProportions",0),c=bC(d,"rowProportions",0)):mC(u)&&(u=bC(d=u,"columnProportions",0),c=bC(d,"rowProportions",0)),(f=e.call(this,t,n,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(bC(d,"createCellContainerCallback")),f.setIndentLeft(bC(d,"space.indentLeftOdd",0),bC(d,"space.indentLeftEven",0)),f.setIndentTop(bC(d,"space.indentTopOdd",0),bC(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,bC(d,"space",void 0)),f}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{key:"setColumnProportion",value:function(t,e){return t>=this.columnProportions.length||(this.columnProportions[t]=e),this}},{key:"setRowProportion",value:function(t,e){return t>=this.rowProportions.length||(this.rowProportions[t]=e),this}},{key:"totalColumnProportions",get:function(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=yC.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=kC.call(this)),this._totalRowProportions}},{key:"getChildAt",value:function(t,e){return this.sizerChildren[e*this.columnCount+t]}},{key:"childToGridIndex",value:function(t,e){if(!t)return null;var i=this.sizerChildren.indexOf(t);return -1===i?null:(void 0===e&&(e={}),e.x=i%this.columnCount,e.y=Math.floor(i/this.columnCount),e)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(Zy);Object.assign(CC.prototype,gC);var xC=function(t,e,i,n){return e/t<=i?e/(n-1):0},wC=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=PC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=PC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},MC=Phaser.Utils.Objects.IsPlainObject,EC=Phaser.Utils.Objects.GetValue,_C=Phaser.Display.Align.CENTER,LC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(yp.call(this,t),MC(e))&&(e=EC(s=e,"padding",0),i=EC(s,"key",void 0),n=EC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=_C,s.padding=vp(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},RC={add:function(t,e,i){if(hg(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,sk.call(this,t),this}},DC={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)vx.call(this,e[i],t);return this}},yx=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},kx=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,yx.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},mx={add:function(t){return this.buttons.push(t),t._click||(t._click=new Ed(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),kx.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)Dx.call(this,e[i],t);return this}},Ix=Phaser.Utils.Objects.GetValue,zx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Ix(n,"row",0),a=Ix(n,"column",n.col||0),h=Ix(n,"createCellContainerCallback"),l=Ix(n,"buttons",void 0),u=Ix(n,"expand",!0),c=u?1:0;if(h&&(n.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&Fx.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Gx.call(this,e[i],t);return this}},Ux=Phaser.Utils.Objects.GetValue,Nx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=n.space;"number"==typeof o&&(n.space={item:o,line:o}),(s=e.call(this,t,n)).type="rexFixWidthButtons",s.buttonGroup=new Px({parent:d(s),eventEmitter:Ux(n,"eventEmitter",d(s)),groupName:Ux(n,"groupName",void 0),clickConfig:Ux(n,"click",void 0)}).setButtonsType(n);var a=Ux(n,"background",void 0),h=Ux(n,"buttons",void 0);return s.buttonsAlign=Ux(n,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(YC);Object.assign(Nx.prototype,Vx,Hx,Ox,Mx);var Kx=Phaser.Utils.Objects.GetValue,Jx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexFileSelectorButton";var o=new cb(t);return t.add.existing(o),s.addBackground(o),s.addChildrenMap("fileChooser",o),s.setAccept(Kx(n,"accept","")),s.setMultiple(Kx(n,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),d(s)),s}return a(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(Nm);Object.assign(Jx.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}});var Zx={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},qx={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,og.modal.call(this,t,e),this}},$x={};Object.assign($x,Zx,qx);var Qx=Phaser.Utils.Objects.GetValue,tw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexDialog",s.eventEmitter=Qx(n,"eventEmitter",d(s));var o,a,h,l,u=Qx(n,"background",void 0),c=Qx(n,"title",void 0),f=Qx(n,"toolbar",void 0),p=Qx(n,"toolbarBackground",void 0),v=Qx(n,"leftToolbar",void 0),g=Qx(n,"leftToolbarBackground",void 0),y=Qx(n,"content",void 0),k=Qx(n,"description",void 0),m=Qx(n,"choices",void 0),b=Qx(n,"choicesBackground",void 0),C=Qx(n,"actions",void 0),x=Qx(n,"actionsBackground",void 0),w=Qx(n,"click",void 0);if(u&&s.addBackground(u),f&&(h=new _x(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Qx(n,"space.toolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),v&&(l=new _x(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Qx(n,"space.leftToolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),c||f||v){var S,O=!!c&&Qx(n,"expand.title",!0),P=Qx(n,"align.title","center"),T=!(c&&!O&&"center"===P||!c&&(f||v));S=T?new Vm(t,{orientation:0}):new uk(t);var M=!!T||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),c){T&&!O&&"right"===P&&S.addSpace();var E={left:Qx(n,"space.titleLeft",0),right:Qx(n,"space.titleRight",0)},_=O?1:0;S.add(c,{align:P,proportion:_,expand:M,padding:E}),T&&!O&&"left"===P&&S.addSpace();}h&&(T&&!c&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||C)&&(E={bottom:Qx(n,"space.title",0),top:Qx(n,"space.titleTop",0)});_=Qx(n,"proportion.title",0);s.add(S,{padding:E,proportion:_,expand:!0});}if(y){var L=Qx(n,"align.content","center"),R=Qx(n,"space.content",0),B=(E={left:Qx(n,"space.contentLeft",0),right:Qx(n,"space.contentRight",0),bottom:k||m||C?R:0},_=Qx(n,"proportion.content",0),Qx(n,"expand.content",!0));s.add(y,{align:L,padding:E,proportion:_,expand:B});}if(k){L=Qx(n,"align.description","center");var j=Qx(n,"space.description",0);E={left:Qx(n,"space.descriptionLeft",0),right:Qx(n,"space.descriptionRight",0),bottom:m||C?j:0},_=Qx(n,"proportion.description",0),B=Qx(n,"expand.description",!0);s.add(k,{align:L,padding:E,proportion:_,expand:B});}if(m){var D=Qx(n,"choicesType","").split("-"),A=ew(D,"wrap")?Nx:ew(D,"grid")?zx:_x,I=ew(D,"radio")?"radio":ew(D,"checkboxes")?"checkboxes":void 0,z={left:Qx(n,"space.choicesBackgroundLeft",0),right:Qx(n,"space.choicesBackgroundRight",0),top:Qx(n,"space.choicesBackgroundTop",0),bottom:Qx(n,"space.choicesBackgroundBottom",0)},F=Qx(n,"space.choice",0);A===_x?z.item=F:A===Nx?(z.item=F,z.line=Qx(n,"space.choiceLine",F)):(z.column=Qx(n,"space.choiceColumn",F),z.row=Qx(n,"space.choiceRow",F));var Y={width:Qx(n,"choicesWidth",void 0),height:Qx(n,"choicesHeight",void 0),groupName:"choices",buttonsType:I,background:b,buttons:m,space:z,click:w,eventEmitter:s.eventEmitter,setValueCallback:Qx(n,"choicesSetValueCallback",void 0),setValueCallbackScope:Qx(n,"choicesSetValueCallbackScope",void 0)};A===_x&&(Y.orientation=ew(D,"x")?0:1),o=new A(t,Y);var V=Qx(n,"space.choices",0);E={left:Qx(n,"space.choicesLeft",0),right:Qx(n,"space.choicesRight",0),bottom:C?V:0},L=Qx(n,"align.choices","center"),_=Qx(n,"proportion.choices",0),B=Qx(n,"expand.choices",!0);s.add(o,{align:L,padding:E,proportion:_,expand:B}),s.buttonsType=I;}if(C){a=new _x(t,{groupName:"actions",background:x,buttons:C,orientation:0,space:{item:Qx(n,"space.action",0)},expand:Qx(n,"expand.actions",!1),align:Qx(n,"align.actions","center"),click:w,eventEmitter:s.eventEmitter});E={left:Qx(n,"space.actionsLeft",0),right:Qx(n,"space.actionsRight",0),bottom:Qx(n,"space.actionsBottom",0)},_=Qx(n,"proportion.action",0);s.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return nw(d(s),"click"),nw(d(s),"over"),nw(d(s),"out"),nw(d(s),"enable"),nw(d(s),"disable"),s.addChildrenMap("background",u),s.addChildrenMap("title",c),s.addChildrenMap("toolbar",f),s.addChildrenMap("leftToolbar",v),s.addChildrenMap("content",y),s.addChildrenMap("description",k),s.addChildrenMap("choices",o?o.buttons:void 0),s.addChildrenMap("actions",a?a.buttons:void 0),s.addChildrenMap("choicesSizer",o),s.addChildrenMap("actionsSizer",a),s.addChildrenMap("toolbarSizer",h),s.addChildrenMap("leftToolbarSizer",l),s}return a(i)}(Vm),ew=function(t,e){return -1!==t.indexOf(e)},iw={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},nw=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){iw.hasOwnProperty(n)&&t.emit("".concat(iw[n],".").concat(e),i,s,r,o);}));};Object.assign(tw.prototype,$x);var sw=function(t,e,i){var n=new tx(t,e,i);return t.add.existing(n),n},rw=function(t){this.childrenMap.title.resetDisplayContent(t.title);},ow=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},aw=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(Dv),Zw=Phaser.Utils.Objects.GetValue,qw=Phaser.Math.Distance.Between,$w=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(Zw(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(Zw(t,"enable",!0)),this.holdThreshold=Zw(t,"holdThreshold",50),this.pointerOutReleaseEnable=Zw(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return Tc(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:qw(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(Ea),Qw=Phaser.Utils.Objects.GetValue,tS=function(){function t(e){r(this,t),this.resetFromJSON(e);}return a(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Qw(t,"value",0)),this.setSpeed(Qw(t,"speed",0)),this.setAcceleration(Qw(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),eS=function(){function t(){r(this,t),this.value,this.dir,this.movement=new tS;}return a(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(Ea),rS={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},oS=Phaser.Utils.Objects.GetValue,aS=function(t){l(i,t);var e=p(i);function i(t,n){var s;(r(this,i),(s=e.call(this,t,n)).parent!==s.scene?s.focusMode=oS(n,"focus",!0):s.focusMode=!1,s.setSpeed(oS(n,"speed",.1)),s.setEnable(oS(n,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(oS(n,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),d(s)):s.scene.input.on("wheel",s.onSceneScroll,d(s));return s}return a(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(Ea),hS=Phaser.Utils.Objects.GetValue,lS=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?hS(n,c,void 0):hS(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=Xt(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new Kw(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=hS(s,"position",0);"string"==typeof v&&(v=uS[v]);var g=hS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=hS(n,"space.slider",void 0))&&(g=l?0:hS(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=hS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=hS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=hS(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?hS(n,k,!0):hS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new sS(u,o));var m,b,C,x,w=hS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new aS(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",x="scroll".concat(i)):(b="t",x="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(x,t);})));a&&(l?(C="childO".concat(i),x="scroll".concat(i)):(C="childOY",x="scroll"),a.on("valuechange",(function(e){t[C]=e,t.emit(x,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},uS={right:0,left:1,bottom:0,top:1},cS=Phaser.Utils.Objects.GetValue,dS=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=cS(e,"width"),o=cS(e,"height");r||(cS(e,"child.expandWidth",!0)||(n[1]=0));o||(cS(e,"child.expandHeight",!0)||(s[1]=0));var a=new CC(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=mw(i,"child"),s=mw(n,"gameObject",void 0);if(s){var r=mw(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=mw(r,"top",0),o.bottom=mw(r,"bottom",0),a.left=mw(r,"left",0),a.right=mw(r,"right",0);break;case 1:o.top=mw(r,"left",0),o.bottom=mw(r,"right",0),a.top=mw(r,"top",0),a.bottom=mw(r,"bottom",0);break;default:o.top=mw(r,"top",0),o.bottom=mw(r,"bottom",0),o.left=mw(r,"left",0),o.right=mw(r,"right",0);}e.add(s,{column:1,row:1,align:mw(n,"align","center"),padding:a,expand:{width:mw(n,"expandWidth",!0),height:mw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:lS(t,a,"y",e);break;case 1:lS(t,a,"x",e);break;default:lS(t,a,"y",e),lS(t,a,"x",e);}return a},fS=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},pS=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},vS=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},wS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},SS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},OS=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},PS=function(t,e){switch(CS(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},TS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&MS.call(this);},MS=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},ES=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},_S={setText:function(t){return void 0!==t&&(this.text=t),this.lines=xS(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(wS.call(this,-this.textOY)),0),e=SS.call(this,t)+this.textOY,i=OS.call(this,t);return PS(this.textObject,i),this.textObject.rexSizer.offsetY=e,TS.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Rp.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,ES.call(this,t,r,o),lp(t,n,s,r,o,e.align),e.preOffsetY=0,TS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},LS=Phaser.Utils.Objects.IsPlainObject,RS=Phaser.Utils.Objects.GetValue,BS=Phaser.Display.Align.TOP_LEFT,jS=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),LS(n)?(n=RS(h=n,"x",0),s=RS(h,"y",0),o=RS(h,"width",void 0),a=RS(h,"height",void 0)):LS(o)&&(o=RS(h=o,"width",void 0),a=RS(h,"height",void 0)),(l=e.call(this,t,n,s,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=RS(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(RS(h,"clamplTextOY",!0)),l.alwaysScrollable=RS(h,"alwaysScrollable",!1);var u=RS(h,"background",void 0),c=RS(h,"text",void 0);void 0===c&&(c=DS(t)),l.textCropEnable=RS(h,"textCrop",!!c.setCrop);var f=RS(h,"textMask",!l.textCropEnable);u&&l.addBackground(u),l.add(c),l.sizerChildren=[c];var p=l.getSizerConfig(c);return p.align=BS,p.padding=vp(0),p.expand=!0,l.textObject=c,l.textObjectType=CS(c),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=Hm.call(d(l),l.textObject,d(l))),l.addChildrenMap("background",u),l.addChildrenMap("text",c),l}return a(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}g(u(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(wS.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=SS.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(Zy),DS=function(t){return t.add.text(0,0,"")};Object.assign(jS.prototype,_S);var AS={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},IS=Phaser.Utils.Objects.GetValue,zS=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=IS(n,"text",void 0),a=IS(n,"textWidth",void 0),h=IS(n,"textHeight",void 0),l=IS(n,"textCrop",!!o.setCrop),u=IS(n,"textMask",!l),c=IS(n,"content",""),d=new jS(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:IS(n,"clamplChildOY",!1),alwaysScrollable:IS(n,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),n.scrollMode=0,n.type="rexTextArea",n.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=IS(n,"space",void 0);return f&&(f.child=IS(f,"text",0)),(s=e.call(this,t,n)).addChildrenMap("text",o),s}return a(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(mS);Object.assign(zS.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},AS);var FS=Phaser.Utils.Objects.GetValue,YS=function(t,e,i){e=e?Se(e):{};var n=FS(i,"background",WC),s=FS(i,"text",HC),r=FS(i,"track",WC),o=FS(i,"thumb",WC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new zS(t,e);return t.add.existing(h),h},VS=Phaser.Utils.Objects.GetValue,WS=Phaser.Utils.Objects.GetValue,XS=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;r(this,i),n=n?Se(n):{},void 0===s&&(s={});var a=WS(s,"background",WC);a?n.background=a(t,n.background):delete n.background,n.title=sw(t,n.title,s.title),n.content=function(t,e,i){var n,s=VS(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new YS(t,e,i):new sw(t,e,i);return t.add.existing(n),n}(t,n.content,s.content),n.content instanceof zS&&rc(n,"height")&&!rc(n,"proportion.content")&&De(n,"proportion.content",1);var h=n.button,l=n.buttonA||h,u=n.buttonB||h,c=n.buttonMode;void 0===c&&(c=l&&u?2:l?1:0);var f=s.button,p=s.buttonA||f,v=s.buttonB||f;switch(c){case 2:n.actions=[sw(t,l,p),sw(t,u,v)];break;case 1:n.actions=[sw(t,l,p)];break;case 0:break;default:n.actions=[];}var g=n.choice;g&&(n.choices=[]),(o=e.call(this,t,n)).type="rexConfirmDialog",o.buttonMode=c,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=s.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),vw.call(d(o)),o}return a(i)}(tw);Object.assign(XS.prototype,lw);var GS=Phaser.Utils.Objects.GetValue,HS=function(t,e,i){var n=GS(t,"proportion.".concat(e),i.proportion),s=GS(t,"align.".concat(e),"center"),r=GS(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:GS(t,"expand.".concat(e),!0)}},US=function(t){return HS(t,"header",{proportion:0,paddingKey:"bottom"})},NS=function(t){return HS(t,"leftSide",{proportion:0,paddingKey:"right"})},KS=function(t){return HS(t,"content",{proportion:1})},JS=function(t){return HS(t,"rightSide",{proportion:0,paddingKey:"left"})},ZS=function(t){return HS(t,"footer",{proportion:0,paddingKey:"top"})},qS=function(t,e){var i=new Vm(t,{orientation:e});return t.add.existing(i),i},$S=Phaser.Utils.Objects.GetValue,QS=[function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,NS(t));var r=t.content;r&&n.add(r,KS(t));var o=t.rightSide;o&&n.add(o,JS(t));var a=t.footer;a&&this.add(a,ZS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,NS(t));var r=qS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=qS(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,KS(t));var h=t.rightSide;h&&o.add(h,JS(t));var l=t.footer;l&&r.add(l,ZS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=qS(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=qS(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,NS(t));var a=t.content;a&&r.add(a,KS(t));var h=t.footer;h&&s.add(h,ZS(t));var l=t.rightSide;l&&n.add(l,JS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,NS(t));var r=qS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,KS(t));var a=t.footer;a&&r.add(a,ZS(t));var h=t.rightSide;h&&n.add(h,JS(t));}],tO={FFF:0,LFF:1,FFR:2,LFR:3},eO=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexHolyGrail",s.build(n),s}return a(i)}(Vm),iO={build:function(t){this.clear(!0);var e=$S(t,"background",void 0);e&&this.addBackground(e);var i=$S(t,"layoutMode",0);"string"==typeof i&&(i=tO[i.toUpperCase()]),(QS[i]||QS[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(eO.prototype,iO);var nO={getButtonsSizer:function(t){return this.childrenMap["".concat(t,"ButtonsSizer")]},getButton:function(t,e){var i=this.getButtonsSizer(t);return i?i.getButton(e):void 0},setButtonEnable:function(t,e,i){return this.getButtonsSizer(t).setButtonEnable(e,i),this},setLeftButtonEnable:function(t,e){return this.childrenMap.leftButtonsSizer.setButtonEnable(t,e),this},setRightButtonEnable:function(t,e){return this.childrenMap.rightButtonsSizer.setButtonEnable(t,e),this},setTopButtonEnable:function(t,e){return this.childrenMap.topButtonsSizer.setButtonEnable(t,e),this},setBottomButtonEnable:function(t,e){return this.childrenMap.bottomButtonsSizer.setButtonEnable(t,e),this},toggleButtonEnable:function(t,e){return this.getButtonsSizer(t).toggleButtonEnable(e),this},toggleLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.toggleButtonEnable(t),this},toggleRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.toggleButtonEnable(t),this},toggleTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.toggleButtonEnable(t),this},toggleBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.toggleButtonEnable(t),this},getButtonEnable:function(t,e){return this.getButtonsSizer(t).getButtonEnable(e)},getLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.getButtonEnable(t)},getRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.getButtonEnable(t)},getTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.getButtonEnable(t)},getBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.getButtonEnable(t)},emitButtonClick:function(t,e){var i=this.getButtonsSizer(t);return i?(i.emitButtonClick(e),this):this},emitLeftButtonClick:function(t){return this.childrenMap.leftButtonsSizer.emitButtonClick(t),this},emitRightButtonClick:function(t){return this.childrenMap.rightButtonsSizer.emitButtonClick(t),this},emitTopButtonClick:function(t){return this.childrenMap.topButtonsSizer.emitButtonClick(t),this},emitBottomButtonClick:function(t){return this.childrenMap.bottomButtonsSizer.emitButtonClick(t),this},getLeftButton:function(t){return this.childrenMap.leftButtonsSizer.getButton(t)},getRightButton:function(t){return this.childrenMap.rightButtonsSizer.getButton(t)},getTopButton:function(t){return this.childrenMap.topButtonsSizer.getButton(t)},getBottomButton:function(t){return this.childrenMap.bottomButtonsSizer.getButton(t)},showButton:function(t,e){return xv(this.getButton(t,e)),this},showLeftButton:function(t){return xv(this.getLeftButton(t)),this},showRightButton:function(t){return xv(this.getRightButton(t)),this},showTopButton:function(t){return xv(this.getTopButton(t)),this},showBottomButton:function(t){return xv(this.getBottomButton(t)),this},hideButton:function(t,e){return wv(this.getButton(t,e)),this},hideLeftButton:function(t){return wv(this.getLeftButton(t)),this},hideRightButton:function(t){return wv(this.getRightButton(t)),this},hideTopButton:function(t){return wv(this.getTopButton(t)),this},hideBottomButton:function(t){return wv(this.getBottomButton(t)),this},addButton:function(t,e){return this.getButtonsSizer(t).addButton(e),this},addLeftButton:function(t){return this.addButton("left",t),this},addRightButton:function(t){return this.addButton("right",t),this},addTopButton:function(t){return this.addButton("top",t),this},removeButton:function(t,e,i){return this.getButtonsSizer(t).removeButton(e,i),this},removeLeftButton:function(t,e){return this.removeButton("left",t,e),this},removeRightButton:function(t,e){return this.removeButton("right",t,e),this},removeTopButton:function(t,e){return this.removeButton("top",t,e),this},removeBottomButton:function(t,e){return this.removeButton("bottom",t,e),this},clearButtons:function(t,e){return this.getButtonsSizer(t).clearButtons(e),this},clearLeftButtons:function(t){return this.clearButtons("left",t),this},clearRightButtons:function(t){return this.clearButtons("right",t),this},clearTopButtons:function(t){return this.clearButtons("top",t),this},clearBottomButtonss:function(t){return this.clearButtons("bottom",t),this},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),this},forEachLeftButton:function(t,e){return this.childrenMap.leftButtonsSizer.forEachButtton(t,e),this},forEachRightButton:function(t,e){return this.childrenMap.rightButtonsSizer.forEachButtton(t,e),this},forEachTopButton:function(t,e){return this.childrenMap.topButtonsSizer.forEachButtton(t,e),this},forEachBottomButton:function(t,e){return this.childrenMap.bottomButtonsSizer.forEachButtton(t,e),this}},sO=Phaser.Utils.Objects.GetValue,rO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.column=3,n.row=3,(s=e.call(this,t,n)).type="rexTabs",s.eventEmitter=sO(n,"eventEmitter",d(s));var o,a,h,l,u=sO(n,"background",void 0),c=sO(n,"panel",void 0),f=sO(n,"leftButtons",void 0),p=sO(n,"leftButtonsBackground",void 0),v=sO(n,"rightButtons",void 0),g=sO(n,"rightButtonsBackground",void 0),y=sO(n,"topButtons",void 0),k=sO(n,"topButtonsBackground",void 0),m=sO(n,"bottomButtons",void 0),b=sO(n,"bottomButtonsBackground",void 0),C=sO(n,"click",void 0);if(u&&s.addBackground(u),c&&s.add(c,1,1,"center",0,!0),f){var x=sO(n,"space.leftButtonsOffset",0),w=sO(n,"space.leftButton",0);o=new _x(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:sO(n,"align.leftButtons",void 0),click:C,eventEmitter:s.eventEmitter});var S={top:x};s.add(o,0,1,"top",S,!1);}if(v){var O=sO(n,"space.rightButtonsOffset",0),P=sO(n,"space.rightButton",0);a=new _x(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:P},align:sO(n,"align.rightButtons",void 0),click:C,eventEmitter:s.eventEmitter});S={top:O};s.add(a,2,1,"top",S,!1);}if(y){var T=sO(n,"space.topButtonsOffset",0),M=sO(n,"space.topButton",0);h=new _x(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:sO(n,"align.topButtons",void 0),click:C,eventEmitter:s.eventEmitter});S={left:T};s.add(h,1,0,"left",S,!1);}if(m){var E=sO(n,"space.bottomButtonsOffset",0),_=sO(n,"space.bottomButton",0);l=new _x(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:sO(n,"align.bottomButtons",void 0),click:C,eventEmitter:s.eventEmitter});S={left:E};s.add(l,1,2,"left",S,!1);}return s.addChildrenMap("background",u),s.addChildrenMap("panel",c),s.addChildrenMap("leftButtons",f),s.addChildrenMap("rightButtons",v),s.addChildrenMap("topButtons",y),s.addChildrenMap("bottomButtons",m),s.addChildrenMap("leftButtonsSizer",o),s.addChildrenMap("rightButtonsSizer",a),s.addChildrenMap("topButtonsSizer",h),s.addChildrenMap("bottomButtonsSizer",l),s}return a(i)}(CC);Object.assign(rO.prototype,nO);var oO=function(){function t(e,i){r(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return a(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Ff[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(oO.prototype,Oi);var aO=Phaser.Utils.Objects.GetValue,hO=Phaser.Utils.Array.SpliceOne,lO=function(){function t(e,i){r(this,t),this.parent=e,this.cells=[],this.cellPool=new ui,this.resetFromJSON(i);}return a(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(aO(t,"cellsCount",0)),this.setColumnCount(aO(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===n(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=OO(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===n(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var i,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},gP={down:0,up:1},yP=Phaser.Utils.Objects.GetValue,kP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=function(t,e){Yp(t,e,"y","Cubic");}),null==n.transitOut&&(n.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new zp(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),n.manualClose=!0,n.clickOutsideClose=!0,n.destroy=!0,s=e.call(this,t,n),vP(t,n),t.isRexSizer&&t.layout();var o=yP(n,"touchOutsideClose",!1),a=yP(n,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,d(s)):o&&s.once("open",s.touchOutsideClose,d(s)),s.requestOpen(),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ig(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),g(u(i.prototype),"onClose",this).call(this);}}]),i}(Xv),mP={openListPanel:function(){if(this.listPanel)return this;var t,e=fP.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new kP(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(mP,cP);var bP=Phaser.Utils.Objects.GetValue,CP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexDropDownList",s.timer=void 0,s.setOptions(bP(n,"options"));var o=bP(n,"list");return s.setWrapEnable(bP(o,"wrap",!1)),s.setCreateButtonCallback(bP(o,"createButtonCallback")),s.setCreateListBackgroundCallback(bP(o,"createBackgroundCallback")),s.setButtonClickCallback(bP(o,"onButtonClick")),s.setButtonOverCallback(bP(o,"onButtonOver")),s.setButtonOutCallback(bP(o,"onButtonOut")),s.setListExpandDirection(bP(o,"expandDirection")),s.setListEaseInDuration(bP(o,"easeIn",500)),s.setListEaseOutDuration(bP(o,"easeOut",100)),s.setListTransitInCallback(bP(o,"transitIn")),s.settListTransitOutCallback(bP(o,"transitOut")),s.setListSize(bP(o,"width"),bP(o,"height")),s.setListAlignmentMode(bP(o,"alignParent","text")),s.setListAlignmentSide(bP(o,"alignSide","")),s.setListBounds(bP(o,"bounds")),s.setListSpace(bP(o,"space")),s.setListDraggable(bP(o,"draggable",!1)),s.setValueChangeCallback(bP(n,"setValueCallback"),bP(n,"setValueCallbackScope")),s.setValue(bP(n,"value")),s.onClick(s.toggleListPanel,d(s)),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(Nm);Object.assign(CP.prototype,mP);var xP=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},wP={clearText:function(){return this.sections.length=0,this.pageStartIndexes.length=0,this.lines.length=0,this},appendPage:function(t){var e=this.totalLinesCount;this.sections.push(xP(t));t=this.sections.join("\n");this.lines=xS(this.parent,t,this.lines);for(var i=this.totalLinesCount-e,n=Math.ceil(i/this.pageLinesCount),s=0;s=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=EP(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(CS(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(Ea);Object.assign(_P.prototype,TP),Phaser.Utils.Objects.GetFastValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var LP=uk.prototype.add,RP=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),LP.call(this,t,e,i,n,s,r,o,a,h),this},BP={add:RP,addPage:RP},jP=se.prototype.setChildVisible,DP={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(jP.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(jP.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(DP,BP);var AP=Phaser.Utils.Objects.GetValue,IP=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(AP(n,"swapMode",0)),s.setFadeInDuration(AP(n,"fadeIn",0)),s}return a(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=zP[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(uk);Object.assign(IP.prototype,DP);var zP={invisible:0,destroy:1},FP=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(Zy);Object.assign(ZT.prototype,UT);var qT=["top","bottom","centerY","center"],$T=["left","right","centerX","center"],QT=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=qT.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=$T.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},tM=Phaser.Utils.Objects.GetValue,eM=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=yw(n),a=tM(n,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=tM(n,"clamplChildOY",!1),a.clamplChildOX=tM(n,"clamplChildOX",!1);var h,l,u=new ZT(t,a);switch(t.add.existing(u),o){case 0:h=tM(n,"expand.panel",!0),l=!0;break;case 1:h=!0,l=tM(n,"expand.panel",!0);break;default:h=!0,l=!0;}n.type="rexScrollablePanel",n.child={gameObject:u,expandWidth:h,expandHeight:l,align:tM(n,"align.panel","center")};var c=tM(n,"space",void 0);return c&&(c.child=tM(c,"panel",0)),(s=e.call(this,t,n)).addChildrenMap("panel",u.child),s.addChildrenMap("panelLayer",u.maskLayer),s.addChildrenMap("mask",u.maskGameObject),s.addChildrenMap("scrollableBlock",u),s}return a(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),Ny(this.childrenMap.child,t),this}}]),i}(mS),iM={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:QT.call(this,t,"y",e);break;case 1:QT.call(this,t,"x",e);break;default:QT.call(this,t,"y",e),QT.call(this,t,"x",e);}return this}};Object.assign(eM.prototype,iM),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;for(var nM,sM=function(t,e,i){void 0===i&&(i=!0),i?e=e?Se(e):{}:e||(e={});var n=new Oc(t,e);return t.add.existing(n),n},rM=Phaser.Utils.Objects.GetValue,oM=Phaser.Display.Color,aM=Phaser.Display.Color.ColorToRGBA,hM=Phaser.Display.Color.HSVToRGB,lM=Phaser.Math.Clamp,uM=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.orientation=0,(s=e.call(this,t,n)).type="rexColorComponents",s.colorObject=new oM;var o=rM(n,"background",void 0),a=rM(n,"formatLabel",void 0);Ht(a)||(a=sw(t,a).resetDisplayContent());var h=[];if(n.inputText0&&n.inputText1&&n.inputText2)h.push(n.inputText0),h.push(n.inputText1),h.push(n.inputText2);else for(var l=rM(n,"inputText"),u=0;u<3;u++){var c=sM(t,l).setMaxLength(3).setNumberInput();h.push(c);}o&&s.addBackground(o);var f=rM(n,"proportion.formatLabel",0),p=!!a.isRexContainerLite,v=rM(n,"expand.formatLabel",p);s.add(a,{proportion:f,expand:v});f=void 0===rM(l,"width")?1:0,v=void 0===rM(l,"height"),u=0;for(var g=h.length;u0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new KM(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},ZM={openColorPicker:function(){if(!this.colorPicker){var t=JM.call(this).layout(),e=new kP(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(ZM,SM);var qM=Phaser.Utils.Objects.GetValue,$M=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexColorInput",n.hasOwnProperty("colorPicker")||(n.colorPicker={background:{color:0}});var o=n.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(qM(o,"width",160),qM(o,"height",170));var l=qM(o,"background");h=l?function(t){return WC(t,l)}:qM(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(qM(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(qM(o,"expandDirection")),s.setColorPickerEaseInDuration(qM(o,"easeIn",200)),s.setColorPickerEaseOutDuration(qM(o,"easeOut",200)),s.setColorPickerTransitInCallback(qM(o,"transitIn")),s.setColorPickerTransitOutCallback(qM(o,"transitOut")),s.setColorPickerBounds(qM(o,"bounds"));var u=qM(o,"space");void 0===u&&(u={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(u);}var c=n.colorComponents;if(a&&(!1!==c&&null!==c)){s.setColorComponentsHeight(qM(c,"height",30)),s.setColorComponentsFormatLabelConfig(qM(c,"formatLabel"));var f=qM(c,"inputText");f||(f=qM(n,"inputText")),s.setColorComponentsInputTextConfig(f);var p=qM(c,"space");void 0===p&&(p={item:8}),s.setColorComponentsSpace(p);}var v=s.childrenMap.swatch;return v&&a&&s.onClick(v,s.openColorPicker,d(s)),s}return a(i)}(wM);Object.assign($M.prototype,ZM);var QM=Phaser.Utils.Array.GetFirst,tE=Phaser.Utils.Array.Remove,eE=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),n=QC(t,n),(s=e.call(this,t,n)).type="rexTweaker.Title",s}return a(i,[{key:"setTitle",value:function(t){return (t=t?Se(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(Nm),iE=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexTweaker.FolderTitle";var o=new jf(t,n.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return a(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(eE),nE=function(t,e){var i=new TE(t,e);return t.add.existing(i),i},sE=function(t,e,i){return WC(t,i)},rE=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexTweaker.Folder",s}return a(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(WT);Object.assign(rE.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var oE=Phaser.Utils.Objects.GetValue,aE=Phaser.Utils.Objects.GetValue,hE={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i0?0:1,s.setMinWidth(this.itemWidth)),this.add(s,{proportion:r,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),s.setAutoUpdateEnable(i.autoUpdate),s.setBindingTarget(t,e),i.monitor&&s.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,s),this},addButton:wE,addButtons:wE,addSeparator:function(t){var e=this.scene,i=SE(this.styles,"separator"),n=sE(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(vr);Object.assign(Dr.prototype,Lr);var Ar=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Ir=Phaser.Utils.Objects.GetValue,zr=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Ir(n,"color",null),Ir(n,"color2",null),Ir(n,"horizontalGradient",!0)),s.setStroke(Ir(n,"stroke",null),Ir(n,"strokeThickness",2)),s.setCornerRadius(Ir(n,"cornerRadius",0),Ir(n,"cornerIteration",null)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,Ar("color2",t,this),Ar("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Ar("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Ar("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return g(u(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){Tn(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Dr),Fr=Phaser.Utils.Objects.GetValue,Yr=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(Fr(n,"color",null),Fr(n,"color2",null),Fr(n,"horizontalGradient",!0)),s.setStroke(Fr(n,"stroke",null),Fr(n,"strokeThickness",2)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=Cn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){g(u(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Fr(t,"color2",null),Fr(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Fr(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(Dr),Vr=Phaser.Utils.Objects.GetValue,Wr=function(){function t(e,i){r(this,t),this.parent=e,this.set(i);}return a(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(Vr(t,"bold",!1)),this.setItalic(Vr(t,"italic",!1)),this.setFontSize(Vr(t,"fontSize","16px")),this.setFontFamily(Vr(t,"fontFamily","Courier")),this.setColor(Vr(t,"color","#fff")),this.setStrokeStyle(Vr(t,"stroke",null),Vr(t,"strokeThickness",0)),this.setShadow(Vr(t,"shadowColor",null),Vr(t,"shadowOffsetX",0),Vr(t,"shadowOffsetY",0),Vr(t,"shadowBlur",0)),this.setOffset(Vr(t,"offsetX",0),Vr(t,"offsetY",0)),this.setSpace(Vr(t,"leftSpace",0),Vr(t,"rightSpace",0)),this.setAlign(Vr(t,"align",void 0)),this.setBackgroundColor(Vr(t,"backgroundColor",null)),this.setBackgroundHeight(Vr(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Vr(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle(Ar("stroke",t,this),Ar("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Ar("shadowOffsetX",t,this),Ar("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=Cn(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=Cn(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=Cn(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=Cn(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),Xr=Phaser.Utils.Array.Remove,Gr=Phaser.Utils.Array.Remove,Hr="text",Ur="image",Nr="drawer",Kr="space",Jr="command",Zr=function(t){return t.type===Hr&&"\n"===t.text},qr=function(t){return t.type===Hr&&"\f"===t.text},$r=function(t){return t.type===Hr},Qr=function(t){return t.type===Jr},to=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,Hr)).updateTextFlag=!1,o.style=new Wr(d(o),s),o.setText(n),o}return a(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),k(u(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),k(u(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),g(u(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&g(u(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(Dr),eo=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},io=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,Ur)).setTexture(n,s),o}return a(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(Dr),no=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},so=function(t){l(i,t);var e=p(i);function i(t,n,s,o){var a;return r(this,i),(a=e.call(this,t,Nr)).setRenderCallback(n),a.setDrawerSize(s,o),a}return a(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(Dr),ro=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,Kr)).setSpaceWidth(n),s}return a(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(Dr),oo=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},ao=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;return r(this,i),(h=e.call(this,t,Jr)).setName(n).setParameter(o).setCallback(s,a),h}return a(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(vr),ho=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},lo=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},uo=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=po.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=po.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=go(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=go(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=go(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=go(t,"letterSpacing",0),f=go(t,"hAlign",0),p=go(t,"vAlign",0),v=go(t,"charWrap",!1),g=lo({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=!R&&g.start===P,g.maxLineWidth=L,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,Y=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=mo(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=mo(t,"maxLines",0);var a=0===i,h=mo(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=mo(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=mo(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=mo(t,"letterSpacing",0),f=mo(t,"rtl",!0),p=mo(t,"hAlign",f?2:0),v=mo(t,"vAlign",0),g=lo({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=g.start===P,g.maxLineHeight=L,g.linesWidth=M.length*r;var I=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,z=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return pr(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return fr(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),Xr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return Gr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,C(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(C(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,C(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Hr);return null===i?i=new to(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),_r(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(ea(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},sa=function(t){return t>>16&255},ra=function(t){return t>>8&255},oa=function(t){return 255&t},aa=Phaser.Events.EventEmitter,ha=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=la),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},la={},ua=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=ha),function(t){if(t.events)return t;var e=new aa,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},ca=Phaser.Utils.Array.Remove,da={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=sa(e),n=ra(e),s=oa(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=sa(e=r),n=ra(e),s=oa(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&ua(e,this.viewport),this.effectPropertiesConfig&&ea(e,this.effectPropertiesConfig),e.once("destroy",(function(){ca(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?Va:Ya,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=Fa,this}},{key:"update",value:function(t,e){this.state!==Fa&&this.state!==Xa&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=Wa)):(this.nowTime=this.duration,this.state=Xa):this.nowTime>=0&&(this.state=Va));}},{key:"t",get:function(){var t;switch(this.state){case Fa:case Ya:case Wa:t=0;break;case Va:t=this.nowTime/this.duration;break;case Xa:t=1;}return Ia(t,0,1)},set:function(t){(t=Ia(t,-1,1))<0?(this.state=Ya,this.nowTime=-this.delay*t):(this.state=Va,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++);}},{key:"setT",value:function(t){return this.t=t,this}},{key:"isIdle",get:function(){return this.state===Fa}},{key:"isDelay",get:function(){return this.state===Ya}},{key:"isCountDown",get:function(){return this.state===Va}},{key:"isRunning",get:function(){return this.state===Ya||this.state===Va}},{key:"isDone",get:function(){return this.state===Xa}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),Fa=0,Ya=1,Va=2,Wa=3,Xa=-1,Ga=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).timer=new za,s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(g(u(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),g(u(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),g(u(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),g(u(i.prototype),"complete",this).call(this),this}}]),i}(ja),Ha=Phaser.Utils.Objects.GetValue,Ua=Phaser.Utils.Objects.GetAdvancedValue,Na=Phaser.Tweens.Builders.GetEaseFunction,Ka=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Ha(t,"timer")),this.setEnable(Ha(t,"enable",!0)),this.setTarget(Ha(t,"target",this.parent)),this.setDelay(Ua(t,"delay",0)),this.setDuration(Ua(t,"duration",1e3)),this.setEase(Ha(t,"ease","Linear")),this.setRepeat(Ha(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setTarget",value:function(t){return void 0===t&&(t=this.parent),this.target=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=Na(t),this}},{key:"start",value:function(){return this.timer.isRunning||g(u(i.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"stop",value:function(t){return void 0===t&&(t=!1),g(u(i.prototype),"stop",this).call(this),t&&(this.timer.setT(1),this.updateGameObject(this.target,this.timer),this.complete()),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable||!this.parent.active)return this;var i=this.target,n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),i}(Ga),Ja=Phaser.Sound.BaseSound,Za=function(t){return t instanceof Ja},qa=Phaser.Utils.Objects.GetValue,$a=Phaser.Utils.Objects.GetAdvancedValue,Qa=Phaser.Math.Linear,th=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),Za(t)&&(s=n,n=t,t=void 0),n.active=!0,n.scene=t,n.game=n.manager.game,(o=e.call(this,n,s)).volume={},o.resetFromJSON(s),o}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(qa(t,"mode",0)),this.setEnable(qa(t,"enable",!0)),this.setVolumeRange($a(t,"volume.start",this.parent.volume),$a(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=eh[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),g(u(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Qa(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(g(u(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(Ka),eh={stop:1,destroy:2},ih=function(t,e,i,n,s){Za(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new th(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},nh=function(t,e,i,n){Za(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new th(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},sh=Phaser.Utils.Objects.GetValue,rh={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:sh(e,"loop",this.backgroundMusicLoop),mute:sh(e,"mute",this.backgroundMusicMute),volume:sh(e,"volume",this.backgroundMusicVolume),detune:sh(e,"detune",0),rate:sh(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&ih(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&nh(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},oh=Phaser.Utils.Objects.GetValue,ah={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:oh(e,"loop",this.backgroundMusicLoop),mute:oh(e,"mute",this.backgroundMusic2Mute),volume:oh(e,"volume",this.backgroundMusic2Volume),detune:oh(e,"detune",0),rate:oh(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&ih(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&nh(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},hh=Phaser.Utils.Array.Remove,lh=Phaser.Utils.Objects.GetValue,uh={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:lh(e,"mute",this.soundEffectsMute),volume:lh(e,"volume",this.soundEffectsVolume),detune:lh(e,"detune",0),rate:lh(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&hh(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&hh(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&ih(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&nh(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)nh(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&ih(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&nh(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)nh(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(Si(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return a(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=qs(this.delimiterLeft),e=qs(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=zh:t||(t=Yh),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return n.setDelimiters(s[0],s[1]),n}return a(i,[{key:"setTagExpression",value:function(t){return t||(t=Wh),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=Wh),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){g(u(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==Wh||this.valueExpression!==Wh){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=qs(this.delimiterLeft),e=qs(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=zh);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Nl,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===Hr&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else Qr(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),$l(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Nl),i=0,n=e.length;i0&&o.chainAnimation(i,n);},cu=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,C(i));},du=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,C(i));},fu=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,C(i));},pu=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(lu(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(C(s))):a.setProperty(i,n,s[0]);}},Cu={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},xu=function(t){var e,i,n,s,r,o,a,h,l=m(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},wu=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(gu(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return zu.length=0,!0;return zu.length=0,!1},zu=[],Fu=void 0,Yu=Phaser.Utils.Objects.GetValue,Vu=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=Yu(e,r,n[1]))&&(i[n[0]]=s);return i},Wu=function(t){t.addEventListener("touchstart",Xu,!1),t.addEventListener("touchmove",Xu,!1),t.addEventListener("touchend",Xu,!1),t.addEventListener("mousedown",Xu,!1),t.addEventListener("mouseup",Xu,!1),t.addEventListener("mousemove",Xu,!1);},Xu=function(t){t.stopPropagation();},Gu=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Hu=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Gu,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this);},Uu=function(){this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this);},Nu=Phaser.Utils.Objects.GetValue,Ku=function(t,e){var i,n=Nu(e,"inputType",void 0);void 0===n&&(n=Nu(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Nu(e,"style",void 0),r=i.style;Vu(ju,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",Vu(Bu,e,i),Wu(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i.addEventListener("focus",(function(e){Hu.call(t);})),i.addEventListener("blur",(function(e){Uu.call(t);})),i},Ju={open:function(){return this.isOpened||this.readOnly||((t=this)!==Fu&&(void 0!==Fu&&Fu.close(),Fu=t),this.node||(this.node=Ku(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===Fu&&(Fu=void 0),this.setBlur(),this):this}},Zu=Phaser.Utils.Objects.GetValue,qu=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),s=e.call(this,t);var o=Zu(n,"inputType",void 0);void 0===o&&(o=Zu(n,"type","text")),s.setEnterCloseEnable(Zu(n,"enterClose","textarea"!==o));var a=Zu(n,"onOpen",void 0);a||(a=Zu(n,"onFocus",void 0)),s.onOpenCallback=a;var h=Zu(n,"onClose",void 0);return h||(h=Zu(n,"onBlur",void 0)),s.onCloseCallback=h,s.onUpdateCallback=Zu(n,"onUpdate",void 0),s.isOpened=!1,t.on("pointerdown",(function(){this.open();}),d(s)).setInteractive(),s.nodeConfig=function(t){void 0===t&&(t={});var e={};return Du(t,e,"inputType"),Du(t,e,"type"),Du(t,e,"style"),Du(t,e,ju),Du(t,e,Bu),e}(n),s.node=void 0,s}return a(i,[{key:"destroy",value:function(){this.close(),g(u(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){Au(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(Ea);Object.assign(qu.prototype,Ju);var $u=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},Qu=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(Qu(this),tc(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=$u,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(qu),nc=Phaser.Utils.Objects.GetValue,sc=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],rc=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}cc.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(dc(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=pd(t,"tl",0),this.radiusTR=pd(t,"tr",0),this.radiusBL=pd(t,"bl",0),this.radiusBR=pd(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Ni(e,e,e,e,180,270,!1,r,t):Ni(0,0,e,e,90,0,!0,r,t):Hi(0,0,t);(e=this.radiusTR)>0?this._convexTR?Ni(n-e,e,e,e,270,360,!1,r,t):Ni(n,0,e,e,180,90,!0,r,t):Hi(n,0,t);(e=this.radiusBR)>0?this._convexBR?Ni(n-e,s-e,e,e,0,90,!1,r,t):Ni(n,s,e,e,270,180,!0,r,t):Hi(n,s,t);(e=this.radiusBL)>0?this._convexBL?Ni(e,s-e,e,e,90,180,!1,r,t):Ni(0,s,e,e,360,270,!0,r,t):Hi(0,s,t);return t.push(t[0],t[1]),Zc(this.x,this.y,t),g(u(i.prototype),"updateData",this).call(this),this}}]),i}(zc),gd=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,yd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),void 0===t&&(t=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,n),l.setP1(s,o),l.setP2(a,h),l}return a(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),g(u(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=gd(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&qi(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&(Qi(t,this),t.fill()),this.isStroked&&(tn(t,this),t.stroke());}}]),i}(Ac),kd={buildShapes:function(){this.addShape((new vd).setName("box")).addShape((new cd).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},md=Phaser.Utils.Objects.GetValue,bd=Phaser.Math.Linear,Cd=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).resetFromJSON(),s.boot(),s}return a(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=md(t,"key","value");var n=e[this.propertyKey];return this.fromValue=md(t,"from",n),this.toValue=md(t,"to",n),this.setEase(md(t,"ease",this.ease)),this.setDuration(md(t,"duration",this.duration)),this.setRepeat(md(t,"repeat",0)),this.setDelay(md(t,"delay",0)),this.setRepeatDelay(md(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,g(u(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=bd(this.fromValue,this.toValue,i);}}]),i}(Ka),xd={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new Cd(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},wd={};Object.assign(wd,jc,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},kd,xd);var Sd=Phaser.Utils.Objects.GetValue,Od=Phaser.Utils.Objects.IsPlainObject,Pd=23730,Td=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),Od(n)?(n=Sd(l=n,"x",0),s=Sd(l,"y",0),o=Sd(l,"width",2),a=Sd(l,"height",2),h=Sd(l,"color",Pd)):Od(h)&&(h=Sd(l=h,"color",Pd)),(u=e.call(this,t,n,s,o,a)).type="rexCheckbox",void 0===h&&(h=Pd),u.setBoxShape(Sd(l,"circleBox",!1)),u.setBoxFillStyle(h,Sd(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(Sd(l,"uncheckedColor",null),Sd(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(Sd(l,"boxLineWidth",4),Sd(l,"boxStrokeColor",h),Sd(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,Sd(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),Sd(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(Sd(l,"checkerColor",16777215),Sd(l,"checkerAlpha",1)),u.setBoxSize(Sd(l,"boxSize",1)),u.setCheckerSize(Sd(l,"checkerSize",1)),u.setCheckerAnimationDuration(Sd(l,"animationDuration",150)),u.buildShapes();var c=Sd(l,"checked");return void 0===c&&(c=Sd(l,"value",!1)),u.setValue(c),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(Bc);Object.assign(Td.prototype,wd);var Md=Phaser.Utils.Objects.GetValue,Ed=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(Md(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(Md(t,"enable",!0)),this.setMode(Md(t,"mode",1)),this.setClickInterval(Md(t,"clickInterval",100)),this.setDragThreshold(Md(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=_d[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,i,n){void 0===this.pointer&&(this.pointer=t,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&t.getDistance()>=this.dragThreshold&&this.cancel();}},{key:"click",value:function(t,e,i){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.parent,e,i),this;this.pointer=void 0;var n=this.lastClickTime;return void 0!==n&&t-n<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(Ea),_d={press:0,pointerdown:0,release:1,pointerup:1},Ld=Phaser.Utils.Objects.GetValue,Rd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new Ed(d(u),Ld(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(Ld(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Td),Bd={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},jd={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},Dd={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},Ad=function(t,e,i){return (e-t)*i+t},Id=Phaser.Math.Linear,zd={buildShapes:function(){this.addShape((new vd).setName("track")).addShape((new vd).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Ad(sa(l),sa(u),c))<<16|(255&Ad(ra(l),ra(u),c))<<8|255&Ad(oa(l),oa(u),c)),f=Id(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=Id(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},Fd={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new Cd(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Yd={};Object.assign(Yd,Bd,jd,Dd,zd,Fd);var Vd=Phaser.Utils.Objects.GetValue,Wd=Phaser.Utils.Objects.IsPlainObject,Xd=23730,Gd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),Wd(n)?(n=Vd(l=n,"x",0),s=Vd(l,"y",0),o=Vd(l,"width",2),a=Vd(l,"height",2),h=Vd(l,"color",Xd)):Wd(h)&&(h=Vd(l=h,"color",Xd)),(u=e.call(this,t,n,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=Xd),u.setTrackFillStyle(h,Vd(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Vd(l,"falseValueTrackColor",function(t){var e=.3*sa(t)+.59*ra(t)+.11*oa(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Vd(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Vd(l,"thumbColor",16777215),Vd(l,"thumbAlpha",1)),u.setTrackSize(Vd(l,"trackWidth",.9),Vd(l,"trackHeight",.5)),u.setTrackRadius(Vd(l,"trackRadius",.5*u.trackHeight));var c=Vd(l,"thumbHeight",void 0),d=Vd(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Vd(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Vd(l,"thumbLeft",.3),Vd(l,"thumbRight",void 0)),u.setRTL(Vd(l,"rtl",!1)),u.setToggleAnimationDuration(Vd(l,"animationDuration",150)),u.buildShapes(),u.setValue(Vd(l,"value",!1),0),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(Bc);Object.assign(Gd.prototype,Yd);var Hd=Phaser.Utils.Objects.GetValue,Ud=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new Ed(d(u),Hd(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(Hd(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Gd),Nd={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Kd=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i)}(kn);Object.assign(Kd.prototype,Nd),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var Jd=Phaser.Math.Linear,Zd=Phaser.Math.Percent,qd={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Zd(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Zd(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Jd(t,e,i)),i}},$d=Phaser.Math.Percent,Qd={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=$d(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new Cd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new Cd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},tf=Phaser.Utils.Objects.GetValue,ef=Phaser.Math.Clamp;function nf(t){var e=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=tf(t,"eventEmitter",this);var e=tf(t,"valuechangeCallback",null);if(null!==e){var i=tf(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(tf(t,"easeValue.duration",0)).setEaseValueFunction(tf(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=ef(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,qd,Qd),e}var sf=Phaser.Math.RadToDeg,rf=Phaser.Math.DegToRad,of=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=rf(r),u=rf(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},af={buildShapes:function(){this.addShape((new cd).setName("track")).addShape((new cd).setName("bar")).addShape((new Vc).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),of(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=sf(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),of(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},hf=Phaser.Utils.Objects.GetValue,lf=Phaser.Utils.Objects.IsPlainObject,uf=Phaser.Math.Clamp,cf=Phaser.Math.DegToRad(270),df=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),lf(n)&&(n=hf(l=n,"x",0),s=hf(l,"y",0),o=hf(l,"radius",1),a=hf(l,"barColor",void 0),h=hf(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,n,s,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(hf(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(hf(l,"centerColor",void 0)),u.setThickness(hf(l,"thickness",.2)),u.setStartAngle(hf(l,"startAngle",cf)),u.setAnticlockwise(hf(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return a(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(g(u(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=uf(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(nf(Bc));Object.assign(df.prototype,af);Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.IsPlainObject,Phaser.Math.Clamp,Phaser.Math.DegToRad(270);nf(kn);var ff=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},pf=Phaser.Utils.Objects.GetValue,vf=Phaser.Utils.Objects.IsPlainObject,gf=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),vf(n)?(n=pf(u=n,"x",0),s=pf(u,"y",0),o=pf(u,"width",2),a=pf(u,"height",2),h=pf(u,"barColor",void 0),l=pf(u,"value",0)):vf(o)?(o=pf(u=o,"width",2),a=pf(u,"height",2),h=pf(u,"barColor",void 0),l=pf(u,"value",0)):vf(h)&&(h=pf(u=h,"barColor",void 0),l=pf(u,"value",0)),(c=e.call(this,t,n,s,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new cd).setName("trackFill")).addShape((new cd).setName("bar")).addShape((new cd).setName("trackStroke")),c.setTrackColor(pf(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(pf(u,"trackStrokeThickness",2),pf(u,"trackStrokeColor",void 0)),c.setSkewX(pf(u,"skewX",0)),c.setRTL(pf(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(nf(Bc)),yf={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&ff(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),ff(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&ff(a,0,0,e,i,t).end();}};Object.assign(gf.prototype,yf);var kf=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),kf(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},bf=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},Cf=Phaser.Utils.Objects.GetValue,xf=Phaser.Utils.Objects.IsPlainObject,wf=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),xf(n)?(n=Cf(u=n,"x",0),s=Cf(u,"y",0),o=Cf(u,"width",2),a=Cf(u,"height",2),h=Cf(u,"barColor",void 0),l=Cf(u,"value",0)):xf(o)?(o=Cf(u=o,"width",2),a=Cf(u,"height",2),h=Cf(u,"barColor",void 0),l=Cf(u,"value",0)):xf(h)&&(h=Cf(u=h,"barColor",void 0),l=Cf(u,"value",0)),(c=e.call(this,t,n,s,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(Cf(u,"trackColor",void 0)),c.setBarColor(h,Cf(u,"barColor2",void 0),Cf(u,"isHorizontalGradient",void 0)),c.setTrackStroke(Cf(u,"trackStrokeThickness",2),Cf(u,"trackStrokeColor",void 0)),c.setSkewX(Cf(u,"skewX",0)),c.setRTL(Cf(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=Cn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),mf.call(this),g(u(i.prototype),"updateTexture",this).call(this),this}}]),i}(nf(kn));Phaser.Math.Wrap;var Sf=Phaser.Math.Linear,Of=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],C=this.easeDirectionProgress;t=Sf(m.a.x,b.a.x,C),e=Sf(m.a.y,b.a.y,C),i=Sf(m.b.x,b.b.x,C),n=Sf(m.b.y,b.b.y,C),s=Sf(m.c.x,b.c.x,C),r=Sf(m.c.y,b.c.y,C);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Pf=(0, Phaser.Math.DegToRad)(120),Tf=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+Pf),i+n*Math.sin(s+Pf)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Pf),i+n*Math.sin(s-Pf)),this.arrowOnly?t.end():t.close();},Mf={buildShapes:function(){this.addShape((new cd).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?Of.call(this):Tf.call(this);}},Ef={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new Cd(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},_f=Phaser.Utils.Objects.GetValue,Lf=Phaser.Utils.Objects.IsPlainObject,Rf=Phaser.Math.DegToRad,Bf=Phaser.Math.RadToDeg,jf=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(r(this,i),Lf(n)){var m=n;n=m.x,s=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,n,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return a(i,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Af(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,i,s){if("object"===n(t)){var r=t,o=_f(r,"x",null);null!==o?(t=o,i=o):(t=_f(r,"left",0),i=_f(r,"right",t));var a=_f(r,"y",null);null!==a?(e=a,s=a):(e=_f(r,"top",0),s=_f(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=i||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Bf(this.verticeRotation)},set:function(t){this.verticeRotation=Rf(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),i}(Bc),Df={right:0,down:1,left:2,up:3},Af=function(t){return "string"==typeof t&&(t=Df[t]),t%=4};Object.assign(jf.prototype,Mf,Ef);var If=function(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer};var zf=Phaser.Display.Align,Ff={center:zf.CENTER,left:zf.LEFT_CENTER,right:zf.RIGHT_CENTER,top:zf.TOP_CENTER,bottom:zf.BOTTOM_CENTER,"left-top":zf.TOP_LEFT,"top-left":zf.TOP_LEFT,"left-center":zf.LEFT_CENTER,"center-left":zf.LEFT_CENTER,"left-bottom":zf.BOTTOM_LEFT,"bottom-left":zf.BOTTOM_LEFT,"center-top":zf.TOP_CENTER,"top-center":zf.TOP_CENTER,"center-center":zf.CENTER,"center-bottom":zf.BOTTOM_CENTER,"bottom-center":zf.BOTTOM_CENTER,"right-top":zf.TOP_RIGHT,"top-right":zf.TOP_RIGHT,"right-center":zf.RIGHT_CENTER,"center-right":zf.RIGHT_CENTER,"right-bottom":zf.BOTTOM_RIGHT,"bottom-right":zf.BOTTOM_RIGHT},Yf=new Phaser.GameObjects.Zone({sys:{queueDepthSort:We,events:{once:We}}},0,0,1,1);Yf.setOrigin(0);var Vf=0,Wf=1,Xf=2,Gf=4,Hf=6,Uf=8,Nf=10,Kf=12,Jf=function(t){var e=Mt(t);return t.y+e-e*t.originY},Zf=function(t){var e=Tt(t);return t.x-e*t.originX+.5*e},qf=function(t,e){var i=Mt(t);return t.y=e-i+i*t.originY,t},$f=function(t,e){var i=Tt(t),n=i*t.originX;return t.x=e+n-.5*i,t},Qf=function(t){var e=Tt(t);return t.x-e*t.originX},tp=function(t,e){var i=Tt(t);return t.x=e+i*t.originX,t},ep=function(t){var e=Tt(t);return t.x+e-e*t.originX},ip=function(t,e){var i=Tt(t);return t.x=e-i+i*t.originX,t},np=function(t,e){var i=Mt(t),n=i*t.originY;return t.y=e+n-.5*i,t},sp=function(t){var e=Mt(t);return t.y-e*t.originY+.5*e},rp=function(t){var e=Mt(t);return t.y-e*t.originY},op=function(t,e){var i=Mt(t);return t.y=e+i*t.originY,t},ap=[];ap[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,Zf(e)+i),qf(t,Jf(e)+n),t},ap[Nf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)-i),qf(t,Jf(e)+n),t},ap[Kf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ip(t,ep(e)+i),qf(t,Jf(e)+n),t},ap[Hf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){$f(t,e),np(t,i);}(t,Zf(e)+i,sp(e)+n),t},ap[Gf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)-i),np(t,sp(e)+n),t},ap[Uf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ip(t,ep(e)+i),np(t,sp(e)+n),t},ap[Wf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,Zf(e)+i),op(t,rp(e)-n),t},ap[Vf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)-i),op(t,rp(e)-n),t},ap[Xf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ip(t,ep(e)+i),op(t,rp(e)-n),t};var hp=function(t,e,i,n,s){return ap[i](t,e,n,s)},lp=function(t,e,i,n,s,r){Yf.setPosition(e,i).setSize(n,s),hp(t,Yf,r);},up=Phaser.Utils.Objects.GetValue,cp=Phaser.GameObjects.Group,dp=function(t,e,i){return t.add.text(0,0,"")},fp=void 0,pp=Phaser.Utils.Objects.GetValue,vp=function(t,e){return void 0===t&&(t=0),void 0===e&&(e={}),"number"==typeof t?(e.left=t,e.right=t,e.top=t,e.bottom=t):(e.left=pp(t,"left",0),e.right=pp(t,"right",0),e.top=pp(t,"top",0),e.bottom=pp(t,"bottom",0)),e},gp=se.prototype.add,yp=function(t){return gp.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this},kp={addBackground:function(t,e,i){return void 0===this.backgroundChildren&&(this.backgroundChildren=[]),"string"==typeof e&&(i=e,e=void 0),void 0===e&&(e=0),yp.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=vp(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},mp=function t(e,i){var n=null;if(void 0===i)e.hasOwnProperty("rexContainer")&&((n=e.rexContainer.parent)?n.isRexSizer||(n=t(n)):n=null);else for(n=t(e);n&&n.name!==i;)n=t(n);return n},bp={getParentSizer:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),mp(t,e)},getTopmostSizer:function(t){return void 0===t&&(t=this),function(t){for(var e=mp(t);e;)t=e,e=mp(e);return t}(t)},hasParentSizer:function(t,e){void 0===e&&(e=this);for(var i=mp(e);i;){if(i===t)return !0;i=mp(i);}return !1},hasChild:function(t,e){return void 0===e&&(e=this),this.hasParentSizer(e,t)}},Cp=Phaser.Utils.Array.Remove,xp=se.prototype.remove,wp=bp.getParentSizer,Sp=function(t,e){for(var i=wp(t);i;)i.removeChildCallback&&i.removeChildCallback(t,e),i=wp(i);return this.isBackground(t)&&Cp(this.backgroundChildren,t),xp.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this},Op=Phaser.Utils.Array.Remove,Pp=bp.getParentSizer,Tp={removeFromParentSizer:function(){var t=Pp(gameObject);return t&&t.remove(this),this},removeBackground:function(t,e){return void 0===this.backgroundChildren||this.getParentSizer(t)!==this||(Op(this.backgroundChildren,t),Sp.call(this,t,e)),this},removeAllBackgrounds:function(t){if(void 0===this.backgroundChildren)return this;for(var e=this.backgroundChildren.length-1;e>=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Mp={getInnerPadding:function(t){return fr(this.space,t)},setInnerPadding:function(t,e){return pr(this.space,t,e),this},getOuterPadding:function(t){return fr(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return pr(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),fr(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),pr(this.getSizerConfig(t).padding,e,i),this}},Ep=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},_p=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Lp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,C(i.children)));}return t}},Rp=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(Dv),Iv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=Ta(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},zv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=We),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=We),this.transitOutCallback=t,this}},Fv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Yv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},Vv={};Object.assign(Vv,Iv,zv,Fv,Yv);var Wv=Phaser.Utils.Objects.GetValue,Xv=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).setTransitInTime(Wv(n,"duration.in",200)),s.setTransitOutTime(Wv(n,"duration.out",200)),s.setTransitInCallback(Wv(n,"transitIn")),s.setTransitOutCallback(Wv(n,"transitOut")),s.oneShotMode=Wv(n,"destroy",!1),s.delayCallTimer=void 0,s._state=new Av(d(s),{eventEmitter:!1,initState:Wv(n,"initState","IDLE")}),s.openEventData=void 0,s.closeEventData=void 0,s}return a(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),g(u(i.prototype),"shutdown",this).call(this,t));}}]),i}(Ea);Object.assign(Xv.prototype,Vv);var Gv=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,0,0,2,2,n,1)).setAlpha(s),o.setScrollFactor(0),o.boot(),o}return a(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),Hv=Phaser.Utils.Objects.GetValue,Uv=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,{eventEmitter:!1})).resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Hv(t,"hitAreaMode",0)),this.setEnable(Hv(t,"enable",!0)),this.setStopMode(Hv(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=Nv[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(Ea),Nv={default:0,fullWindow:1},Kv=Phaser.Utils.Objects.GetValue,Jv=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=Kv(n,"color",0),a=Kv(n,"alpha",.8);return (s=e.call(this,t,o,a)).touchEventStop=new Uv(d(s),{hitAreaMode:1}),s}return a(i)}(Gv),Zv=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Yp(t,e);},qv=function(t,e){Vp(t,e,void 0,void 0,!1);},$v=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,qp(t,e);},Qv=function(t,e){$p(t,e,!1);},tg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,qp(t,e,t.alpha);},eg=function(t,e){$p(t,e,!1);},ig=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!Rt(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},ng=Phaser.Utils.Objects.GetValue,sg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=rg.popUp),null==n.transitOut&&(n.transitOut=rg.scaleDown),n.destroy=ng(n,"destroy",!0),s=e.call(this,t,n);var o=ng(n,"cover");s.cover=!1!==o?function(t,e){var i=t.scene,n=new Jv(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,s.cover&&(s.setCoverTransitInCallback(ng(o,"transitIn",tg)),s.setCoverTransitOutCallback(ng(o,"transitOut",eg)));var a=ng(n,"touchOutsideClose",!1),h=ng(n,"duration.hold",-1),l=ng(n,"timeOutClose",h>=0),u=ng(n,"anyTouchClose",!1);return ng(n,"manualClose",!1)&&(a=!1,u=!1,l=!1),u&&(a=!1),l?s.setDisplayTime(h):s.setDisplayTime(-1),u?s.once("open",s.anyTouchClose,d(s)):a&&s.once("open",s.touchOutsideClose,d(s)),ng(n,"openOnStart",!0)&&s.delayCall(0,s.requestOpen,d(s)),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ig(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=g(u(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=g(u(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),g(u(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=rg[t]),t){case rg.popUp:t=Zv;break;case rg.fadeIn:t=$v;}return g(u(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=rg[t]),t){case rg.scaleDown:t=qv;break;case rg.fadeOut:t=Qv;}return g(u(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(Xv),rg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},og={modal:function(t,e){return Oe(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=function(t,e){var i=new sg(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i}(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return function(t,e){t.emit("modal.requestClose",e);}(this,t),this}},ag=function(t,e,i,n){if(e)return ig(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(Ea),Sg={press:0,pointerdown:0,release:1,pointerup:1},Og={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new wg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Pg=function(t){l(i,t);var e=p(i);function i(){var t;return r(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return a(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(Dv),Tg=Phaser.Utils.Objects.GetValue,Mg=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,s.cooldown=new Pg,s.parent.setInteractive(Tg(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Tg(t,"enable",!0)),this.setCooldown(Tg(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(Ea),Eg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&ag(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Mg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Mg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},_g=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=Ug,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===Ng&&this.onDragEnd(),this.pointer=void 0,this.tracerState=Ug,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){g(u(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){g(u(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Kg,this}}]),i}(La),Ug=0,Ng=1,Kg="IDLE",Jg=Phaser.Utils.Objects.GetValue,Zg=Phaser.Math.Distance.Between,qg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=$g;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(Jg(t,"time",250)),this.setTapInterval(Jg(t,"tapInterval",200)),this.setDragThreshold(Jg(t,"threshold",9)),this.setTapOffset(Jg(t,"tapOffset",10));var e=Jg(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(Jg(t,"maxTaps",void 0)),this.setMinTaps(Jg(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case $g:this.state=Qg;break;case Qg:var t=this.lastPointer;Zg(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=ty,this.state=Qg);break;case ty:this.state=Qg;}}},{key:"onDragEnd",value:function(){this.state===Qg&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=ty));}},{key:"onDrag",value:function(){this.state!==$g&&this.pointer.getDistance()>this.dragThreshold&&(this.state=$g);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===Qg){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=$g);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=ty:this.state=$g);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===ty&&(this.state=$g);}},{key:"isTapped",get:function(){return this.state===ty}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(Hg),$g="IDLE",Qg="BEGIN",ty="RECOGNIZED",ey=Phaser.Utils.Objects.GetValue,iy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=ny;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(ey(t,"threshold",9)),this.setHoldTime(ey(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=sy,0===this.holdTime&&(this.state=ry);}},{key:"onDragEnd",value:function(){this.state=ny;}},{key:"onDrag",value:function(){this.state!==ny&&this.pointer.getDistance()>this.dragThreshold&&(this.state=ny);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===sy&&t-this.pointer.downTime>=this.holdTime&&(this.state=ry));}},{key:"isPressed",get:function(){return this.state===ry}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Hg),ny="IDLE",sy="BEGIN",ry="RECOGNIZED";Phaser.Utils.Objects.GetValue;var oy=Phaser.Math.Distance.Between,ay=Phaser.Math.Angle.Between,hy={getDt:function(){return Tc(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return oy(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return ay(e.x,e.y,t.x,t.y)}},ly={"up&down":0,"left&right":1,"4dir":2,"8dir":3},uy={},cy=Phaser.Utils.Objects.GetValue,dy=Phaser.Math.RadToDeg,fy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=py;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s.clearDirectionStates(),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(cy(t,"threshold",10)),this.setVelocityThreshold(cy(t,"velocityThreshold",1e3)),this.setDirectionMode(cy(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=vy;}},{key:"onDragEnd",value:function(){this.state=py;}},{key:"onDrag",value:function(){this.state===vy&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=gy));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===gy&&(this.state=py);}},{key:"isSwiped",get:function(){return this.state===gy}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=ly[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=uy),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(dy(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(Hg);Object.assign(fy.prototype,hy);var py="IDLE",vy="BEGIN",gy="RECOGNIZED",yy=Phaser.Utils.Objects.GetValue,ky=Phaser.Utils.Array.SpliceOne,my=Phaser.Math.Distance.Between,by=Phaser.Math.Angle.Between,Cy=function(){function t(e,i){r(this,t);var n=e.input.manager.pointersTotal-1;n<2&&e.input.addPointer(2-n),this.scene=e,this.setEventEmitter(yy(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return a(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(yy(t,"enable",!0)),this.bounds=yy(t,"bounds",void 0),this.tracerState=wy,this.pointers.length=0,Wt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,Wt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case wy:this.tracerState=Sy,this.onDrag1Start();break;case Sy:this.tracerState=Oy,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],ky(this.pointers,e),this.tracerState){case Sy:this.tracerState=wy,this.onDrag1End();break;case Oy:this.tracerState=Sy,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case Sy:this.onDrag1();break;case Oy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Oy&&this.onDrag2End(),this.pointers.length=0,Wt(this.movedState),this.tracerState=wy,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0],e=this.pointers[1];return my(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0],e=this.pointers[1];return by(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;xy.x=e.x-i.x,xy.y=e.y-i.y;}else xy.x=0,xy.y=0;return xy}},{key:"centerX",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==Oy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==Oy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==Oy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Py,this}}]),t}();Object.assign(Cy.prototype,Ho);var xy={},wy=0,Sy=1,Oy=2,Py="IDLE";Phaser.Utils.Objects.GetValue;var Ty=Phaser.Math.RotateAround,My=function(t,e,i,n){return Ty(t,e,i,n),t.rotation+=n,t},Ey={},_y=Phaser.Utils.Objects.GetValue,Ly=Phaser.Math.Angle.WrapDegrees,Ry=Phaser.Math.Angle.ShortestBetween,By=Phaser.Math.RadToDeg,jy=Phaser.Math.DegToRad,Dy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=Iy;},eventEmitter:!1};return s.setRecongizedStateObject(new Dv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(_y(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Ly(By(this.angleBetween)),this.state=zy,0===this.dragThreshold&&(this.state=Fy);}},{key:"onDrag2End",value:function(){this.state=Iy;}},{key:"onDrag2",value:function(){switch(this.state){case zy:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Ly(By(this.angleBetween));this.angle=Ry(this.prevAngle,t),this.prevAngle=t,this.state=Fy;}break;case Fy:t=Ly(By(this.angleBetween));this.angle=Ry(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===Fy}},{key:"rotation",get:function(){return jy(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Cy),Ay={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Ey),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?u.pop().setTexture(d,M):s(c,d,M),h&&c.add.existing(T),l){var E=b+w*P+o*w,_=C+S*O+a*S;T.setOrigin(o,a).setPosition(E,_).setScale(g,y).setRotation(k),am(T,b,C,k);}x.push(T);}return x}(t,e,i,n),o=0,a=r.length;ol?(n.width=a*l,n.height=a):(n.width=o,n.height=a);}else n.width=s,n.height=r;else {var l=s/r;n.width=Math.min(s,o),n.height=Math.min(r,a);var u=n.width/n.height;ul&&(n.width=n.height*l);}return n}(t,{width:this.width,height:this.height},this.scaleUp,!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return g(u(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(se);Object.assign(xm.prototype,lm);var wm=Phaser.Math.Wrap,Sm=function(t){l(i,t);var e=p(i);function i(t){var n;return r(this,i),(n=e.call(this,t,0,0,1,1)).isRexSpace=!0,n}return a(i)}(Phaser.GameObjects.Zone),Om=function(t,e){var i=this.sizerChildren;if(0===i.length)return -1;for(var n=-1,s=1/0,r=0,o=i.length;r(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},Pm=Phaser.Utils.Objects.IsPlainObject,Tm=Phaser.Utils.Objects.GetValue,Mm=Phaser.Display.Align.CENTER,Em={min:0,full:-1},_m=function(t,e,i,s,r,o,a,h,l,u){yp.call(this,t);var c=t.isRexSpace,d=n(e);if(null===e)return this;if("number"===d);else if("string"===d)e=Em[e];else if(Pm(e)){var f;e=Tm(f=e,"proportion",void 0),i=Tm(f,"align",Mm),s=Tm(f,"padding",0),r=Tm(f,"expand",!1),o=Tm(f,"key",void 0),a=Tm(f,"index",void 0),t.isRexSizer||(h=Tm(f,"minWidth",void 0),l=Tm(f,"minHeight",void 0)),u=Tm(f,"fitRatio",0);}return "string"==typeof i&&(i=Ff[i]),void 0===e&&(e=c?1:0),void 0===i&&(i=Mm),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=i,f.padding=vp(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?Tt(t):h:t.minHeight=void 0===l?Mt(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},Lm={add:_m,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),_m.call(this,new Sm(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return Pm(i)&&(i.index=t),_m.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=Om.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Rm=Phaser.Utils.Array.Remove,Bm={remove:function(t,e){return this.getParentSizer(t)!==this||(Rm(this.sizerChildren,t),Sp.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,sk.call(this,t),this}},jm={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Ff[e]),this.getSizerConfig(t).align=e,this}},Dm={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=_p.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(Dm,Lm,Bm,jm,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var Am=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},Im={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},zm=function(t){return "string"==typeof t&&(t=Im[t]),t},Fm=Phaser.Utils.Objects.IsPlainObject,Ym=Phaser.Utils.Objects.GetValue,Vm=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),Fm(n)?(n=Ym(l=n,"x",0),s=Ym(l,"y",0),o=Ym(l,"width",void 0),a=Ym(l,"height",void 0),h=Ym(l,"orientation",0)):Fm(o)?(o=Ym(l=o,"width",void 0),a=Ym(l,"height",void 0),h=Ym(l,"orientation",0)):Fm(h)&&(h=Ym(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,n,s,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(Ym(l,"space.item",0)),u.setStartChildIndex(Ym(l,"startChildIndex",0)),u.setRTL(Ym(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return a(i,[{key:"setOrientation",value:function(t){return this.orientation=zm(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=Am.call(this)),this._childrenProportion}}]),i}(Zy);Object.assign(Vm.prototype,Dm);var Wm=function(t,e,i){if(t){var n=null==e,s=null==i;return n&&s||(n||(t.displayWidth=e),s||(t.displayHeight=i),n&&(t.scaleX=t.scaleY),s&&(t.scaleY=t.scaleX)),t}},Xm={appendText:Es,resetDisplayContent:function(t){void 0===t?t={}:"string"==typeof t&&(t={text:t});var e=t.text||"";this.setText(e);var i=this.childrenMap.icon;if(i){t.icon?this.show(i):this.hide(i);var n=t.iconSize;n&&(this.setChildDisplaySize(i,n,n),void 0!==this.iconWidth&&this.setIconSize(n)),!0!==t.icon&&this.setIconTexture(t.icon,t.iconFrame);}var s=this.childrenMap.action;if(s){t.action?this.show(s):this.hide(s);var r=t.actionSize;r&&(this.setChildDisplaySize(s,r,r),void 0!==this.actionWidth&&this.setActionSize(r)),!0!==t.action&&this.setActionTexture(t.action,t.actionFrame);}return this}},Gm=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"text",get:function(){var t=this.childrenMap.text;return t?t.text:""},set:function(t){var e=this.childrenMap.text;e&&e.setText(t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"setIconTexture",value:function(t,e){var i=this.childrenMap.icon;return i?(i.setTexture(t,e),void 0!==this.iconWidth&&void 0!==this.iconHeight&&(Wm(i,this.iconWidth,this.iconHeight),this.resetChildScaleState(i)),this):this}},{key:"setTexture",value:function(t,e){return this.setIconTexture(t,e),this}},{key:"setIconSize",value:function(t,e){return void 0===e&&(e=t),this.iconWidth=t,this.iconHeight=e,this}},{key:"texture",get:function(){var t=this.childrenMap.icon;if(t)return t.texture}},{key:"frame",get:function(){var t=this.childrenMap.icon;if(t)return t.frame}},{key:"setActionTexture",value:function(t,e){var i=this.childrenMap.action;return void 0===i||(i.setTexture(t,e),void 0!==this.actionWidth&&void 0!==this.actionHeight&&(Wm(i,this.actionWidth,this.actionHeight),this.resetChildScaleState(i))),this}},{key:"actionTexture",get:function(){var t=this.childrenMap.action;if(t)return t.texture}},{key:"actionFrame",get:function(){var t=this.childrenMap.action;if(t)return t.frame}},{key:"setActionSize",value:function(t,e){return void 0===e&&(e=t),this.actionWidth=t,this.actionHeight=e,this}},{key:"preLayout",value:function(){var t=this.childrenMap.icon;t&&void 0!==this.iconWidth&&void 0!==this.iconHeight&&Wm(t,this.iconWidth,this.iconHeight);var e=this.childrenMap.action;e&&void 0!==this.actionWidth&&void 0!==this.actionHeight&&Wm(e,this.actionWidth,this.actionHeight),g(u(i.prototype),"preLayout",this).call(this);}},{key:"postLayout",value:function(t,e,i){var n=this.childrenMap.iconMask;n&&(n.setPosition(),this.resetChildPositionState(n));var s=this.childrenMap.actionMask;return s&&(s.setPosition(),this.resetChildPositionState(s)),this}},{key:"resize",value:function(t,e){g(u(i.prototype),"resize",this).call(this,t,e);var n=this.childrenMap.iconMask;n&&n.resize();var s=this.childrenMap.actionMask;return s&&s.resize(),this}}]),i}(Vm);Object.assign(Gm.prototype,Xm);var Hm=function(t,e,i,n){var s=new tm(e,i,n);if(t&&!t.isRexSizer){var r=s.createGeometryMask();t.setMask(r),this.once("destroy",(function(){t.setMask(),r.destroy();}));}return this.pin(s),s},Um=Phaser.Utils.Objects.GetValue,Nm=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexLabel";var o=Um(n,"background",void 0),a=Um(n,"icon",void 0),h=Um(n,"iconMask",void 0),l=Um(n,"text",void 0),u=Um(n,"action",void 0),c=Um(n,"actionMask",void 0),f=Um(n,"align",void 0);if(o&&s.addBackground(o),"right"!==f&&"bottom"!==f&&"center"!==f||s.addSpace(),a){0===s.orientation?(l||u)&&(C={right:Um(n,"space.icon",0),top:Um(n,"space.iconTop",0),bottom:Um(n,"space.iconBottom",0),left:Um(n,"space.iconLeft",0)}):(l||u)&&(C={bottom:Um(n,"space.icon",0),left:Um(n,"space.iconLeft",0),right:Um(n,"space.iconRight",0),top:Um(n,"space.iconTop",0)});var p=Um(n,"squareFitIcon",!1)?1:0;if(s.add(a,{proportion:0,padding:C,fitRatio:p}),h&&(h=Hm.call(d(s),a,a,1)),!p){var v=Um(n,"iconSize",void 0);s.setIconSize(Um(n,"iconWidth",v),Um(n,"iconHeight",v));}}if(l){var g,y,k=Um(n,"space.text",0),m=Um(n,"expandTextWidth",!1),b=Um(n,"expandTextHeight",!1);0===s.orientation?(g=m?1:0,u&&(C={right:k}),y=b):(g=b?1:0,u&&(C={bottom:k}),y=m),s.add(l,{proportion:g,expand:y,padding:C});}if(u){var C;C=0===s.orientation?{top:Um(n,"space.actionTop",0),bottom:Um(n,"space.actionBottom",0),right:Um(n,"space.actionRight",0)}:{left:Um(n,"space.actionLeft",0),right:Um(n,"space.actionRight",0),bottom:Um(n,"space.actionBottom",0)};p=Um(n,"squareFitAction",!1)?1:0;if(s.add(u,{proportion:0,padding:C,fitRatio:p}),c&&(c=Hm.call(d(s),u,u,1)),!p){var x=Um(n,"actionSize");s.setActionSize(Um(n,"actionWidth",x),Um(n,"actionHeight",x));}}return "center"===f&&s.addSpace(),s.addChildrenMap("background",o),s.addChildrenMap("icon",a),s.addChildrenMap("iconMask",h),s.addChildrenMap("text",l),s.addChildrenMap("action",u),s.addChildrenMap("actionMask",c),s}return a(i)}(Gm),Km=Phaser.Utils.Objects.GetValue,Jm=function(t,e){var i=Km(e,"canvas"),n=Km(i,"width",128),s=Km(i,"height",128),r=new Kd(t,0,0,n,s);t.add.existing(r);var o=Km(i,"key"),a=Km(i,"frame"),h=Km(i,"fill");return void 0!==h?r.fill(h):void 0!==o&&r.loadTexture(o,a),r.setTexture=r.loadTexture.bind(r),r},Zm=Phaser.Utils.Objects.GetValue,qm=function(t,e){var i=Zm(e,"clickTarget",t);return "string"==typeof i&&(i=t.getElement(i)),i},$m=Phaser.Utils.Objects.GetValue,Qm=Phaser.Utils.Objects.GetValue,tb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Hl(qe(e).events,"focus").then((function(){return void 0===(t=n)&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}));var t,e;})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},eb=Phaser.Utils.Objects.GetValue,ib=Phaser.DOM.RemoveFromDOM,nb=function(t,e){var i=eb(e,"closeDelay",200),n=function(t,e){var i=document.createElement("input");i.type="file";var n=Qm(e,"accept",""),s=Qm(e,"multiple",!1);return i.setAttribute("accept",n),s?i.setAttribute("multiple",""):i.removeAttribute("multiple"),i}(0,e);return n.click(),tb({game:t,fileInput:n,closeDelay:i}).then((function(t){return ib(n),n.remove(),Promise.resolve(t)}))},sb=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},rb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},ob=function(t,e,i,n,s,r){if(null===s||!1===s);else if(Oe(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=qe(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),Oe(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},ab={loadFile:function(t,e,i,n,s){var r=this.scene;return ob(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){ob(s,t,e,i,n,(function(t){r(t);}));}))}},hb=Phaser.GameObjects.DOMElement,lb=Phaser.Utils.Objects.IsPlainObject,ub=Phaser.Utils.Objects.GetValue,cb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),lb(n)?(n=ub(h=n,"x",0),s=ub(h,"y",0),o=ub(h,"width",0),a=ub(h,"height",0)):lb(o)&&(o=ub(h=o,"width",0),a=ub(h,"height",0));var u=document.createElement("input");u.type="file",u.style.display="none";var c=document.createElement("label");c.appendChild(u);var f=ub(h,"style",void 0);(l=e.call(this,t,n,s,c,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=d(l);return u.onchange=function(){p.emit("change",p);},l.setCloseDelay(ub(h,"closeDelay",200)),u.onclick=function(){tb({game:t,fileInput:u,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return a(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(ub(t,"accept","")),this.setMultiple(ub(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(hb),db={resize:sb,syncTo:rb};Object.assign(cb.prototype,db,ab);var fb={accept:"image/*",multiple:!1},pb=function(t,e){if(0!==e.length){var i=t.childrenMap.icon,n=i.image,s=e[0];return n.loadFromFilePromise(s).then((function(){i.scaleImage(),t.emit("select",s,t);}))}},vb={openPromise:function(){var t,e=this;return (t=i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e,t.abrupt("return",nb(e.scene.game,fb).then((function(t){return pb(n,t.files)})));case 2:case"end":return t.stop()}}),t)})),function(){var e=this,i=arguments;return new Promise((function(n,r){var o=t.apply(e,i);function a(t){s(o,n,r,a,h,"next",t);}function h(t){s(o,n,r,a,h,"throw",t);}a(void 0);}))})()},open:function(){return this.openPromise(),this}},gb={getFileName:function(t){if(!t)return null;var e=t.name;return e.substr(0,e.lastIndexOf("."))},saveTexture:function(t){return this.childrenMap.canvas.generateTexture(t),this}};Object.assign(gb,vb);var yb=Phaser.Utils.Objects.GetValue,kb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=function(t,e){var i=new xm(t,{scaleUp:Km(e,"scaleUpIcon",!0),image:Jm(t,e)});return t.add.existing(i),i}(t,n);n.icon=o,(s=e.call(this,t,n)).type="rexImageFileInputLabel";var a=s.iconWidth,h=s.iconWidth;return void 0!==a&&void 0!==h&&o.resize(a,h),s.clickTarget=qm(d(s),n),s.clickTarget&&(yb(n,"domButton",!0)?s.fileChooser=function(t,e){var i=t.scene,n=new cb(i,fb);return i.add.existing(n),t.pin(n),n.on("change",(function(){pb(t,n.files);})),n}(d(s)):s.clickBehavior=function(t,e){var i=qm(t,e);if(i){var n=$m(e,"click"),s=new Ed(i,n);return s.on("click",t.open,t),s}}(d(s),n)),s.addChildrenMap("canvas",o.image),s.addChildrenMap("fileChooser",s.fileChooser),s}return a(i,[{key:"postLayout",value:function(){this.fileChooser&&(this.fileChooser.syncTo(this.clickTarget),this.resetChildState(this.fileChooser));}}]),i}(Nm);Object.assign(kb.prototype,gb);var mb={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},bb={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},Cb={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},xb=Phaser.Utils.Objects.GetValue,wb=function(t,e,i,n){var s=xb(n,"preventDefault",!1),r=xb(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},Sb=Phaser.GameObjects.DOMElement,Ob=Phaser.Utils.Objects.IsPlainObject,Pb=Phaser.Utils.Objects.GetValue,Tb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l,u;r(this,i),Ob(n)?(n=Pb(h=n,"x",0),s=Pb(h,"y",0),o=Pb(h,"width",0),a=Pb(h,"height",0)):Ob(o)&&(o=Pb(h=o,"width",0),a=Pb(h,"height",0)),void 0===h&&(h={});var c=Pb(h,"inputType",void 0);void 0===c&&(c=Pb(h,"type","text")),"textarea"===c?(u=document.createElement("textarea")).style.resize="none":(u=document.createElement("input")).type=c,Vu(mb,h,u);var f=Pb(h,"style",void 0);f=Vu(bb,h,f);var p=u.style;for(var v in h)v in mb||v in bb||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,n,s,u,f)).type="rexInputText",l.resize(o,a),wb(d(l),u,Cb),Wu(u),Pb(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),d(l)).on("blur",(function(){this._isFocused=!1;}),d(l)),l}return a(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(Sb),Mb={resize:sb};Object.assign(Tb.prototype,Mb);var Eb={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},_b={resize:sb,syncTo:rb};Object.assign(_b,Eb,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},ab);var Lb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Rb=Phaser.GameObjects.DOMElement,Bb=Phaser.Utils.Objects.IsPlainObject,jb=Phaser.Utils.Objects.GetValue,Db=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),Bb(n)?(n=jb(h=n,"x",0),s=jb(h,"y",0),o=jb(h,"width",0),a=jb(h,"height",0)):Bb(o)&&(o=jb(h=o,"width",0),a=jb(h,"height",0)),void 0===h&&(h={});var u=document.createElement("div"),c=jb(h,"style",void 0);(l=e.call(this,t,n,s,u,c)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(jb(h,"dropEnable",!0));var f=jb(h,"filters");return f&&l.addFilters(f),wb(d(l),u,Lb,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),d(l)),l}return a(i,[{key:"files",get:function(){return this._files}}]),i}(Rb);Object.assign(Db.prototype,_b);var Ab=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(Zo(t,e))return t[e];var i=t.parent;return Zo(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Zo(t,e)?t[e]=i:Zo(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(Ea),Ib=Phaser.Utils.Objects.GetValue,zb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).style=Ib(n,"style",d(s));var o=Ib(n,"propertiesMap");return s.activeStyle=Fb(n,"active",o),s.hoverStyle=Fb(n,"hover",o),s.disableStyle=Fb(n,"disable",o),s.onModifyStyle=Ib(n,"onModifyStyle"),s}return a(i,[{key:"getStyle",value:function(t){return ac(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return hc(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return Yb.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return Yb.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return Yb.call(this,"disable",t),this}}]),i}(Ea),Fb=function(t,e,i){var n=oc(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},Yb=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Vb={addStyleManager:function(t){return this.styleManager=new zb(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},Wb=Phaser.GameObjects.Image,Xb=Phaser.Utils.Objects.GetValue,Gb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Xb(n,"x",0),a=Xb(n,"y",0),h=Xb(n,"key",""),l=Xb(n,"frame",void 0);(s=e.call(this,t,o,a,h,l)).type="rexStatesImage";var u=Xb(n,"effects",!0);return u&&ea(d(s),u),s.style=new Ab(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Wb);Object.assign(Gb.prototype,Vb);var Hb=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(Zo(t,e))return t[e];var i=t.parent;return Zo(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Zo(t,e)?t[e]=i:Zo(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(Ea),Ub=Phaser.GameObjects.NineSlice,Nb=Phaser.Utils.Objects.GetValue,Kb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Nb(n,"x",0),a=Nb(n,"y",0),h=Nb(n,"key",null),l=Nb(n,"frame",null),u=Nb(n,"width",0),c=Nb(n,"height",0),f=Nb(n,"leftWidth",0),p=Nb(n,"rightWidth",0),v=Nb(n,"topHeight",0),g=Nb(n,"bottomHeight",0);(s=e.call(this,t,o,a,h,l,u,c,f,p,v,g)).type="rexStatesNineSlice";var y=Nb(n,"effects",!0);return y&&ea(d(s),y),s.style=new Hb(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Ub);Object.assign(Kb.prototype,Vb);var Jb=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexStatesRoundRectangleShape",n.style=d(s),n.propertiesMap=Zb,s.addStyleManager(n),delete n.style,delete n.propertiesMap,s}return a(i)}(hn),Zb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Jb.prototype,Vb);var qb=Phaser.GameObjects.Text,$b=Phaser.Utils.Objects.GetValue,Qb=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=$b(n,"x",0),a=$b(n,"y",0),h=$b(n,"text","");return (s=e.call(this,t,o,a,h,n)).type="rexStatesText",n.style=s.style,n.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},s.addStyleManager(n),delete n.style,s}return a(i)}(qb);Object.assign(Qb.prototype,Vb);var tC=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},eC=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return a(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(g(u(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Kd),iC={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,tC(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return uC(this.sizerChildren,null),sk.call(this,t),this}},dC={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)uC(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},gC={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=_p.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,uC(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)uC(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},kC=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},mC=Phaser.Utils.Objects.IsPlainObject,bC=Phaser.Utils.Objects.GetValue,CC=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u,c,d){var f;return r(this,i),mC(n)?(n=bC(d=n,"x",0),s=bC(d,"y",0),o=bC(d,"width",void 0),a=bC(d,"height",void 0),h=bC(d,"column",d.col||0),l=bC(d,"row",0),u=bC(d,"columnProportions",0),c=bC(d,"rowProportions",0)):mC(o)?(o=bC(d=o,"width",void 0),a=bC(d,"height",void 0),h=bC(d,"column",d.col||0),l=bC(d,"row",0),u=bC(d,"columnProportions",0),c=bC(d,"rowProportions",0)):mC(h)?(h=bC(d=h,"column",d.col||0),l=bC(d,"row",0),u=bC(d,"columnProportions",0),c=bC(d,"rowProportions",0)):mC(u)&&(u=bC(d=u,"columnProportions",0),c=bC(d,"rowProportions",0)),(f=e.call(this,t,n,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(bC(d,"createCellContainerCallback")),f.setIndentLeft(bC(d,"space.indentLeftOdd",0),bC(d,"space.indentLeftEven",0)),f.setIndentTop(bC(d,"space.indentTopOdd",0),bC(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,bC(d,"space",void 0)),f}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{key:"setColumnProportion",value:function(t,e){return t>=this.columnProportions.length||(this.columnProportions[t]=e),this}},{key:"setRowProportion",value:function(t,e){return t>=this.rowProportions.length||(this.rowProportions[t]=e),this}},{key:"totalColumnProportions",get:function(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=yC.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=kC.call(this)),this._totalRowProportions}},{key:"getChildAt",value:function(t,e){return this.sizerChildren[e*this.columnCount+t]}},{key:"childToGridIndex",value:function(t,e){if(!t)return null;var i=this.sizerChildren.indexOf(t);return -1===i?null:(void 0===e&&(e={}),e.x=i%this.columnCount,e.y=Math.floor(i/this.columnCount),e)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(Zy);Object.assign(CC.prototype,gC);var xC=function(t,e,i,n){return e/t<=i?e/(n-1):0},wC=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=PC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=PC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},MC=Phaser.Utils.Objects.IsPlainObject,EC=Phaser.Utils.Objects.GetValue,_C=Phaser.Display.Align.CENTER,LC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(yp.call(this,t),MC(e))&&(e=EC(s=e,"padding",0),i=EC(s,"key",void 0),n=EC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=_C,s.padding=vp(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},RC={add:function(t,e,i){if(hg(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,sk.call(this,t),this}},DC={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)vx.call(this,e[i],t);return this}},yx=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},kx=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,yx.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},mx={add:function(t){return this.buttons.push(t),t._click||(t._click=new Ed(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),kx.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)Dx.call(this,e[i],t);return this}},Ix=Phaser.Utils.Objects.GetValue,zx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Ix(n,"row",0),a=Ix(n,"column",n.col||0),h=Ix(n,"createCellContainerCallback"),l=Ix(n,"buttons",void 0),u=Ix(n,"expand",!0),c=u?1:0;if(h&&(n.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&Fx.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Gx.call(this,e[i],t);return this}},Ux=Phaser.Utils.Objects.GetValue,Nx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=n.space;"number"==typeof o&&(n.space={item:o,line:o}),(s=e.call(this,t,n)).type="rexFixWidthButtons",s.buttonGroup=new Px({parent:d(s),eventEmitter:Ux(n,"eventEmitter",d(s)),groupName:Ux(n,"groupName",void 0),clickConfig:Ux(n,"click",void 0)}).setButtonsType(n);var a=Ux(n,"background",void 0),h=Ux(n,"buttons",void 0);return s.buttonsAlign=Ux(n,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(YC);Object.assign(Nx.prototype,Vx,Hx,Ox,Mx);var Kx=Phaser.Utils.Objects.GetValue,Jx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexFileSelectorButton";var o=new cb(t);return t.add.existing(o),s.addBackground(o),s.addChildrenMap("fileChooser",o),s.setAccept(Kx(n,"accept","")),s.setMultiple(Kx(n,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),d(s)),s}return a(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(Nm);Object.assign(Jx.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}});var Zx={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},qx={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,og.modal.call(this,t,e),this}},$x={};Object.assign($x,Zx,qx);var Qx=Phaser.Utils.Objects.GetValue,tw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexDialog",s.eventEmitter=Qx(n,"eventEmitter",d(s));var o,a,h,l,u=Qx(n,"background",void 0),c=Qx(n,"title",void 0),f=Qx(n,"toolbar",void 0),p=Qx(n,"toolbarBackground",void 0),v=Qx(n,"leftToolbar",void 0),g=Qx(n,"leftToolbarBackground",void 0),y=Qx(n,"content",void 0),k=Qx(n,"description",void 0),m=Qx(n,"choices",void 0),b=Qx(n,"choicesBackground",void 0),C=Qx(n,"actions",void 0),x=Qx(n,"actionsBackground",void 0),w=Qx(n,"click",void 0);if(u&&s.addBackground(u),f&&(h=new _x(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Qx(n,"space.toolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),v&&(l=new _x(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Qx(n,"space.leftToolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),c||f||v){var S,O=!!c&&Qx(n,"expand.title",!0),P=Qx(n,"align.title","center"),T=!(c&&!O&&"center"===P||!c&&(f||v));S=T?new Vm(t,{orientation:0}):new uk(t);var M=!!T||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),c){T&&!O&&"right"===P&&S.addSpace();var E={left:Qx(n,"space.titleLeft",0),right:Qx(n,"space.titleRight",0)},_=O?1:0;S.add(c,{align:P,proportion:_,expand:M,padding:E}),T&&!O&&"left"===P&&S.addSpace();}h&&(T&&!c&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||C)&&(E={bottom:Qx(n,"space.title",0),top:Qx(n,"space.titleTop",0)});_=Qx(n,"proportion.title",0);s.add(S,{padding:E,proportion:_,expand:!0});}if(y){var L=Qx(n,"align.content","center"),R=Qx(n,"space.content",0),B=(E={left:Qx(n,"space.contentLeft",0),right:Qx(n,"space.contentRight",0),bottom:k||m||C?R:0},_=Qx(n,"proportion.content",0),Qx(n,"expand.content",!0));s.add(y,{align:L,padding:E,proportion:_,expand:B});}if(k){L=Qx(n,"align.description","center");var j=Qx(n,"space.description",0);E={left:Qx(n,"space.descriptionLeft",0),right:Qx(n,"space.descriptionRight",0),bottom:m||C?j:0},_=Qx(n,"proportion.description",0),B=Qx(n,"expand.description",!0);s.add(k,{align:L,padding:E,proportion:_,expand:B});}if(m){var D=Qx(n,"choicesType","").split("-"),A=ew(D,"wrap")?Nx:ew(D,"grid")?zx:_x,I=ew(D,"radio")?"radio":ew(D,"checkboxes")?"checkboxes":void 0,z={left:Qx(n,"space.choicesBackgroundLeft",0),right:Qx(n,"space.choicesBackgroundRight",0),top:Qx(n,"space.choicesBackgroundTop",0),bottom:Qx(n,"space.choicesBackgroundBottom",0)},F=Qx(n,"space.choice",0);A===_x?z.item=F:A===Nx?(z.item=F,z.line=Qx(n,"space.choiceLine",F)):(z.column=Qx(n,"space.choiceColumn",F),z.row=Qx(n,"space.choiceRow",F));var Y={width:Qx(n,"choicesWidth",void 0),height:Qx(n,"choicesHeight",void 0),groupName:"choices",buttonsType:I,background:b,buttons:m,space:z,click:w,eventEmitter:s.eventEmitter,setValueCallback:Qx(n,"choicesSetValueCallback",void 0),setValueCallbackScope:Qx(n,"choicesSetValueCallbackScope",void 0)};A===_x&&(Y.orientation=ew(D,"x")?0:1),o=new A(t,Y);var V=Qx(n,"space.choices",0);E={left:Qx(n,"space.choicesLeft",0),right:Qx(n,"space.choicesRight",0),bottom:C?V:0},L=Qx(n,"align.choices","center"),_=Qx(n,"proportion.choices",0),B=Qx(n,"expand.choices",!0);s.add(o,{align:L,padding:E,proportion:_,expand:B}),s.buttonsType=I;}if(C){a=new _x(t,{groupName:"actions",background:x,buttons:C,orientation:0,space:{item:Qx(n,"space.action",0)},expand:Qx(n,"expand.actions",!1),align:Qx(n,"align.actions","center"),click:w,eventEmitter:s.eventEmitter});E={left:Qx(n,"space.actionsLeft",0),right:Qx(n,"space.actionsRight",0),bottom:Qx(n,"space.actionsBottom",0)},_=Qx(n,"proportion.action",0);s.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return nw(d(s),"click"),nw(d(s),"over"),nw(d(s),"out"),nw(d(s),"enable"),nw(d(s),"disable"),s.addChildrenMap("background",u),s.addChildrenMap("title",c),s.addChildrenMap("toolbar",f),s.addChildrenMap("leftToolbar",v),s.addChildrenMap("content",y),s.addChildrenMap("description",k),s.addChildrenMap("choices",o?o.buttons:void 0),s.addChildrenMap("actions",a?a.buttons:void 0),s.addChildrenMap("choicesSizer",o),s.addChildrenMap("actionsSizer",a),s.addChildrenMap("toolbarSizer",h),s.addChildrenMap("leftToolbarSizer",l),s}return a(i)}(Vm),ew=function(t,e){return -1!==t.indexOf(e)},iw={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},nw=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){iw.hasOwnProperty(n)&&t.emit("".concat(iw[n],".").concat(e),i,s,r,o);}));};Object.assign(tw.prototype,$x);var sw=function(t,e,i){var n=new tx(t,e,i);return t.add.existing(n),n},rw=function(t){this.childrenMap.title.resetDisplayContent(t.title);},ow=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},aw=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(Dv),Zw=Phaser.Utils.Objects.GetValue,qw=Phaser.Math.Distance.Between,$w=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(Zw(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(Zw(t,"enable",!0)),this.holdThreshold=Zw(t,"holdThreshold",50),this.pointerOutReleaseEnable=Zw(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return Tc(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:qw(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(Ea),Qw=Phaser.Utils.Objects.GetValue,tS=function(){function t(e){r(this,t),this.resetFromJSON(e);}return a(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Qw(t,"value",0)),this.setSpeed(Qw(t,"speed",0)),this.setAcceleration(Qw(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),eS=function(){function t(){r(this,t),this.value,this.dir,this.movement=new tS;}return a(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(Ea),rS={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},oS=Phaser.Utils.Objects.GetValue,aS=function(t){l(i,t);var e=p(i);function i(t,n){var s;(r(this,i),(s=e.call(this,t,n)).parent!==s.scene?s.focusMode=oS(n,"focus",!0):s.focusMode=!1,s.setSpeed(oS(n,"speed",.1)),s.setEnable(oS(n,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(oS(n,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),d(s)):s.scene.input.on("wheel",s.onSceneScroll,d(s));return s}return a(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(Ea),hS=Phaser.Utils.Objects.GetValue,lS=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?hS(n,c,void 0):hS(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=Xt(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new Kw(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=hS(s,"position",0);"string"==typeof v&&(v=uS[v]);var g=hS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=hS(n,"space.slider",void 0))&&(g=l?0:hS(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=hS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=hS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=hS(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?hS(n,k,!0):hS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new sS(u,o));var m,b,C,x,w=hS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new aS(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",x="scroll".concat(i)):(b="t",x="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(x,t);})));a&&(l?(C="childO".concat(i),x="scroll".concat(i)):(C="childOY",x="scroll"),a.on("valuechange",(function(e){t[C]=e,t.emit(x,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},uS={right:0,left:1,bottom:0,top:1},cS=Phaser.Utils.Objects.GetValue,dS=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=cS(e,"width"),o=cS(e,"height");r||(cS(e,"child.expandWidth",!0)||(n[1]=0));o||(cS(e,"child.expandHeight",!0)||(s[1]=0));var a=new CC(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=mw(i,"child"),s=mw(n,"gameObject",void 0);if(s){var r=mw(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=mw(r,"top",0),o.bottom=mw(r,"bottom",0),a.left=mw(r,"left",0),a.right=mw(r,"right",0);break;case 1:o.top=mw(r,"left",0),o.bottom=mw(r,"right",0),a.top=mw(r,"top",0),a.bottom=mw(r,"bottom",0);break;default:o.top=mw(r,"top",0),o.bottom=mw(r,"bottom",0),o.left=mw(r,"left",0),o.right=mw(r,"right",0);}e.add(s,{column:1,row:1,align:mw(n,"align","center"),padding:a,expand:{width:mw(n,"expandWidth",!0),height:mw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:lS(t,a,"y",e);break;case 1:lS(t,a,"x",e);break;default:lS(t,a,"y",e),lS(t,a,"x",e);}return a},fS=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},pS=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},vS=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},wS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},SS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},OS=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},PS=function(t,e){switch(CS(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},TS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&MS.call(this);},MS=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},ES=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},_S={setText:function(t){return void 0!==t&&(this.text=t),this.lines=xS(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(wS.call(this,-this.textOY)),0),e=SS.call(this,t)+this.textOY,i=OS.call(this,t);return PS(this.textObject,i),this.textObject.rexSizer.offsetY=e,TS.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Rp.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,ES.call(this,t,r,o),lp(t,n,s,r,o,e.align),e.preOffsetY=0,TS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},LS=Phaser.Utils.Objects.IsPlainObject,RS=Phaser.Utils.Objects.GetValue,BS=Phaser.Display.Align.TOP_LEFT,jS=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),LS(n)?(n=RS(h=n,"x",0),s=RS(h,"y",0),o=RS(h,"width",void 0),a=RS(h,"height",void 0)):LS(o)&&(o=RS(h=o,"width",void 0),a=RS(h,"height",void 0)),(l=e.call(this,t,n,s,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=RS(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(RS(h,"clamplTextOY",!0)),l.alwaysScrollable=RS(h,"alwaysScrollable",!1);var u=RS(h,"background",void 0),c=RS(h,"text",void 0);void 0===c&&(c=DS(t)),l.textCropEnable=RS(h,"textCrop",!!c.setCrop);var f=RS(h,"textMask",!l.textCropEnable);u&&l.addBackground(u),l.add(c),l.sizerChildren=[c];var p=l.getSizerConfig(c);return p.align=BS,p.padding=vp(0),p.expand=!0,l.textObject=c,l.textObjectType=CS(c),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=Hm.call(d(l),l.textObject,d(l))),l.addChildrenMap("background",u),l.addChildrenMap("text",c),l}return a(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}g(u(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(wS.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=SS.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(Zy),DS=function(t){return t.add.text(0,0,"")};Object.assign(jS.prototype,_S);var AS={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},IS=Phaser.Utils.Objects.GetValue,zS=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=IS(n,"text",void 0),a=IS(n,"textWidth",void 0),h=IS(n,"textHeight",void 0),l=IS(n,"textCrop",!!o.setCrop),u=IS(n,"textMask",!l),c=IS(n,"content",""),d=new jS(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:IS(n,"clamplChildOY",!1),alwaysScrollable:IS(n,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),n.scrollMode=0,n.type="rexTextArea",n.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=IS(n,"space",void 0);return f&&(f.child=IS(f,"text",0)),(s=e.call(this,t,n)).addChildrenMap("text",o),s}return a(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(mS);Object.assign(zS.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},AS);var FS=Phaser.Utils.Objects.GetValue,YS=function(t,e,i){e=e?Se(e):{};var n=FS(i,"background",WC),s=FS(i,"text",HC),r=FS(i,"track",WC),o=FS(i,"thumb",WC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new zS(t,e);return t.add.existing(h),h},VS=Phaser.Utils.Objects.GetValue,WS=Phaser.Utils.Objects.GetValue,XS=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;r(this,i),n=n?Se(n):{},void 0===s&&(s={});var a=WS(s,"background",WC);a?n.background=a(t,n.background):delete n.background,n.title=sw(t,n.title,s.title),n.content=function(t,e,i){var n,s=VS(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new YS(t,e,i):new sw(t,e,i);return t.add.existing(n),n}(t,n.content,s.content),n.content instanceof zS&&rc(n,"height")&&!rc(n,"proportion.content")&&De(n,"proportion.content",1);var h=n.button,l=n.buttonA||h,u=n.buttonB||h,c=n.buttonMode;void 0===c&&(c=l&&u?2:l?1:0);var f=s.button,p=s.buttonA||f,v=s.buttonB||f;switch(c){case 2:n.actions=[sw(t,l,p),sw(t,u,v)];break;case 1:n.actions=[sw(t,l,p)];break;case 0:break;default:n.actions=[];}var g=n.choice;g&&(n.choices=[]),(o=e.call(this,t,n)).type="rexConfirmDialog",o.buttonMode=c,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=s.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),vw.call(d(o)),o}return a(i)}(tw);Object.assign(XS.prototype,lw);var GS=Phaser.Utils.Objects.GetValue,HS=function(t,e,i){var n=GS(t,"proportion.".concat(e),i.proportion),s=GS(t,"align.".concat(e),"center"),r=GS(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:GS(t,"expand.".concat(e),!0)}},US=function(t){return HS(t,"header",{proportion:0,paddingKey:"bottom"})},NS=function(t){return HS(t,"leftSide",{proportion:0,paddingKey:"right"})},KS=function(t){return HS(t,"content",{proportion:1})},JS=function(t){return HS(t,"rightSide",{proportion:0,paddingKey:"left"})},ZS=function(t){return HS(t,"footer",{proportion:0,paddingKey:"top"})},qS=function(t,e){var i=new Vm(t,{orientation:e});return t.add.existing(i),i},$S=Phaser.Utils.Objects.GetValue,QS=[function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,NS(t));var r=t.content;r&&n.add(r,KS(t));var o=t.rightSide;o&&n.add(o,JS(t));var a=t.footer;a&&this.add(a,ZS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,NS(t));var r=qS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=qS(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,KS(t));var h=t.rightSide;h&&o.add(h,JS(t));var l=t.footer;l&&r.add(l,ZS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=qS(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=qS(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,NS(t));var a=t.content;a&&r.add(a,KS(t));var h=t.footer;h&&s.add(h,ZS(t));var l=t.rightSide;l&&n.add(l,JS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,US(t));var n=qS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,NS(t));var r=qS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,KS(t));var a=t.footer;a&&r.add(a,ZS(t));var h=t.rightSide;h&&n.add(h,JS(t));}],tO={FFF:0,LFF:1,FFR:2,LFR:3},eO=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexHolyGrail",s.build(n),s}return a(i)}(Vm),iO={build:function(t){this.clear(!0);var e=$S(t,"background",void 0);e&&this.addBackground(e);var i=$S(t,"layoutMode",0);"string"==typeof i&&(i=tO[i.toUpperCase()]),(QS[i]||QS[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(eO.prototype,iO);var nO={getButtonsSizer:function(t){return this.childrenMap["".concat(t,"ButtonsSizer")]},getButton:function(t,e){var i=this.getButtonsSizer(t);return i?i.getButton(e):void 0},setButtonEnable:function(t,e,i){return this.getButtonsSizer(t).setButtonEnable(e,i),this},setLeftButtonEnable:function(t,e){return this.childrenMap.leftButtonsSizer.setButtonEnable(t,e),this},setRightButtonEnable:function(t,e){return this.childrenMap.rightButtonsSizer.setButtonEnable(t,e),this},setTopButtonEnable:function(t,e){return this.childrenMap.topButtonsSizer.setButtonEnable(t,e),this},setBottomButtonEnable:function(t,e){return this.childrenMap.bottomButtonsSizer.setButtonEnable(t,e),this},toggleButtonEnable:function(t,e){return this.getButtonsSizer(t).toggleButtonEnable(e),this},toggleLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.toggleButtonEnable(t),this},toggleRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.toggleButtonEnable(t),this},toggleTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.toggleButtonEnable(t),this},toggleBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.toggleButtonEnable(t),this},getButtonEnable:function(t,e){return this.getButtonsSizer(t).getButtonEnable(e)},getLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.getButtonEnable(t)},getRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.getButtonEnable(t)},getTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.getButtonEnable(t)},getBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.getButtonEnable(t)},emitButtonClick:function(t,e){var i=this.getButtonsSizer(t);return i?(i.emitButtonClick(e),this):this},emitLeftButtonClick:function(t){return this.childrenMap.leftButtonsSizer.emitButtonClick(t),this},emitRightButtonClick:function(t){return this.childrenMap.rightButtonsSizer.emitButtonClick(t),this},emitTopButtonClick:function(t){return this.childrenMap.topButtonsSizer.emitButtonClick(t),this},emitBottomButtonClick:function(t){return this.childrenMap.bottomButtonsSizer.emitButtonClick(t),this},getLeftButton:function(t){return this.childrenMap.leftButtonsSizer.getButton(t)},getRightButton:function(t){return this.childrenMap.rightButtonsSizer.getButton(t)},getTopButton:function(t){return this.childrenMap.topButtonsSizer.getButton(t)},getBottomButton:function(t){return this.childrenMap.bottomButtonsSizer.getButton(t)},showButton:function(t,e){return xv(this.getButton(t,e)),this},showLeftButton:function(t){return xv(this.getLeftButton(t)),this},showRightButton:function(t){return xv(this.getRightButton(t)),this},showTopButton:function(t){return xv(this.getTopButton(t)),this},showBottomButton:function(t){return xv(this.getBottomButton(t)),this},hideButton:function(t,e){return wv(this.getButton(t,e)),this},hideLeftButton:function(t){return wv(this.getLeftButton(t)),this},hideRightButton:function(t){return wv(this.getRightButton(t)),this},hideTopButton:function(t){return wv(this.getTopButton(t)),this},hideBottomButton:function(t){return wv(this.getBottomButton(t)),this},addButton:function(t,e){return this.getButtonsSizer(t).addButton(e),this},addLeftButton:function(t){return this.addButton("left",t),this},addRightButton:function(t){return this.addButton("right",t),this},addTopButton:function(t){return this.addButton("top",t),this},removeButton:function(t,e,i){return this.getButtonsSizer(t).removeButton(e,i),this},removeLeftButton:function(t,e){return this.removeButton("left",t,e),this},removeRightButton:function(t,e){return this.removeButton("right",t,e),this},removeTopButton:function(t,e){return this.removeButton("top",t,e),this},removeBottomButton:function(t,e){return this.removeButton("bottom",t,e),this},clearButtons:function(t,e){return this.getButtonsSizer(t).clearButtons(e),this},clearLeftButtons:function(t){return this.clearButtons("left",t),this},clearRightButtons:function(t){return this.clearButtons("right",t),this},clearTopButtons:function(t){return this.clearButtons("top",t),this},clearBottomButtonss:function(t){return this.clearButtons("bottom",t),this},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),this},forEachLeftButton:function(t,e){return this.childrenMap.leftButtonsSizer.forEachButtton(t,e),this},forEachRightButton:function(t,e){return this.childrenMap.rightButtonsSizer.forEachButtton(t,e),this},forEachTopButton:function(t,e){return this.childrenMap.topButtonsSizer.forEachButtton(t,e),this},forEachBottomButton:function(t,e){return this.childrenMap.bottomButtonsSizer.forEachButtton(t,e),this}},sO=Phaser.Utils.Objects.GetValue,rO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.column=3,n.row=3,(s=e.call(this,t,n)).type="rexTabs",s.eventEmitter=sO(n,"eventEmitter",d(s));var o,a,h,l,u=sO(n,"background",void 0),c=sO(n,"panel",void 0),f=sO(n,"leftButtons",void 0),p=sO(n,"leftButtonsBackground",void 0),v=sO(n,"rightButtons",void 0),g=sO(n,"rightButtonsBackground",void 0),y=sO(n,"topButtons",void 0),k=sO(n,"topButtonsBackground",void 0),m=sO(n,"bottomButtons",void 0),b=sO(n,"bottomButtonsBackground",void 0),C=sO(n,"click",void 0);if(u&&s.addBackground(u),c&&s.add(c,1,1,"center",0,!0),f){var x=sO(n,"space.leftButtonsOffset",0),w=sO(n,"space.leftButton",0);o=new _x(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:sO(n,"align.leftButtons",void 0),click:C,eventEmitter:s.eventEmitter});var S={top:x};s.add(o,0,1,"top",S,!1);}if(v){var O=sO(n,"space.rightButtonsOffset",0),P=sO(n,"space.rightButton",0);a=new _x(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:P},align:sO(n,"align.rightButtons",void 0),click:C,eventEmitter:s.eventEmitter});S={top:O};s.add(a,2,1,"top",S,!1);}if(y){var T=sO(n,"space.topButtonsOffset",0),M=sO(n,"space.topButton",0);h=new _x(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:sO(n,"align.topButtons",void 0),click:C,eventEmitter:s.eventEmitter});S={left:T};s.add(h,1,0,"left",S,!1);}if(m){var E=sO(n,"space.bottomButtonsOffset",0),_=sO(n,"space.bottomButton",0);l=new _x(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:sO(n,"align.bottomButtons",void 0),click:C,eventEmitter:s.eventEmitter});S={left:E};s.add(l,1,2,"left",S,!1);}return s.addChildrenMap("background",u),s.addChildrenMap("panel",c),s.addChildrenMap("leftButtons",f),s.addChildrenMap("rightButtons",v),s.addChildrenMap("topButtons",y),s.addChildrenMap("bottomButtons",m),s.addChildrenMap("leftButtonsSizer",o),s.addChildrenMap("rightButtonsSizer",a),s.addChildrenMap("topButtonsSizer",h),s.addChildrenMap("bottomButtonsSizer",l),s}return a(i)}(CC);Object.assign(rO.prototype,nO);var oO=function(){function t(e,i){r(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return a(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Ff[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(oO.prototype,Oi);var aO=Phaser.Utils.Objects.GetValue,hO=Phaser.Utils.Array.SpliceOne,lO=function(){function t(e,i){r(this,t),this.parent=e,this.cells=[],this.cellPool=new ui,this.resetFromJSON(i);}return a(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(aO(t,"cellsCount",0)),this.setColumnCount(aO(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===n(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=OO(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===n(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var i,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},gP={down:0,up:1},yP=Phaser.Utils.Objects.GetValue,kP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=function(t,e){Yp(t,e,"y","Cubic");}),null==n.transitOut&&(n.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new zp(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),n.manualClose=!0,n.clickOutsideClose=!0,n.destroy=!0,s=e.call(this,t,n),vP(t,n),t.isRexSizer&&t.layout();var o=yP(n,"touchOutsideClose",!1),a=yP(n,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,d(s)):o&&s.once("open",s.touchOutsideClose,d(s)),s.requestOpen(),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ig(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),g(u(i.prototype),"onClose",this).call(this);}}]),i}(Xv),mP={openListPanel:function(){if(this.listPanel)return this;var t,e=fP.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new kP(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(mP,cP);var bP=Phaser.Utils.Objects.GetValue,CP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexDropDownList",s.timer=void 0,s.setOptions(bP(n,"options"));var o=bP(n,"list");return s.setWrapEnable(bP(o,"wrap",!1)),s.setCreateButtonCallback(bP(o,"createButtonCallback")),s.setCreateListBackgroundCallback(bP(o,"createBackgroundCallback")),s.setButtonClickCallback(bP(o,"onButtonClick")),s.setButtonOverCallback(bP(o,"onButtonOver")),s.setButtonOutCallback(bP(o,"onButtonOut")),s.setListExpandDirection(bP(o,"expandDirection")),s.setListEaseInDuration(bP(o,"easeIn",500)),s.setListEaseOutDuration(bP(o,"easeOut",100)),s.setListTransitInCallback(bP(o,"transitIn")),s.settListTransitOutCallback(bP(o,"transitOut")),s.setListSize(bP(o,"width"),bP(o,"height")),s.setListAlignmentMode(bP(o,"alignParent","text")),s.setListAlignmentSide(bP(o,"alignSide","")),s.setListBounds(bP(o,"bounds")),s.setListSpace(bP(o,"space")),s.setListDraggable(bP(o,"draggable",!1)),s.setValueChangeCallback(bP(n,"setValueCallback"),bP(n,"setValueCallbackScope")),s.setValue(bP(n,"value")),s.onClick(s.toggleListPanel,d(s)),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(Nm);Object.assign(CP.prototype,mP);var xP=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},wP={clearText:function(){return this.sections.length=0,this.pageStartIndexes.length=0,this.lines.length=0,this},appendPage:function(t){var e=this.totalLinesCount;this.sections.push(xP(t));t=this.sections.join("\n");this.lines=xS(this.parent,t,this.lines);for(var i=this.totalLinesCount-e,n=Math.ceil(i/this.pageLinesCount),s=0;s=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=EP(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(CS(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(Ea);Object.assign(_P.prototype,TP),Phaser.Utils.Objects.GetFastValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var LP=uk.prototype.add,RP=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),LP.call(this,t,e,i,n,s,r,o,a,h),this},BP={add:RP,addPage:RP},jP=se.prototype.setChildVisible,DP={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(jP.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(jP.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(DP,BP);var AP=Phaser.Utils.Objects.GetValue,IP=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(AP(n,"swapMode",0)),s.setFadeInDuration(AP(n,"fadeIn",0)),s}return a(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=zP[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(uk);Object.assign(IP.prototype,DP);var zP={invisible:0,destroy:1},FP=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(Zy);Object.assign(ZT.prototype,UT);var qT=["top","bottom","centerY","center"],$T=["left","right","centerX","center"],QT=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=qT.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=$T.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},tM=Phaser.Utils.Objects.GetValue,eM=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=yw(n),a=tM(n,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=tM(n,"clamplChildOY",!1),a.clamplChildOX=tM(n,"clamplChildOX",!1);var h,l,u=new ZT(t,a);switch(t.add.existing(u),o){case 0:h=tM(n,"expand.panel",!0),l=!0;break;case 1:h=!0,l=tM(n,"expand.panel",!0);break;default:h=!0,l=!0;}n.type="rexScrollablePanel",n.child={gameObject:u,expandWidth:h,expandHeight:l,align:tM(n,"align.panel","center")};var c=tM(n,"space",void 0);return c&&(c.child=tM(c,"panel",0)),(s=e.call(this,t,n)).addChildrenMap("panel",u.child),s.addChildrenMap("panelLayer",u.maskLayer),s.addChildrenMap("mask",u.maskGameObject),s.addChildrenMap("scrollableBlock",u),s}return a(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),Ny(this.childrenMap.child,t),this}}]),i}(mS),iM={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:QT.call(this,t,"y",e);break;case 1:QT.call(this,t,"x",e);break;default:QT.call(this,t,"y",e),QT.call(this,t,"x",e);}return this}};Object.assign(eM.prototype,iM),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;for(var nM,sM=function(t,e,i){void 0===i&&(i=!0),i?e=e?Se(e):{}:e||(e={});var n=new Oc(t,e);return t.add.existing(n),n},rM=Phaser.Utils.Objects.GetValue,oM=Phaser.Display.Color,aM=Phaser.Display.Color.ColorToRGBA,hM=Phaser.Display.Color.HSVToRGB,lM=Phaser.Math.Clamp,uM=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.orientation=0,(s=e.call(this,t,n)).type="rexColorComponents",s.colorObject=new oM;var o=rM(n,"background",void 0),a=rM(n,"formatLabel",void 0);Ht(a)||(a=sw(t,a).resetDisplayContent());var h=[];if(n.inputText0&&n.inputText1&&n.inputText2)h.push(n.inputText0),h.push(n.inputText1),h.push(n.inputText2);else for(var l=rM(n,"inputText"),u=0;u<3;u++){var c=sM(t,l).setMaxLength(3).setNumberInput();h.push(c);}o&&s.addBackground(o);var f=rM(n,"proportion.formatLabel",0),p=!!a.isRexContainerLite,v=rM(n,"expand.formatLabel",p);s.add(a,{proportion:f,expand:v});f=void 0===rM(l,"width")?1:0,v=void 0===rM(l,"height"),u=0;for(var g=h.length;u0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new KM(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},ZM={openColorPicker:function(){if(!this.colorPicker){var t=JM.call(this).layout(),e=new kP(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(ZM,SM);var qM=Phaser.Utils.Objects.GetValue,$M=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexColorInput",n.hasOwnProperty("colorPicker")||(n.colorPicker={background:{color:0}});var o=n.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(qM(o,"width",160),qM(o,"height",170));var l=qM(o,"background");h=l?function(t){return WC(t,l)}:qM(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(qM(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(qM(o,"expandDirection")),s.setColorPickerEaseInDuration(qM(o,"easeIn",200)),s.setColorPickerEaseOutDuration(qM(o,"easeOut",200)),s.setColorPickerTransitInCallback(qM(o,"transitIn")),s.setColorPickerTransitOutCallback(qM(o,"transitOut")),s.setColorPickerBounds(qM(o,"bounds"));var u=qM(o,"space");void 0===u&&(u={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(u);}var c=n.colorComponents;if(a&&(!1!==c&&null!==c)){s.setColorComponentsHeight(qM(c,"height",30)),s.setColorComponentsFormatLabelConfig(qM(c,"formatLabel"));var f=qM(c,"inputText");f||(f=qM(n,"inputText")),s.setColorComponentsInputTextConfig(f);var p=qM(c,"space");void 0===p&&(p={item:8}),s.setColorComponentsSpace(p);}var v=s.childrenMap.swatch;return v&&a&&s.onClick(v,s.openColorPicker,d(s)),s}return a(i)}(wM);Object.assign($M.prototype,ZM);var QM=Phaser.Utils.Array.GetFirst,tE=Phaser.Utils.Array.Remove,eE=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),n=QC(t,n),(s=e.call(this,t,n)).type="rexTweaker.Title",s}return a(i,[{key:"setTitle",value:function(t){return (t=t?Se(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(Nm),iE=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexTweaker.FolderTitle";var o=new jf(t,n.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return a(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(eE),nE=function(t,e){var i=new TE(t,e);return t.add.existing(i),i},sE=function(t,e,i){return WC(t,i)},rE=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexTweaker.Folder",s}return a(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(WT);Object.assign(rE.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var oE=Phaser.Utils.Objects.GetValue,aE=Phaser.Utils.Objects.GetValue,hE={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i0?0:1,s.setMinWidth(this.itemWidth)),this.add(s,{proportion:r,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),s.setAutoUpdateEnable(i.autoUpdate),s.setBindingTarget(t,e),i.monitor&&s.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,s),this},addButton:wE,addButtons:wE,addSeparator:function(t){var e=this.scene,i=SE(this.styles,"separator"),n=sE(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(wi.prototype,Ke,Si);var Pi=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"freeLine",value:function(t){if(t)return this.push(t),this}},{key:"freeLines",value:function(t){if(t)return this.pushMultiple(t),this}},{key:"getLine",value:function(t,e,i){var n=this.pop();return null===n&&(n={}),n.text=t,n.width=e,n.newLineMode=i,n}}]),i}(ot),Ti=Phaser.Utils.Objects.IsPlainObject,Oi=Phaser.Utils.Objects.GetValue,Mi=function(t,e){Ti(t)?t=(e=t).key:void 0===e&&(e={key:t}),e.hasOwnProperty("key")||(e.key=t);var i=e.key,n=e.frame,s=e.width,r=e.height;if(void 0===s||void 0===r){var o=this.textureManager.getFrame(i,n),a=o?o.cutWidth:0,h=o?o.cutHeight:0;void 0===s&&void 0===r?(s=a,r=h):void 0===s?s=a*(r/h):void 0===r&&(r=h*(s/a));}this.images[t]={key:i,frame:n,width:s,height:r,y:Oi(e,"y",0),left:Oi(e,"left",0),right:Oi(e,"right",0),originX:Oi(e,"originX",0),originY:Oi(e,"originY",0)};},Ei=function(){function t(e){r(this,t),this.textureManager=e.sys.textures,this.images={};}return a(t,[{key:"destroy",value:function(){this.textureManager=void 0,this.images=void 0;}},{key:"add",value:function(t,e){if("string"==typeof t)Mi.call(this,t,e);else if(Array.isArray(t))for(var i=0,n=(s=t).length;i").concat(t,""):e.hasOwnProperty("_style")?"").concat(t,""):t}},{key:"destroy",value:function(){this.tags=void 0;}},{key:"isTextTag",value:function(t){var e=this.tags[t];return !!e&&null==e.img}}]),t}(),kn=function(t){for(var e,i,n,s={},r=0,o=(t=t.split(";")).length;r=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px","")));break;case"shadow":a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.offsetX=parseInt(a[1].replace("px",""))),h>=3&&(n.offsetY=parseInt(a[2].replace("px",""))),h>=4&&(n.blur=parseInt(a[3].replace("px","")));break;case"u":case"underline":case"s":case"strikethrough":var h;a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px",""))),h>=3&&(n.offset=parseInt(a[2].replace("px",""))),"underline"===i?i="u":"strikethrough"===i&&(i="s");break;case"y":n=parseFloat(n);}s[i]=n;}return s},mn=function(t){return 0===(t=t.replace(Pn,"")).length},bn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>|<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/g,xn=/<\s*class=/i,Cn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>/,wn=/<\s*style=/i,Sn=/<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/,Pn=/^\s+|\s+$/,Tn=Phaser.Utils.Objects.GetValue,On=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){r(this,i);var h=Tn(a,"tags",void 0),l=new yn(h);return e.call(this,t,n,s,o,a,"rexTagText",l)}return a(i,[{key:"addTag",value:function(t,e){return this.parser.addTag(t,e),this.updateText(!0)}},{key:"addTags",value:function(t){for(var e in t)this.parser.addTag(e,t[e]);return this.updateText(!0)}},{key:"getTag",value:function(t){return this.parser.getTag(t)}},{key:"preDestroy",value:function(){g(u(i.prototype),"preDestroy",this).call(this),this.parser.destroy(),this.parser=void 0;}}]),i}(Vi);M.register("tagText",(function(t,e,i,n){var s=new On(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),$(window,"RexPlugins.UI.TagText",On);var Mn=Phaser.Utils.Objects.GetValue,En=function(t,e){return void 0===e?t:t[e]},_n=function(t,e,i){void 0===t&&(t={}),void 0===e&&(e=0);var s=n(e);return "string"===s?t[e]=i:"number"===s?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Mn(e,"left",0),t.right=Mn(e,"right",0),t.top=Mn(e,"top",0),t.bottom=Mn(e,"bottom",0)),t},Rn=function(){function t(e,i){r(this,t),this.setParent(e),this.type=i,this.renderable=!1,this.reset().setActive();}return a(t,[{key:"destroy",value:function(){this.parent.removeChild(this);}},{key:"setParent",value:function(t){return this.parent=t,this}},{key:"scene",get:function(){return this.parent.scene}},{key:"canvas",get:function(){return this.parent?this.parent.canvas:null}},{key:"context",get:function(){return this.parent?this.parent.context:null}},{key:"setDirty",value:function(t){return t&&this.parent&&(this.parent.dirty=!0),this}},{key:"active",get:function(){return this._active},set:function(t){this.setDirty(this._active!=t),this._active=t;}},{key:"setActive",value:function(t){return void 0===t&&(t=!0),this.active=t,this}},{key:"modifyPorperties",value:function(t){return this}},{key:"onFree",value:function(){this.reset().setParent();}},{key:"reset",value:function(){return this}},{key:"render",value:function(){}},{key:"contains",value:function(t,e){return !1}}]),t}();Object.assign(Rn.prototype,St);var Ln,Bn,Dn,In,jn,zn={renderContent:function(){},render:function(){if(!this.willRender)return this;var t=this.context;if(t.save(),t.globalAlpha=this.alpha,this.toLocalPosition){var e=this.drawX,i=this.drawY;this.autoRound&&(e=Math.round(e),i=Math.round(i)),t.translate(e,i),t.scale(this.scaleX,this.scaleY),t.rotate(this.rotation);}return this.drawBelowCallback&&this.drawBelowCallback(this),this.renderContent(),this.drawAboveCallback&&this.drawAboveCallback(this),t.restore(),this}},An=Phaser.Math.RotateAround,Fn=Phaser.Geom.Rectangle,Yn=function(t){void 0===Bn&&(Bn=new Fn);var e=t.drawTLX,i=t.drawTLY;return Bn.setTo(e,i,t.drawTRX-e,t.drawBLY-i),Bn},Wn=Phaser.Math.RotateAround,Vn=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===Dn&&(Dn={}),n=Dn),n.x=e,n.y=i,0!==t.rotation&&Wn(n,0,0,t.rotation),n.x=n.x*t.scaleX+t.drawX,n.y=n.y*t.scaleY+t.drawY,n},Xn=Phaser.GameObjects.Components.TransformMatrix,Gn={},Hn=function(t,e,i,n,s){var r=Vn(e,i,n,!0),o=function(t,e,i,n){void 0===n?n={}:!0===n&&(n=Gn);var s=e-t.width*t.originX,r=i-t.height*t.originY;return void 0===In&&(In=new Xn,jn=new Xn),t.parentContainer?t.getWorldTransformMatrix(In,jn):In.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),In.transformPoint(s,r,n),n}(t,r.x,r.y,s);return o},Un=function(t,e,i,n,s){"number"!=typeof i&&(s=i,i=0,n=0);var r=e.drawCenterX+i,o=e.drawCenterY+n;return Hn(t,e,r,o,s)},Nn={contains:function(t,e){if(0===this.width||0===this.height)return !1;var i=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===Ln&&(Ln={}),n=Ln),n.x=(t-i.drawX)/i.scaleX,n.y=(e-i.drawY)/i.scaleY,0!==i.rotation&&An(n,0,0,-i.rotation),n}(t,e,this,!0);return Yn(this).contains(i.x,i.y)},getWorldPosition:function(t,e,i){return Un(this.parent,this,t,e,i)}};Object.assign(Nn,zn);var Kn=Phaser.Math.DegToRad,Jn=Phaser.Math.RadToDeg,Zn=Phaser.Utils.Objects.GetValue,qn=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).renderable=!0,s.scrollFactorX=1,s.scrollFactorY=1,s.toLocalPosition=!0,s.originX=0,s.offsetX=0,s.offsetY=0,s}return a(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDirty(this._visible!=t),this._visible=t;}},{key:"setVisible",value:function(t){return void 0===t&&(t=!0),this.visible=t,this}},{key:"alpha",get:function(){return this._alpha},set:function(t){this.setDirty(this._alpha!=t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"x",get:function(){return this._x},set:function(t){this.setDirty(this._x!=t),this._x=t;}},{key:"setX",value:function(t){return this.x=t,this}},{key:"y",get:function(){return this._y},set:function(t){this.setDirty(this._y!=t),this._y=t;}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setPosition",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setInitialPosition",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"setScrollFactorX",value:function(t){return this.scrollFactorX=t,this}},{key:"setScrollFactorY",value:function(t){return this.scrollFactorY=t,this}},{key:"setScrollFactor",value:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}},{key:"rotation",get:function(){return this._rotation},set:function(t){this.setDirty(this._rotation!=t),this._rotation=t;}},{key:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Jn(this._rotation)},set:function(t){this.rotation=Kn(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this.setDirty(this._scaleX!==t),this._scaleX=t;}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return 0},set:function(t){}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"leftSpace",get:function(){return this._leftSpace},set:function(t){this.setDirty(this._leftSpace!==t),this._leftSpace=t;}},{key:"setLeftSpace",value:function(t){return this.leftSpace=t,this}},{key:"rightSpace",get:function(){return this._rightSpace},set:function(t){this.setDirty(this._rightSpace!==t),this._rightSpace=t;}},{key:"setRightSpace",value:function(t){return this.rightSpace=t,this}},{key:"outerWidth",get:function(){return this.width+this.leftSpace+this.rightSpace}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this.setDirty(this._scaleY!==t),this._scaleY=t;}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"height",get:function(){return 0},set:function(t){}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"setOrigin",value:function(t){return this.originX=t,this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"modifyPorperties",value:function(t){if(!t)return this;t.hasOwnProperty("x")&&this.setX(t.x),t.hasOwnProperty("y")&&this.setY(t.y),t.hasOwnProperty("rotation")?this.setRotation(t.rotation):t.hasOwnProperty("angle")&&this.setAngle(t.angle),t.hasOwnProperty("alpha")&&this.setAlpha(t.alpha);var e=Zn(t,"width",void 0),i=Zn(t,"height",void 0),n=Zn(t,"scaleX",void 0),s=Zn(t,"scaleY",void 0);return void 0!==e?void 0===i&&void 0===s?this.setWidth(e,!0):this.setWidth(e):void 0!==n&&this.setScaleX(n),void 0!==i?void 0===e&&void 0===n?this.setHeight(i,!0):this.setHeight(i):void 0!==s&&this.setScaleY(s),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),this}},{key:"setDrawBelowCallback",value:function(t){return this.drawBelowCallback=t,this}},{key:"setDrawAboveCallback",value:function(t){return this.drawAboveCallback=t,this}},{key:"reset",value:function(){return this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setLeftSpace(0).setRightSpace(0).setOrigin(0).setAlign().setDrawBelowCallback().setDrawAboveCallback(),this}},{key:"willRender",get:function(){return this.visible&&this.alpha>0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(Rn);Object.assign(qn.prototype,Nn);var $n=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Qn=Phaser.Utils.Objects.GetValue,ts=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Qn(n,"color",null),Qn(n,"color2",null),Qn(n,"horizontalGradient",!0)),s.setStroke(Qn(n,"stroke",null),Qn(n,"strokeThickness",2)),s.setCornerRadius(Qn(n,"cornerRadius",0),Qn(n,"cornerIteration",null)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,$n("color2",t,this),$n("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,$n("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,$n("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return g(u(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){Pe(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(qn),es=Phaser.Utils.Objects.GetValue,is=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(es(n,"color",null),es(n,"color2",null),es(n,"horizontalGradient",!0)),s.setStroke(es(n,"stroke",null),es(n,"strokeThickness",2)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){g(u(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,es(t,"color2",null),es(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,es(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(qn),ns=Phaser.Utils.Objects.GetValue,ss=function(){function t(e,i){r(this,t),this.parent=e,this.set(i);}return a(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(ns(t,"bold",!1)),this.setItalic(ns(t,"italic",!1)),this.setFontSize(ns(t,"fontSize","16px")),this.setFontFamily(ns(t,"fontFamily","Courier")),this.setColor(ns(t,"color","#fff")),this.setStrokeStyle(ns(t,"stroke",null),ns(t,"strokeThickness",0)),this.setShadow(ns(t,"shadowColor",null),ns(t,"shadowOffsetX",0),ns(t,"shadowOffsetY",0),ns(t,"shadowBlur",0)),this.setOffset(ns(t,"offsetX",0),ns(t,"offsetY",0)),this.setSpace(ns(t,"leftSpace",0),ns(t,"rightSpace",0)),this.setAlign(ns(t,"align",void 0)),this.setBackgroundColor(ns(t,"backgroundColor",null)),this.setBackgroundHeight(ns(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(ns(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle($n("stroke",t,this),$n("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset($n("shadowOffsetX",t,this),$n("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=me(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=me(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=me(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=me(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),rs=Phaser.Utils.Array.Remove,os=Phaser.Utils.Array.Remove,as="text",hs="image",ls="drawer",us="space",cs="command",ds=function(t){return t.type===as&&"\n"===t.text},fs=function(t){return t.type===as&&"\f"===t.text},ps=function(t){return t.type===as},vs=function(t){return t.type===cs},gs=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,as)).updateTextFlag=!1,o.style=new ss(d(o),s),o.setText(n),o}return a(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),k(u(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),k(u(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),g(u(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&g(u(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(qn),ys=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},ks=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,hs)).setTexture(n,s),o}return a(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(qn),ms=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},bs=function(t){l(i,t);var e=p(i);function i(t,n,s,o){var a;return r(this,i),(a=e.call(this,t,ls)).setRenderCallback(n),a.setDrawerSize(s,o),a}return a(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(qn),xs=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,us)).setSpaceWidth(n),s}return a(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(qn),Cs=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},ws=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;return r(this,i),(h=e.call(this,t,cs)).setName(n).setParameter(o).setCallback(s,a),h}return a(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(Rn),Ss=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},Ps=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},Ts=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=Es.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=Es.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=Rs(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=Rs(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=Rs(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=Rs(t,"letterSpacing",0),f=Rs(t,"hAlign",0),p=Rs(t,"vAlign",0),v=Rs(t,"charWrap",!1),g=Ps({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=!L&&g.start===T,g.maxLineWidth=R,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,Y=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=Ds(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=Ds(t,"maxLines",0);var a=0===i,h=Ds(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=Ds(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=Ds(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=Ds(t,"letterSpacing",0),f=Ds(t,"rtl",!0),p=Ds(t,"hAlign",f?2:0),v=Ds(t,"vAlign",0),g=Ps({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=g.start===T,g.maxLineHeight=R,g.linesWidth=M.length*r;var z=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,A=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return _n(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return En(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),rs(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return os(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,x(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(x(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,x(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(as);return null===i?i=new gs(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Un(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(gr(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},mr=function(t){return t>>16&255},br=function(t){return t>>8&255},xr=function(t){return 255&t},Cr=Phaser.Events.EventEmitter,wr=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=Sr),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},Sr={},Pr=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=wr),function(t){if(t.events)return t;var e=new Cr,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},Tr=Phaser.Utils.Array.Remove,Or={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=mr(e),n=br(e),s=xr(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=mr(e=r),n=br(e),s=xr(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&Pr(e,this.viewport),this.effectPropertiesConfig&&gr(e,this.effectPropertiesConfig),e.once("destroy",(function(){Tr(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?xo:bo,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=mo,this}},{key:"update",value:function(t,e){this.state!==mo&&this.state!==wo&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=Co)):(this.nowTime=this.duration,this.state=wo):this.nowTime>=0&&(this.state=xo));}},{key:"t",get:function(){var t;switch(this.state){case mo:case bo:case Co:t=0;break;case xo:t=this.nowTime/this.duration;break;case wo:t=1;}return yo(t,0,1)},set:function(t){(t=yo(t,-1,1))<0?(this.state=bo,this.nowTime=-this.delay*t):(this.state=xo,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++);}},{key:"setT",value:function(t){return this.t=t,this}},{key:"isIdle",get:function(){return this.state===mo}},{key:"isDelay",get:function(){return this.state===bo}},{key:"isCountDown",get:function(){return this.state===xo}},{key:"isRunning",get:function(){return this.state===bo||this.state===xo}},{key:"isDone",get:function(){return this.state===wo}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),mo=0,bo=1,xo=2,Co=3,wo=-1,So=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).timer=new ko,s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(g(u(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),g(u(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),g(u(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),g(u(i.prototype),"complete",this).call(this),this}}]),i}(po),Po=Phaser.Utils.Objects.GetValue,To=Phaser.Utils.Objects.GetAdvancedValue,Oo=Phaser.Tweens.Builders.GetEaseFunction,Mo=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Po(t,"timer")),this.setEnable(Po(t,"enable",!0)),this.setTarget(Po(t,"target",this.parent)),this.setDelay(To(t,"delay",0)),this.setDuration(To(t,"duration",1e3)),this.setEase(Po(t,"ease","Linear")),this.setRepeat(Po(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setTarget",value:function(t){return void 0===t&&(t=this.parent),this.target=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=Oo(t),this}},{key:"start",value:function(){return this.timer.isRunning||g(u(i.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"stop",value:function(t){return void 0===t&&(t=!1),g(u(i.prototype),"stop",this).call(this),t&&(this.timer.setT(1),this.updateGameObject(this.target,this.timer),this.complete()),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable||!this.parent.active)return this;var i=this.target,n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),i}(So),Eo=Phaser.Sound.BaseSound,_o=function(t){return t instanceof Eo},Ro=Phaser.Utils.Objects.GetValue,Lo=Phaser.Utils.Objects.GetAdvancedValue,Bo=Phaser.Math.Linear,Do=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),_o(t)&&(s=n,n=t,t=void 0),n.active=!0,n.scene=t,n.game=n.manager.game,(o=e.call(this,n,s)).volume={},o.resetFromJSON(s),o}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ro(t,"mode",0)),this.setEnable(Ro(t,"enable",!0)),this.setVolumeRange(Lo(t,"volume.start",this.parent.volume),Lo(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Io[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),g(u(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Bo(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(g(u(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(Mo),Io={stop:1,destroy:2},jo=function(t,e,i,n,s){_o(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new Do(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},zo=function(t,e,i,n){_o(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new Do(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},Ao=Phaser.Utils.Objects.GetValue,Fo={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:Ao(e,"loop",this.backgroundMusicLoop),mute:Ao(e,"mute",this.backgroundMusicMute),volume:Ao(e,"volume",this.backgroundMusicVolume),detune:Ao(e,"detune",0),rate:Ao(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&jo(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&zo(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},Yo=Phaser.Utils.Objects.GetValue,Wo={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:Yo(e,"loop",this.backgroundMusicLoop),mute:Yo(e,"mute",this.backgroundMusic2Mute),volume:Yo(e,"volume",this.backgroundMusic2Volume),detune:Yo(e,"detune",0),rate:Yo(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&jo(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&zo(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},Vo=Phaser.Utils.Array.Remove,Xo=Phaser.Utils.Objects.GetValue,Go={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:Xo(e,"mute",this.soundEffectsMute),volume:Xo(e,"volume",this.soundEffectsVolume),detune:Xo(e,"detune",0),rate:Xo(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&Vo(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&Vo(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&jo(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&zo(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)zo(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&jo(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&zo(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)zo(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(Ct(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return a(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=Qi(this.delimiterLeft),e=Qi(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=ma:t||(t=xa),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return n.setDelimiters(s[0],s[1]),n}return a(i,[{key:"setTagExpression",value:function(t){return t||(t=wa),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=wa),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){g(u(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==wa||this.valueExpression!==wa){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=Qi(this.delimiterLeft),e=Qi(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=ma);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Mh,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===as&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else vs(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),Bh(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Mh),i=0,n=e.length;i0&&o.chainAnimation(i,n);},Uh=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,x(i));},Nh=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,x(i));},Kh=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,x(i));},Jh=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(Gh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(x(s))):a.setProperty(i,n,s[0]);}},il={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},nl=function(t){var e,i,n,s,r,o,a,h,l=m(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},sl=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(qh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return ml.length=0,!0;return ml.length=0,!1},ml=[],bl=void 0,xl=Phaser.Utils.Objects.GetValue,Cl=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=xl(e,r,n[1]))&&(i[n[0]]=s);return i},wl=function(t){t.addEventListener("touchstart",Sl,!1),t.addEventListener("touchmove",Sl,!1),t.addEventListener("touchend",Sl,!1),t.addEventListener("mousedown",Sl,!1),t.addEventListener("mouseup",Sl,!1),t.addEventListener("mousemove",Sl,!1);},Sl=function(t){t.stopPropagation();},Pl=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Tl=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Pl,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this);},Ol=function(){this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this);},Ml=Phaser.Utils.Objects.GetValue,El=function(t,e){var i,n=Ml(e,"inputType",void 0);void 0===n&&(n=Ml(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Ml(e,"style",void 0),r=i.style;Cl(vl,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",Cl(pl,e,i),wl(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i.addEventListener("focus",(function(e){Tl.call(t);})),i.addEventListener("blur",(function(e){Ol.call(t);})),i},_l={open:function(){return this.isOpened||this.readOnly||((t=this)!==bl&&(void 0!==bl&&bl.close(),bl=t),this.node||(this.node=El(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===bl&&(bl=void 0),this.setBlur(),this):this}},Rl=Phaser.Utils.Objects.GetValue,Ll=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),s=e.call(this,t);var o=Rl(n,"inputType",void 0);void 0===o&&(o=Rl(n,"type","text")),s.setEnterCloseEnable(Rl(n,"enterClose","textarea"!==o));var a=Rl(n,"onOpen",void 0);a||(a=Rl(n,"onFocus",void 0)),s.onOpenCallback=a;var h=Rl(n,"onClose",void 0);return h||(h=Rl(n,"onBlur",void 0)),s.onCloseCallback=h,s.onUpdateCallback=Rl(n,"onUpdate",void 0),s.isOpened=!1,t.on("pointerdown",(function(){this.open();}),d(s)).setInteractive(),s.nodeConfig=function(t){void 0===t&&(t={});var e={};return gl(t,e,"inputType"),gl(t,e,"type"),gl(t,e,"style"),gl(t,e,vl),gl(t,e,pl),e}(n),s.node=void 0,s}return a(i,[{key:"destroy",value:function(){this.close(),g(u(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){yl(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(ho);Object.assign(Ll.prototype,_l);var Bl=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},Dl=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(Dl(this),Il(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Bl,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Ll),Al=Phaser.Utils.Objects.GetValue,Fl=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],Yl=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}Ul.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(Nl(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Qu(t,"tl",0),this.radiusTR=Qu(t,"tr",0),this.radiusBL=Qu(t,"bl",0),this.radiusBR=Qu(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Ut(e,e,e,e,180,270,!1,r,t):Ut(0,0,e,e,90,0,!0,r,t):Gt(0,0,t);(e=this.radiusTR)>0?this._convexTR?Ut(n-e,e,e,e,270,360,!1,r,t):Ut(n,0,e,e,180,90,!0,r,t):Gt(n,0,t);(e=this.radiusBR)>0?this._convexBR?Ut(n-e,s-e,e,e,0,90,!1,r,t):Ut(n,s,e,e,270,180,!0,r,t):Gt(n,s,t);(e=this.radiusBL)>0?this._convexBL?Ut(e,s-e,e,e,90,180,!1,r,t):Ut(0,s,e,e,360,270,!0,r,t):Gt(0,s,t);return t.push(t[0],t[1]),Du(this.x,this.y,t),g(u(i.prototype),"updateData",this).call(this),this}}]),i}(Cu),ec=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,ic=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),void 0===t&&(t=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,n),l.setP1(s,o),l.setP2(a,h),l}return a(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),g(u(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=ec(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&Zt(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&($t(t,this),t.fill()),this.isStroked&&(Qt(t,this),t.stroke());}}]),i}(bu),nc={buildShapes:function(){this.addShape((new tc).setName("box")).addShape((new Zu).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},sc=Phaser.Utils.Objects.GetValue,rc=Phaser.Math.Linear,oc=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).resetFromJSON(),s.boot(),s}return a(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=sc(t,"key","value");var n=e[this.propertyKey];return this.fromValue=sc(t,"from",n),this.toValue=sc(t,"to",n),this.setEase(sc(t,"ease",this.ease)),this.setDuration(sc(t,"duration",this.duration)),this.setRepeat(sc(t,"repeat",0)),this.setDelay(sc(t,"delay",0)),this.setRepeatDelay(sc(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,g(u(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=rc(this.fromValue,this.toValue,i);}}]),i}(Mo),ac={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new oc(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},hc={};Object.assign(hc,ku,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},nc,ac);var lc=Phaser.Utils.Objects.GetValue,uc=Phaser.Utils.Objects.IsPlainObject,cc=23730,dc=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),uc(n)?(n=lc(l=n,"x",0),s=lc(l,"y",0),o=lc(l,"width",2),a=lc(l,"height",2),h=lc(l,"color",cc)):uc(h)&&(h=lc(l=h,"color",cc)),(u=e.call(this,t,n,s,o,a)).type="rexCheckbox",void 0===h&&(h=cc),u.setBoxShape(lc(l,"circleBox",!1)),u.setBoxFillStyle(h,lc(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(lc(l,"uncheckedColor",null),lc(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(lc(l,"boxLineWidth",4),lc(l,"boxStrokeColor",h),lc(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,lc(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),lc(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(lc(l,"checkerColor",16777215),lc(l,"checkerAlpha",1)),u.setBoxSize(lc(l,"boxSize",1)),u.setCheckerSize(lc(l,"checkerSize",1)),u.setCheckerAnimationDuration(lc(l,"animationDuration",150)),u.buildShapes();var c=lc(l,"checked");return void 0===c&&(c=lc(l,"value",!1)),u.setValue(c),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(yu);Object.assign(dc.prototype,hc);var fc=Phaser.Utils.Objects.GetValue,pc=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(fc(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(fc(t,"enable",!0)),this.setMode(fc(t,"mode",1)),this.setClickInterval(fc(t,"clickInterval",100)),this.setDragThreshold(fc(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=vc[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,i,n){void 0===this.pointer&&(this.pointer=t,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&t.getDistance()>=this.dragThreshold&&this.cancel();}},{key:"click",value:function(t,e,i){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.parent,e,i),this;this.pointer=void 0;var n=this.lastClickTime;return void 0!==n&&t-n<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(ho),vc={press:0,pointerdown:0,release:1,pointerup:1},gc=Phaser.Utils.Objects.GetValue,yc=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new pc(d(u),gc(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(gc(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(dc);M.register("checkbox",(function(t,e,i,n,s,r){var o=new yc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.Checkbox",yc);var kc={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},mc={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},bc={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},xc=function(t,e,i){return (e-t)*i+t},Cc=Phaser.Math.Linear,wc={buildShapes:function(){this.addShape((new tc).setName("track")).addShape((new tc).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&xc(mr(l),mr(u),c))<<16|(255&xc(br(l),br(u),c))<<8|255&xc(xr(l),xr(u),c)),f=Cc(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=Cc(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},Sc={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new oc(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Pc={};Object.assign(Pc,kc,mc,bc,wc,Sc);var Tc=Phaser.Utils.Objects.GetValue,Oc=Phaser.Utils.Objects.IsPlainObject,Mc=23730,Ec=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),Oc(n)?(n=Tc(l=n,"x",0),s=Tc(l,"y",0),o=Tc(l,"width",2),a=Tc(l,"height",2),h=Tc(l,"color",Mc)):Oc(h)&&(h=Tc(l=h,"color",Mc)),(u=e.call(this,t,n,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=Mc),u.setTrackFillStyle(h,Tc(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Tc(l,"falseValueTrackColor",function(t){var e=.3*mr(t)+.59*br(t)+.11*xr(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Tc(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Tc(l,"thumbColor",16777215),Tc(l,"thumbAlpha",1)),u.setTrackSize(Tc(l,"trackWidth",.9),Tc(l,"trackHeight",.5)),u.setTrackRadius(Tc(l,"trackRadius",.5*u.trackHeight));var c=Tc(l,"thumbHeight",void 0),d=Tc(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Tc(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Tc(l,"thumbLeft",.3),Tc(l,"thumbRight",void 0)),u.setRTL(Tc(l,"rtl",!1)),u.setToggleAnimationDuration(Tc(l,"animationDuration",150)),u.buildShapes(),u.setValue(Tc(l,"value",!1),0),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(yu);Object.assign(Ec.prototype,Pc);var _c=Phaser.Utils.Objects.GetValue,Rc=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new pc(d(u),_c(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(_c(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Ec);M.register("toggleSwitch",(function(t,e,i,n,s,r){var o=new Rc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.ToggleSwitch",Rc);var Lc={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Bc=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i)}(ge);Object.assign(Bc.prototype,Lc),M.register("canvas",(function(t,e,i,n){var s=new Bc(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),$(window,"RexPlugins.UI.Canvas",Bc);var Dc=Phaser.Utils.Objects.GetValue,Ic=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s)).type="rexCircleMaskImage",l.setTexture(o,a,h),l}return a(i,[{key:"setTexture",value:function(t,e,i){"object"===n(e)&&(i=e,e=void 0),"string"==typeof i&&(i={maskType:i});var s=Dc(i,"maskType",0),r=Dc(i,"backgroundColor",void 0),o=Dc(i,"strokeColor",void 0),a=Dc(i,"strokeWidth",null!=o?10:0);if(void 0===s?s=0:"string"==typeof s&&(s=jc[s]),this._textureKey=t,this._frameName=e,null===s)return this.loadTexture(t,e),this.dirty=!0,this;var h=this.scene.sys.textures.getFrame(t,e);if(!h)return this;h.cutWidth!==this.width||h.cutHeight!==this.height?this.setCanvasSize(h.cutWidth,h.cutHeight):this.clear();var l=this.canvas,u=this.context,c=l.width,d=l.height;null!=r&&(u.fillStyle=r,u.fillRect(0,0,c,d)),u.save(),u.beginPath();var f=a/2;switch(s){case 1:var p=(k=Math.floor(c/2))-f,v=(m=Math.floor(d/2))-f;u.ellipse(k,m,p,v,0,0,2*Math.PI);break;case 2:var g=Dc(i,"radius",0),y=Dc(i,"iteration",void 0);xe(u,f,f,c-a,d-a,g,y);break;default:var k=Math.floor(c/2),m=Math.floor(d/2),b=Math.min(k,m)-f;u.arc(k,m,b,0,2*Math.PI);}return null!=o&&(u.strokeStyle=o,u.lineWidth=a,u.stroke()),u.clip(),this.loadTexture(t,e),u.restore(),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),i}(ge),jc={circle:0,ellipse:1,roundRectangle:2};M.register("circleMaskImage",(function(t,e,i,n,s){var r=new Ic(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),$(window,"RexPlugins.UI.CircleMaskImage",Ic);var zc=Phaser.Utils.Objects.GetValue,Ac=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s)).type="rexAlphaMaskImage",l.maskFrame=null,l.setTexture(o,a,h),l}return a(i,[{key:"setTexture",value:function(t,e,i){"object"===n(e)&&(i=e,e=void 0),"string"==typeof i&&(i={mask:{key:i}});var s=zc(i,"mask.key"),r=zc(i,"mask.frame"),o=zc(i,"mask.invertAlpha",!1),a=zc(i,"mask.scale"),h=zc(i,"backgroundColor");if(s){this._maskKey=s,this._maskFrame=r,this._maskScale=a;var l=s?this.scene.sys.textures.get(s):null;this.maskFrame=l?l.get(r):null;}this._textureKey=t,this._frameName=e;var u=this.maskFrame;if(null===u)return this.loadTexture(t,e),this.dirty=!0,this;var c=null!=h;this.loadTexture(t,e);var d,f,p=this.canvas,v=this.context,g=p.width,y=p.height;v.save(),v.globalCompositeOperation=o?"destination-out":"destination-in",null!=this._maskScale?(d=u.cutWidth*this._maskScale,f=u.cutHeight*this._maskScale):(d=g,f=y);var k=(g-d)/2,m=(y-f)/2;return this.drawFrame(this._maskKey,this._maskFrame,k,m,d,f),v.restore(),c&&(v.save(),v.globalCompositeOperation="destination-over",v.fillStyle=h,v.fillRect(0,0,g,y),v.restore()),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),i}(ge);M.register("alphaMaskImage",(function(t,e,i,n,s){var r=new Ac(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),$(window,"RexPlugins.UI.AlphaMaskImage",Ac);var Fc=Phaser.Math.Linear,Yc=Phaser.Math.Percent,Wc={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Yc(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Yc(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Fc(t,e,i)),i}},Vc=Phaser.Math.Percent,Xc={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=Vc(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new oc(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new oc(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Gc=Phaser.Utils.Objects.GetValue,Hc=Phaser.Math.Clamp;function Uc(t){var e=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=Gc(t,"eventEmitter",this);var e=Gc(t,"valuechangeCallback",null);if(null!==e){var i=Gc(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Gc(t,"easeValue.duration",0)).setEaseValueFunction(Gc(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Hc(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,Wc,Xc),e}var Nc=Phaser.Math.RadToDeg,Kc=Phaser.Math.DegToRad,Jc=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Kc(r),u=Kc(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},Zc={buildShapes:function(){this.addShape((new Zu).setName("track")).addShape((new Zu).setName("bar")).addShape((new Pu).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),Jc(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=Nc(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),Jc(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},qc=Phaser.Utils.Objects.GetValue,$c=Phaser.Utils.Objects.IsPlainObject,Qc=Phaser.Math.Clamp,td=Phaser.Math.DegToRad(270),ed=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),$c(n)&&(n=qc(l=n,"x",0),s=qc(l,"y",0),o=qc(l,"radius",1),a=qc(l,"barColor",void 0),h=qc(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,n,s,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(qc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(qc(l,"centerColor",void 0)),u.setThickness(qc(l,"thickness",.2)),u.setStartAngle(qc(l,"startAngle",td)),u.setAnticlockwise(qc(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return a(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(g(u(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=Qc(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(Uc(yu));Object.assign(ed.prototype,Zc),M.register("circularProgress",(function(t,e,i,n,s,r){var o=new ed(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.CircularProgress",ed);var id=function(t,e,i,n,s,r,o,a,h,l,u,c){void 0===l&&(l=0),void 0===u&&(u=2*Math.PI),void 0===c&&(c=!1),e.beginPath(),e.ellipse(i,n,s,r,0,l,u,c),null!=o&&(e.fillStyle=o,e.fill()),null!=a&&(e.strokeStyle=a,e.lineWidth=h,e.stroke());},nd=function(){var t,e=this.radius,i=this.thickness*this.radius,n=this.radius-i/2,s=this.radius-i,r=(this.canvas,this.context);if(this.trackColor&&i>0&&(r.save(),id(0,r,e,e,n,n,void 0,this.trackColor,i),r.restore()),this.barColor&&n>0){var o,a,h;if(1===this.value)o=!1,a=0,h=2*Math.PI;else o=this.anticlockwise,a=this.startAngle,h=2*Math.PI*(o?1-this.value:this.value)+a;r.save(),id(0,r,e,e,n,n,void 0,this.barColor,i,a,h,o),r.restore();}this.centerColor&&s>0&&(this.centerColor2?((t=this.context.createRadialGradient(e,e,0,e,e,s)).addColorStop(0,this.centerColor),t.addColorStop(1,this.centerColor2)):t=this.centerColor,r.save(),id(0,r,e,e,s,s,t),r.restore());this.textFormatCallback&&(this.textColor||this.textStrokeColor)&&(r.save(),function(t,e,i,n,s,r,o,a,h,l,u){void 0===h&&null!=a&&(h=2),void 0===l&&(l="start"),void 0===u&&(u="alphabetic"),e.font=r,e.textAlign=l,e.textBaseline=u,e.fillStyle=o,e.strokeStyle=a,e.lineWidth=h,e.lineCap="round",e.lineJoin="round",null!=a&&"none"!==a&&h>0&&e.strokeText(s,i,n),null!=o&&"none"!==o&&e.fillText(s,i,n);}(0,r,e,e,this.getFormatText(),this.textFont,this.textColor,this.textStrokeColor,this.textStrokeThickness,"center","middle"),r.restore());},sd=Phaser.Utils.Objects.GetValue,rd=Phaser.Utils.Objects.IsPlainObject,od=Phaser.Math.Clamp,ad=Phaser.Math.DegToRad(270),hd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),rd(n)&&(n=sd(l=n,"x",0),s=sd(l,"y",0),o=sd(l,"radius",1),a=sd(l,"barColor",void 0),h=sd(l,"value",0));var c=2*o;(u=e.call(this,t,n,s,c,c)).type="rexCircularProgressCanvas",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(sd(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(sd(l,"centerColor",void 0)),u.setThickness(sd(l,"thickness",.2)),u.setStartAngle(sd(l,"startAngle",ad)),u.setAnticlockwise(sd(l,"anticlockwise",!1)),u.setTextColor(sd(l,"textColor",void 0)),u.setTextStrokeColor(sd(l,"textStrokeColor",void 0),sd(l,"textStrokeThickness",void 0));var d=sd(l,"textFont",void 0);return d?u.setTextFont(d):u.setTextFont(sd(l,"textSize","16px"),sd(l,"textFamily","Courier"),sd(l,"textStyle","")),u.setTextFormatCallback(sd(l,"textFormatCallback",void 0),sd(l,"textFormatCallbackScope",void 0)),u.setValue(h),u}return a(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(g(u(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=od(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"centerColor2",get:function(){return this._centerColor2},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor2!=t,this._centerColor2=t;}},{key:"setCenterColor",value:function(t,e){return this.centerColor=t,this.centerColor2=e,this}},{key:"textColor",get:function(){return this._textColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._textColor!=t,this._textColor=t;}},{key:"setTextColor",value:function(t){return this.textColor=t,this}},{key:"textStrokeColor",get:function(){return this._textStrokeColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._textStrokeColor!=t,this._textStrokeColor=t;}},{key:"textStrokeThickness",get:function(){return this._textStrokeThickness},set:function(t){this.dirty=this.dirty||this._textStrokeThickness!=t,this._textStrokeThickness=t;}},{key:"setTextStrokeColor",value:function(t,e){return void 0===e&&(e=2),this.textStrokeColor=t,this.textStrokeThickness=e,this}},{key:"textFont",get:function(){return this._textFont},set:function(t){this.dirty=this.dirty||this._textFont!=t,this._textFont=t;}},{key:"setTextFont",value:function(t,e,i){var n;return n=void 0===e?t:i+" "+t+" "+e,this.textFont=n,this}},{key:"setTextFormatCallback",value:function(t,e){return this.textFormatCallback=t,this.textFormatCallbackScope=e,this}},{key:"updateTexture",value:function(){return this.clear(),nd.call(this),g(u(i.prototype),"updateTexture",this).call(this),this}},{key:"getFormatText",value:function(t){return void 0===t&&(t=this.value),this.textFormatCallbackScope?this.textFormatCallback(t):this.textFormatCallback.call(this.textFormatCallbackScope,t)}}]),i}(Uc(ge));M.register("circularProgressCanvas",(function(t,e,i,n,s,r){var o=new hd(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.CircularProgressCanvas",hd);var ld=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},ud=Phaser.Utils.Objects.GetValue,cd=Phaser.Utils.Objects.IsPlainObject,dd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),cd(n)?(n=ud(u=n,"x",0),s=ud(u,"y",0),o=ud(u,"width",2),a=ud(u,"height",2),h=ud(u,"barColor",void 0),l=ud(u,"value",0)):cd(o)?(o=ud(u=o,"width",2),a=ud(u,"height",2),h=ud(u,"barColor",void 0),l=ud(u,"value",0)):cd(h)&&(h=ud(u=h,"barColor",void 0),l=ud(u,"value",0)),(c=e.call(this,t,n,s,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new Zu).setName("trackFill")).addShape((new Zu).setName("bar")).addShape((new Zu).setName("trackStroke")),c.setTrackColor(ud(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(ud(u,"trackStrokeThickness",2),ud(u,"trackStrokeColor",void 0)),c.setSkewX(ud(u,"skewX",0)),c.setRTL(ud(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(Uc(yu)),fd={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&ld(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),ld(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&ld(a,0,0,e,i,t).end();}};Object.assign(dd.prototype,fd),M.register("lineProgress",(function(t,e,i,n,s,r,o){var a=new dd(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),$(window,"RexPlugins.UI.LineProgress",dd);var pd=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),pd(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},gd=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},yd=Phaser.Utils.Objects.GetValue,kd=Phaser.Utils.Objects.IsPlainObject,md=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),kd(n)?(n=yd(u=n,"x",0),s=yd(u,"y",0),o=yd(u,"width",2),a=yd(u,"height",2),h=yd(u,"barColor",void 0),l=yd(u,"value",0)):kd(o)?(o=yd(u=o,"width",2),a=yd(u,"height",2),h=yd(u,"barColor",void 0),l=yd(u,"value",0)):kd(h)&&(h=yd(u=h,"barColor",void 0),l=yd(u,"value",0)),(c=e.call(this,t,n,s,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(yd(u,"trackColor",void 0)),c.setBarColor(h,yd(u,"barColor2",void 0),yd(u,"isHorizontalGradient",void 0)),c.setTrackStroke(yd(u,"trackStrokeThickness",2),yd(u,"trackStrokeColor",void 0)),c.setSkewX(yd(u,"skewX",0)),c.setRTL(yd(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),vd.call(this),g(u(i.prototype),"updateTexture",this).call(this),this}}]),i}(Uc(ge));M.register("circularProgressCanvas",(function(t,e,i,n,s,r,o){var a=new md(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),$(window,"RexPlugins.UI.LineProgressCanvas",md),Phaser.Math.Wrap;var bd=Phaser.Math.Linear,xd=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],x=this.easeDirectionProgress;t=bd(m.a.x,b.a.x,x),e=bd(m.a.y,b.a.y,x),i=bd(m.b.x,b.b.x,x),n=bd(m.b.y,b.b.y,x),s=bd(m.c.x,b.c.x,x),r=bd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Cd=(0, Phaser.Math.DegToRad)(120),wd=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+Cd),i+n*Math.sin(s+Cd)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Cd),i+n*Math.sin(s-Cd)),this.arrowOnly?t.end():t.close();},Sd={buildShapes:function(){this.addShape((new Zu).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?xd.call(this):wd.call(this);}},Pd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new oc(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},Td=Phaser.Utils.Objects.GetValue,Od=Phaser.Utils.Objects.IsPlainObject,Md=Phaser.Math.DegToRad,Ed=Phaser.Math.RadToDeg,_d=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(r(this,i),Od(n)){var m=n;n=m.x,s=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,n,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return a(i,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Ld(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,i,s){if("object"===n(t)){var r=t,o=Td(r,"x",null);null!==o?(t=o,i=o):(t=Td(r,"left",0),i=Td(r,"right",t));var a=Td(r,"y",null);null!==a?(e=a,s=a):(e=Td(r,"top",0),s=Td(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=i||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Ed(this.verticeRotation)},set:function(t){this.verticeRotation=Md(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),i}(yu),Rd={right:0,down:1,left:2,up:3},Ld=function(t){return "string"==typeof t&&(t=Rd[t]),t%=4};Object.assign(_d.prototype,Sd,Pd),M.register("triangle",(function(t,e,i,n,s,r){var o=new _d(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.Triangle",_d),ct();var Bd=Phaser.GameObjects.Zone,Dd=Phaser.Utils.Array.Add,Id=Phaser.Utils.Array.Remove,jd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;return r(this,i),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=1),(h=e.call(this,t,n,s,o,a)).children=[],h}return a(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(t)for(var e,n=this.children.length-1;n>=0;n--)(e=this.children[n]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),g(u(i.prototype),"destroy",this).call(this,t);}}},{key:"contains",value:function(t){return -1!==this.children.indexOf(t)}},{key:"add",value:function(t){var e=this;return Dd(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return Id(this.children,t,(function(t){t.off("destroy",i.onChildDestroy,i),e&&t.destroy();})),this}},{key:"onChildDestroy",value:function(t,e){this.remove(t,!1);}},{key:"clear",value:function(t){for(var e,i=0,n=this.children.length;i0;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,x(n.children));}},yf=Phaser.Utils.Array,kf={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Dp=function(t,e){if("string"==typeof t)this.childrenMap[t]=e;else {var i=t;for(t in i)this.childrenMap[t]=i[t];}return this},Ip=/(\S+)\[(\d+)\]/i,jp={getInnerPadding:function(t){return En(this.space,t)},setInnerPadding:function(t,e){return _n(this.space,t,e),this},getOuterPadding:function(t){return En(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return _n(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),En(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),_n(this.getSizerConfig(t).padding,e,i),this}},zp=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},Ap=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Fp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,x(i.children)));}return t}},Yp=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(Hv),Nv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=oo(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Kv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=j),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=j),this.transitOutCallback=t,this}},Jv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Zv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},qv={};Object.assign(qv,Nv,Kv,Jv,Zv);var $v=Phaser.Utils.Objects.GetValue,Qv=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).setTransitInTime($v(n,"duration.in",200)),s.setTransitOutTime($v(n,"duration.out",200)),s.setTransitInCallback($v(n,"transitIn")),s.setTransitOutCallback($v(n,"transitOut")),s.oneShotMode=$v(n,"destroy",!1),s.delayCallTimer=void 0,s._state=new Uv(d(s),{eventEmitter:!1,initState:$v(n,"initState","IDLE")}),s.openEventData=void 0,s.closeEventData=void 0,s}return a(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),g(u(i.prototype),"shutdown",this).call(this,t));}}]),i}(ho);Object.assign(Qv.prototype,qv);var tg=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,0,0,2,2,n,1)).setAlpha(s),o.setScrollFactor(0),o.boot(),o}return a(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),eg=Phaser.Utils.Objects.GetValue,ig=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,{eventEmitter:!1})).resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(eg(t,"hitAreaMode",0)),this.setEnable(eg(t,"enable",!0)),this.setStopMode(eg(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=ng[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(ho),ng={default:0,fullWindow:1},sg=Phaser.Utils.Objects.GetValue,rg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=sg(n,"color",0),a=sg(n,"alpha",.8);return (s=e.call(this,t,o,a)).touchEventStop=new ig(d(s),{hitAreaMode:1}),s}return a(i)}(tg),og=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Kp(t,e);},ag=function(t,e){Jp(t,e,void 0,void 0,!1);},hg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,rv(t,e);},lg=function(t,e){ov(t,e,!1);},ug=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,rv(t,e,t.alpha);},cg=function(t,e){ov(t,e,!1);},dg=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!zr(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},fg=Phaser.Utils.Objects.GetValue,pg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=vg.popUp),null==n.transitOut&&(n.transitOut=vg.scaleDown),n.destroy=fg(n,"destroy",!0),s=e.call(this,t,n);var o=fg(n,"cover");s.cover=!1!==o?function(t,e){var i=t.scene,n=new rg(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,s.cover&&(s.setCoverTransitInCallback(fg(o,"transitIn",ug)),s.setCoverTransitOutCallback(fg(o,"transitOut",cg)));var a=fg(n,"touchOutsideClose",!1),h=fg(n,"duration.hold",-1),l=fg(n,"timeOutClose",h>=0),u=fg(n,"anyTouchClose",!1);return fg(n,"manualClose",!1)&&(a=!1,u=!1,l=!1),u&&(a=!1),l?s.setDisplayTime(h):s.setDisplayTime(-1),u?s.once("open",s.anyTouchClose,d(s)):a&&s.once("open",s.touchOutsideClose,d(s)),fg(n,"openOnStart",!0)&&s.delayCall(0,s.requestOpen,d(s)),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&dg(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=g(u(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=g(u(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),g(u(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=vg[t]),t){case vg.popUp:t=og;break;case vg.fadeIn:t=hg;}return g(u(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=vg[t]),t){case vg.scaleDown:t=ag;break;case vg.fadeOut:t=lg;}return g(u(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(Qv),vg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},gg=function(t,e){var i=new pg(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i},yg=function(t,e){t.emit("modal.requestClose",e);},kg=function(t){return t&&"function"==typeof t},mg={modal:function(t,e){return kg(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=gg(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return yg(this,t),this}},bg=function(t,e,i,n){if(e)return dg(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(ho),zg={press:0,pointerdown:0,release:1,pointerup:1},Ag={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new jg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Fg=function(t){l(i,t);var e=p(i);function i(){var t;return r(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return a(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(Hv),Yg=Phaser.Utils.Objects.GetValue,Wg=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,s.cooldown=new Fg,s.parent.setInteractive(Yg(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Yg(t,"enable",!0)),this.setCooldown(Yg(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(ho),Vg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&bg(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Wg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Wg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},Xg=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=ry,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===oy&&this.onDragEnd(),this.pointer=void 0,this.tracerState=ry,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){g(u(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){g(u(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=ay,this}}]),i}(uo),ry=0,oy=1,ay="IDLE",hy=Phaser.Utils.Objects.GetValue,ly=Phaser.Math.Distance.Between,uy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=cy;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(hy(t,"time",250)),this.setTapInterval(hy(t,"tapInterval",200)),this.setDragThreshold(hy(t,"threshold",9)),this.setTapOffset(hy(t,"tapOffset",10));var e=hy(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(hy(t,"maxTaps",void 0)),this.setMinTaps(hy(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case cy:this.state=dy;break;case dy:var t=this.lastPointer;ly(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=fy,this.state=dy);break;case fy:this.state=dy;}}},{key:"onDragEnd",value:function(){this.state===dy&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=fy));}},{key:"onDrag",value:function(){this.state!==cy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=cy);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===dy){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=cy);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=fy:this.state=cy);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===fy&&(this.state=cy);}},{key:"isTapped",get:function(){return this.state===fy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(sy),cy="IDLE",dy="BEGIN",fy="RECOGNIZED",py=Phaser.Utils.Objects.GetValue,vy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=gy;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(py(t,"threshold",9)),this.setHoldTime(py(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=yy,0===this.holdTime&&(this.state=ky);}},{key:"onDragEnd",value:function(){this.state=gy;}},{key:"onDrag",value:function(){this.state!==gy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=gy);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===yy&&t-this.pointer.downTime>=this.holdTime&&(this.state=ky));}},{key:"isPressed",get:function(){return this.state===ky}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(sy),gy="IDLE",yy="BEGIN",ky="RECOGNIZED",my=Phaser.Utils.Objects.GetValue,by=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{},BEGIN:{enter:function(){var t=o.pointer;o.startX=t.x,o.startY=t.y,o.startWorldX=t.worldX,o.startWorldY=t.worldY;}},RECOGNIZED:{enter:function(){o.emit("panstart",o,o.gameObject,o.lastPointer);},exit:function(){var t=o.lastPointer;o.endX=t.x,o.endY=t.y,o.endWorldX=t.worldX,o.endWorldY=t.worldY,o.emit("panend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=xy;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(my(t,"threshold",10)),this}},{key:"onDragStart",value:function(){this.state=Cy,0===this.dragThreshold&&(this.state=wy);}},{key:"onDragEnd",value:function(){this.state=xy;}},{key:"onDrag",value:function(){switch(this.state){case Cy:this.pointer.getDistance()>=this.dragThreshold&&(this.state=wy);break;case wy:var t=this.pointer.position,e=this.pointer.prevPosition;this.dx=t.x-e.x,this.dy=t.y-e.y;var i=this.pointer;this.x=i.x,this.y=i.y,this.worldX=i.worldX,this.worldY=i.worldY,this.emit("pan",this,this.gameObject,this.lastPointer);}}},{key:"isPanned",get:function(){return this.state===wy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(sy),xy="IDLE",Cy="BEGIN",wy="RECOGNIZED",Sy=Phaser.Math.Distance.Between,Py=Phaser.Math.Angle.Between,Ty={getDt:function(){return hu(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Sy(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Py(e.x,e.y,t.x,t.y)}},Oy={"up&down":0,"left&right":1,"4dir":2,"8dir":3},My={},Ey=Phaser.Utils.Objects.GetValue,_y=Phaser.Math.RadToDeg,Ry=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=Ly;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s.clearDirectionStates(),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Ey(t,"threshold",10)),this.setVelocityThreshold(Ey(t,"velocityThreshold",1e3)),this.setDirectionMode(Ey(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=By;}},{key:"onDragEnd",value:function(){this.state=Ly;}},{key:"onDrag",value:function(){this.state===By&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Dy));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Dy&&(this.state=Ly);}},{key:"isSwiped",get:function(){return this.state===Dy}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=Oy[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=My),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(_y(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(sy);Object.assign(Ry.prototype,Ty);var Ly="IDLE",By="BEGIN",Dy="RECOGNIZED",Iy=Phaser.Utils.Objects.GetValue,jy=Phaser.Utils.Array.SpliceOne,zy=Phaser.Math.Distance.Between,Ay=Phaser.Math.Angle.Between,Fy=function(){function t(e,i){r(this,t);var n=e.input.manager.pointersTotal-1;n<2&&e.input.addPointer(2-n),this.scene=e,this.setEventEmitter(Iy(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return a(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(Iy(t,"enable",!0)),this.bounds=Iy(t,"bounds",void 0),this.tracerState=Wy,this.pointers.length=0,wt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,wt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case Wy:this.tracerState=Vy,this.onDrag1Start();break;case Vy:this.tracerState=Xy,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],jy(this.pointers,e),this.tracerState){case Vy:this.tracerState=Wy,this.onDrag1End();break;case Xy:this.tracerState=Vy,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case Vy:this.onDrag1();break;case Xy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Xy&&this.onDrag2End(),this.pointers.length=0,wt(this.movedState),this.tracerState=Wy,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0],e=this.pointers[1];return zy(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0],e=this.pointers[1];return Ay(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;Yy.x=e.x-i.x,Yy.y=e.y-i.y;}else Yy.x=0,Yy.y=0;return Yy}},{key:"centerX",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==Xy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==Xy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Gy,this}}]),t}();Object.assign(Fy.prototype,or);var Yy={},Wy=0,Vy=1,Xy=2,Gy="IDLE",Hy=Phaser.Utils.Objects.GetValue,Uy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.prevDistance=void 0,o.scaleFactor=1;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("pinchstart",o);},exit:function(){o.emit("pinchend",o);}}},init:function(){this.state=Ny;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Hy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.scaleFactor=1,this.prevDistance=this.distanceBetween,this.state=Ky,0===this.dragThreshold&&(this.state=Jy);}},{key:"onDrag2End",value:function(){this.state=Ny;}},{key:"onDrag2",value:function(){switch(this.state){case Ky:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.prevDistance=t,this.state=Jy;}break;case Jy:t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.emit("pinch",this),this.prevDistance=t;}}},{key:"isPinched",get:function(){return this.state===Jy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Fy),Ny="IDLE",Ky="BEGIN",Jy="RECOGNIZED",Zy=Phaser.Math.RotateAround,qy=function(t,e,i,n){return Zy(t,e,i,n),t.rotation+=n,t},$y={},Qy=Phaser.Utils.Objects.GetValue,tk=Phaser.Math.Angle.WrapDegrees,ek=Phaser.Math.Angle.ShortestBetween,ik=Phaser.Math.RadToDeg,nk=Phaser.Math.DegToRad,sk=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=ok;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Qy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=tk(ik(this.angleBetween)),this.state=ak,0===this.dragThreshold&&(this.state=hk);}},{key:"onDrag2End",value:function(){this.state=ok;}},{key:"onDrag2",value:function(){switch(this.state){case ak:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=tk(ik(this.angleBetween));this.angle=ek(this.prevAngle,t),this.prevAngle=t,this.state=hk;}break;case hk:t=tk(ik(this.angleBetween));this.angle=ek(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===hk}},{key:"rotation",get:function(){return nk(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Fy),rk={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=$y),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?u.pop().setTexture(d,M):s(c,d,M),h&&c.add.existing(O),l){var E=b+w*T+o*w,_=x+S*P+a*S;O.setOrigin(o,a).setPosition(E,_).setScale(g,y).setRotation(k),Bm(O,b,x,k);}C.push(O);}return C}(t,e,i,n),o=0,a=r.length;o=0;n--)(o=s[n])instanceof e&&(o.destroy(),qm(s,n));else {n=0;for(var s,r=(s=t.postPipelines).length;nl?(n.width=a*l,n.height=a):(n.width=o,n.height=a);}else n.width=s,n.height=r;else {var l=s/r;n.width=Math.min(s,o),n.height=Math.min(r,a);var u=n.width/n.height;ul&&(n.width=n.height*l);}return n}(t,{width:this.width,height:this.height},this.scaleUp,!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return g(u(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(Vf);Object.assign(sb.prototype,Im),M.register("imageBox",(function(t,e,i,n,s){var r=new sb(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),$(window,"RexPlugins.UI.ImageBox",sb),M.register("fullWindowRectangle",(function(t,e){var i=new tg(this.scene,t,e);return this.scene.add.existing(i),i})),$(window,"RexPlugins.UI.FullWindowRectangle",tg),M.register("cover",(function(t){var e=new rg(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Cover",rg);var rb=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},ob={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},ab={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},hb={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},lb=Phaser.Utils.Objects.GetValue,ub=function(t,e,i,n){var s=lb(n,"preventDefault",!1),r=lb(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},cb=Phaser.GameObjects.DOMElement,db=Phaser.Utils.Objects.IsPlainObject,fb=Phaser.Utils.Objects.GetValue,pb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l,u;r(this,i),db(n)?(n=fb(h=n,"x",0),s=fb(h,"y",0),o=fb(h,"width",0),a=fb(h,"height",0)):db(o)&&(o=fb(h=o,"width",0),a=fb(h,"height",0)),void 0===h&&(h={});var c=fb(h,"inputType",void 0);void 0===c&&(c=fb(h,"type","text")),"textarea"===c?(u=document.createElement("textarea")).style.resize="none":(u=document.createElement("input")).type=c,Cl(ob,h,u);var f=fb(h,"style",void 0);f=Cl(ab,h,f);var p=u.style;for(var v in h)v in ob||v in ab||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,n,s,u,f)).type="rexInputText",l.resize(o,a),ub(d(l),u,hb),wl(u),fb(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),d(l)).on("blur",(function(){this._isFocused=!1;}),d(l)),l}return a(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(cb),vb={resize:rb};Object.assign(pb.prototype,vb),M.register("inputText",(function(t){var e=new pb(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.InputText",pb);var gb=Phaser.Utils.Objects.GetValue,yb=function(t,e){return void 0===t&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}))},kb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Th(H(e).events,"focus").then((function(){return yb(n)})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},mb=Phaser.Utils.Objects.GetValue,bb=Phaser.DOM.RemoveFromDOM,xb=function(t,e){var i=mb(e,"closeDelay",200),n=function(t,e){var i=document.createElement("input");i.type="file";var n=gb(e,"accept",""),s=gb(e,"multiple",!1);return i.setAttribute("accept",n),s?i.setAttribute("multiple",""):i.removeAttribute("multiple"),i}(0,e);return n.click(),kb({game:t,fileInput:n,closeDelay:i}).then((function(t){return bb(n),n.remove(),Promise.resolve(t)}))},Cb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},wb=function(t,e,i,n,s,r){if(null===s||!1===s);else if(kg(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=H(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),kg(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},Sb={loadFile:function(t,e,i,n,s){var r=this.scene;return wb(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){wb(s,t,e,i,n,(function(t){r(t);}));}))}},Pb=Phaser.GameObjects.DOMElement,Tb=Phaser.Utils.Objects.IsPlainObject,Ob=Phaser.Utils.Objects.GetValue,Mb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),Tb(n)?(n=Ob(h=n,"x",0),s=Ob(h,"y",0),o=Ob(h,"width",0),a=Ob(h,"height",0)):Tb(o)&&(o=Ob(h=o,"width",0),a=Ob(h,"height",0));var u=document.createElement("input");u.type="file",u.style.display="none";var c=document.createElement("label");c.appendChild(u);var f=Ob(h,"style",void 0);(l=e.call(this,t,n,s,c,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=d(l);return u.onchange=function(){p.emit("change",p);},l.setCloseDelay(Ob(h,"closeDelay",200)),u.onclick=function(){kb({game:t,fileInput:u,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return a(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(Ob(t,"accept","")),this.setMultiple(Ob(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(Pb),Eb={resize:rb,syncTo:Cb};Object.assign(Mb.prototype,Eb,Sb),M.register("fileChooser",(function(t){var e=new Mb(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FileChooser",Mb);var _b={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Rb={resize:rb,syncTo:Cb};Object.assign(Rb,_b,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},Sb);var Lb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Bb=Phaser.GameObjects.DOMElement,Db=Phaser.Utils.Objects.IsPlainObject,Ib=Phaser.Utils.Objects.GetValue,jb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),Db(n)?(n=Ib(h=n,"x",0),s=Ib(h,"y",0),o=Ib(h,"width",0),a=Ib(h,"height",0)):Db(o)&&(o=Ib(h=o,"width",0),a=Ib(h,"height",0)),void 0===h&&(h={});var u=document.createElement("div"),c=Ib(h,"style",void 0);(l=e.call(this,t,n,s,u,c)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Ib(h,"dropEnable",!0));var f=Ib(h,"filters");return f&&l.addFilters(f),ub(d(l),u,Lb,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),d(l)),l}return a(i,[{key:"files",get:function(){return this._files}}]),i}(Bb);Object.assign(jb.prototype,Rb),M.register("fileDropZone",(function(t){var e=new jb(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FileDropZone",jb);var zb=Phaser.Math.Wrap,Ab=function(t){l(i,t);var e=p(i);function i(t){var n;return r(this,i),(n=e.call(this,t,0,0,1,1)).isRexSpace=!0,n}return a(i)}(Phaser.GameObjects.Zone),Fb=function(t,e){var i=this.sizerChildren;if(0===i.length)return -1;for(var n=-1,s=1/0,r=0,o=i.length;r(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},Yb=Phaser.Utils.Objects.IsPlainObject,Wb=Phaser.Utils.Objects.GetValue,Vb=Phaser.Display.Align.CENTER,Xb={min:0,full:-1},Gb=function(t,e,i,s,r,o,a,h,l,u){wp.call(this,t);var c=t.isRexSpace,d=n(e);if(null===e)return this;if("number"===d);else if("string"===d)e=Xb[e];else if(Yb(e)){var f;e=Wb(f=e,"proportion",void 0),i=Wb(f,"align",Vb),s=Wb(f,"padding",0),r=Wb(f,"expand",!1),o=Wb(f,"key",void 0),a=Wb(f,"index",void 0),t.isRexSizer||(h=Wb(f,"minWidth",void 0),l=Wb(f,"minHeight",void 0)),u=Wb(f,"fitRatio",0);}return "string"==typeof i&&(i=Hf[i]),void 0===e&&(e=c?1:0),void 0===i&&(i=Vb),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=i,f.padding=xp(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?Lr(t):h:t.minHeight=void 0===l?Br(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},Hb={add:Gb,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),Gb.call(this,new Ab(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return Yb(i)&&(i.index=t),Gb.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=Fb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Ub=Phaser.Utils.Array.Remove,Nb={remove:function(t,e){return this.getParentSizer(t)!==this||(Ub(this.sizerChildren,t),_p.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ok.call(this,t),this}},Kb={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Hf[e]),this.getSizerConfig(t).align=e,this}},Jb={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=Ap.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(Jb,Hb,Nb,Kb,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var Zb=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},qb={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},$b=function(t){return "string"==typeof t&&(t=qb[t]),t},Qb=Phaser.Utils.Objects.IsPlainObject,tx=Phaser.Utils.Objects.GetValue,ex=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),Qb(n)?(n=tx(l=n,"x",0),s=tx(l,"y",0),o=tx(l,"width",void 0),a=tx(l,"height",void 0),h=tx(l,"orientation",0)):Qb(o)?(o=tx(l=o,"width",void 0),a=tx(l,"height",void 0),h=tx(l,"orientation",0)):Qb(h)&&(h=tx(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,n,s,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(tx(l,"space.item",0)),u.setStartChildIndex(tx(l,"startChildIndex",0)),u.setRTL(tx(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return a(i,[{key:"setOrientation",value:function(t){return this.orientation=$b(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=Zb.call(this)),this._childrenProportion}}]),i}(mk);Object.assign(ex.prototype,Jb);var ix=function(t,e,i){if(t){var n=null==e,s=null==i;return n&&s||(n||(t.displayWidth=e),s||(t.displayHeight=i),n&&(t.scaleX=t.scaleY),s&&(t.scaleY=t.scaleX)),t}},nx={appendText:Ri,resetDisplayContent:function(t){void 0===t?t={}:"string"==typeof t&&(t={text:t});var e=t.text||"";this.setText(e);var i=this.childrenMap.icon;if(i){t.icon?this.show(i):this.hide(i);var n=t.iconSize;n&&(this.setChildDisplaySize(i,n,n),void 0!==this.iconWidth&&this.setIconSize(n)),!0!==t.icon&&this.setIconTexture(t.icon,t.iconFrame);}var s=this.childrenMap.action;if(s){t.action?this.show(s):this.hide(s);var r=t.actionSize;r&&(this.setChildDisplaySize(s,r,r),void 0!==this.actionWidth&&this.setActionSize(r)),!0!==t.action&&this.setActionTexture(t.action,t.actionFrame);}return this}},sx=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"text",get:function(){var t=this.childrenMap.text;return t?t.text:""},set:function(t){var e=this.childrenMap.text;e&&e.setText(t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"setIconTexture",value:function(t,e){var i=this.childrenMap.icon;return i?(i.setTexture(t,e),void 0!==this.iconWidth&&void 0!==this.iconHeight&&(ix(i,this.iconWidth,this.iconHeight),this.resetChildScaleState(i)),this):this}},{key:"setTexture",value:function(t,e){return this.setIconTexture(t,e),this}},{key:"setIconSize",value:function(t,e){return void 0===e&&(e=t),this.iconWidth=t,this.iconHeight=e,this}},{key:"texture",get:function(){var t=this.childrenMap.icon;if(t)return t.texture}},{key:"frame",get:function(){var t=this.childrenMap.icon;if(t)return t.frame}},{key:"setActionTexture",value:function(t,e){var i=this.childrenMap.action;return void 0===i||(i.setTexture(t,e),void 0!==this.actionWidth&&void 0!==this.actionHeight&&(ix(i,this.actionWidth,this.actionHeight),this.resetChildScaleState(i))),this}},{key:"actionTexture",get:function(){var t=this.childrenMap.action;if(t)return t.texture}},{key:"actionFrame",get:function(){var t=this.childrenMap.action;if(t)return t.frame}},{key:"setActionSize",value:function(t,e){return void 0===e&&(e=t),this.actionWidth=t,this.actionHeight=e,this}},{key:"preLayout",value:function(){var t=this.childrenMap.icon;t&&void 0!==this.iconWidth&&void 0!==this.iconHeight&&ix(t,this.iconWidth,this.iconHeight);var e=this.childrenMap.action;e&&void 0!==this.actionWidth&&void 0!==this.actionHeight&&ix(e,this.actionWidth,this.actionHeight),g(u(i.prototype),"preLayout",this).call(this);}},{key:"postLayout",value:function(t,e,i){var n=this.childrenMap.iconMask;n&&(n.setPosition(),this.resetChildPositionState(n));var s=this.childrenMap.actionMask;return s&&(s.setPosition(),this.resetChildPositionState(s)),this}},{key:"resize",value:function(t,e){g(u(i.prototype),"resize",this).call(this,t,e);var n=this.childrenMap.iconMask;n&&n.resize();var s=this.childrenMap.actionMask;return s&&s.resize(),this}}]),i}(ex);Object.assign(sx.prototype,nx);var rx=function(t,e,i,n){var s=new Tm(e,i,n);if(t&&!t.isRexSizer){var r=s.createGeometryMask();t.setMask(r),this.once("destroy",(function(){t.setMask(),r.destroy();}));}return this.pin(s),s},ox=Phaser.Utils.Objects.GetValue,ax=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexLabel";var o=ox(n,"background",void 0),a=ox(n,"icon",void 0),h=ox(n,"iconMask",void 0),l=ox(n,"text",void 0),u=ox(n,"action",void 0),c=ox(n,"actionMask",void 0),f=ox(n,"align",void 0);if(o&&s.addBackground(o),"right"!==f&&"bottom"!==f&&"center"!==f||s.addSpace(),a){0===s.orientation?(l||u)&&(x={right:ox(n,"space.icon",0),top:ox(n,"space.iconTop",0),bottom:ox(n,"space.iconBottom",0),left:ox(n,"space.iconLeft",0)}):(l||u)&&(x={bottom:ox(n,"space.icon",0),left:ox(n,"space.iconLeft",0),right:ox(n,"space.iconRight",0),top:ox(n,"space.iconTop",0)});var p=ox(n,"squareFitIcon",!1)?1:0;if(s.add(a,{proportion:0,padding:x,fitRatio:p}),h&&(h=rx.call(d(s),a,a,1)),!p){var v=ox(n,"iconSize",void 0);s.setIconSize(ox(n,"iconWidth",v),ox(n,"iconHeight",v));}}if(l){var g,y,k=ox(n,"space.text",0),m=ox(n,"expandTextWidth",!1),b=ox(n,"expandTextHeight",!1);0===s.orientation?(g=m?1:0,u&&(x={right:k}),y=b):(g=b?1:0,u&&(x={bottom:k}),y=m),s.add(l,{proportion:g,expand:y,padding:x});}if(u){var x;x=0===s.orientation?{top:ox(n,"space.actionTop",0),bottom:ox(n,"space.actionBottom",0),right:ox(n,"space.actionRight",0)}:{left:ox(n,"space.actionLeft",0),right:ox(n,"space.actionRight",0),bottom:ox(n,"space.actionBottom",0)};p=ox(n,"squareFitAction",!1)?1:0;if(s.add(u,{proportion:0,padding:x,fitRatio:p}),c&&(c=rx.call(d(s),u,u,1)),!p){var C=ox(n,"actionSize");s.setActionSize(ox(n,"actionWidth",C),ox(n,"actionHeight",C));}}return "center"===f&&s.addSpace(),s.addChildrenMap("background",o),s.addChildrenMap("icon",a),s.addChildrenMap("iconMask",h),s.addChildrenMap("text",l),s.addChildrenMap("action",u),s.addChildrenMap("actionMask",c),s}return a(i)}(sx),hx=Phaser.Utils.Objects.GetValue,lx=function(t,e){var i=hx(e,"canvas"),n=hx(i,"width",128),s=hx(i,"height",128),r=new Bc(t,0,0,n,s);t.add.existing(r);var o=hx(i,"key"),a=hx(i,"frame"),h=hx(i,"fill");return void 0!==h?r.fill(h):void 0!==o&&r.loadTexture(o,a),r.setTexture=r.loadTexture.bind(r),r},ux=Phaser.Utils.Objects.GetValue,cx=function(t,e){var i=ux(e,"clickTarget",t);return "string"==typeof i&&(i=t.getElement(i)),i},dx=Phaser.Utils.Objects.GetValue,fx={accept:"image/*",multiple:!1},px=function(t,e){if(0!==e.length){var i=t.childrenMap.icon,n=i.image,s=e[0];return n.loadFromFilePromise(s).then((function(){i.scaleImage(),t.emit("select",s,self);}))}},vx={openPromise:function(){var t,e=this;return (t=i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e,t.abrupt("return",xb(e.scene.game,fx).then((function(t){return px(n,t.files)})));case 2:case"end":return t.stop()}}),t)})),function(){var e=this,i=arguments;return new Promise((function(n,r){var o=t.apply(e,i);function a(t){s(o,n,r,a,h,"next",t);}function h(t){s(o,n,r,a,h,"throw",t);}a(void 0);}))})()},open:function(){return this.openPromise(),this}},gx={saveTexture:function(t){return this.childrenMap.canvas.generateTexture(t),this}};Object.assign(gx,vx);var yx=Phaser.Utils.Objects.GetValue,kx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=function(t,e){var i=new sb(t,{scaleUp:hx(e,"scaleUpIcon",!0),image:lx(t,e)});return t.add.existing(i),i}(t,n);n.icon=o,(s=e.call(this,t,n)).type="rexImageFileInputLabel";var a=s.iconWidth,h=s.iconWidth;return void 0!==a&&void 0!==h&&o.resize(a,h),s.clickTarget=cx(d(s),n),s.clickTarget&&(yx(n,"domButton",!1)?s.fileChooser=function(t,e){var i=t.scene,n=new Mb(i,fx);return i.add.existing(n),t.pin(n),n.on("change",(function(){px(t,n.files);})),n}(d(s)):s.clickBehavior=function(t,e){var i=cx(t,e);if(i){var n=dx(e,"click"),s=new pc(i,n);return s.on("click",t.open,t),s}}(d(s),n)),s.addChildrenMap("canvas",o.image),s.addChildrenMap("fileChooser",s.fileChooser),s}return a(i,[{key:"postLayout",value:function(){this.fileChooser&&(this.fileChooser.syncTo(this.clickTarget),this.resetChildState(this.fileChooser));}}]),i}(ax);Object.assign(kx.prototype,gx),M.register("imageInputLabel",(function(t){var e=new kx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ImageInputLabel",kx);var mx=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(cr(t,e))return t[e];var i=t.parent;return cr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return cr(t,e)?t[e]=i:cr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(ho),bx=Phaser.Utils.Objects.GetValue,xx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).style=bx(n,"style",d(s));var o=bx(n,"propertiesMap");return s.activeStyle=Cx(n,"active",o),s.hoverStyle=Cx(n,"hover",o),s.disableStyle=Cx(n,"disable",o),s.onModifyStyle=bx(n,"onModifyStyle"),s}return a(i,[{key:"getStyle",value:function(t){return Vl(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return Xl(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return wx.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return wx.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return wx.call(this,"disable",t),this}}]),i}(ho),Cx=function(t,e,i){var n=Wl(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},wx=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Sx={addStyleManager:function(t){return this.styleManager=new xx(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},Px=Phaser.GameObjects.Image,Tx=Phaser.Utils.Objects.GetValue,Ox=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Tx(n,"x",0),a=Tx(n,"y",0),h=Tx(n,"key",""),l=Tx(n,"frame",void 0);(s=e.call(this,t,o,a,h,l)).type="rexStatesImage";var u=Tx(n,"effects",!0);return u&&gr(d(s),u),s.style=new mx(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Px);Object.assign(Ox.prototype,Sx),M.register("statesImage",(function(t){var e=new Ox(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesImage",Ox);var Mx=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexStatesRoundRectangleShape",n.style=d(s),n.propertiesMap=Ex,s.addStyleManager(n),delete n.style,delete n.propertiesMap,s}return a(i)}(oe),Ex={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Mx.prototype,Sx),M.register("statesRoundRectangle",(function(t){var e=new Mx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesRoundRectangle",Mx);var _x=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(cr(t,e))return t[e];var i=t.parent;return cr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return cr(t,e)?t[e]=i:cr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(ho),Rx=Phaser.GameObjects.NineSlice,Lx=Phaser.Utils.Objects.GetValue,Bx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Lx(n,"x",0),a=Lx(n,"y",0),h=Lx(n,"key",null),l=Lx(n,"frame",null),u=Lx(n,"width",0),c=Lx(n,"height",0),f=Lx(n,"leftWidth",0),p=Lx(n,"rightWidth",0),v=Lx(n,"topHeight",0),g=Lx(n,"bottomHeight",0);(s=e.call(this,t,o,a,h,l,u,c,f,p,v,g)).type="rexStatesNineSlice";var y=Lx(n,"effects",!0);return y&&gr(d(s),y),s.style=new _x(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Rx);Object.assign(Bx.prototype,Sx),M.register("statesNineSlice",(function(t){var e=new Bx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesNineSlice",Bx);var Dx=Phaser.GameObjects.Text,Ix=Phaser.Utils.Objects.GetValue,jx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Ix(n,"x",0),a=Ix(n,"y",0),h=Ix(n,"text","");return (s=e.call(this,t,o,a,h,n)).type="rexStatesText",n.style=s.style,n.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},s.addStyleManager(n),delete n.style,s}return a(i)}(Dx);Object.assign(jx.prototype,Sx),M.register("statesText",(function(t){var e=new jx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesText",jx);var zx=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},Ax=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return a(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(g(u(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Bc),Fx={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,zx(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return Nx(this.sizerChildren,null),Ok.call(this,t),this}},Jx={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Nx(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Qx={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=Ap.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,Nx(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Nx(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},eC=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},iC=Phaser.Utils.Objects.IsPlainObject,nC=Phaser.Utils.Objects.GetValue,sC=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u,c,d){var f;return r(this,i),iC(n)?(n=nC(d=n,"x",0),s=nC(d,"y",0),o=nC(d,"width",void 0),a=nC(d,"height",void 0),h=nC(d,"column",d.col||0),l=nC(d,"row",0),u=nC(d,"columnProportions",0),c=nC(d,"rowProportions",0)):iC(o)?(o=nC(d=o,"width",void 0),a=nC(d,"height",void 0),h=nC(d,"column",d.col||0),l=nC(d,"row",0),u=nC(d,"columnProportions",0),c=nC(d,"rowProportions",0)):iC(h)?(h=nC(d=h,"column",d.col||0),l=nC(d,"row",0),u=nC(d,"columnProportions",0),c=nC(d,"rowProportions",0)):iC(u)&&(u=nC(d=u,"columnProportions",0),c=nC(d,"rowProportions",0)),(f=e.call(this,t,n,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(nC(d,"createCellContainerCallback")),f.setIndentLeft(nC(d,"space.indentLeftOdd",0),nC(d,"space.indentLeftEven",0)),f.setIndentTop(nC(d,"space.indentTopOdd",0),nC(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,nC(d,"space",void 0)),f}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{key:"setColumnProportion",value:function(t,e){return t>=this.columnProportions.length||(this.columnProportions[t]=e),this}},{key:"setRowProportion",value:function(t,e){return t>=this.rowProportions.length||(this.rowProportions[t]=e),this}},{key:"totalColumnProportions",get:function(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=tC.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=eC.call(this)),this._totalRowProportions}},{key:"getChildAt",value:function(t,e){return this.sizerChildren[e*this.columnCount+t]}},{key:"childToGridIndex",value:function(t,e){if(!t)return null;var i=this.sizerChildren.indexOf(t);return -1===i?null:(void 0===e&&(e={}),e.x=i%this.columnCount,e.y=Math.floor(i/this.columnCount),e)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(mk);Object.assign(sC.prototype,Qx),M.register("gridSizer",(function(t,e,i,n,s,r,o,a,h){var l=new sC(this.scene,t,e,i,n,s,r,o,a,h);return this.scene.add.existing(l),l})),$(window,"RexPlugins.UI.GridSizer",sC);var rC=function(t,e,i,n){return e/t<=i?e/(n-1):0},oC=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=lC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=lC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},cC=Phaser.Utils.Objects.IsPlainObject,dC=Phaser.Utils.Objects.GetValue,fC=Phaser.Display.Align.CENTER,pC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(wp.call(this,t),cC(e))&&(e=dC(s=e,"padding",0),i=dC(s,"key",void 0),n=dC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=fC,s.padding=xp(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},vC={add:function(t,e,i){if(xg(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ok.call(this,t),this}},kC={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)nw.call(this,e[i],t);return this}},rw=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},ow=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,rw.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},aw={add:function(t){return this.buttons.push(t),t._click||(t._click=new pc(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),ow.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)ww.call(this,e[i],t);return this}},Pw=Phaser.Utils.Objects.GetValue,Tw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Pw(n,"row",0),a=Pw(n,"column",n.col||0),h=Pw(n,"createCellContainerCallback"),l=Pw(n,"buttons",void 0),u=Pw(n,"expand",!0),c=u?1:0;if(h&&(n.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&Ow.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Lw.call(this,e[i],t);return this}},Dw=Phaser.Utils.Objects.GetValue,Iw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=n.space;"number"==typeof o&&(n.space={item:o,line:o}),(s=e.call(this,t,n)).type="rexFixWidthButtons",s.buttonGroup=new pw({parent:d(s),eventEmitter:Dw(n,"eventEmitter",d(s)),groupName:Dw(n,"groupName",void 0),clickConfig:Dw(n,"click",void 0)}).setButtonsType(n);var a=Dw(n,"background",void 0),h=Dw(n,"buttons",void 0);return s.buttonsAlign=Dw(n,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(wC);Object.assign(Iw.prototype,Ew,Bw,fw,gw),M.register("fixWidthButtons",(function(t){var e=new Iw(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FixWidthButtons",Iw);var jw=Phaser.Utils.Objects.GetValue,zw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexFileSelectorButton";var o=new Mb(t);return t.add.existing(o),s.addBackground(o),s.addChildrenMap("fileChooser",o),s.setAccept(jw(n,"accept","")),s.setMultiple(jw(n,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),d(s)),s}return a(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(ax);Object.assign(zw.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}}),M.register("fileSelectorButton",(function(t){var e=new zw(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FileSelectorButton",zw);var Aw={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},Fw={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,mg.modal.call(this,t,e),this}},Yw={};Object.assign(Yw,Aw,Fw);var Ww=Phaser.Utils.Objects.GetValue,Vw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexDialog",s.eventEmitter=Ww(n,"eventEmitter",d(s));var o,a,h,l,u=Ww(n,"background",void 0),c=Ww(n,"title",void 0),f=Ww(n,"toolbar",void 0),p=Ww(n,"toolbarBackground",void 0),v=Ww(n,"leftToolbar",void 0),g=Ww(n,"leftToolbarBackground",void 0),y=Ww(n,"content",void 0),k=Ww(n,"description",void 0),m=Ww(n,"choices",void 0),b=Ww(n,"choicesBackground",void 0),x=Ww(n,"actions",void 0),C=Ww(n,"actionsBackground",void 0),w=Ww(n,"click",void 0);if(u&&s.addBackground(u),f&&(h=new kw(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Ww(n,"space.toolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),v&&(l=new kw(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Ww(n,"space.leftToolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),c||f||v){var S,P=!!c&&Ww(n,"expand.title",!0),T=Ww(n,"align.title","center"),O=!(c&&!P&&"center"===T||!c&&(f||v));S=O?new ex(t,{orientation:0}):new Bk(t);var M=!!O||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),c){O&&!P&&"right"===T&&S.addSpace();var E={left:Ww(n,"space.titleLeft",0),right:Ww(n,"space.titleRight",0)},_=P?1:0;S.add(c,{align:T,proportion:_,expand:M,padding:E}),O&&!P&&"left"===T&&S.addSpace();}h&&(O&&!c&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||x)&&(E={bottom:Ww(n,"space.title",0),top:Ww(n,"space.titleTop",0)});_=Ww(n,"proportion.title",0);s.add(S,{padding:E,proportion:_,expand:!0});}if(y){var R=Ww(n,"align.content","center"),L=Ww(n,"space.content",0),B=(E={left:Ww(n,"space.contentLeft",0),right:Ww(n,"space.contentRight",0),bottom:k||m||x?L:0},_=Ww(n,"proportion.content",0),Ww(n,"expand.content",!0));s.add(y,{align:R,padding:E,proportion:_,expand:B});}if(k){R=Ww(n,"align.description","center");var D=Ww(n,"space.description",0);E={left:Ww(n,"space.descriptionLeft",0),right:Ww(n,"space.descriptionRight",0),bottom:m||x?D:0},_=Ww(n,"proportion.description",0),B=Ww(n,"expand.description",!0);s.add(k,{align:R,padding:E,proportion:_,expand:B});}if(m){var I=Ww(n,"choicesType","").split("-"),j=Xw(I,"wrap")?Iw:Xw(I,"grid")?Tw:kw,z=Xw(I,"radio")?"radio":Xw(I,"checkboxes")?"checkboxes":void 0,A={left:Ww(n,"space.choicesBackgroundLeft",0),right:Ww(n,"space.choicesBackgroundRight",0),top:Ww(n,"space.choicesBackgroundTop",0),bottom:Ww(n,"space.choicesBackgroundBottom",0)},F=Ww(n,"space.choice",0);j===kw?A.item=F:j===Iw?(A.item=F,A.line=Ww(n,"space.choiceLine",F)):(A.column=Ww(n,"space.choiceColumn",F),A.row=Ww(n,"space.choiceRow",F));var Y={width:Ww(n,"choicesWidth",void 0),height:Ww(n,"choicesHeight",void 0),groupName:"choices",buttonsType:z,background:b,buttons:m,space:A,click:w,eventEmitter:s.eventEmitter,setValueCallback:Ww(n,"choicesSetValueCallback",void 0),setValueCallbackScope:Ww(n,"choicesSetValueCallbackScope",void 0)};j===kw&&(Y.orientation=Xw(I,"x")?0:1),o=new j(t,Y);var W=Ww(n,"space.choices",0);E={left:Ww(n,"space.choicesLeft",0),right:Ww(n,"space.choicesRight",0),bottom:x?W:0},R=Ww(n,"align.choices","center"),_=Ww(n,"proportion.choices",0),B=Ww(n,"expand.choices",!0);s.add(o,{align:R,padding:E,proportion:_,expand:B}),s.buttonsType=z;}if(x){a=new kw(t,{groupName:"actions",background:C,buttons:x,orientation:0,space:{item:Ww(n,"space.action",0)},expand:Ww(n,"expand.actions",!1),align:Ww(n,"align.actions","center"),click:w,eventEmitter:s.eventEmitter});E={left:Ww(n,"space.actionsLeft",0),right:Ww(n,"space.actionsRight",0),bottom:Ww(n,"space.actionsBottom",0)},_=Ww(n,"proportion.action",0);s.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Hw(d(s),"click"),Hw(d(s),"over"),Hw(d(s),"out"),Hw(d(s),"enable"),Hw(d(s),"disable"),s.addChildrenMap("background",u),s.addChildrenMap("title",c),s.addChildrenMap("toolbar",f),s.addChildrenMap("leftToolbar",v),s.addChildrenMap("content",y),s.addChildrenMap("description",k),s.addChildrenMap("choices",o?o.buttons:void 0),s.addChildrenMap("actions",a?a.buttons:void 0),s.addChildrenMap("choicesSizer",o),s.addChildrenMap("actionsSizer",a),s.addChildrenMap("toolbarSizer",h),s.addChildrenMap("leftToolbarSizer",l),s}return a(i)}(ex),Xw=function(t,e){return -1!==t.indexOf(e)},Gw={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Hw=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Gw.hasOwnProperty(n)&&t.emit("".concat(Gw[n],".").concat(e),i,s,r,o);}));};Object.assign(Vw.prototype,Yw),M.register("dialog",(function(t){var e=new Vw(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Dialog",Vw);var Uw=function(t,e,i){var n=new zC(t,e,i);return t.add.existing(n),n},Nw=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Kw=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Jw=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(Hv),AS=Phaser.Utils.Objects.GetValue,FS=Phaser.Math.Distance.Between,YS=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(AS(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(AS(t,"enable",!0)),this.holdThreshold=AS(t,"holdThreshold",50),this.pointerOutReleaseEnable=AS(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return hu(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:FS(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(ho),WS=Phaser.Utils.Objects.GetValue,VS=function(){function t(e){r(this,t),this.resetFromJSON(e);}return a(t,[{key:"resetFromJSON",value:function(t){return this.setValue(WS(t,"value",0)),this.setSpeed(WS(t,"speed",0)),this.setAcceleration(WS(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),XS=function(){function t(){r(this,t),this.value,this.dir,this.movement=new VS;}return a(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(ho),NS={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},KS=Phaser.Utils.Objects.GetValue,JS=function(t){l(i,t);var e=p(i);function i(t,n){var s;(r(this,i),(s=e.call(this,t,n)).parent!==s.scene?s.focusMode=KS(n,"focus",!0):s.focusMode=!1,s.setSpeed(KS(n,"speed",.1)),s.setEnable(KS(n,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(KS(n,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),d(s)):s.scene.input.on("wheel",s.onSceneScroll,d(s));return s}return a(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(ho),ZS=Phaser.Utils.Objects.GetValue,qS=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?ZS(n,c,void 0):ZS(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=Qe(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new jS(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=ZS(s,"position",0);"string"==typeof v&&(v=$S[v]);var g=ZS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=ZS(n,"space.slider",void 0))&&(g=l?0:ZS(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=ZS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=ZS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=ZS(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?ZS(n,k,!0):ZS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new US(u,o));var m,b,x,C,w=ZS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new JS(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",C="scroll".concat(i)):(b="t",C="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(C,t);})));a&&(l?(x="childO".concat(i),C="scroll".concat(i)):(x="childOY",C="scroll"),a.on("valuechange",(function(e){t[x]=e,t.emit(C,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},$S={right:0,left:1,bottom:0,top:1},QS=Phaser.Utils.Objects.GetValue,tP=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=QS(e,"width"),o=QS(e,"height");r||(QS(e,"child.expandWidth",!0)||(n[1]=0));o||(QS(e,"child.expandHeight",!0)||(s[1]=0));var a=new sC(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=aS(i,"child"),s=aS(n,"gameObject",void 0);if(s){var r=aS(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=aS(r,"top",0),o.bottom=aS(r,"bottom",0),a.left=aS(r,"left",0),a.right=aS(r,"right",0);break;case 1:o.top=aS(r,"left",0),o.bottom=aS(r,"right",0),a.top=aS(r,"top",0),a.bottom=aS(r,"bottom",0);break;default:o.top=aS(r,"top",0),o.bottom=aS(r,"bottom",0),o.left=aS(r,"left",0),o.right=aS(r,"right",0);}e.add(s,{column:1,row:1,align:aS(n,"align","center"),padding:a,expand:{width:aS(n,"expandWidth",!0),height:aS(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:qS(t,a,"y",e);break;case 1:qS(t,a,"x",e);break;default:qS(t,a,"y",e),qS(t,a,"x",e);}return a},eP=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},iP=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},nP=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},cP=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},dP=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},fP=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},pP=function(t,e){switch(lP(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},vP=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&gP.call(this);},gP=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},yP=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},kP={setText:function(t){return void 0!==t&&(this.text=t),this.lines=uP(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(cP.call(this,-this.textOY)),0),e=dP.call(this,t)+this.textOY,i=fP.call(this,t);return pP(this.textObject,i),this.textObject.rexSizer.offsetY=e,vP.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Yp.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,yP.call(this,t,r,o),vp(t,n,s,r,o,e.align),e.preOffsetY=0,vP.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},mP=Phaser.Utils.Objects.IsPlainObject,bP=Phaser.Utils.Objects.GetValue,xP=Phaser.Display.Align.TOP_LEFT,CP=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),mP(n)?(n=bP(h=n,"x",0),s=bP(h,"y",0),o=bP(h,"width",void 0),a=bP(h,"height",void 0)):mP(o)&&(o=bP(h=o,"width",void 0),a=bP(h,"height",void 0)),(l=e.call(this,t,n,s,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=bP(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(bP(h,"clamplTextOY",!0)),l.alwaysScrollable=bP(h,"alwaysScrollable",!1);var u=bP(h,"background",void 0),c=bP(h,"text",void 0);void 0===c&&(c=wP(t)),l.textCropEnable=bP(h,"textCrop",!!c.setCrop);var f=bP(h,"textMask",!l.textCropEnable);u&&l.addBackground(u),l.add(c),l.sizerChildren=[c];var p=l.getSizerConfig(c);return p.align=xP,p.padding=xp(0),p.expand=!0,l.textObject=c,l.textObjectType=lP(c),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=rx.call(d(l),l.textObject,d(l))),l.addChildrenMap("background",u),l.addChildrenMap("text",c),l}return a(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}g(u(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(cP.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=dP.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(mk),wP=function(t){return t.add.text(0,0,"")};Object.assign(CP.prototype,kP);var SP={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},PP=Phaser.Utils.Objects.GetValue,TP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=PP(n,"text",void 0),a=PP(n,"textWidth",void 0),h=PP(n,"textHeight",void 0),l=PP(n,"textCrop",!!o.setCrop),u=PP(n,"textMask",!l),c=PP(n,"content",""),d=new CP(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:PP(n,"clamplChildOY",!1),alwaysScrollable:PP(n,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),n.scrollMode=0,n.type="rexTextArea",n.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=PP(n,"space",void 0);return f&&(f.child=PP(f,"text",0)),(s=e.call(this,t,n)).addChildrenMap("text",o),s}return a(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(aP);Object.assign(TP.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},SP);var OP=Phaser.Utils.Objects.GetValue,MP=function(t,e,i){e=e?_(e):{};var n=OP(i,"background",PC),s=OP(i,"text",MC),r=OP(i,"track",PC),o=OP(i,"thumb",PC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new TP(t,e);return t.add.existing(h),h},EP=Phaser.Utils.Objects.GetValue,_P=Phaser.Utils.Objects.GetValue,RP=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;r(this,i),n=n?_(n):{},void 0===s&&(s={});var a=_P(s,"background",PC);a?n.background=a(t,n.background):delete n.background,n.title=Uw(t,n.title,s.title),n.content=function(t,e,i){var n,s=EP(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new MP(t,e,i):new Uw(t,e,i);return t.add.existing(n),n}(t,n.content,s.content),n.content instanceof TP&&Yl(n,"height")&&!Yl(n,"proportion.content")&&$(n,"proportion.content",1);var h=n.button,l=n.buttonA||h,u=n.buttonB||h,c=n.buttonMode;void 0===c&&(c=l&&u?2:l?1:0);var f=s.button,p=s.buttonA||f,v=s.buttonB||f;switch(c){case 2:n.actions=[Uw(t,l,p),Uw(t,u,v)];break;case 1:n.actions=[Uw(t,l,p)];break;case 0:break;default:n.actions=[];}var g=n.choice;g&&(n.choices=[]),(o=e.call(this,t,n)).type="rexConfirmDialog",o.buttonMode=c,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=s.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),nS.call(d(o)),o}return a(i)}(Vw);Object.assign(RP.prototype,qw),M.register("confirmDialog",(function(t,e){var i=new RP(this.scene,t,e);return this.scene.add.existing(i),i})),$(window,"RexPlugins.UI.ConfirmDialog",RP);var LP=Phaser.Utils.Objects.GetValue,BP=function(t,e,i){var n=LP(t,"proportion.".concat(e),i.proportion),s=LP(t,"align.".concat(e),"center"),r=LP(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:LP(t,"expand.".concat(e),!0)}},DP=function(t){return BP(t,"header",{proportion:0,paddingKey:"bottom"})},IP=function(t){return BP(t,"leftSide",{proportion:0,paddingKey:"right"})},jP=function(t){return BP(t,"content",{proportion:1})},zP=function(t){return BP(t,"rightSide",{proportion:0,paddingKey:"left"})},AP=function(t){return BP(t,"footer",{proportion:0,paddingKey:"top"})},FP=function(t,e){var i=new ex(t,{orientation:e});return t.add.existing(i),i},YP=Phaser.Utils.Objects.GetValue,WP=[function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,IP(t));var r=t.content;r&&n.add(r,jP(t));var o=t.rightSide;o&&n.add(o,zP(t));var a=t.footer;a&&this.add(a,AP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,IP(t));var r=FP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=FP(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,jP(t));var h=t.rightSide;h&&o.add(h,zP(t));var l=t.footer;l&&r.add(l,AP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=FP(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=FP(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,IP(t));var a=t.content;a&&r.add(a,jP(t));var h=t.footer;h&&s.add(h,AP(t));var l=t.rightSide;l&&n.add(l,zP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,IP(t));var r=FP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,jP(t));var a=t.footer;a&&r.add(a,AP(t));var h=t.rightSide;h&&n.add(h,zP(t));}],VP={FFF:0,LFF:1,FFR:2,LFR:3},XP=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexHolyGrail",s.build(n),s}return a(i)}(ex),GP={build:function(t){this.clear(!0);var e=YP(t,"background",void 0);e&&this.addBackground(e);var i=YP(t,"layoutMode",0);"string"==typeof i&&(i=VP[i.toUpperCase()]),(WP[i]||WP[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(XP.prototype,GP),M.register("holyGrail",(function(t){var e=new XP(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.HolyGrail",XP);var HP={getButtonsSizer:function(t){return this.childrenMap["".concat(t,"ButtonsSizer")]},getButton:function(t,e){var i=this.getButtonsSizer(t);return i?i.getButton(e):void 0},setButtonEnable:function(t,e,i){return this.getButtonsSizer(t).setButtonEnable(e,i),this},setLeftButtonEnable:function(t,e){return this.childrenMap.leftButtonsSizer.setButtonEnable(t,e),this},setRightButtonEnable:function(t,e){return this.childrenMap.rightButtonsSizer.setButtonEnable(t,e),this},setTopButtonEnable:function(t,e){return this.childrenMap.topButtonsSizer.setButtonEnable(t,e),this},setBottomButtonEnable:function(t,e){return this.childrenMap.bottomButtonsSizer.setButtonEnable(t,e),this},toggleButtonEnable:function(t,e){return this.getButtonsSizer(t).toggleButtonEnable(e),this},toggleLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.toggleButtonEnable(t),this},toggleRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.toggleButtonEnable(t),this},toggleTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.toggleButtonEnable(t),this},toggleBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.toggleButtonEnable(t),this},getButtonEnable:function(t,e){return this.getButtonsSizer(t).getButtonEnable(e)},getLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.getButtonEnable(t)},getRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.getButtonEnable(t)},getTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.getButtonEnable(t)},getBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.getButtonEnable(t)},emitButtonClick:function(t,e){var i=this.getButtonsSizer(t);return i?(i.emitButtonClick(e),this):this},emitLeftButtonClick:function(t){return this.childrenMap.leftButtonsSizer.emitButtonClick(t),this},emitRightButtonClick:function(t){return this.childrenMap.rightButtonsSizer.emitButtonClick(t),this},emitTopButtonClick:function(t){return this.childrenMap.topButtonsSizer.emitButtonClick(t),this},emitBottomButtonClick:function(t){return this.childrenMap.bottomButtonsSizer.emitButtonClick(t),this},getLeftButton:function(t){return this.childrenMap.leftButtonsSizer.getButton(t)},getRightButton:function(t){return this.childrenMap.rightButtonsSizer.getButton(t)},getTopButton:function(t){return this.childrenMap.topButtonsSizer.getButton(t)},getBottomButton:function(t){return this.childrenMap.bottomButtonsSizer.getButton(t)},showButton:function(t,e){return Lv(this.getButton(t,e)),this},showLeftButton:function(t){return Lv(this.getLeftButton(t)),this},showRightButton:function(t){return Lv(this.getRightButton(t)),this},showTopButton:function(t){return Lv(this.getTopButton(t)),this},showBottomButton:function(t){return Lv(this.getBottomButton(t)),this},hideButton:function(t,e){return Bv(this.getButton(t,e)),this},hideLeftButton:function(t){return Bv(this.getLeftButton(t)),this},hideRightButton:function(t){return Bv(this.getRightButton(t)),this},hideTopButton:function(t){return Bv(this.getTopButton(t)),this},hideBottomButton:function(t){return Bv(this.getBottomButton(t)),this},addButton:function(t,e){return this.getButtonsSizer(t).addButton(e),this},addLeftButton:function(t){return this.addButton("left",t),this},addRightButton:function(t){return this.addButton("right",t),this},addTopButton:function(t){return this.addButton("top",t),this},removeButton:function(t,e,i){return this.getButtonsSizer(t).removeButton(e,i),this},removeLeftButton:function(t,e){return this.removeButton("left",t,e),this},removeRightButton:function(t,e){return this.removeButton("right",t,e),this},removeTopButton:function(t,e){return this.removeButton("top",t,e),this},removeBottomButton:function(t,e){return this.removeButton("bottom",t,e),this},clearButtons:function(t,e){return this.getButtonsSizer(t).clearButtons(e),this},clearLeftButtons:function(t){return this.clearButtons("left",t),this},clearRightButtons:function(t){return this.clearButtons("right",t),this},clearTopButtons:function(t){return this.clearButtons("top",t),this},clearBottomButtonss:function(t){return this.clearButtons("bottom",t),this},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),this},forEachLeftButton:function(t,e){return this.childrenMap.leftButtonsSizer.forEachButtton(t,e),this},forEachRightButton:function(t,e){return this.childrenMap.rightButtonsSizer.forEachButtton(t,e),this},forEachTopButton:function(t,e){return this.childrenMap.topButtonsSizer.forEachButtton(t,e),this},forEachBottomButton:function(t,e){return this.childrenMap.bottomButtonsSizer.forEachButtton(t,e),this}},UP=Phaser.Utils.Objects.GetValue,NP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.column=3,n.row=3,(s=e.call(this,t,n)).type="rexTabs",s.eventEmitter=UP(n,"eventEmitter",d(s));var o,a,h,l,u=UP(n,"background",void 0),c=UP(n,"panel",void 0),f=UP(n,"leftButtons",void 0),p=UP(n,"leftButtonsBackground",void 0),v=UP(n,"rightButtons",void 0),g=UP(n,"rightButtonsBackground",void 0),y=UP(n,"topButtons",void 0),k=UP(n,"topButtonsBackground",void 0),m=UP(n,"bottomButtons",void 0),b=UP(n,"bottomButtonsBackground",void 0),x=UP(n,"click",void 0);if(u&&s.addBackground(u),c&&s.add(c,1,1,"center",0,!0),f){var C=UP(n,"space.leftButtonsOffset",0),w=UP(n,"space.leftButton",0);o=new kw(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:UP(n,"align.leftButtons",void 0),click:x,eventEmitter:s.eventEmitter});var S={top:C};s.add(o,0,1,"top",S,!1);}if(v){var P=UP(n,"space.rightButtonsOffset",0),T=UP(n,"space.rightButton",0);a=new kw(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:T},align:UP(n,"align.rightButtons",void 0),click:x,eventEmitter:s.eventEmitter});S={top:P};s.add(a,2,1,"top",S,!1);}if(y){var O=UP(n,"space.topButtonsOffset",0),M=UP(n,"space.topButton",0);h=new kw(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:UP(n,"align.topButtons",void 0),click:x,eventEmitter:s.eventEmitter});S={left:O};s.add(h,1,0,"left",S,!1);}if(m){var E=UP(n,"space.bottomButtonsOffset",0),_=UP(n,"space.bottomButton",0);l=new kw(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:UP(n,"align.bottomButtons",void 0),click:x,eventEmitter:s.eventEmitter});S={left:E};s.add(l,1,2,"left",S,!1);}return s.addChildrenMap("background",u),s.addChildrenMap("panel",c),s.addChildrenMap("leftButtons",f),s.addChildrenMap("rightButtons",v),s.addChildrenMap("topButtons",y),s.addChildrenMap("bottomButtons",m),s.addChildrenMap("leftButtonsSizer",o),s.addChildrenMap("rightButtonsSizer",a),s.addChildrenMap("topButtonsSizer",h),s.addChildrenMap("bottomButtonsSizer",l),s}return a(i)}(sC);Object.assign(NP.prototype,HP),M.register("tabs",(function(t){var e=new NP(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Tabs",NP),M.register("slider",(function(t){var e=new LS(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Slider",LS);var KP=function(){function t(e,i){r(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return a(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Hf[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(KP.prototype,St);var JP=Phaser.Utils.Objects.GetValue,ZP=Phaser.Utils.Array.SpliceOne,qP=function(){function t(e,i){r(this,t),this.parent=e,this.cells=[],this.cellPool=new ot,this.resetFromJSON(i);}return a(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(JP(t,"cellsCount",0)),this.setColumnCount(JP(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===n(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=fT(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===n(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var i,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},sO={down:0,up:1},rO=Phaser.Utils.Objects.GetValue,oO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=function(t,e){Kp(t,e,"y","Cubic");}),null==n.transitOut&&(n.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new Up(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),n.manualClose=!0,n.clickOutsideClose=!0,n.destroy=!0,s=e.call(this,t,n),nO(t,n),t.isRexSizer&&t.layout();var o=rO(n,"touchOutsideClose",!1),a=rO(n,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,d(s)):o&&s.once("open",s.touchOutsideClose,d(s)),s.requestOpen(),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&dg(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),g(u(i.prototype),"onClose",this).call(this);}}]),i}(Qv),aO={openListPanel:function(){if(this.listPanel)return this;var t,e=eO.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new oO(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(aO,QT);var hO=Phaser.Utils.Objects.GetValue,lO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexDropDownList",s.timer=void 0,s.setOptions(hO(n,"options"));var o=hO(n,"list");return s.setWrapEnable(hO(o,"wrap",!1)),s.setCreateButtonCallback(hO(o,"createButtonCallback")),s.setCreateListBackgroundCallback(hO(o,"createBackgroundCallback")),s.setButtonClickCallback(hO(o,"onButtonClick")),s.setButtonOverCallback(hO(o,"onButtonOver")),s.setButtonOutCallback(hO(o,"onButtonOut")),s.setListExpandDirection(hO(o,"expandDirection")),s.setListEaseInDuration(hO(o,"easeIn",500)),s.setListEaseOutDuration(hO(o,"easeOut",100)),s.setListTransitInCallback(hO(o,"transitIn")),s.settListTransitOutCallback(hO(o,"transitOut")),s.setListSize(hO(o,"width"),hO(o,"height")),s.setListAlignmentMode(hO(o,"alignParent","text")),s.setListAlignmentSide(hO(o,"alignSide","")),s.setListBounds(hO(o,"bounds")),s.setListSpace(hO(o,"space")),s.setListDraggable(hO(o,"draggable",!1)),s.setValueChangeCallback(hO(n,"setValueCallback"),hO(n,"setValueCallbackScope")),s.setValue(hO(n,"value")),s.onClick(s.toggleListPanel,d(s)),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(ax);Object.assign(lO.prototype,aO),M.register("dropDownList",(function(t){var e=new lO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.DropDownList",lO);var uO=function(t,e,i){void 0===i&&(i={});var n=(e=e?_(e):{}).label||e.button,s=e.button||e.label;delete e.label,delete e.button;var r=i.label||i.button||i,o=i.button||i.label||i,a=jC(t,n,r);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=Uw(t,s,o).resetDisplayContent({text:e.text});return e.hasOwnProperty("value")&&(i.value=e.value),i},a.list.onButtonOver=function(t,e,i,n){t.setHoverState&&t.setHoverState(!0);},a.list.onButtonOut=function(t,e,i,n){t.setHoverState&&t.setHoverState(!1);},a},cO=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),n=uO(t,n,s),(o=e.call(this,t,n)).type="rexSimpleDropDownList",o}return a(i,[{key:"setOptions",value:function(t){void 0===t&&(t=[]);for(var e=0,n=t.length;e=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=mO(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(lP(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(ho);Object.assign(bO.prototype,yO);var xO,CO=Phaser.Utils.Objects.GetFastValue,wO=Phaser.Utils.Objects.GetValue,SO=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).timer=null,s.resetFromJSON(n),s}return a(i,[{key:"resetFromJSON",value:function(t){this.setTextWrapEnable(wO(t,"wrap",!1)),this.setTypeMode(wO(t,"typeMode",0)),this.setTypingSpeed(wO(t,"speed",333)),this.setTextCallback=CO(t,"setTextCallback",null),this.setTextCallbackScope=CO(t,"setTextCallbackScope",null),this.setTypingContent(CO(t,"text","")),this.typingIdx=CO(t,"typingIdx",0),this.insertIdx=null,this.insertChar=null;var e=CO(t,"elapsed",null);return null!==e&&this.start(void 0,void 0,this.typingIdx,e),this}},{key:"shutdown",value:function(t){this.isShutdown||(this.freeTimer(),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"setTypeMode",value:function(t){return "string"==typeof t&&(t=TO[t]),this.typeMode=t,this}},{key:"setTypeSpeed",value:function(t){return this.speed=t,this}},{key:"setTypingSpeed",value:function(t){return this.speed=t,this}},{key:"setTextWrapEnable",value:function(t){return void 0===t&&(t=!0),this.textWrapEnable=t,this}},{key:"text",get:function(){return this._text},set:function(t){var e=PO(t);this.textWrapEnable&&(e=function(t,e){switch(lP(t)){case 0:t.style.syncFont(t.canvas,t.context),e=t.runWordWrap(e);break;case 1:e=t.getText(e,void 0,void 0,!0);break;case 2:e=t.setText(e).getTextBounds().wrappedText;}return e}(this.parent,e)),this._text=e;}},{key:"isTyping",get:function(){return null!==this.getTimer()}},{key:"isLastChar",get:function(){return this.typingIdx===this.textLen}},{key:"start",value:function(t,e,i,n){return void 0!==t&&this.setTypingContent(t),void 0!==e&&(this.speed=e),void 0===i&&(i=0),this.typingIdx=i+1,0===this.speed?this.stop(!0):(this.setText(""),this.startTimer(n)),this}},{key:"appendText",value:function(t){var e=this.text.concat(PO(t));return this.isTyping?this.setTypingContent(e):this.start(e,void 0,this.textLen),this}},{key:"stop",value:function(t){if(this.getTimer()&&this.freeTimer(),t){for(;!this.isLastChar;)this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode),this.emit("typechar",this.insertChar),this.typingIdx++;this.setText(this.text),this.emit("type"),this.emit("complete",this,this.parent);}return this}},{key:"pause",value:function(){var t=this.getTimer();return t&&(t.paused=!0),this}},{key:"resume",value:function(){var t=this.getTimer();return t&&(t.paused=!1),this}},{key:"setTypingContent",value:function(t){return this.text=t,this.textLen=this.getTextLength(this.text),this}},{key:"onTyping",value:function(){var t=this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode);this.setText(t),this.emit("typechar",this.insertChar),this.emit("type"),this.isLastChar?(this.freeTimer(),this.emit("complete",this,this.parent)):(this.timer.delay=this.speed,this.typingIdx++);}},{key:"getTypingString",value:function(t,e,i,n){var s;if(0===n){var r=0,o=e;this.insertIdx=o,s=this.getSubString(t,r,o);}else if(1===n){r=(o=i)-e;this.insertIdx=0,s=this.getSubString(t,r,o);}else if(2===n){var a=i/2;o=(r=Math.floor(a-e/2))+e;this.insertIdx=e%2?e:0,s=this.getSubString(t,r,o);}else if(3===n){var h,l=Math.floor(e/2);if(l>0){r=(o=i)-l;h=this.getSubString(t,r,o);}else h="";var u,c=e-l;if(c>0){o=(r=0)+c;this.insertIdx=o,u=this.getSubString(t,r,o);}else u="",this.insertIdx=0;s=u+h;}return this.insertChar=s.charAt(this.insertIdx-1),s}},{key:"startTimer",value:function(t){var e;return this.timer&&this.freeTimer(),void 0===t?e=0:(this.speed,e=t),this.timer=this.scene.time.addEvent({delay:1e-4,startAt:e,loop:!0,callback:this.onTyping,callbackScope:this}),this}},{key:"getTimer",value:function(){return this.timer}},{key:"freeTimer",value:function(){return this.timer&&(this.timer.remove(),this.timer=null),this}},{key:"setText",value:function(t){this.setTextCallback&&(t=this.setTextCallbackScope?this.setTextCallback.call(this.setTextCallbackScope,t,this.isLastChar,this.insertIdx):this.setTextCallback(t,this.isLastChar,this.insertIdx)),this.textWrapEnable?pP(this.parent,t):this.parent.setText(t);}},{key:"getTextLength",value:function(t){var e=this.parent;return e.getPlainText?e.getPlainText(t).length:t.length}},{key:"getSubString",value:function(t,e,i){var n=this.parent;return n.getSubString?n.getSubString(t,e,i):t.slice(e,i)}}]),i}(ho),PO=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},TO={"left-to-right":0,"right-to-left":1,"middle-to-sides":2,"sides-to-middle":3},OO=Phaser.Utils.Objects.GetValue,MO=function(t){l(i,t);var e=p(i);function i(t,n){return r(this,i),void 0===n&&(n={}),n.hasOwnProperty("layoutMode")||(n.layoutMode=1),e.call(this,t,n)}return a(i)}((void 0===xO&&(xO="rexTextBox"),function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type=xO;var o=s.childrenMap.text;return s.page=new bO(o,OO(n,"page",void 0)),s.typing=new SO(o,OO(n,"typing",n.type)),s.typing.on("complete",s.onPageEnd,d(s)).on("type",s.onType,d(s)).on("typechar",s.onTypeChar,d(s)),s.textWidth=o.width,s.textHeight=o.height,s}return a(i,[{key:"start",value:function(t,e){return this.page.setText(t),void 0!==e&&this.setTypingSpeed(e),this.emit("start"),this.typeNextPage(),this}},{key:"typeNextPage",value:function(){if(this.isLastPage)this.emit("complete");else {var t=this.page.getNextPage();this.typing.start(t);}return this}},{key:"pause",value:function(){return this.isTyping&&(this.typing.pause(),this.emit("pause")),this}},{key:"resume",value:function(){return this.isTyping||(this.emit("resume"),this.typing.resume()),this}},{key:"stop",value:function(t){return this.typing.stop(t),this}},{key:"showLastPage",value:function(){return this.typing.stop(),this.page.showLastPage(),this.emit("type"),this.onPageEnd(),this}},{key:"setTypeSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"setTypingSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"isTyping",get:function(){return this.typing.isTyping}},{key:"isLastPage",get:function(){return this.page.isLastPage}},{key:"isFirstPage",get:function(){return this.page.isFirstPage}},{key:"pageCount",get:function(){return this.page.pageCount}},{key:"pageIndex",get:function(){return this.page.pageIndex}},{key:"typingSpeed",get:function(){return this.typing.speed}},{key:"onType",value:function(){var t=this.childrenMap.text;this.textWidth===t.width&&this.textHeight===t.height||(this.textWidth=t.width,this.textHeight=t.height,this.getTopmostSizer().layout()),this.emit("type");}},{key:"onTypeChar",value:function(t){this.emit("typechar",t);}},{key:"onPageEnd",value:function(){var t=this.isLastPage;this.emit("pageend"),t&&this.emit("complete");}}]),i}(XC)));M.register("textBox",(function(t){var e=new MO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.TextBox",MO);var EO=Phaser.Utils.Objects.GetValue,_O=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexNumberBar";var o,a=EO(n,"background",void 0),h=EO(n,"icon",void 0),l=EO(n,"iconMask",void 0),u=EO(n,"slider",void 0),c=EO(n,"text",void 0),f=EO(n,"space.icon",0),p=EO(n,"space.slider",0);(a&&s.addBackground(a),h)&&(0===s.orientation?(u||c)&&(v={right:f}):(u||c)&&(v={bottom:f}),s.add(h,{proportion:0,align:"center",padding:v}),l&&(l=rx.call(d(s),h,h,1)));if(u){var v,g;if(u.orientation=s.orientation,u.eventEmitter=d(s),u.value=null,u.hasOwnProperty("input")||(u.input=-1),o=new LS(t,u),t.add.existing(o),0===s.orientation?c&&(v={right:p}):c&&(v={bottom:p}),0===s.orientation)g=void 0===EO(u,"width",void 0)?1:0;else g=void 0===EO(u,"height",void 0)?1:0;s.add(o,{proportion:g,align:"center",padding:v});}c&&s.add(c),s.addChildrenMap("background",a),s.addChildrenMap("icon",h),s.addChildrenMap("iconMask",l),s.addChildrenMap("slider",o),s.addChildrenMap("text",c);var y=EO(n,"valuechangeCallback",null);if(null!==y){var k=EO(n,"valuechangeCallbackScope",void 0);s.on("valuechange",y,k);}return s.setEnable(EO(n,"enable",void 0)),s.setValue(EO(n,"value",0)),s}return a(i,[{key:"enable",get:function(){return !!this.childrenMap.slider&&this.childrenMap.slider.enable},set:function(t){this.childrenMap.slider&&this.childrenMap.slider.setEnable(t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"value",get:function(){return this.childrenMap.slider?this.childrenMap.slider.value:0},set:function(t){this.childrenMap.slider&&(this.childrenMap.slider.value=t);}},{key:"setValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.setValue(t,e,i),this}},{key:"addValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.addValue(t,e,i),this}},{key:"getValue",value:function(t,e){return this.childrenMap.slider?this.childrenMap.slider.getValue(t,e):0}},{key:"easeValueTo",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.easeValueTo(t,e,i),this}},{key:"stopEaseValue",value:function(){return this.childrenMap.slider&&this.childrenMap.slider.stopEaseValue(),this}},{key:"setEaseValueDuration",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueDuration(t),this}},{key:"setEaseValueFunction",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueFunction(t),this}},{key:"text",get:function(){var t=this.childrenMap.text;return void 0===t?"":t.text?t.text:t.getData("text")},set:function(t){var e=this.childrenMap.text;void 0!==e&&(e.setText?e.setText(t):e.setData("text",t));}},{key:"setText",value:function(t){return this.text=t,this}}]),i}(ex);M.register("numberBar",(function(t){var e=new _O(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.NumberBar",_O),M.register("scrollBar",(function(t){var e=new jS(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ScrollBar",jS);var RO=Phaser.Utils.Objects.GetValue,LO={leftTop:"left-top",centerTop:"center-top",rightTop:"right-top",leftCenter:"left-center",center:"center",rightCenter:"right-center",leftBottom:"left-bottom",centerBottom:"center-bottom",rightBottom:"right-bottom"},BO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexBadge";var o=RO(n,"background",void 0);o&&s.addBackground(o),s.addChildrenMap("background",o);var a=RO(n,"main",void 0);for(var h in a&&s.add(a,{key:"main",align:"center",expand:!1}),s.addChildrenMap("main",a),LO){var l=RO(n,h,void 0);l&&(s.add(l,{key:h,align:LO[h],expand:!1}),s.addChildrenMap(h,l));}return s}return a(i)}(Bk);M.register("badgeLabel",(function(t){var e=new BO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.BadgeLabel",BO);var DO=Bk.prototype.add,IO=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),DO.call(this,t,e,i,n,s,r,o,a,h),this},jO={add:IO,addPage:IO},zO=Vf.prototype.setChildVisible,AO={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(zO.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(zO.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(AO,jO);var FO=Phaser.Utils.Objects.GetValue,YO=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(FO(n,"swapMode",0)),s.setFadeInDuration(FO(n,"fadeIn",0)),s}return a(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=WO[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(Bk);Object.assign(YO.prototype,AO);var WO={invisible:0,destroy:1};M.register("pages",(function(t){var e=new YO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Pages",YO);var VO=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(mk);Object.assign(sE.prototype,tE);var rE=["top","bottom","centerY","center"],oE=["left","right","centerX","center"],aE=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=rE.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=oE.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},hE=Phaser.Utils.Objects.GetValue,lE=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=rS(n),a=hE(n,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=hE(n,"clamplChildOY",!1),a.clamplChildOX=hE(n,"clamplChildOX",!1);var h,l,u=new sE(t,a);switch(t.add.existing(u),o){case 0:h=hE(n,"expand.panel",!0),l=!0;break;case 1:h=!0,l=hE(n,"expand.panel",!0);break;default:h=!0,l=!0;}n.type="rexScrollablePanel",n.child={gameObject:u,expandWidth:h,expandHeight:l,align:hE(n,"align.panel","center")};var c=hE(n,"space",void 0);return c&&(c.child=hE(c,"panel",0)),(s=e.call(this,t,n)).addChildrenMap("panel",u.child),s.addChildrenMap("panelLayer",u.maskLayer),s.addChildrenMap("mask",u.maskGameObject),s.addChildrenMap("scrollableBlock",u),s}return a(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),gk(this.childrenMap.child,t),this}}]),i}(aP),uE={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:aE.call(this,t,"y",e);break;case 1:aE.call(this,t,"x",e);break;default:aE.call(this,t,"y",e),aE.call(this,t,"x",e);}return this}};Object.assign(lE.prototype,uE),M.register("scrollablePanel",(function(t){var e=new lE(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ScrollablePanel",lE);var cE=function(t,e){t.popUp(e);},dE=function(t,e){t.scaleDown(e);},fE=function(t,e){t.fadeIn(e);},pE=function(t,e){t.fadeOut(e);},vE=function t(e,i,n){var s,r=Ct(n,"reverse",!1);if(xg(e[0]))if(r)for(o=(a=e.length)-1;o>=0;o--)s=t(e[o],i,n);else for(var o=0,a=e.length;on?1:it)return this;for(var e=this.commands.length-1;;){var i=this.commands[this.index],n=i[1];if(xg(n)||(n=Au(bE,i,1)),vE(n,this.scope),this.emit("runcommand",n,this.scope),this.index===e)return this.complete(),this;if(this.index++,this.nextTime=this.getNextDt(this.nextTime),this.nextTime>t)return this}}},{key:"complete",value:function(){this.clock.stop(),this.state=2,this.emit("complete",this.parent,this);}},{key:"getNextDt",value:function(t){var e=this.commands[this.index][0];return 1===this.timeUnit&&(e*=1e3),1===this.dtMode&&(e+=t),e}},{key:"setDtMode",value:function(t){return "string"==typeof t&&(t=CE[t]),this.dtMode=t,this}},{key:"setTimeUnit",value:function(t){return "string"==typeof t&&(t=xE[t]),this.timeUnit=t,this}}]),i}(ho),bE=[],xE={ms:0,s:1,sec:1},CE={abs:0,absolute:0,inc:1,increment:1},wE=Phaser.Utils.Objects.GetValue,SE=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={text:createDefaultTextObject(t)}),(s=e.call(this,t,n)).type="rexToast",s.setTransitInTime(wE(n,"duration.in",200)),s.setDisplayTime(wE(n,"duration.hold",1200)),s.setTransitOutTime(wE(n,"duration.out",200)),s.setTransitInCallback(wE(n,"transitIn",PE.popUp)),s.setTransitOutCallback(wE(n,"transitOut",PE.scaleDown)),s.player=new mE(d(s),{dtMode:1}),s.messages=[],s.scaleX0=void 0,s.scaleY0=void 0,s.setVisible(!1),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.player.destroy(),this.player=void 0,this.messages=void 0,g(u(i.prototype),"destroy",this).call(this,t));}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitOutTime",value:function(t){return this.transitOutTime=t,this}},{key:"setTransitInTime",value:function(t){return this.transitInTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=PE[t]),t){case PE.popUp:t=cE;break;case PE.fadeIn:t=fE;}return t||(t=j),this.transitInCallback=t,this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=PE[t]),t){case PE.scaleDown:t=dE;break;case PE.fadeOut:t=pE;}return t||(t=j),this.transitOutCallback=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX0=t,this.scaleY0=e,g(u(i.prototype),"setScale",this).call(this,t,e),this}},{key:"showMessage",value:function(t){if(void 0===this.scaleX0&&(this.scaleX0=this.scaleX),void 0===this.scaleY0&&(this.scaleY0=this.scaleY),void 0===t){if(0===this.messages.length)return this;t=this.messages.shift();}if(this.player.isPlaying)return this.messages.push(t),this;this.setScale(this.scaleX0,this.scaleY0).setVisible(!0),"string"==typeof t?this.setText(t):t(this),this.layout();var e=[[0,[this.transitInCallback,this,this.transitInTime]],[this.transitInTime,[j]],[this.displayTime,[this.transitOutCallback,this,this.transitOutTime]],[this.transitOutTime,[this.setVisible,!1]],[30,[j]]];return this.player.load(e,this).once("complete",(function(){this.showMessage();}),this).start(),this}}]),i}(ax),PE={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1};M.register("toast",(function(t){var e=new SE(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Toast",SE);for(var TE,OE=function(t,e,i){void 0===i&&(i=!0),i?e=e?_(e):{}:e||(e={});var n=new ou(t,e);return t.add.existing(n),n},ME=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],EE=[15792383,16444375,65535,8388564,15794175,16119260,16770244,0,16772045,255,9055202,10824234,14596231,6266528,8388352,13789470,16744272,6591981,16775388,14423100,65535,139,35723,12092939,11119017,11119017,25600,12433259,9109643,5597999,16747520,10040012,9109504,15308410,9419919,4734347,3100495,3100495,52945,9699539,16716947,49151,6908265,6908265,2003199,11674146,16775920,2263842,16711935,14474460,16316671,16766720,14329120,8421504,8421504,32768,11403055,15794160,16738740,13458524,4915330,16777200,15787660,15132410,16773365,8190976,16775885,11393254,15761536,14745599,16448210,13882323,13882323,9498256,16758465,16752762,2142890,8900346,7833753,7833753,11584734,16777184,65280,3329330,16445670,16711935,8388608,6737322,205,12211667,9662683,3978097,8087790,64154,4772300,13047173,1644912,16121850,16770273,16770229,16768685,128,16643558,8421376,7048739,16753920,16729344,14315734,15657130,10025880,11529966,14381203,16773077,16767673,13468991,16761035,14524637,11591910,8388736,6697881,16711680,12357519,4286945,9127187,16416882,16032864,3050327,16774638,10506797,12632256,8900331,6970061,7372944,7372944,16775930,65407,4620980,13808780,32896,14204888,16737095,4251856,15631086,16113331,16777215,16119285,16776960,10145074],_E={},RE=0,LE=ME.length;RE0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new y_(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},m_={openColorPicker:function(){if(!this.colorPicker){var t=k_.call(this).layout(),e=new oO(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(m_,WE);var b_=Phaser.Utils.Objects.GetValue,x_=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexColorInput",n.hasOwnProperty("colorPicker")||(n.colorPicker={background:{color:0}});var o=n.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(b_(o,"width",160),b_(o,"height",170));var l=b_(o,"background");h=l?function(t){return PC(t,l)}:b_(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(b_(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(b_(o,"expandDirection")),s.setColorPickerEaseInDuration(b_(o,"easeIn",200)),s.setColorPickerEaseOutDuration(b_(o,"easeOut",200)),s.setColorPickerTransitInCallback(b_(o,"transitIn")),s.setColorPickerTransitOutCallback(b_(o,"transitOut")),s.setColorPickerBounds(b_(o,"bounds"));var u=b_(o,"space");void 0===u&&(u={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(u);}var c=n.colorComponents;if(a&&(!1!==c&&null!==c)){s.setColorComponentsHeight(b_(c,"height",30)),s.setColorComponentsFormatLabelConfig(b_(c,"formatLabel"));var f=b_(c,"inputText");f||(f=b_(n,"inputText")),s.setColorComponentsInputTextConfig(f);var p=b_(c,"space");void 0===p&&(p={item:8}),s.setColorComponentsSpace(p);}var v=s.childrenMap.swatch;return v&&a&&s.onClick(v,s.openColorPicker,d(s)),s}return a(i)}(YE);Object.assign(x_.prototype,m_),M.register("colorInput",(function(t){var e=new x_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorInput",x_),M.register("colorInputLite",(function(t){var e=new YE(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorInputBase",YE),M.register("colorPicker",(function(t){var e=new h_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorPicker",h_),M.register("colorComponents",(function(t){var e=new v_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorComponents",v_);var C_=function(t,e){return function(i,n,s,r){"panel"!==n&&s.moveChild(i,r?0:t,e);}},w_=function(t,e){return function(i,n,s,r){"panel"===n&&s.moveChild(i,r?0:t,e);}},S_={visible:{show:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!0);}},hide:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!1);}}},fade:{show:function(t,e){return void 0===e&&(e=1),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}},hide:function(t,e){return void 0===e&&(e=0),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}}},move:{show:C_,hide:C_},"move-panel":{show:w_,hide:w_}},P_=Vf.prototype.setChildVisible,T_={setChildVisible:function(t,e){if("string"==typeof t){var i=t;t=this.sizerChildren[i];}else i=_k(this.sizerChildren,t);return void 0===e&&(e=this.currentChildKey===i),P_.call(this,t,e),this}},O_={fadeChild:function(t,e,i){var n;return "string"==typeof t?(n=t,t=this.sizerChildren[n]):n=_k(this.sizerChildren,t),void 0===e&&(e=500),void 0===i&&(i=this.currentChildKey===n?1:0),t.fadeIn(e,{start:t.alpha,end:i}),this},fadeChildPromise:function(t,e,i){return "string"==typeof t&&(t=this.sizerChildren[key]),this.fadeChild(t,e,i),t._fade?Oh(t._fade):Promise.resolve()}},M_={moveChild:function(t,e,i,n){var s;"string"==typeof t?(s=t,t=this.sizerChildren[s]):s=_k(this.sizerChildren,t),void 0===e&&(e=500);var r,o,a,h,l=this.currentChildKey===s;if(void 0===n)switch(s){case"leftSide":case"rightSide":n=Lr(t);break;case"topSide":case"bottomSide":n=Br(t);break;default:if(l)switch(this.previousChildKey){case"leftSide":case"rightSide":n=Lr(this.sizerChildren[this.previousChildKey]);break;case"topSide":case"bottomSide":n=Br(this.sizerChildren[this.previousChildKey]);break;default:n=0;}else switch(this.currentChildKey){case"leftSide":case"rightSide":n=Lr(this.sizerChildren[this.currentChildKey]);break;case"topSide":case"bottomSide":n=Br(this.sizerChildren[this.currentChildKey]);break;default:n=0;}}if(l)switch(s){case"panel":switch(this.previousChildKey){case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}break;case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}else switch(s){case"panel":switch(this.currentChildKey){case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}break;case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}return r?t.moveTo(e,"-=".concat(n),void 0,i):o?t.moveTo(e,"+=".concat(n),void 0,i):a?t.moveTo(e,void 0,"-=".concat(n),i):h?t.moveTo(e,void 0,"+=".concat(n),i):t.moveTo(0),this},moveChildPromise:function(t,e,i,n){return "string"==typeof t&&(t=this.sizerChildren[key]),this.moveChild(t,e,i,n),t._easeMove?Oh(t._easeMove):Promise.resolve()}},E_={};Object.assign(E_,T_,O_,M_);var __=Phaser.Utils.Objects.GetValue,R_=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexSides",s.childrenMap=s.sizerChildren,s.previousChildKey=void 0,s.currentChildKey=void 0;var o=__(n,"showChildCallback",void 0);if(o)if(kg(o)){var a=__(n,"showChildCallbackScope",void 0);s.on("showchild",o,a);var h=__(n,"hideChildCallback",void 0),l=__(n,"hideChildCallbackScope",void 0);s.on("hidechild",h,l);}else {var u=function(t){var e,i,n,s,r=b("string"==typeof t?[t]:t);return e=r[0],i=r.slice(1),S_.hasOwnProperty(e)?(n=S_[e].show.apply(null,i),s=S_[e].hide.apply(null,i)):(n=j,s=j),{show:n,hide:s}}(o);s.on("showchild",u.show),s.on("hidechild",u.hide);}var c=__(n,"background",void 0),d=__(n,"panel",void 0),f=__(n,"leftSide",void 0),p=__(n,"rightSide",void 0),v=__(n,"topSide",void 0),g=__(n,"bottomSide",void 0);if(c&&s.addBackground(c),d&&s.add(d,"panel","center",0,!0),f){var y=__(n,"expand.left",!0);s.add(f,"leftSide","left-top",0,{height:y});}if(p){y=__(n,"expand.right",!0);s.add(p,"rightSide","right-top",0,{height:y});}if(v){y=__(n,"expand.top",!0);s.add(v,"topSide","left-top",0,{width:y});}if(g){y=__(n,"expand.bottom",!0);s.add(g,"bottomSide","left-bottom",0,{width:y});}return s}return a(i,[{key:"reset",value:function(){return this.previousChildKey=void 0,this.currentChildKey="panel",this.showChild("panel",!0),this.hideChild("leftSide",!0),this.hideChild("rightSide",!0),this.hideChild("topSide",!0),this.hideChild("bottomSide",!0),this}}]),i}(Bk);Object.assign(R_.prototype,{showChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("showchild",i,t,this,e),this.resetChildState(i)),this},hideChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("hidechild",i,t,this,e),this.resetChildState(i)),this},swapChild:function(t,e){return this.currentChildKey===t||("panel"===this.currentChildKey||"panel"===t?(this.previousChildKey=this.currentChildKey,this.currentChildKey=t,this.hideChild(this.previousChildKey,e),this.showChild(this.currentChildKey,e)):(this.swapChild("panel",e),this.swapChild(t,e))),this},showPanel:function(t){return this.swapChild("panel",t),this},showLeftSide:function(){return this.swapChild("leftSide"),this},showRightSide:function(){return this.swapChild("rightSide"),this},showTopSide:function(){return this.swapChild("topSide"),this},showBottomSide:function(){return this.swapChild("bottomSide"),this},hideLeftSide:function(){return "leftSide"==this.currentChildKey&&this.showPanel(),this},hideRightSide:function(){return "rightSide"==this.currentChildKey&&this.showPanel(),this},hideTopSide:function(){return "topSide"==this.currentChildKey&&this.showPanel(),this},hideBottomSide:function(){return "bottomSide"==this.currentChildKey&&this.showPanel(),this},toggleLeftSide:function(){var t="panel"!==this.currentChildKey?"panel":"leftSide";return this.swapChild(t),this},toggleRightSide:function(){var t="panel"!==this.currentChildKey?"panel":"rightSide";return this.swapChild(t),this},toggleTopSide:function(){var t="panel"!==this.currentChildKey?"panel":"topSide";return this.swapChild(t),this},toggleBottomSide:function(){var t="panel"!==this.currentChildKey?"panel":"bottomSide";return this.swapChild(t),this}},E_),M.register("sides",(function(t){var e=new R_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Sides",R_);var L_=Phaser.Utils.Array.GetFirst,B_=Phaser.Utils.Array.Remove,D_=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),n=jC(t,n),(s=e.call(this,t,n)).type="rexTweaker.Title",s}return a(i,[{key:"setTitle",value:function(t){return (t=t?_(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(ax),I_=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexTweaker.FolderTitle";var o=new _d(t,n.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return a(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(D_),j_=function(t,e){var i=new oR(t,e);return t.add.existing(i),i},z_=function(t,e,i){return PC(t,i)},A_=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexTweaker.Folder",s}return a(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(ZM);Object.assign(A_.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var F_=Phaser.Utils.Objects.GetValue,Y_=Phaser.Utils.Objects.GetValue,W_={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i0?0:1,s.setMinWidth(this.itemWidth)),this.add(s,{proportion:r,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),s.setAutoUpdateEnable(i.autoUpdate),s.setBindingTarget(t,e),i.monitor&&s.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,s),this},addButton:iR,addButtons:iR,addSeparator:function(t){var e=this.scene,i=nR(this.styles,"separator"),n=z_(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;is?r:-r),u.localY=d+(c>n?o:-o);}},qR=Phaser.Utils.Objects.IsPlainObject,$R=Phaser.Utils.Objects.GetValue,QR=Phaser.Math.DegToRad,tL=Phaser.Math.RadToDeg,eL=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;if(r(this,i),qR(n)){var l=n;n=$R(l,"x",0),s=$R(l,"y",0),o=$R(l,"key",null),a=$R(l,"frame",null);}return (h=e.call(this,t,n,s,o,a)).type="rexSkewmage",h._skewX=0,h._skewY=0,h}return a(i,[{key:"skewX",get:function(){return this._skewX},set:function(t){this._skewX=t,ZR(this,this._skewX,this._skewY);}},{key:"skewXDeg",get:function(){return tL(this._skewX)},set:function(t){this.skewX=QR(t);}},{key:"skewY",get:function(){return this._skewY},set:function(t){this._skewY=t,ZR(this,this._skewX,this._skewY);}},{key:"skewYDeg",get:function(){return tL(this._skewY)},set:function(t){this.skewY=QR(t);}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"setSkewY",value:function(t){return this.skewY=t,this}},{key:"setSkew",value:function(t,e){return void 0===e&&(e=t),this.skewX=t,this.skewY=e,this}},{key:"setSkewXDeg",value:function(t){return this.skewXDeg=t,this}},{key:"setSkewYDeg",value:function(t){return this.skewYDeg=t,this}},{key:"setSkewDeg",value:function(t,e){return void 0===e&&(e=t),this.skewXDeg=t,this.skewYDeg=e,this}}]),i}(JR),iL=Phaser.Utils.Objects.IsPlainObject,nL=Phaser.Utils.Objects.GetValue,sL=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"skewState",get:function(){return this.isRunning}}]),i}(OM(function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;if(r(this,i),iL(n)){var l=n;n=nL(l,"x",0),s=nL(l,"y",0),o=nL(l,"width",32),a=nL(l,"height",32);}var u=iM(t,o,a);return (h=e.call(this,t,n,s,u,null)).type="rexSkewRenderTexture",h.rt=h.texture,h}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.rt.destroy(),this.rt=null);}}]),i}(eL)));M.register("skew",(function(t,e){return new sL(t,e)})),$(window,"RexPlugins.UI.Skew",sL),M.register("anchor",(function(t,e){return new Vp(t,e)})),$(window,"RexPlugins.UI.Anchor",Vp),M.register("textTyping",(function(t,e){return new SO(t,e)})),$(window,"RexPlugins.UI.TextTyping",SO),M.register("textPage",(function(t,e){return new bO(t,e)})),$(window,"RexPlugins.UI.TextPage",bO);var rL=void 0,oL=Phaser.Utils.Objects.GetValue,aL=Phaser.Utils.Objects.Clone,hL=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},lL=Phaser.Utils.Objects.GetValue,uL=Phaser.Utils.Objects.Merge,cL={open:function(t,e){var i;void 0===t&&(t={}),t=uL(t,this.openConfig),(i=this)!==rL&&(void 0!==rL&&rL.close(),rL=i),kg(t)&&(e=t,t=void 0);var n=lL(t,"inputType",void 0);void 0===n&&(n=lL(t,"type","text")),void 0===e&&(e=lL(t,"onClose",void 0));var s=lL(t,"onOpen",void 0),r=lL(t,"onTextChanged",void 0);return this.inputText=function(t,e){void 0===e&&(e={}),e=aL(e);var i=t.scene,n=t.style,s=oL(e,"backgroundColor",n.backgroundColor);null===s&&(s="transparent"),e.text=oL(e,"text",t.text),e.fontFamily=oL(e,"fontFamily",n.fontFamily),e.fontSize=oL(e,"fontSize",n.fontSize),e.color=oL(e,"color",n.color),e.backgroundColor=s,e.direction=oL(e,"rtl",n.rtl)?"rtl":"ltr",e.align=oL(e,"align",hL(n)),"rtl"===e.direction&&LC(t)&&(e.align="right");var r=new pb(i,t.x,t.y,oL(e,"width",t.width),oL(e,"height",t.height),e);r.setOrigin(t.originX,t.originY).setScrollFactor(t.scrollFactorX,t.scrollFactorY);var o=t.parentContainer;return o?o.add(r):i.add.existing(r),r}(this.parent,t).on("textchange",(function(t){var e=t.text;r?r(this.parent,e):this.parent.text=e;}),this).setFocus(),this.parent.setVisible(!1),this.onClose=e,lL(t,"enterClose","textarea"!==n)&&this.scene.input.keyboard.once("keydown-ENTER",this.close,this),this.delayCall=function(t,e,i){return t.time.delayedCall(0,e,[],i)}(this.scene,(function(){this.scene.input.once("pointerdown",this.close,this),s&&s(this.parent),this.emit("open",this.parent);}),this),this},close:function(){return this===rL&&(rL=void 0),this.parent.setVisible(!0),this.inputText&&(this.inputText.destroy(),this.inputText=void 0),this.delayCall&&(this.delayCall.remove(),this.delayCall=void 0),this.scene.input.keyboard.off("keydown-ENTER",this.close,this),this.scene.input.off("pointerdown",this.close,this),this.onClose&&this.onClose(this.parent),this.emit("close",this.parent),this}},dL=Phaser.Utils.Objects.GetValue,fL=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t)).inputText=void 0,s.onClose=void 0,s.delayCall=void 0,s.setOpenConfig(n),dL(n,"clickEnable",!0)&&t.on("pointerdown",(function(){this.open();}),d(s)).setInteractive(),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.close(),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"setOpenConfig",value:function(t){return void 0===t&&(t={}),this.openConfig=t,this}},{key:"isOpened",get:function(){return void 0!==this.inputText}},{key:"text",get:function(){return this.isOpened?this.inputText.text:this.parent.text}}]),i}(ho);Object.assign(fL.prototype,cL);M.register("textEdit",(function(t,e){return new fL(t,e)})),$(window,"RexPlugins.UI.TextEdit",fL);var pL=65535,vL=function(t,e,i){if(null==e)return t;if(0===e)return kL(t,0,i),t;var n=t.text.length;if(0===n)return kL(t,e,i),t;var s=Math.floor(1.5*e/n);void 0!==i&&s>i&&(s=Math.floor(i));for(var r={},o=yL(t,s,e,i,r),a=0;a<=pL&&0!==o;a++){if((s+=o)<0){s=0;break}o=yL(t,s,e,i,r);}return a===pL&&console.warn("FontSizeFit: Test count exceeds ".concat(pL)),t.setFontSize(s),kL(t,e,i),t},gL=function(t,e,i){return void 0===i[e]&&(t.setFontSize(e),i[e]={width:t.width,height:t.height}),i[e]},yL=function(t,e,i,n,s){var r,o=gL(t,e,s),a=gL(t,e+1,s);if(void 0!==n)if(o.height<=n&&a.height>n)r=0;else {if(o.height>n)return -1;r=Math.floor(n-o.height);}if(o.width<=i&&a.width>i)return 0;if(o.width>i)return -1;var h=Math.floor(i-o.width);return void 0===r?h:Math.min(h,r)},kL=function(t,e,i){var n=t.style;n&&(n.fixedWidth=e,n.parent.width=e,void 0!==i&&(n.fixedHeight=i,n.parent.height=i),n.update(!1));},mL=Phaser.Utils.Objects.GetValue,bL=function(t){l(i,Phaser.Plugins.ScenePlugin);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).add=new M(t),s}return a(i,[{key:"start",value:function(){this.scene.events.on("destroy",this.destroy,this);}},{key:"isInTouching",value:function(t,e,i,n){return !!t.visible&&bg(t,e,i,n)}},{key:"viewport",get:function(){return $r(this.scene,this.scene.cameras.main,!0)}}]),i}(),xL={getParentSizer:Fd,getTopmostSizer:Yd,hide:Bv,show:Lv,isShown:Dv,edit:function(t,e,i){return t._edit||(t._edit=new fL(t,{clickEnable:!1})),t._edit.open(e,i),t._edit},wrapExpandText:BC,fontSizeExpandText:function(t,e){"number"==typeof e&&(e={minWidth:e});var i=mL(e,"minWidth",0),n=mL(e,"minHeight",0),s=mL(e,"fitHeight",!1);return t._minWidth=i,t._minHeight=n,s?(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),t.setFontSize(1),t},t.resize=function(e,i){return vL(t,e,i),t}):(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),vL(t,e,void 0),t},t.resize=function(e,i){return t.width===e&&t.height===i||t.setFixedSize(e,i),t}),t},fontSizeResize:vL,setFontSizeToFitWidth:vL,waitEvent:Th,waitComplete:Oh,delayPromise:yb,setChildrenInteractive:gk,fadeIn:rv,fadeOutDestroy:ov,easeMoveTo:gv,easeMoveFrom:yv,modal:gg,modalPromise:function(t,e){var i=gg(t,e);return new Promise((function(t,e){i.once("close",(function(e){t(e);}));}))},modalClose:yg,requestDrag:wR,openFileChooser:xb};return Object.assign(bL.prototype,xL),bL})); + */Object.assign(wi.prototype,Ke,Si);var Pi=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"freeLine",value:function(t){if(t)return this.push(t),this}},{key:"freeLines",value:function(t){if(t)return this.pushMultiple(t),this}},{key:"getLine",value:function(t,e,i){var n=this.pop();return null===n&&(n={}),n.text=t,n.width=e,n.newLineMode=i,n}}]),i}(ot),Ti=Phaser.Utils.Objects.IsPlainObject,Oi=Phaser.Utils.Objects.GetValue,Mi=function(t,e){Ti(t)?t=(e=t).key:void 0===e&&(e={key:t}),e.hasOwnProperty("key")||(e.key=t);var i=e.key,n=e.frame,s=e.width,r=e.height;if(void 0===s||void 0===r){var o=this.textureManager.getFrame(i,n),a=o?o.cutWidth:0,h=o?o.cutHeight:0;void 0===s&&void 0===r?(s=a,r=h):void 0===s?s=a*(r/h):void 0===r&&(r=h*(s/a));}this.images[t]={key:i,frame:n,width:s,height:r,y:Oi(e,"y",0),left:Oi(e,"left",0),right:Oi(e,"right",0),originX:Oi(e,"originX",0),originY:Oi(e,"originY",0)};},Ei=function(){function t(e){r(this,t),this.textureManager=e.sys.textures,this.images={};}return a(t,[{key:"destroy",value:function(){this.textureManager=void 0,this.images=void 0;}},{key:"add",value:function(t,e){if("string"==typeof t)Mi.call(this,t,e);else if(Array.isArray(t))for(var i=0,n=(s=t).length;i").concat(t,""):e.hasOwnProperty("_style")?"").concat(t,""):t}},{key:"destroy",value:function(){this.tags=void 0;}},{key:"isTextTag",value:function(t){var e=this.tags[t];return !!e&&null==e.img}}]),t}(),kn=function(t){for(var e,i,n,s={},r=0,o=(t=t.split(";")).length;r=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px","")));break;case"shadow":a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.offsetX=parseInt(a[1].replace("px",""))),h>=3&&(n.offsetY=parseInt(a[2].replace("px",""))),h>=4&&(n.blur=parseInt(a[3].replace("px","")));break;case"u":case"underline":case"s":case"strikethrough":var h;a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px",""))),h>=3&&(n.offset=parseInt(a[2].replace("px",""))),"underline"===i?i="u":"strikethrough"===i&&(i="s");break;case"y":n=parseFloat(n);}s[i]=n;}return s},mn=function(t){return 0===(t=t.replace(Pn,"")).length},bn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>|<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/g,xn=/<\s*class=/i,Cn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>/,wn=/<\s*style=/i,Sn=/<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/,Pn=/^\s+|\s+$/,Tn=Phaser.Utils.Objects.GetValue,On=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){r(this,i);var h=Tn(a,"tags",void 0),l=new yn(h);return e.call(this,t,n,s,o,a,"rexTagText",l)}return a(i,[{key:"addTag",value:function(t,e){return this.parser.addTag(t,e),this.updateText(!0)}},{key:"addTags",value:function(t){for(var e in t)this.parser.addTag(e,t[e]);return this.updateText(!0)}},{key:"getTag",value:function(t){return this.parser.getTag(t)}},{key:"preDestroy",value:function(){g(u(i.prototype),"preDestroy",this).call(this),this.parser.destroy(),this.parser=void 0;}}]),i}(Vi);M.register("tagText",(function(t,e,i,n){var s=new On(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),$(window,"RexPlugins.UI.TagText",On);var Mn=Phaser.Utils.Objects.GetValue,En=function(t,e){return void 0===e?t:t[e]},_n=function(t,e,i){void 0===t&&(t={}),void 0===e&&(e=0);var s=n(e);return "string"===s?t[e]=i:"number"===s?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Mn(e,"left",0),t.right=Mn(e,"right",0),t.top=Mn(e,"top",0),t.bottom=Mn(e,"bottom",0)),t},Rn=function(){function t(e,i){r(this,t),this.setParent(e),this.type=i,this.renderable=!1,this.reset().setActive();}return a(t,[{key:"destroy",value:function(){this.parent.removeChild(this);}},{key:"setParent",value:function(t){return this.parent=t,this}},{key:"scene",get:function(){return this.parent.scene}},{key:"canvas",get:function(){return this.parent?this.parent.canvas:null}},{key:"context",get:function(){return this.parent?this.parent.context:null}},{key:"setDirty",value:function(t){return t&&this.parent&&(this.parent.dirty=!0),this}},{key:"active",get:function(){return this._active},set:function(t){this.setDirty(this._active!=t),this._active=t;}},{key:"setActive",value:function(t){return void 0===t&&(t=!0),this.active=t,this}},{key:"modifyPorperties",value:function(t){return this}},{key:"onFree",value:function(){this.reset().setParent();}},{key:"reset",value:function(){return this}},{key:"render",value:function(){}},{key:"contains",value:function(t,e){return !1}}]),t}();Object.assign(Rn.prototype,St);var Ln,Bn,Dn,In,jn,zn={renderContent:function(){},render:function(){if(!this.willRender)return this;var t=this.context;if(t.save(),t.globalAlpha=this.alpha,this.toLocalPosition){var e=this.drawX,i=this.drawY;this.autoRound&&(e=Math.round(e),i=Math.round(i)),t.translate(e,i),t.scale(this.scaleX,this.scaleY),t.rotate(this.rotation);}return this.drawBelowCallback&&this.drawBelowCallback(this),this.renderContent(),this.drawAboveCallback&&this.drawAboveCallback(this),t.restore(),this}},An=Phaser.Math.RotateAround,Fn=Phaser.Geom.Rectangle,Yn=function(t){void 0===Bn&&(Bn=new Fn);var e=t.drawTLX,i=t.drawTLY;return Bn.setTo(e,i,t.drawTRX-e,t.drawBLY-i),Bn},Wn=Phaser.Math.RotateAround,Vn=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===Dn&&(Dn={}),n=Dn),n.x=e,n.y=i,0!==t.rotation&&Wn(n,0,0,t.rotation),n.x=n.x*t.scaleX+t.drawX,n.y=n.y*t.scaleY+t.drawY,n},Xn=Phaser.GameObjects.Components.TransformMatrix,Gn={},Hn=function(t,e,i,n,s){var r=Vn(e,i,n,!0),o=function(t,e,i,n){void 0===n?n={}:!0===n&&(n=Gn);var s=e-t.width*t.originX,r=i-t.height*t.originY;return void 0===In&&(In=new Xn,jn=new Xn),t.parentContainer?t.getWorldTransformMatrix(In,jn):In.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),In.transformPoint(s,r,n),n}(t,r.x,r.y,s);return o},Un=function(t,e,i,n,s){"number"!=typeof i&&(s=i,i=0,n=0);var r=e.drawCenterX+i,o=e.drawCenterY+n;return Hn(t,e,r,o,s)},Nn={contains:function(t,e){if(0===this.width||0===this.height)return !1;var i=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===Ln&&(Ln={}),n=Ln),n.x=(t-i.drawX)/i.scaleX,n.y=(e-i.drawY)/i.scaleY,0!==i.rotation&&An(n,0,0,-i.rotation),n}(t,e,this,!0);return Yn(this).contains(i.x,i.y)},getWorldPosition:function(t,e,i){return Un(this.parent,this,t,e,i)}};Object.assign(Nn,zn);var Kn=Phaser.Math.DegToRad,Jn=Phaser.Math.RadToDeg,Zn=Phaser.Utils.Objects.GetValue,qn=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).renderable=!0,s.scrollFactorX=1,s.scrollFactorY=1,s.toLocalPosition=!0,s.originX=0,s.offsetX=0,s.offsetY=0,s}return a(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDirty(this._visible!=t),this._visible=t;}},{key:"setVisible",value:function(t){return void 0===t&&(t=!0),this.visible=t,this}},{key:"alpha",get:function(){return this._alpha},set:function(t){this.setDirty(this._alpha!=t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"x",get:function(){return this._x},set:function(t){this.setDirty(this._x!=t),this._x=t;}},{key:"setX",value:function(t){return this.x=t,this}},{key:"y",get:function(){return this._y},set:function(t){this.setDirty(this._y!=t),this._y=t;}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setPosition",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setInitialPosition",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"setScrollFactorX",value:function(t){return this.scrollFactorX=t,this}},{key:"setScrollFactorY",value:function(t){return this.scrollFactorY=t,this}},{key:"setScrollFactor",value:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}},{key:"rotation",get:function(){return this._rotation},set:function(t){this.setDirty(this._rotation!=t),this._rotation=t;}},{key:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Jn(this._rotation)},set:function(t){this.rotation=Kn(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this.setDirty(this._scaleX!==t),this._scaleX=t;}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return 0},set:function(t){}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"leftSpace",get:function(){return this._leftSpace},set:function(t){this.setDirty(this._leftSpace!==t),this._leftSpace=t;}},{key:"setLeftSpace",value:function(t){return this.leftSpace=t,this}},{key:"rightSpace",get:function(){return this._rightSpace},set:function(t){this.setDirty(this._rightSpace!==t),this._rightSpace=t;}},{key:"setRightSpace",value:function(t){return this.rightSpace=t,this}},{key:"outerWidth",get:function(){return this.width+this.leftSpace+this.rightSpace}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this.setDirty(this._scaleY!==t),this._scaleY=t;}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"height",get:function(){return 0},set:function(t){}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"setOrigin",value:function(t){return this.originX=t,this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"modifyPorperties",value:function(t){if(!t)return this;t.hasOwnProperty("x")&&this.setX(t.x),t.hasOwnProperty("y")&&this.setY(t.y),t.hasOwnProperty("rotation")?this.setRotation(t.rotation):t.hasOwnProperty("angle")&&this.setAngle(t.angle),t.hasOwnProperty("alpha")&&this.setAlpha(t.alpha);var e=Zn(t,"width",void 0),i=Zn(t,"height",void 0),n=Zn(t,"scaleX",void 0),s=Zn(t,"scaleY",void 0);return void 0!==e?void 0===i&&void 0===s?this.setWidth(e,!0):this.setWidth(e):void 0!==n&&this.setScaleX(n),void 0!==i?void 0===e&&void 0===n?this.setHeight(i,!0):this.setHeight(i):void 0!==s&&this.setScaleY(s),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),this}},{key:"setDrawBelowCallback",value:function(t){return this.drawBelowCallback=t,this}},{key:"setDrawAboveCallback",value:function(t){return this.drawAboveCallback=t,this}},{key:"reset",value:function(){return this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setLeftSpace(0).setRightSpace(0).setOrigin(0).setAlign().setDrawBelowCallback().setDrawAboveCallback(),this}},{key:"willRender",get:function(){return this.visible&&this.alpha>0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(Rn);Object.assign(qn.prototype,Nn);var $n=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Qn=Phaser.Utils.Objects.GetValue,ts=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Qn(n,"color",null),Qn(n,"color2",null),Qn(n,"horizontalGradient",!0)),s.setStroke(Qn(n,"stroke",null),Qn(n,"strokeThickness",2)),s.setCornerRadius(Qn(n,"cornerRadius",0),Qn(n,"cornerIteration",null)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,$n("color2",t,this),$n("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,$n("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,$n("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return g(u(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){Pe(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(qn),es=Phaser.Utils.Objects.GetValue,is=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(es(n,"color",null),es(n,"color2",null),es(n,"horizontalGradient",!0)),s.setStroke(es(n,"stroke",null),es(n,"strokeThickness",2)),s}return a(i,[{key:"color",get:function(){return this._color},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=me(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){g(u(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,es(t,"color2",null),es(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,es(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(qn),ns=Phaser.Utils.Objects.GetValue,ss=function(){function t(e,i){r(this,t),this.parent=e,this.set(i);}return a(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(ns(t,"bold",!1)),this.setItalic(ns(t,"italic",!1)),this.setFontSize(ns(t,"fontSize","16px")),this.setFontFamily(ns(t,"fontFamily","Courier")),this.setColor(ns(t,"color","#fff")),this.setStrokeStyle(ns(t,"stroke",null),ns(t,"strokeThickness",0)),this.setShadow(ns(t,"shadowColor",null),ns(t,"shadowOffsetX",0),ns(t,"shadowOffsetY",0),ns(t,"shadowBlur",0)),this.setOffset(ns(t,"offsetX",0),ns(t,"offsetY",0)),this.setSpace(ns(t,"leftSpace",0),ns(t,"rightSpace",0)),this.setAlign(ns(t,"align",void 0)),this.setBackgroundColor(ns(t,"backgroundColor",null)),this.setBackgroundHeight(ns(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(ns(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle($n("stroke",t,this),$n("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset($n("shadowOffsetX",t,this),$n("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=me(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=me(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=me(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=me(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),rs=Phaser.Utils.Array.Remove,os=Phaser.Utils.Array.Remove,as="text",hs="image",ls="drawer",us="space",cs="command",ds=function(t){return t.type===as&&"\n"===t.text},fs=function(t){return t.type===as&&"\f"===t.text},ps=function(t){return t.type===as},vs=function(t){return t.type===cs},gs=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,as)).updateTextFlag=!1,o.style=new ss(d(o),s),o.setText(n),o}return a(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),k(u(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),k(u(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),g(u(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&g(u(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(qn),ys=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},ks=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,hs)).setTexture(n,s),o}return a(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(qn),ms=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},bs=function(t){l(i,t);var e=p(i);function i(t,n,s,o){var a;return r(this,i),(a=e.call(this,t,ls)).setRenderCallback(n),a.setDrawerSize(s,o),a}return a(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(qn),xs=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,us)).setSpaceWidth(n),s}return a(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(qn),Cs=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},ws=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;return r(this,i),(h=e.call(this,t,cs)).setName(n).setParameter(o).setCallback(s,a),h}return a(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){g(u(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(Rn),Ss=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},Ps=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},Ts=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=Es.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=Es.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=Rs(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=Rs(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=Rs(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=Rs(t,"letterSpacing",0),f=Rs(t,"hAlign",0),p=Rs(t,"vAlign",0),v=Rs(t,"charWrap",!1),g=Ps({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=!L&&g.start===T,g.maxLineWidth=R,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,Y=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=Ds(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=Ds(t,"maxLines",0);var a=0===i,h=Ds(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=Ds(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=Ds(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=Ds(t,"letterSpacing",0),f=Ds(t,"rtl",!0),p=Ds(t,"hAlign",f?2:0),v=Ds(t,"vAlign",0),g=Ps({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=g.start===T,g.maxLineHeight=R,g.linesWidth=M.length*r;var z=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,A=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return _n(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return En(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),rs(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return os(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,x(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(x(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,x(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(as);return null===i?i=new gs(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Un(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(gr(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},mr=function(t){return t>>16&255},br=function(t){return t>>8&255},xr=function(t){return 255&t},Cr=Phaser.Events.EventEmitter,wr=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=Sr),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},Sr={},Pr=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=wr),function(t){if(t.events)return t;var e=new Cr,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},Tr=Phaser.Utils.Array.Remove,Or={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=mr(e),n=br(e),s=xr(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=mr(e=r),n=br(e),s=xr(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&Pr(e,this.viewport),this.effectPropertiesConfig&&gr(e,this.effectPropertiesConfig),e.once("destroy",(function(){Tr(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?xo:bo,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=mo,this}},{key:"update",value:function(t,e){this.state!==mo&&this.state!==wo&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=Co)):(this.nowTime=this.duration,this.state=wo):this.nowTime>=0&&(this.state=xo));}},{key:"t",get:function(){var t;switch(this.state){case mo:case bo:case Co:t=0;break;case xo:t=this.nowTime/this.duration;break;case wo:t=1;}return yo(t,0,1)},set:function(t){(t=yo(t,-1,1))<0?(this.state=bo,this.nowTime=-this.delay*t):(this.state=xo,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++);}},{key:"setT",value:function(t){return this.t=t,this}},{key:"isIdle",get:function(){return this.state===mo}},{key:"isDelay",get:function(){return this.state===bo}},{key:"isCountDown",get:function(){return this.state===xo}},{key:"isRunning",get:function(){return this.state===bo||this.state===xo}},{key:"isDone",get:function(){return this.state===wo}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),mo=0,bo=1,xo=2,Co=3,wo=-1,So=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).timer=new ko,s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(g(u(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),g(u(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),g(u(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),g(u(i.prototype),"complete",this).call(this),this}}]),i}(po),Po=Phaser.Utils.Objects.GetValue,To=Phaser.Utils.Objects.GetAdvancedValue,Oo=Phaser.Tweens.Builders.GetEaseFunction,Mo=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Po(t,"timer")),this.setEnable(Po(t,"enable",!0)),this.setTarget(Po(t,"target",this.parent)),this.setDelay(To(t,"delay",0)),this.setDuration(To(t,"duration",1e3)),this.setEase(Po(t,"ease","Linear")),this.setRepeat(Po(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setTarget",value:function(t){return void 0===t&&(t=this.parent),this.target=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=Oo(t),this}},{key:"start",value:function(){return this.timer.isRunning||g(u(i.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"stop",value:function(t){return void 0===t&&(t=!1),g(u(i.prototype),"stop",this).call(this),t&&(this.timer.setT(1),this.updateGameObject(this.target,this.timer),this.complete()),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable||!this.parent.active)return this;var i=this.target,n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),i}(So),Eo=Phaser.Sound.BaseSound,_o=function(t){return t instanceof Eo},Ro=Phaser.Utils.Objects.GetValue,Lo=Phaser.Utils.Objects.GetAdvancedValue,Bo=Phaser.Math.Linear,Do=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),_o(t)&&(s=n,n=t,t=void 0),n.active=!0,n.scene=t,n.game=n.manager.game,(o=e.call(this,n,s)).volume={},o.resetFromJSON(s),o}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ro(t,"mode",0)),this.setEnable(Ro(t,"enable",!0)),this.setVolumeRange(Lo(t,"volume.start",this.parent.volume),Lo(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Io[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),g(u(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Bo(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(g(u(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(Mo),Io={stop:1,destroy:2},jo=function(t,e,i,n,s){_o(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new Do(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},zo=function(t,e,i,n){_o(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new Do(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},Ao=Phaser.Utils.Objects.GetValue,Fo={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:Ao(e,"loop",this.backgroundMusicLoop),mute:Ao(e,"mute",this.backgroundMusicMute),volume:Ao(e,"volume",this.backgroundMusicVolume),detune:Ao(e,"detune",0),rate:Ao(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&jo(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&zo(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},Yo=Phaser.Utils.Objects.GetValue,Wo={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:Yo(e,"loop",this.backgroundMusicLoop),mute:Yo(e,"mute",this.backgroundMusic2Mute),volume:Yo(e,"volume",this.backgroundMusic2Volume),detune:Yo(e,"detune",0),rate:Yo(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&jo(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&zo(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},Vo=Phaser.Utils.Array.Remove,Xo=Phaser.Utils.Objects.GetValue,Go={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:Xo(e,"mute",this.soundEffectsMute),volume:Xo(e,"volume",this.soundEffectsVolume),detune:Xo(e,"detune",0),rate:Xo(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&Vo(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&Vo(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&jo(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&zo(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)zo(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&jo(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&zo(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)zo(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(Ct(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return a(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=Qi(this.delimiterLeft),e=Qi(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=ma:t||(t=xa),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return n.setDelimiters(s[0],s[1]),n}return a(i,[{key:"setTagExpression",value:function(t){return t||(t=wa),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=wa),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){g(u(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==wa||this.valueExpression!==wa){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=Qi(this.delimiterLeft),e=Qi(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=ma);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Mh,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===as&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else vs(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),Bh(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Mh),i=0,n=e.length;i0&&o.chainAnimation(i,n);},Uh=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,x(i));},Nh=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,x(i));},Kh=function(t){var e,i,n=b(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,x(i));},Jh=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(Gh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(x(s))):a.setProperty(i,n,s[0]);}},il={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},nl=function(t){var e,i,n,s,r,o,a,h,l=m(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},sl=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(qh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return ml.length=0,!0;return ml.length=0,!1},ml=[],bl=void 0,xl=Phaser.Utils.Objects.GetValue,Cl=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=xl(e,r,n[1]))&&(i[n[0]]=s);return i},wl=function(t){t.addEventListener("touchstart",Sl,!1),t.addEventListener("touchmove",Sl,!1),t.addEventListener("touchend",Sl,!1),t.addEventListener("mousedown",Sl,!1),t.addEventListener("mouseup",Sl,!1),t.addEventListener("mousemove",Sl,!1);},Sl=function(t){t.stopPropagation();},Pl=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Tl=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Pl,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this);},Ol=function(){this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this);},Ml=Phaser.Utils.Objects.GetValue,El=function(t,e){var i,n=Ml(e,"inputType",void 0);void 0===n&&(n=Ml(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Ml(e,"style",void 0),r=i.style;Cl(vl,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",Cl(pl,e,i),wl(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i.addEventListener("focus",(function(e){Tl.call(t);})),i.addEventListener("blur",(function(e){Ol.call(t);})),i},_l={open:function(){return this.isOpened||this.readOnly||((t=this)!==bl&&(void 0!==bl&&bl.close(),bl=t),this.node||(this.node=El(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===bl&&(bl=void 0),this.setBlur(),this):this}},Rl=Phaser.Utils.Objects.GetValue,Ll=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),s=e.call(this,t);var o=Rl(n,"inputType",void 0);void 0===o&&(o=Rl(n,"type","text")),s.setEnterCloseEnable(Rl(n,"enterClose","textarea"!==o));var a=Rl(n,"onOpen",void 0);a||(a=Rl(n,"onFocus",void 0)),s.onOpenCallback=a;var h=Rl(n,"onClose",void 0);return h||(h=Rl(n,"onBlur",void 0)),s.onCloseCallback=h,s.onUpdateCallback=Rl(n,"onUpdate",void 0),s.isOpened=!1,t.on("pointerdown",(function(){this.open();}),d(s)).setInteractive(),s.nodeConfig=function(t){void 0===t&&(t={});var e={};return gl(t,e,"inputType"),gl(t,e,"type"),gl(t,e,"style"),gl(t,e,vl),gl(t,e,pl),e}(n),s.node=void 0,s}return a(i,[{key:"destroy",value:function(){this.close(),g(u(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){yl(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(ho);Object.assign(Ll.prototype,_l);var Bl=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},Dl=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(Dl(this),Il(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Bl,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Ll),Al=Phaser.Utils.Objects.GetValue,Fl=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],Yl=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}Ul.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(Nl(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Qu(t,"tl",0),this.radiusTR=Qu(t,"tr",0),this.radiusBL=Qu(t,"bl",0),this.radiusBR=Qu(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Ut(e,e,e,e,180,270,!1,r,t):Ut(0,0,e,e,90,0,!0,r,t):Gt(0,0,t);(e=this.radiusTR)>0?this._convexTR?Ut(n-e,e,e,e,270,360,!1,r,t):Ut(n,0,e,e,180,90,!0,r,t):Gt(n,0,t);(e=this.radiusBR)>0?this._convexBR?Ut(n-e,s-e,e,e,0,90,!1,r,t):Ut(n,s,e,e,270,180,!0,r,t):Gt(n,s,t);(e=this.radiusBL)>0?this._convexBL?Ut(e,s-e,e,e,90,180,!1,r,t):Ut(0,s,e,e,360,270,!0,r,t):Gt(0,s,t);return t.push(t[0],t[1]),Du(this.x,this.y,t),g(u(i.prototype),"updateData",this).call(this),this}}]),i}(Cu),ec=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,ic=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),void 0===t&&(t=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,n),l.setP1(s,o),l.setP2(a,h),l}return a(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),g(u(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=ec(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&Zt(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&($t(t,this),t.fill()),this.isStroked&&(Qt(t,this),t.stroke());}}]),i}(bu),nc={buildShapes:function(){this.addShape((new tc).setName("box")).addShape((new Zu).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},sc=Phaser.Utils.Objects.GetValue,rc=Phaser.Math.Linear,oc=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).resetFromJSON(),s.boot(),s}return a(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=sc(t,"key","value");var n=e[this.propertyKey];return this.fromValue=sc(t,"from",n),this.toValue=sc(t,"to",n),this.setEase(sc(t,"ease",this.ease)),this.setDuration(sc(t,"duration",this.duration)),this.setRepeat(sc(t,"repeat",0)),this.setDelay(sc(t,"delay",0)),this.setRepeatDelay(sc(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,g(u(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=rc(this.fromValue,this.toValue,i);}}]),i}(Mo),ac={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new oc(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},hc={};Object.assign(hc,ku,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},nc,ac);var lc=Phaser.Utils.Objects.GetValue,uc=Phaser.Utils.Objects.IsPlainObject,cc=23730,dc=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),uc(n)?(n=lc(l=n,"x",0),s=lc(l,"y",0),o=lc(l,"width",2),a=lc(l,"height",2),h=lc(l,"color",cc)):uc(h)&&(h=lc(l=h,"color",cc)),(u=e.call(this,t,n,s,o,a)).type="rexCheckbox",void 0===h&&(h=cc),u.setBoxShape(lc(l,"circleBox",!1)),u.setBoxFillStyle(h,lc(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(lc(l,"uncheckedColor",null),lc(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(lc(l,"boxLineWidth",4),lc(l,"boxStrokeColor",h),lc(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,lc(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),lc(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(lc(l,"checkerColor",16777215),lc(l,"checkerAlpha",1)),u.setBoxSize(lc(l,"boxSize",1)),u.setCheckerSize(lc(l,"checkerSize",1)),u.setCheckerAnimationDuration(lc(l,"animationDuration",150)),u.buildShapes();var c=lc(l,"checked");return void 0===c&&(c=lc(l,"value",!1)),u.setValue(c),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(yu);Object.assign(dc.prototype,hc);var fc=Phaser.Utils.Objects.GetValue,pc=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(fc(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(fc(t,"enable",!0)),this.setMode(fc(t,"mode",1)),this.setClickInterval(fc(t,"clickInterval",100)),this.setDragThreshold(fc(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=vc[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,i,n){void 0===this.pointer&&(this.pointer=t,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&t.getDistance()>=this.dragThreshold&&this.cancel();}},{key:"click",value:function(t,e,i){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.parent,e,i),this;this.pointer=void 0;var n=this.lastClickTime;return void 0!==n&&t-n<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(ho),vc={press:0,pointerdown:0,release:1,pointerup:1},gc=Phaser.Utils.Objects.GetValue,yc=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new pc(d(u),gc(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(gc(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(dc);M.register("checkbox",(function(t,e,i,n,s,r){var o=new yc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.Checkbox",yc);var kc={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},mc={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},bc={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},xc=function(t,e,i){return (e-t)*i+t},Cc=Phaser.Math.Linear,wc={buildShapes:function(){this.addShape((new tc).setName("track")).addShape((new tc).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&xc(mr(l),mr(u),c))<<16|(255&xc(br(l),br(u),c))<<8|255&xc(xr(l),xr(u),c)),f=Cc(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=Cc(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},Sc={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new oc(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Pc={};Object.assign(Pc,kc,mc,bc,wc,Sc);var Tc=Phaser.Utils.Objects.GetValue,Oc=Phaser.Utils.Objects.IsPlainObject,Mc=23730,Ec=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),Oc(n)?(n=Tc(l=n,"x",0),s=Tc(l,"y",0),o=Tc(l,"width",2),a=Tc(l,"height",2),h=Tc(l,"color",Mc)):Oc(h)&&(h=Tc(l=h,"color",Mc)),(u=e.call(this,t,n,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=Mc),u.setTrackFillStyle(h,Tc(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Tc(l,"falseValueTrackColor",function(t){var e=.3*mr(t)+.59*br(t)+.11*xr(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Tc(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Tc(l,"thumbColor",16777215),Tc(l,"thumbAlpha",1)),u.setTrackSize(Tc(l,"trackWidth",.9),Tc(l,"trackHeight",.5)),u.setTrackRadius(Tc(l,"trackRadius",.5*u.trackHeight));var c=Tc(l,"thumbHeight",void 0),d=Tc(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Tc(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Tc(l,"thumbLeft",.3),Tc(l,"thumbRight",void 0)),u.setRTL(Tc(l,"rtl",!1)),u.setToggleAnimationDuration(Tc(l,"animationDuration",150)),u.buildShapes(),u.setValue(Tc(l,"value",!1),0),u}return a(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(yu);Object.assign(Ec.prototype,Pc);var _c=Phaser.Utils.Objects.GetValue,Rc=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),(u=e.call(this,t,n,s,o,a,h,l))._click=new pc(d(u),_c(l,"click")),u._click.on("click",(function(){this.toggleValue();}),d(u)),u.setReadOnly(_c(l,"readOnly",!1)),u}return a(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Ec);M.register("toggleSwitch",(function(t,e,i,n,s,r){var o=new Rc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.ToggleSwitch",Rc);var Lc={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Bc=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i)}(ge);Object.assign(Bc.prototype,Lc),M.register("canvas",(function(t,e,i,n){var s=new Bc(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),$(window,"RexPlugins.UI.Canvas",Bc);var Dc=Phaser.Utils.Objects.GetValue,Ic=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s)).type="rexCircleMaskImage",l.setTexture(o,a,h),l}return a(i,[{key:"setTexture",value:function(t,e,i){"object"===n(e)&&(i=e,e=void 0),"string"==typeof i&&(i={maskType:i});var s=Dc(i,"maskType",0),r=Dc(i,"backgroundColor",void 0),o=Dc(i,"strokeColor",void 0),a=Dc(i,"strokeWidth",null!=o?10:0);if(void 0===s?s=0:"string"==typeof s&&(s=jc[s]),this._textureKey=t,this._frameName=e,null===s)return this.loadTexture(t,e),this.dirty=!0,this;var h=this.scene.sys.textures.getFrame(t,e);if(!h)return this;h.cutWidth!==this.width||h.cutHeight!==this.height?this.setCanvasSize(h.cutWidth,h.cutHeight):this.clear();var l=this.canvas,u=this.context,c=l.width,d=l.height;null!=r&&(u.fillStyle=r,u.fillRect(0,0,c,d)),u.save(),u.beginPath();var f=a/2;switch(s){case 1:var p=(k=Math.floor(c/2))-f,v=(m=Math.floor(d/2))-f;u.ellipse(k,m,p,v,0,0,2*Math.PI);break;case 2:var g=Dc(i,"radius",0),y=Dc(i,"iteration",void 0);xe(u,f,f,c-a,d-a,g,y);break;default:var k=Math.floor(c/2),m=Math.floor(d/2),b=Math.min(k,m)-f;u.arc(k,m,b,0,2*Math.PI);}return null!=o&&(u.strokeStyle=o,u.lineWidth=a,u.stroke()),u.clip(),this.loadTexture(t,e),u.restore(),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),i}(ge),jc={circle:0,ellipse:1,roundRectangle:2};M.register("circleMaskImage",(function(t,e,i,n,s){var r=new Ic(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),$(window,"RexPlugins.UI.CircleMaskImage",Ic);var zc=Phaser.Utils.Objects.GetValue,Ac=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s)).type="rexAlphaMaskImage",l.maskFrame=null,l.setTexture(o,a,h),l}return a(i,[{key:"setTexture",value:function(t,e,i){"object"===n(e)&&(i=e,e=void 0),"string"==typeof i&&(i={mask:{key:i}});var s=zc(i,"mask.key"),r=zc(i,"mask.frame"),o=zc(i,"mask.invertAlpha",!1),a=zc(i,"mask.scale"),h=zc(i,"backgroundColor");if(s){this._maskKey=s,this._maskFrame=r,this._maskScale=a;var l=s?this.scene.sys.textures.get(s):null;this.maskFrame=l?l.get(r):null;}this._textureKey=t,this._frameName=e;var u=this.maskFrame;if(null===u)return this.loadTexture(t,e),this.dirty=!0,this;var c=null!=h;this.loadTexture(t,e);var d,f,p=this.canvas,v=this.context,g=p.width,y=p.height;v.save(),v.globalCompositeOperation=o?"destination-out":"destination-in",null!=this._maskScale?(d=u.cutWidth*this._maskScale,f=u.cutHeight*this._maskScale):(d=g,f=y);var k=(g-d)/2,m=(y-f)/2;return this.drawFrame(this._maskKey,this._maskFrame,k,m,d,f),v.restore(),c&&(v.save(),v.globalCompositeOperation="destination-over",v.fillStyle=h,v.fillRect(0,0,g,y),v.restore()),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),i}(ge);M.register("alphaMaskImage",(function(t,e,i,n,s){var r=new Ac(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),$(window,"RexPlugins.UI.AlphaMaskImage",Ac);var Fc=Phaser.Math.Linear,Yc=Phaser.Math.Percent,Wc={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Yc(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Yc(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Fc(t,e,i)),i}},Vc=Phaser.Math.Percent,Xc={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=Vc(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new oc(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new oc(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Gc=Phaser.Utils.Objects.GetValue,Hc=Phaser.Math.Clamp;function Uc(t){var e=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=Gc(t,"eventEmitter",this);var e=Gc(t,"valuechangeCallback",null);if(null!==e){var i=Gc(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Gc(t,"easeValue.duration",0)).setEaseValueFunction(Gc(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Hc(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,Wc,Xc),e}var Nc=Phaser.Math.RadToDeg,Kc=Phaser.Math.DegToRad,Jc=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Kc(r),u=Kc(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},Zc={buildShapes:function(){this.addShape((new Zu).setName("track")).addShape((new Zu).setName("bar")).addShape((new Pu).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),Jc(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=Nc(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),Jc(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},qc=Phaser.Utils.Objects.GetValue,$c=Phaser.Utils.Objects.IsPlainObject,Qc=Phaser.Math.Clamp,td=Phaser.Math.DegToRad(270),ed=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),$c(n)&&(n=qc(l=n,"x",0),s=qc(l,"y",0),o=qc(l,"radius",1),a=qc(l,"barColor",void 0),h=qc(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,n,s,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(qc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(qc(l,"centerColor",void 0)),u.setThickness(qc(l,"thickness",.2)),u.setStartAngle(qc(l,"startAngle",td)),u.setAnticlockwise(qc(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return a(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(g(u(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=Qc(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(Uc(yu));Object.assign(ed.prototype,Zc),M.register("circularProgress",(function(t,e,i,n,s,r){var o=new ed(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.CircularProgress",ed);var id=function(t,e,i,n,s,r,o,a,h,l,u,c){void 0===l&&(l=0),void 0===u&&(u=2*Math.PI),void 0===c&&(c=!1),e.beginPath(),e.ellipse(i,n,s,r,0,l,u,c),null!=o&&(e.fillStyle=o,e.fill()),null!=a&&(e.strokeStyle=a,e.lineWidth=h,e.stroke());},nd=function(){var t,e=this.radius,i=this.thickness*this.radius,n=this.radius-i/2,s=this.radius-i,r=(this.canvas,this.context);if(this.trackColor&&i>0&&(r.save(),id(0,r,e,e,n,n,void 0,this.trackColor,i),r.restore()),this.barColor&&n>0){var o,a,h;if(1===this.value)o=!1,a=0,h=2*Math.PI;else o=this.anticlockwise,a=this.startAngle,h=2*Math.PI*(o?1-this.value:this.value)+a;r.save(),id(0,r,e,e,n,n,void 0,this.barColor,i,a,h,o),r.restore();}this.centerColor&&s>0&&(this.centerColor2?((t=this.context.createRadialGradient(e,e,0,e,e,s)).addColorStop(0,this.centerColor),t.addColorStop(1,this.centerColor2)):t=this.centerColor,r.save(),id(0,r,e,e,s,s,t),r.restore());this.textFormatCallback&&(this.textColor||this.textStrokeColor)&&(r.save(),function(t,e,i,n,s,r,o,a,h,l,u){void 0===h&&null!=a&&(h=2),void 0===l&&(l="start"),void 0===u&&(u="alphabetic"),e.font=r,e.textAlign=l,e.textBaseline=u,e.fillStyle=o,e.strokeStyle=a,e.lineWidth=h,e.lineCap="round",e.lineJoin="round",null!=a&&"none"!==a&&h>0&&e.strokeText(s,i,n),null!=o&&"none"!==o&&e.fillText(s,i,n);}(0,r,e,e,this.getFormatText(),this.textFont,this.textColor,this.textStrokeColor,this.textStrokeThickness,"center","middle"),r.restore());},sd=Phaser.Utils.Objects.GetValue,rd=Phaser.Utils.Objects.IsPlainObject,od=Phaser.Math.Clamp,ad=Phaser.Math.DegToRad(270),hd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;r(this,i),rd(n)&&(n=sd(l=n,"x",0),s=sd(l,"y",0),o=sd(l,"radius",1),a=sd(l,"barColor",void 0),h=sd(l,"value",0));var c=2*o;(u=e.call(this,t,n,s,c,c)).type="rexCircularProgressCanvas",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(sd(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(sd(l,"centerColor",void 0)),u.setThickness(sd(l,"thickness",.2)),u.setStartAngle(sd(l,"startAngle",ad)),u.setAnticlockwise(sd(l,"anticlockwise",!1)),u.setTextColor(sd(l,"textColor",void 0)),u.setTextStrokeColor(sd(l,"textStrokeColor",void 0),sd(l,"textStrokeThickness",void 0));var d=sd(l,"textFont",void 0);return d?u.setTextFont(d):u.setTextFont(sd(l,"textSize","16px"),sd(l,"textFamily","Courier"),sd(l,"textStyle","")),u.setTextFormatCallback(sd(l,"textFormatCallback",void 0),sd(l,"textFormatCallbackScope",void 0)),u.setValue(h),u}return a(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(g(u(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=od(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"centerColor2",get:function(){return this._centerColor2},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor2!=t,this._centerColor2=t;}},{key:"setCenterColor",value:function(t,e){return this.centerColor=t,this.centerColor2=e,this}},{key:"textColor",get:function(){return this._textColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._textColor!=t,this._textColor=t;}},{key:"setTextColor",value:function(t){return this.textColor=t,this}},{key:"textStrokeColor",get:function(){return this._textStrokeColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._textStrokeColor!=t,this._textStrokeColor=t;}},{key:"textStrokeThickness",get:function(){return this._textStrokeThickness},set:function(t){this.dirty=this.dirty||this._textStrokeThickness!=t,this._textStrokeThickness=t;}},{key:"setTextStrokeColor",value:function(t,e){return void 0===e&&(e=2),this.textStrokeColor=t,this.textStrokeThickness=e,this}},{key:"textFont",get:function(){return this._textFont},set:function(t){this.dirty=this.dirty||this._textFont!=t,this._textFont=t;}},{key:"setTextFont",value:function(t,e,i){var n;return n=void 0===e?t:i+" "+t+" "+e,this.textFont=n,this}},{key:"setTextFormatCallback",value:function(t,e){return this.textFormatCallback=t,this.textFormatCallbackScope=e,this}},{key:"updateTexture",value:function(){return this.clear(),nd.call(this),g(u(i.prototype),"updateTexture",this).call(this),this}},{key:"getFormatText",value:function(t){return void 0===t&&(t=this.value),this.textFormatCallbackScope?this.textFormatCallback(t):this.textFormatCallback.call(this.textFormatCallbackScope,t)}}]),i}(Uc(ge));M.register("circularProgressCanvas",(function(t,e,i,n,s,r){var o=new hd(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.CircularProgressCanvas",hd);var ld=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},ud=Phaser.Utils.Objects.GetValue,cd=Phaser.Utils.Objects.IsPlainObject,dd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),cd(n)?(n=ud(u=n,"x",0),s=ud(u,"y",0),o=ud(u,"width",2),a=ud(u,"height",2),h=ud(u,"barColor",void 0),l=ud(u,"value",0)):cd(o)?(o=ud(u=o,"width",2),a=ud(u,"height",2),h=ud(u,"barColor",void 0),l=ud(u,"value",0)):cd(h)&&(h=ud(u=h,"barColor",void 0),l=ud(u,"value",0)),(c=e.call(this,t,n,s,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new Zu).setName("trackFill")).addShape((new Zu).setName("bar")).addShape((new Zu).setName("trackStroke")),c.setTrackColor(ud(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(ud(u,"trackStrokeThickness",2),ud(u,"trackStrokeColor",void 0)),c.setSkewX(ud(u,"skewX",0)),c.setRTL(ud(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(Uc(yu)),fd={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&ld(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),ld(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&ld(a,0,0,e,i,t).end();}};Object.assign(dd.prototype,fd),M.register("lineProgress",(function(t,e,i,n,s,r,o){var a=new dd(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),$(window,"RexPlugins.UI.LineProgress",dd);var pd=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),pd(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},gd=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},yd=Phaser.Utils.Objects.GetValue,kd=Phaser.Utils.Objects.IsPlainObject,md=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u){var c;return r(this,i),kd(n)?(n=yd(u=n,"x",0),s=yd(u,"y",0),o=yd(u,"width",2),a=yd(u,"height",2),h=yd(u,"barColor",void 0),l=yd(u,"value",0)):kd(o)?(o=yd(u=o,"width",2),a=yd(u,"height",2),h=yd(u,"barColor",void 0),l=yd(u,"value",0)):kd(h)&&(h=yd(u=h,"barColor",void 0),l=yd(u,"value",0)),(c=e.call(this,t,n,s,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(yd(u,"trackColor",void 0)),c.setBarColor(h,yd(u,"barColor2",void 0),yd(u,"isHorizontalGradient",void 0)),c.setTrackStroke(yd(u,"trackStrokeThickness",2),yd(u,"trackStrokeColor",void 0)),c.setSkewX(yd(u,"skewX",0)),c.setRTL(yd(u,"rtl",!1)),c.setValue(l),c}return a(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=me(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),vd.call(this),g(u(i.prototype),"updateTexture",this).call(this),this}}]),i}(Uc(ge));M.register("circularProgressCanvas",(function(t,e,i,n,s,r,o){var a=new md(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),$(window,"RexPlugins.UI.LineProgressCanvas",md),Phaser.Math.Wrap;var bd=Phaser.Math.Linear,xd=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],x=this.easeDirectionProgress;t=bd(m.a.x,b.a.x,x),e=bd(m.a.y,b.a.y,x),i=bd(m.b.x,b.b.x,x),n=bd(m.b.y,b.b.y,x),s=bd(m.c.x,b.c.x,x),r=bd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Cd=(0, Phaser.Math.DegToRad)(120),wd=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+Cd),i+n*Math.sin(s+Cd)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Cd),i+n*Math.sin(s-Cd)),this.arrowOnly?t.end():t.close();},Sd={buildShapes:function(){this.addShape((new Zu).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?xd.call(this):wd.call(this);}},Pd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new oc(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},Td=Phaser.Utils.Objects.GetValue,Od=Phaser.Utils.Objects.IsPlainObject,Md=Phaser.Math.DegToRad,Ed=Phaser.Math.RadToDeg,_d=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(r(this,i),Od(n)){var m=n;n=m.x,s=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,n,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return a(i,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Ld(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,i,s){if("object"===n(t)){var r=t,o=Td(r,"x",null);null!==o?(t=o,i=o):(t=Td(r,"left",0),i=Td(r,"right",t));var a=Td(r,"y",null);null!==a?(e=a,s=a):(e=Td(r,"top",0),s=Td(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=i||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Ed(this.verticeRotation)},set:function(t){this.verticeRotation=Md(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),i}(yu),Rd={right:0,down:1,left:2,up:3},Ld=function(t){return "string"==typeof t&&(t=Rd[t]),t%=4};Object.assign(_d.prototype,Sd,Pd),M.register("triangle",(function(t,e,i,n,s,r){var o=new _d(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),$(window,"RexPlugins.UI.Triangle",_d),ct();var Bd=Phaser.GameObjects.Zone,Dd=Phaser.Utils.Array.Add,Id=Phaser.Utils.Array.Remove,jd=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;return r(this,i),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=1),(h=e.call(this,t,n,s,o,a)).children=[],h}return a(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(t)for(var e,n=this.children.length-1;n>=0;n--)(e=this.children[n]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),g(u(i.prototype),"destroy",this).call(this,t);}}},{key:"contains",value:function(t){return -1!==this.children.indexOf(t)}},{key:"add",value:function(t){var e=this;return Dd(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return Id(this.children,t,(function(t){t.off("destroy",i.onChildDestroy,i),e&&t.destroy();})),this}},{key:"onChildDestroy",value:function(t,e){this.remove(t,!1);}},{key:"clear",value:function(t){for(var e,i=0,n=this.children.length;i0;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,x(n.children));}},yf=Phaser.Utils.Array,kf={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Dp=function(t,e){if("string"==typeof t)this.childrenMap[t]=e;else {var i=t;for(t in i)this.childrenMap[t]=i[t];}return this},Ip=/(\S+)\[(\d+)\]/i,jp={getInnerPadding:function(t){return En(this.space,t)},setInnerPadding:function(t,e){return _n(this.space,t,e),this},getOuterPadding:function(t){return En(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return _n(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),En(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),_n(this.getSizerConfig(t).padding,e,i),this}},zp=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},Ap=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Fp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,x(i.children)));}return t}},Yp=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(Hv),Nv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=oo(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Kv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=j),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=j),this.transitOutCallback=t,this}},Jv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Zv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},qv={};Object.assign(qv,Nv,Kv,Jv,Zv);var $v=Phaser.Utils.Objects.GetValue,Qv=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).setTransitInTime($v(n,"duration.in",200)),s.setTransitOutTime($v(n,"duration.out",200)),s.setTransitInCallback($v(n,"transitIn")),s.setTransitOutCallback($v(n,"transitOut")),s.oneShotMode=$v(n,"destroy",!1),s.delayCallTimer=void 0,s._state=new Uv(d(s),{eventEmitter:!1,initState:$v(n,"initState","IDLE")}),s.openEventData=void 0,s.closeEventData=void 0,s}return a(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),g(u(i.prototype),"shutdown",this).call(this,t));}}]),i}(ho);Object.assign(Qv.prototype,qv);var tg=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),(o=e.call(this,t,0,0,2,2,n,1)).setAlpha(s),o.setScrollFactor(0),o.boot(),o}return a(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),eg=Phaser.Utils.Objects.GetValue,ig=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,{eventEmitter:!1})).resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(eg(t,"hitAreaMode",0)),this.setEnable(eg(t,"enable",!0)),this.setStopMode(eg(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=ng[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(ho),ng={default:0,fullWindow:1},sg=Phaser.Utils.Objects.GetValue,rg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=sg(n,"color",0),a=sg(n,"alpha",.8);return (s=e.call(this,t,o,a)).touchEventStop=new ig(d(s),{hitAreaMode:1}),s}return a(i)}(tg),og=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Kp(t,e);},ag=function(t,e){Jp(t,e,void 0,void 0,!1);},hg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,rv(t,e);},lg=function(t,e){ov(t,e,!1);},ug=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,rv(t,e,t.alpha);},cg=function(t,e){ov(t,e,!1);},dg=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!zr(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},fg=Phaser.Utils.Objects.GetValue,pg=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=vg.popUp),null==n.transitOut&&(n.transitOut=vg.scaleDown),n.destroy=fg(n,"destroy",!0),s=e.call(this,t,n);var o=fg(n,"cover");s.cover=!1!==o?function(t,e){var i=t.scene,n=new rg(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,s.cover&&(s.setCoverTransitInCallback(fg(o,"transitIn",ug)),s.setCoverTransitOutCallback(fg(o,"transitOut",cg)));var a=fg(n,"touchOutsideClose",!1),h=fg(n,"duration.hold",-1),l=fg(n,"timeOutClose",h>=0),u=fg(n,"anyTouchClose",!1);return fg(n,"manualClose",!1)&&(a=!1,u=!1,l=!1),u&&(a=!1),l?s.setDisplayTime(h):s.setDisplayTime(-1),u?s.once("open",s.anyTouchClose,d(s)):a&&s.once("open",s.touchOutsideClose,d(s)),fg(n,"openOnStart",!0)&&s.delayCall(0,s.requestOpen,d(s)),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&dg(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=g(u(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=g(u(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),g(u(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=vg[t]),t){case vg.popUp:t=og;break;case vg.fadeIn:t=hg;}return g(u(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=vg[t]),t){case vg.scaleDown:t=ag;break;case vg.fadeOut:t=lg;}return g(u(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(Qv),vg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},gg=function(t,e){var i=new pg(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i},yg=function(t,e){t.emit("modal.requestClose",e);},kg=function(t){return t&&"function"==typeof t},mg={modal:function(t,e){return kg(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=gg(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return yg(this,t),this}},bg=function(t,e,i,n){if(e)return dg(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(ho),zg={press:0,pointerdown:0,release:1,pointerup:1},Ag={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new jg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Fg=function(t){l(i,t);var e=p(i);function i(){var t;return r(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return a(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(Hv),Yg=Phaser.Utils.Objects.GetValue,Wg=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,s.cooldown=new Fg,s.parent.setInteractive(Yg(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Yg(t,"enable",!0)),this.setCooldown(Yg(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(ho),Vg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&bg(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Wg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new Wg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==n(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==n(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},Xg=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=ry,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===oy&&this.onDragEnd(),this.pointer=void 0,this.tracerState=ry,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){g(u(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){g(u(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=ay,this}}]),i}(uo),ry=0,oy=1,ay="IDLE",hy=Phaser.Utils.Objects.GetValue,ly=Phaser.Math.Distance.Between,uy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=cy;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(hy(t,"time",250)),this.setTapInterval(hy(t,"tapInterval",200)),this.setDragThreshold(hy(t,"threshold",9)),this.setTapOffset(hy(t,"tapOffset",10));var e=hy(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(hy(t,"maxTaps",void 0)),this.setMinTaps(hy(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case cy:this.state=dy;break;case dy:var t=this.lastPointer;ly(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=fy,this.state=dy);break;case fy:this.state=dy;}}},{key:"onDragEnd",value:function(){this.state===dy&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=fy));}},{key:"onDrag",value:function(){this.state!==cy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=cy);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===dy){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=cy);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=fy:this.state=cy);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===fy&&(this.state=cy);}},{key:"isTapped",get:function(){return this.state===fy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(sy),cy="IDLE",dy="BEGIN",fy="RECOGNIZED",py=Phaser.Utils.Objects.GetValue,vy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=gy;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(py(t,"threshold",9)),this.setHoldTime(py(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=yy,0===this.holdTime&&(this.state=ky);}},{key:"onDragEnd",value:function(){this.state=gy;}},{key:"onDrag",value:function(){this.state!==gy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=gy);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===yy&&t-this.pointer.downTime>=this.holdTime&&(this.state=ky));}},{key:"isPressed",get:function(){return this.state===ky}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(sy),gy="IDLE",yy="BEGIN",ky="RECOGNIZED",my=Phaser.Utils.Objects.GetValue,by=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{},BEGIN:{enter:function(){var t=o.pointer;o.startX=t.x,o.startY=t.y,o.startWorldX=t.worldX,o.startWorldY=t.worldY;}},RECOGNIZED:{enter:function(){o.emit("panstart",o,o.gameObject,o.lastPointer);},exit:function(){var t=o.lastPointer;o.endX=t.x,o.endY=t.y,o.endWorldX=t.worldX,o.endWorldY=t.worldY,o.emit("panend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=xy;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(my(t,"threshold",10)),this}},{key:"onDragStart",value:function(){this.state=Cy,0===this.dragThreshold&&(this.state=wy);}},{key:"onDragEnd",value:function(){this.state=xy;}},{key:"onDrag",value:function(){switch(this.state){case Cy:this.pointer.getDistance()>=this.dragThreshold&&(this.state=wy);break;case wy:var t=this.pointer.position,e=this.pointer.prevPosition;this.dx=t.x-e.x,this.dy=t.y-e.y;var i=this.pointer;this.x=i.x,this.y=i.y,this.worldX=i.worldX,this.worldY=i.worldY,this.emit("pan",this,this.gameObject,this.lastPointer);}}},{key:"isPanned",get:function(){return this.state===wy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(sy),xy="IDLE",Cy="BEGIN",wy="RECOGNIZED",Sy=Phaser.Math.Distance.Between,Py=Phaser.Math.Angle.Between,Ty={getDt:function(){return hu(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Sy(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Py(e.x,e.y,t.x,t.y)}},Oy={"up&down":0,"left&right":1,"4dir":2,"8dir":3},My={},Ey=Phaser.Utils.Objects.GetValue,_y=Phaser.Math.RadToDeg,Ry=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=Ly;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s.clearDirectionStates(),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Ey(t,"threshold",10)),this.setVelocityThreshold(Ey(t,"velocityThreshold",1e3)),this.setDirectionMode(Ey(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=By;}},{key:"onDragEnd",value:function(){this.state=Ly;}},{key:"onDrag",value:function(){this.state===By&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Dy));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Dy&&(this.state=Ly);}},{key:"isSwiped",get:function(){return this.state===Dy}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=Oy[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=My),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(_y(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(sy);Object.assign(Ry.prototype,Ty);var Ly="IDLE",By="BEGIN",Dy="RECOGNIZED",Iy=Phaser.Utils.Objects.GetValue,jy=Phaser.Utils.Array.SpliceOne,zy=Phaser.Math.Distance.Between,Ay=Phaser.Math.Angle.Between,Fy=function(){function t(e,i){r(this,t);var n=e.input.manager.pointersTotal-1;n<2&&e.input.addPointer(2-n),this.scene=e,this.setEventEmitter(Iy(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return a(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(Iy(t,"enable",!0)),this.bounds=Iy(t,"bounds",void 0),this.tracerState=Wy,this.pointers.length=0,wt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,wt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case Wy:this.tracerState=Vy,this.onDrag1Start();break;case Vy:this.tracerState=Xy,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],jy(this.pointers,e),this.tracerState){case Vy:this.tracerState=Wy,this.onDrag1End();break;case Xy:this.tracerState=Vy,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case Vy:this.onDrag1();break;case Xy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Xy&&this.onDrag2End(),this.pointers.length=0,wt(this.movedState),this.tracerState=Wy,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0],e=this.pointers[1];return zy(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0],e=this.pointers[1];return Ay(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;Yy.x=e.x-i.x,Yy.y=e.y-i.y;}else Yy.x=0,Yy.y=0;return Yy}},{key:"centerX",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==Xy)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==Xy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==Xy)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Gy,this}}]),t}();Object.assign(Fy.prototype,or);var Yy={},Wy=0,Vy=1,Xy=2,Gy="IDLE",Hy=Phaser.Utils.Objects.GetValue,Uy=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.prevDistance=void 0,o.scaleFactor=1;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("pinchstart",o);},exit:function(){o.emit("pinchend",o);}}},init:function(){this.state=Ny;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Hy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.scaleFactor=1,this.prevDistance=this.distanceBetween,this.state=Ky,0===this.dragThreshold&&(this.state=Jy);}},{key:"onDrag2End",value:function(){this.state=Ny;}},{key:"onDrag2",value:function(){switch(this.state){case Ky:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.prevDistance=t,this.state=Jy;}break;case Jy:t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.emit("pinch",this),this.prevDistance=t;}}},{key:"isPinched",get:function(){return this.state===Jy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Fy),Ny="IDLE",Ky="BEGIN",Jy="RECOGNIZED",Zy=Phaser.Math.RotateAround,qy=function(t,e,i,n){return Zy(t,e,i,n),t.rotation+=n,t},$y={},Qy=Phaser.Utils.Objects.GetValue,tk=Phaser.Math.Angle.WrapDegrees,ek=Phaser.Math.Angle.ShortestBetween,ik=Phaser.Math.RadToDeg,nk=Phaser.Math.DegToRad,sk=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=d(s=e.call(this,t,n)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=ok;},eventEmitter:!1};return s.setRecongizedStateObject(new Hv(a)),s}return a(i,[{key:"resetFromJSON",value:function(t){return g(u(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Qy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=tk(ik(this.angleBetween)),this.state=ak,0===this.dragThreshold&&(this.state=hk);}},{key:"onDrag2End",value:function(){this.state=ok;}},{key:"onDrag2",value:function(){switch(this.state){case ak:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=tk(ik(this.angleBetween));this.angle=ek(this.prevAngle,t),this.prevAngle=t,this.state=hk;}break;case hk:t=tk(ik(this.angleBetween));this.angle=ek(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===hk}},{key:"rotation",get:function(){return nk(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Fy),rk={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=$y),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?u.pop().setTexture(d,M):s(c,d,M),h&&c.add.existing(O),l){var E=b+w*T+o*w,_=x+S*P+a*S;O.setOrigin(o,a).setPosition(E,_).setScale(g,y).setRotation(k),Bm(O,b,x,k);}C.push(O);}return C}(t,e,i,n),o=0,a=r.length;o=0;n--)(o=s[n])instanceof e&&(o.destroy(),qm(s,n));else {n=0;for(var s,r=(s=t.postPipelines).length;nl?(n.width=a*l,n.height=a):(n.width=o,n.height=a);}else n.width=s,n.height=r;else {var l=s/r;n.width=Math.min(s,o),n.height=Math.min(r,a);var u=n.width/n.height;ul&&(n.width=n.height*l);}return n}(t,{width:this.width,height:this.height},this.scaleUp,!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return g(u(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(Vf);Object.assign(sb.prototype,Im),M.register("imageBox",(function(t,e,i,n,s){var r=new sb(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),$(window,"RexPlugins.UI.ImageBox",sb),M.register("fullWindowRectangle",(function(t,e){var i=new tg(this.scene,t,e);return this.scene.add.existing(i),i})),$(window,"RexPlugins.UI.FullWindowRectangle",tg),M.register("cover",(function(t){var e=new rg(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Cover",rg);var rb=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},ob={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},ab={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},hb={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},lb=Phaser.Utils.Objects.GetValue,ub=function(t,e,i,n){var s=lb(n,"preventDefault",!1),r=lb(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},cb=Phaser.GameObjects.DOMElement,db=Phaser.Utils.Objects.IsPlainObject,fb=Phaser.Utils.Objects.GetValue,pb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l,u;r(this,i),db(n)?(n=fb(h=n,"x",0),s=fb(h,"y",0),o=fb(h,"width",0),a=fb(h,"height",0)):db(o)&&(o=fb(h=o,"width",0),a=fb(h,"height",0)),void 0===h&&(h={});var c=fb(h,"inputType",void 0);void 0===c&&(c=fb(h,"type","text")),"textarea"===c?(u=document.createElement("textarea")).style.resize="none":(u=document.createElement("input")).type=c,Cl(ob,h,u);var f=fb(h,"style",void 0);f=Cl(ab,h,f);var p=u.style;for(var v in h)v in ob||v in ab||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,n,s,u,f)).type="rexInputText",l.resize(o,a),ub(d(l),u,hb),wl(u),fb(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),d(l)).on("blur",(function(){this._isFocused=!1;}),d(l)),l}return a(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(cb),vb={resize:rb};Object.assign(pb.prototype,vb),M.register("inputText",(function(t){var e=new pb(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.InputText",pb);var gb=Phaser.Utils.Objects.GetValue,yb=function(t,e){return void 0===t&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}))},kb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Th(H(e).events,"focus").then((function(){return yb(n)})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},mb=Phaser.Utils.Objects.GetValue,bb=Phaser.DOM.RemoveFromDOM,xb=function(t,e){var i=mb(e,"closeDelay",200),n=function(t,e){var i=document.createElement("input");i.type="file";var n=gb(e,"accept",""),s=gb(e,"multiple",!1);return i.setAttribute("accept",n),s?i.setAttribute("multiple",""):i.removeAttribute("multiple"),i}(0,e);return n.click(),kb({game:t,fileInput:n,closeDelay:i}).then((function(t){return bb(n),n.remove(),Promise.resolve(t)}))},Cb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},wb=function(t,e,i,n,s,r){if(null===s||!1===s);else if(kg(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=H(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),kg(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},Sb={loadFile:function(t,e,i,n,s){var r=this.scene;return wb(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){wb(s,t,e,i,n,(function(t){r(t);}));}))}},Pb=Phaser.GameObjects.DOMElement,Tb=Phaser.Utils.Objects.IsPlainObject,Ob=Phaser.Utils.Objects.GetValue,Mb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),Tb(n)?(n=Ob(h=n,"x",0),s=Ob(h,"y",0),o=Ob(h,"width",0),a=Ob(h,"height",0)):Tb(o)&&(o=Ob(h=o,"width",0),a=Ob(h,"height",0));var u=document.createElement("input");u.type="file",u.style.display="none";var c=document.createElement("label");c.appendChild(u);var f=Ob(h,"style",void 0);(l=e.call(this,t,n,s,c,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=d(l);return u.onchange=function(){p.emit("change",p);},l.setCloseDelay(Ob(h,"closeDelay",200)),u.onclick=function(){kb({game:t,fileInput:u,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return a(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(Ob(t,"accept","")),this.setMultiple(Ob(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(Pb),Eb={resize:rb,syncTo:Cb};Object.assign(Mb.prototype,Eb,Sb),M.register("fileChooser",(function(t){var e=new Mb(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FileChooser",Mb);var _b={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Rb={resize:rb,syncTo:Cb};Object.assign(Rb,_b,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},Sb);var Lb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Bb=Phaser.GameObjects.DOMElement,Db=Phaser.Utils.Objects.IsPlainObject,Ib=Phaser.Utils.Objects.GetValue,jb=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),Db(n)?(n=Ib(h=n,"x",0),s=Ib(h,"y",0),o=Ib(h,"width",0),a=Ib(h,"height",0)):Db(o)&&(o=Ib(h=o,"width",0),a=Ib(h,"height",0)),void 0===h&&(h={});var u=document.createElement("div"),c=Ib(h,"style",void 0);(l=e.call(this,t,n,s,u,c)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Ib(h,"dropEnable",!0));var f=Ib(h,"filters");return f&&l.addFilters(f),ub(d(l),u,Lb,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),d(l)),l}return a(i,[{key:"files",get:function(){return this._files}}]),i}(Bb);Object.assign(jb.prototype,Rb),M.register("fileDropZone",(function(t){var e=new jb(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FileDropZone",jb);var zb=Phaser.Math.Wrap,Ab=function(t){l(i,t);var e=p(i);function i(t){var n;return r(this,i),(n=e.call(this,t,0,0,1,1)).isRexSpace=!0,n}return a(i)}(Phaser.GameObjects.Zone),Fb=function(t,e){var i=this.sizerChildren;if(0===i.length)return -1;for(var n=-1,s=1/0,r=0,o=i.length;r(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},Yb=Phaser.Utils.Objects.IsPlainObject,Wb=Phaser.Utils.Objects.GetValue,Vb=Phaser.Display.Align.CENTER,Xb={min:0,full:-1},Gb=function(t,e,i,s,r,o,a,h,l,u){wp.call(this,t);var c=t.isRexSpace,d=n(e);if(null===e)return this;if("number"===d);else if("string"===d)e=Xb[e];else if(Yb(e)){var f;e=Wb(f=e,"proportion",void 0),i=Wb(f,"align",Vb),s=Wb(f,"padding",0),r=Wb(f,"expand",!1),o=Wb(f,"key",void 0),a=Wb(f,"index",void 0),t.isRexSizer||(h=Wb(f,"minWidth",void 0),l=Wb(f,"minHeight",void 0)),u=Wb(f,"fitRatio",0);}return "string"==typeof i&&(i=Hf[i]),void 0===e&&(e=c?1:0),void 0===i&&(i=Vb),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=i,f.padding=xp(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?Lr(t):h:t.minHeight=void 0===l?Br(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},Hb={add:Gb,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),Gb.call(this,new Ab(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return Yb(i)&&(i.index=t),Gb.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=Fb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Ub=Phaser.Utils.Array.Remove,Nb={remove:function(t,e){return this.getParentSizer(t)!==this||(Ub(this.sizerChildren,t),_p.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ok.call(this,t),this}},Kb={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Hf[e]),this.getSizerConfig(t).align=e,this}},Jb={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=Ap.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(Jb,Hb,Nb,Kb,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var Zb=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},qb={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},$b=function(t){return "string"==typeof t&&(t=qb[t]),t},Qb=Phaser.Utils.Objects.IsPlainObject,tx=Phaser.Utils.Objects.GetValue,ex=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l){var u;return r(this,i),Qb(n)?(n=tx(l=n,"x",0),s=tx(l,"y",0),o=tx(l,"width",void 0),a=tx(l,"height",void 0),h=tx(l,"orientation",0)):Qb(o)?(o=tx(l=o,"width",void 0),a=tx(l,"height",void 0),h=tx(l,"orientation",0)):Qb(h)&&(h=tx(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,n,s,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(tx(l,"space.item",0)),u.setStartChildIndex(tx(l,"startChildIndex",0)),u.setRTL(tx(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return a(i,[{key:"setOrientation",value:function(t){return this.orientation=$b(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=Zb.call(this)),this._childrenProportion}}]),i}(mk);Object.assign(ex.prototype,Jb);var ix=function(t,e,i){if(t){var n=null==e,s=null==i;return n&&s||(n||(t.displayWidth=e),s||(t.displayHeight=i),n&&(t.scaleX=t.scaleY),s&&(t.scaleY=t.scaleX)),t}},nx={appendText:Ri,resetDisplayContent:function(t){void 0===t?t={}:"string"==typeof t&&(t={text:t});var e=t.text||"";this.setText(e);var i=this.childrenMap.icon;if(i){t.icon?this.show(i):this.hide(i);var n=t.iconSize;n&&(this.setChildDisplaySize(i,n,n),void 0!==this.iconWidth&&this.setIconSize(n)),!0!==t.icon&&this.setIconTexture(t.icon,t.iconFrame);}var s=this.childrenMap.action;if(s){t.action?this.show(s):this.hide(s);var r=t.actionSize;r&&(this.setChildDisplaySize(s,r,r),void 0!==this.actionWidth&&this.setActionSize(r)),!0!==t.action&&this.setActionTexture(t.action,t.actionFrame);}return this}},sx=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"text",get:function(){var t=this.childrenMap.text;return t?t.text:""},set:function(t){var e=this.childrenMap.text;e&&e.setText(t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"setIconTexture",value:function(t,e){var i=this.childrenMap.icon;return i?(i.setTexture(t,e),void 0!==this.iconWidth&&void 0!==this.iconHeight&&(ix(i,this.iconWidth,this.iconHeight),this.resetChildScaleState(i)),this):this}},{key:"setTexture",value:function(t,e){return this.setIconTexture(t,e),this}},{key:"setIconSize",value:function(t,e){return void 0===e&&(e=t),this.iconWidth=t,this.iconHeight=e,this}},{key:"texture",get:function(){var t=this.childrenMap.icon;if(t)return t.texture}},{key:"frame",get:function(){var t=this.childrenMap.icon;if(t)return t.frame}},{key:"setActionTexture",value:function(t,e){var i=this.childrenMap.action;return void 0===i||(i.setTexture(t,e),void 0!==this.actionWidth&&void 0!==this.actionHeight&&(ix(i,this.actionWidth,this.actionHeight),this.resetChildScaleState(i))),this}},{key:"actionTexture",get:function(){var t=this.childrenMap.action;if(t)return t.texture}},{key:"actionFrame",get:function(){var t=this.childrenMap.action;if(t)return t.frame}},{key:"setActionSize",value:function(t,e){return void 0===e&&(e=t),this.actionWidth=t,this.actionHeight=e,this}},{key:"preLayout",value:function(){var t=this.childrenMap.icon;t&&void 0!==this.iconWidth&&void 0!==this.iconHeight&&ix(t,this.iconWidth,this.iconHeight);var e=this.childrenMap.action;e&&void 0!==this.actionWidth&&void 0!==this.actionHeight&&ix(e,this.actionWidth,this.actionHeight),g(u(i.prototype),"preLayout",this).call(this);}},{key:"postLayout",value:function(t,e,i){var n=this.childrenMap.iconMask;n&&(n.setPosition(),this.resetChildPositionState(n));var s=this.childrenMap.actionMask;return s&&(s.setPosition(),this.resetChildPositionState(s)),this}},{key:"resize",value:function(t,e){g(u(i.prototype),"resize",this).call(this,t,e);var n=this.childrenMap.iconMask;n&&n.resize();var s=this.childrenMap.actionMask;return s&&s.resize(),this}}]),i}(ex);Object.assign(sx.prototype,nx);var rx=function(t,e,i,n){var s=new Tm(e,i,n);if(t&&!t.isRexSizer){var r=s.createGeometryMask();t.setMask(r),this.once("destroy",(function(){t.setMask(),r.destroy();}));}return this.pin(s),s},ox=Phaser.Utils.Objects.GetValue,ax=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexLabel";var o=ox(n,"background",void 0),a=ox(n,"icon",void 0),h=ox(n,"iconMask",void 0),l=ox(n,"text",void 0),u=ox(n,"action",void 0),c=ox(n,"actionMask",void 0),f=ox(n,"align",void 0);if(o&&s.addBackground(o),"right"!==f&&"bottom"!==f&&"center"!==f||s.addSpace(),a){0===s.orientation?(l||u)&&(x={right:ox(n,"space.icon",0),top:ox(n,"space.iconTop",0),bottom:ox(n,"space.iconBottom",0),left:ox(n,"space.iconLeft",0)}):(l||u)&&(x={bottom:ox(n,"space.icon",0),left:ox(n,"space.iconLeft",0),right:ox(n,"space.iconRight",0),top:ox(n,"space.iconTop",0)});var p=ox(n,"squareFitIcon",!1)?1:0;if(s.add(a,{proportion:0,padding:x,fitRatio:p}),h&&(h=rx.call(d(s),a,a,1)),!p){var v=ox(n,"iconSize",void 0);s.setIconSize(ox(n,"iconWidth",v),ox(n,"iconHeight",v));}}if(l){var g,y,k=ox(n,"space.text",0),m=ox(n,"expandTextWidth",!1),b=ox(n,"expandTextHeight",!1);0===s.orientation?(g=m?1:0,u&&(x={right:k}),y=b):(g=b?1:0,u&&(x={bottom:k}),y=m),s.add(l,{proportion:g,expand:y,padding:x});}if(u){var x;x=0===s.orientation?{top:ox(n,"space.actionTop",0),bottom:ox(n,"space.actionBottom",0),right:ox(n,"space.actionRight",0)}:{left:ox(n,"space.actionLeft",0),right:ox(n,"space.actionRight",0),bottom:ox(n,"space.actionBottom",0)};p=ox(n,"squareFitAction",!1)?1:0;if(s.add(u,{proportion:0,padding:x,fitRatio:p}),c&&(c=rx.call(d(s),u,u,1)),!p){var C=ox(n,"actionSize");s.setActionSize(ox(n,"actionWidth",C),ox(n,"actionHeight",C));}}return "center"===f&&s.addSpace(),s.addChildrenMap("background",o),s.addChildrenMap("icon",a),s.addChildrenMap("iconMask",h),s.addChildrenMap("text",l),s.addChildrenMap("action",u),s.addChildrenMap("actionMask",c),s}return a(i)}(sx),hx=Phaser.Utils.Objects.GetValue,lx=function(t,e){var i=hx(e,"canvas"),n=hx(i,"width",128),s=hx(i,"height",128),r=new Bc(t,0,0,n,s);t.add.existing(r);var o=hx(i,"key"),a=hx(i,"frame"),h=hx(i,"fill");return void 0!==h?r.fill(h):void 0!==o&&r.loadTexture(o,a),r.setTexture=r.loadTexture.bind(r),r},ux=Phaser.Utils.Objects.GetValue,cx=function(t,e){var i=ux(e,"clickTarget",t);return "string"==typeof i&&(i=t.getElement(i)),i},dx=Phaser.Utils.Objects.GetValue,fx={accept:"image/*",multiple:!1},px=function(t,e){if(0!==e.length){var i=t.childrenMap.icon,n=i.image,s=e[0];return n.loadFromFilePromise(s).then((function(){i.scaleImage(),t.emit("select",s,t);}))}},vx={openPromise:function(){var t,e=this;return (t=i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e,t.abrupt("return",xb(e.scene.game,fx).then((function(t){return px(n,t.files)})));case 2:case"end":return t.stop()}}),t)})),function(){var e=this,i=arguments;return new Promise((function(n,r){var o=t.apply(e,i);function a(t){s(o,n,r,a,h,"next",t);}function h(t){s(o,n,r,a,h,"throw",t);}a(void 0);}))})()},open:function(){return this.openPromise(),this}},gx={getFileName:function(t){if(!t)return null;var e=t.name;return e.substr(0,e.lastIndexOf("."))},saveTexture:function(t){return this.childrenMap.canvas.generateTexture(t),this}};Object.assign(gx,vx);var yx=Phaser.Utils.Objects.GetValue,kx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i);var o=function(t,e){var i=new sb(t,{scaleUp:hx(e,"scaleUpIcon",!0),image:lx(t,e)});return t.add.existing(i),i}(t,n);n.icon=o,(s=e.call(this,t,n)).type="rexImageFileInputLabel";var a=s.iconWidth,h=s.iconWidth;return void 0!==a&&void 0!==h&&o.resize(a,h),s.clickTarget=cx(d(s),n),s.clickTarget&&(yx(n,"domButton",!0)?s.fileChooser=function(t,e){var i=t.scene,n=new Mb(i,fx);return i.add.existing(n),t.pin(n),n.on("change",(function(){px(t,n.files);})),n}(d(s)):s.clickBehavior=function(t,e){var i=cx(t,e);if(i){var n=dx(e,"click"),s=new pc(i,n);return s.on("click",t.open,t),s}}(d(s),n)),s.addChildrenMap("canvas",o.image),s.addChildrenMap("fileChooser",s.fileChooser),s}return a(i,[{key:"postLayout",value:function(){this.fileChooser&&(this.fileChooser.syncTo(this.clickTarget),this.resetChildState(this.fileChooser));}}]),i}(ax);Object.assign(kx.prototype,gx),M.register("imageInputLabel",(function(t){var e=new kx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ImageInputLabel",kx);var mx=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(cr(t,e))return t[e];var i=t.parent;return cr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return cr(t,e)?t[e]=i:cr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(ho),bx=Phaser.Utils.Objects.GetValue,xx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).style=bx(n,"style",d(s));var o=bx(n,"propertiesMap");return s.activeStyle=Cx(n,"active",o),s.hoverStyle=Cx(n,"hover",o),s.disableStyle=Cx(n,"disable",o),s.onModifyStyle=bx(n,"onModifyStyle"),s}return a(i,[{key:"getStyle",value:function(t){return Vl(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return Xl(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return wx.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return wx.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return wx.call(this,"disable",t),this}}]),i}(ho),Cx=function(t,e,i){var n=Wl(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},wx=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Sx={addStyleManager:function(t){return this.styleManager=new xx(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},Px=Phaser.GameObjects.Image,Tx=Phaser.Utils.Objects.GetValue,Ox=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Tx(n,"x",0),a=Tx(n,"y",0),h=Tx(n,"key",""),l=Tx(n,"frame",void 0);(s=e.call(this,t,o,a,h,l)).type="rexStatesImage";var u=Tx(n,"effects",!0);return u&&gr(d(s),u),s.style=new mx(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Px);Object.assign(Ox.prototype,Sx),M.register("statesImage",(function(t){var e=new Ox(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesImage",Ox);var Mx=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexStatesRoundRectangleShape",n.style=d(s),n.propertiesMap=Ex,s.addStyleManager(n),delete n.style,delete n.propertiesMap,s}return a(i)}(oe),Ex={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Mx.prototype,Sx),M.register("statesRoundRectangle",(function(t){var e=new Mx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesRoundRectangle",Mx);var _x=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),f(s=e.call(this,t),new Proxy(d(s),d(s)))}return a(i,[{key:"get",value:function(t,e){if(cr(t,e))return t[e];var i=t.parent;return cr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return cr(t,e)?t[e]=i:cr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(ho),Rx=Phaser.GameObjects.NineSlice,Lx=Phaser.Utils.Objects.GetValue,Bx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Lx(n,"x",0),a=Lx(n,"y",0),h=Lx(n,"key",null),l=Lx(n,"frame",null),u=Lx(n,"width",0),c=Lx(n,"height",0),f=Lx(n,"leftWidth",0),p=Lx(n,"rightWidth",0),v=Lx(n,"topHeight",0),g=Lx(n,"bottomHeight",0);(s=e.call(this,t,o,a,h,l,u,c,f,p,v,g)).type="rexStatesNineSlice";var y=Lx(n,"effects",!0);return y&&gr(d(s),y),s.style=new _x(d(s),n),n.style=s.style,s.addStyleManager(n),delete n.style,s}return a(i)}(Rx);Object.assign(Bx.prototype,Sx),M.register("statesNineSlice",(function(t){var e=new Bx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesNineSlice",Bx);var Dx=Phaser.GameObjects.Text,Ix=Phaser.Utils.Objects.GetValue,jx=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Ix(n,"x",0),a=Ix(n,"y",0),h=Ix(n,"text","");return (s=e.call(this,t,o,a,h,n)).type="rexStatesText",n.style=s.style,n.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},s.addStyleManager(n),delete n.style,s}return a(i)}(Dx);Object.assign(jx.prototype,Sx),M.register("statesText",(function(t){var e=new jx(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.StatesText",jx);var zx=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},Ax=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;return r(this,i),(l=e.call(this,t,n,s,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return a(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(g(u(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Bc),Fx={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,zx(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return Nx(this.sizerChildren,null),Ok.call(this,t),this}},Jx={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Nx(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Qx={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=Ap.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,Nx(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Nx(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},eC=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},iC=Phaser.Utils.Objects.IsPlainObject,nC=Phaser.Utils.Objects.GetValue,sC=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h,l,u,c,d){var f;return r(this,i),iC(n)?(n=nC(d=n,"x",0),s=nC(d,"y",0),o=nC(d,"width",void 0),a=nC(d,"height",void 0),h=nC(d,"column",d.col||0),l=nC(d,"row",0),u=nC(d,"columnProportions",0),c=nC(d,"rowProportions",0)):iC(o)?(o=nC(d=o,"width",void 0),a=nC(d,"height",void 0),h=nC(d,"column",d.col||0),l=nC(d,"row",0),u=nC(d,"columnProportions",0),c=nC(d,"rowProportions",0)):iC(h)?(h=nC(d=h,"column",d.col||0),l=nC(d,"row",0),u=nC(d,"columnProportions",0),c=nC(d,"rowProportions",0)):iC(u)&&(u=nC(d=u,"columnProportions",0),c=nC(d,"rowProportions",0)),(f=e.call(this,t,n,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(nC(d,"createCellContainerCallback")),f.setIndentLeft(nC(d,"space.indentLeftOdd",0),nC(d,"space.indentLeftEven",0)),f.setIndentTop(nC(d,"space.indentTopOdd",0),nC(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,nC(d,"space",void 0)),f}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{key:"setColumnProportion",value:function(t,e){return t>=this.columnProportions.length||(this.columnProportions[t]=e),this}},{key:"setRowProportion",value:function(t,e){return t>=this.rowProportions.length||(this.rowProportions[t]=e),this}},{key:"totalColumnProportions",get:function(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=tC.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=eC.call(this)),this._totalRowProportions}},{key:"getChildAt",value:function(t,e){return this.sizerChildren[e*this.columnCount+t]}},{key:"childToGridIndex",value:function(t,e){if(!t)return null;var i=this.sizerChildren.indexOf(t);return -1===i?null:(void 0===e&&(e={}),e.x=i%this.columnCount,e.y=Math.floor(i/this.columnCount),e)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(mk);Object.assign(sC.prototype,Qx),M.register("gridSizer",(function(t,e,i,n,s,r,o,a,h){var l=new sC(this.scene,t,e,i,n,s,r,o,a,h);return this.scene.add.existing(l),l})),$(window,"RexPlugins.UI.GridSizer",sC);var rC=function(t,e,i,n){return e/t<=i?e/(n-1):0},oC=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=lC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=lC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},cC=Phaser.Utils.Objects.IsPlainObject,dC=Phaser.Utils.Objects.GetValue,fC=Phaser.Display.Align.CENTER,pC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(wp.call(this,t),cC(e))&&(e=dC(s=e,"padding",0),i=dC(s,"key",void 0),n=dC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=fC,s.padding=xp(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},vC={add:function(t,e,i){if(xg(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ok.call(this,t),this}},kC={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)nw.call(this,e[i],t);return this}},rw=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},ow=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,rw.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},aw={add:function(t){return this.buttons.push(t),t._click||(t._click=new pc(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),ow.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)ww.call(this,e[i],t);return this}},Pw=Phaser.Utils.Objects.GetValue,Tw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=Pw(n,"row",0),a=Pw(n,"column",n.col||0),h=Pw(n,"createCellContainerCallback"),l=Pw(n,"buttons",void 0),u=Pw(n,"expand",!0),c=u?1:0;if(h&&(n.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&Ow.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Lw.call(this,e[i],t);return this}},Dw=Phaser.Utils.Objects.GetValue,Iw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=n.space;"number"==typeof o&&(n.space={item:o,line:o}),(s=e.call(this,t,n)).type="rexFixWidthButtons",s.buttonGroup=new pw({parent:d(s),eventEmitter:Dw(n,"eventEmitter",d(s)),groupName:Dw(n,"groupName",void 0),clickConfig:Dw(n,"click",void 0)}).setButtonsType(n);var a=Dw(n,"background",void 0),h=Dw(n,"buttons",void 0);return s.buttonsAlign=Dw(n,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(wC);Object.assign(Iw.prototype,Ew,Bw,fw,gw),M.register("fixWidthButtons",(function(t){var e=new Iw(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FixWidthButtons",Iw);var jw=Phaser.Utils.Objects.GetValue,zw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexFileSelectorButton";var o=new Mb(t);return t.add.existing(o),s.addBackground(o),s.addChildrenMap("fileChooser",o),s.setAccept(jw(n,"accept","")),s.setMultiple(jw(n,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),d(s)),s}return a(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(ax);Object.assign(zw.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}}),M.register("fileSelectorButton",(function(t){var e=new zw(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.FileSelectorButton",zw);var Aw={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},Fw={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,mg.modal.call(this,t,e),this}},Yw={};Object.assign(Yw,Aw,Fw);var Ww=Phaser.Utils.Objects.GetValue,Vw=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexDialog",s.eventEmitter=Ww(n,"eventEmitter",d(s));var o,a,h,l,u=Ww(n,"background",void 0),c=Ww(n,"title",void 0),f=Ww(n,"toolbar",void 0),p=Ww(n,"toolbarBackground",void 0),v=Ww(n,"leftToolbar",void 0),g=Ww(n,"leftToolbarBackground",void 0),y=Ww(n,"content",void 0),k=Ww(n,"description",void 0),m=Ww(n,"choices",void 0),b=Ww(n,"choicesBackground",void 0),x=Ww(n,"actions",void 0),C=Ww(n,"actionsBackground",void 0),w=Ww(n,"click",void 0);if(u&&s.addBackground(u),f&&(h=new kw(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Ww(n,"space.toolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),v&&(l=new kw(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Ww(n,"space.leftToolbarItem",0)},click:w,eventEmitter:s.eventEmitter})),c||f||v){var S,P=!!c&&Ww(n,"expand.title",!0),T=Ww(n,"align.title","center"),O=!(c&&!P&&"center"===T||!c&&(f||v));S=O?new ex(t,{orientation:0}):new Bk(t);var M=!!O||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),c){O&&!P&&"right"===T&&S.addSpace();var E={left:Ww(n,"space.titleLeft",0),right:Ww(n,"space.titleRight",0)},_=P?1:0;S.add(c,{align:T,proportion:_,expand:M,padding:E}),O&&!P&&"left"===T&&S.addSpace();}h&&(O&&!c&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||x)&&(E={bottom:Ww(n,"space.title",0),top:Ww(n,"space.titleTop",0)});_=Ww(n,"proportion.title",0);s.add(S,{padding:E,proportion:_,expand:!0});}if(y){var R=Ww(n,"align.content","center"),L=Ww(n,"space.content",0),B=(E={left:Ww(n,"space.contentLeft",0),right:Ww(n,"space.contentRight",0),bottom:k||m||x?L:0},_=Ww(n,"proportion.content",0),Ww(n,"expand.content",!0));s.add(y,{align:R,padding:E,proportion:_,expand:B});}if(k){R=Ww(n,"align.description","center");var D=Ww(n,"space.description",0);E={left:Ww(n,"space.descriptionLeft",0),right:Ww(n,"space.descriptionRight",0),bottom:m||x?D:0},_=Ww(n,"proportion.description",0),B=Ww(n,"expand.description",!0);s.add(k,{align:R,padding:E,proportion:_,expand:B});}if(m){var I=Ww(n,"choicesType","").split("-"),j=Xw(I,"wrap")?Iw:Xw(I,"grid")?Tw:kw,z=Xw(I,"radio")?"radio":Xw(I,"checkboxes")?"checkboxes":void 0,A={left:Ww(n,"space.choicesBackgroundLeft",0),right:Ww(n,"space.choicesBackgroundRight",0),top:Ww(n,"space.choicesBackgroundTop",0),bottom:Ww(n,"space.choicesBackgroundBottom",0)},F=Ww(n,"space.choice",0);j===kw?A.item=F:j===Iw?(A.item=F,A.line=Ww(n,"space.choiceLine",F)):(A.column=Ww(n,"space.choiceColumn",F),A.row=Ww(n,"space.choiceRow",F));var Y={width:Ww(n,"choicesWidth",void 0),height:Ww(n,"choicesHeight",void 0),groupName:"choices",buttonsType:z,background:b,buttons:m,space:A,click:w,eventEmitter:s.eventEmitter,setValueCallback:Ww(n,"choicesSetValueCallback",void 0),setValueCallbackScope:Ww(n,"choicesSetValueCallbackScope",void 0)};j===kw&&(Y.orientation=Xw(I,"x")?0:1),o=new j(t,Y);var W=Ww(n,"space.choices",0);E={left:Ww(n,"space.choicesLeft",0),right:Ww(n,"space.choicesRight",0),bottom:x?W:0},R=Ww(n,"align.choices","center"),_=Ww(n,"proportion.choices",0),B=Ww(n,"expand.choices",!0);s.add(o,{align:R,padding:E,proportion:_,expand:B}),s.buttonsType=z;}if(x){a=new kw(t,{groupName:"actions",background:C,buttons:x,orientation:0,space:{item:Ww(n,"space.action",0)},expand:Ww(n,"expand.actions",!1),align:Ww(n,"align.actions","center"),click:w,eventEmitter:s.eventEmitter});E={left:Ww(n,"space.actionsLeft",0),right:Ww(n,"space.actionsRight",0),bottom:Ww(n,"space.actionsBottom",0)},_=Ww(n,"proportion.action",0);s.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Hw(d(s),"click"),Hw(d(s),"over"),Hw(d(s),"out"),Hw(d(s),"enable"),Hw(d(s),"disable"),s.addChildrenMap("background",u),s.addChildrenMap("title",c),s.addChildrenMap("toolbar",f),s.addChildrenMap("leftToolbar",v),s.addChildrenMap("content",y),s.addChildrenMap("description",k),s.addChildrenMap("choices",o?o.buttons:void 0),s.addChildrenMap("actions",a?a.buttons:void 0),s.addChildrenMap("choicesSizer",o),s.addChildrenMap("actionsSizer",a),s.addChildrenMap("toolbarSizer",h),s.addChildrenMap("leftToolbarSizer",l),s}return a(i)}(ex),Xw=function(t,e){return -1!==t.indexOf(e)},Gw={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Hw=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Gw.hasOwnProperty(n)&&t.emit("".concat(Gw[n],".").concat(e),i,s,r,o);}));};Object.assign(Vw.prototype,Yw),M.register("dialog",(function(t){var e=new Vw(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Dialog",Vw);var Uw=function(t,e,i){var n=new zC(t,e,i);return t.add.existing(n),n},Nw=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Kw=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Jw=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(Hv),AS=Phaser.Utils.Objects.GetValue,FS=Phaser.Math.Distance.Between,YS=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n))._enable=void 0,t.setInteractive(AS(n,"inputConfig",void 0)),s.resetFromJSON(n),s.boot(),s}return a(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(AS(t,"enable",!0)),this.holdThreshold=AS(t,"holdThreshold",50),this.pointerOutReleaseEnable=AS(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return hu(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:FS(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(ho),WS=Phaser.Utils.Objects.GetValue,VS=function(){function t(e){r(this,t),this.resetFromJSON(e);}return a(t,[{key:"resetFromJSON",value:function(t){return this.setValue(WS(t,"value",0)),this.setSpeed(WS(t,"speed",0)),this.setAcceleration(WS(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),XS=function(){function t(){r(this,t),this.value,this.dir,this.movement=new VS;}return a(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(ho),NS={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},KS=Phaser.Utils.Objects.GetValue,JS=function(t){l(i,t);var e=p(i);function i(t,n){var s;(r(this,i),(s=e.call(this,t,n)).parent!==s.scene?s.focusMode=KS(n,"focus",!0):s.focusMode=!1,s.setSpeed(KS(n,"speed",.1)),s.setEnable(KS(n,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(KS(n,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),d(s)):s.scene.input.on("wheel",s.onSceneScroll,d(s));return s}return a(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(ho),ZS=Phaser.Utils.Objects.GetValue,qS=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?ZS(n,c,void 0):ZS(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=Qe(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new jS(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=ZS(s,"position",0);"string"==typeof v&&(v=$S[v]);var g=ZS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=ZS(n,"space.slider",void 0))&&(g=l?0:ZS(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=ZS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=ZS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=ZS(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?ZS(n,k,!0):ZS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new US(u,o));var m,b,x,C,w=ZS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new JS(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",C="scroll".concat(i)):(b="t",C="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(C,t);})));a&&(l?(x="childO".concat(i),C="scroll".concat(i)):(x="childOY",C="scroll"),a.on("valuechange",(function(e){t[x]=e,t.emit(C,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},$S={right:0,left:1,bottom:0,top:1},QS=Phaser.Utils.Objects.GetValue,tP=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=QS(e,"width"),o=QS(e,"height");r||(QS(e,"child.expandWidth",!0)||(n[1]=0));o||(QS(e,"child.expandHeight",!0)||(s[1]=0));var a=new sC(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=aS(i,"child"),s=aS(n,"gameObject",void 0);if(s){var r=aS(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=aS(r,"top",0),o.bottom=aS(r,"bottom",0),a.left=aS(r,"left",0),a.right=aS(r,"right",0);break;case 1:o.top=aS(r,"left",0),o.bottom=aS(r,"right",0),a.top=aS(r,"top",0),a.bottom=aS(r,"bottom",0);break;default:o.top=aS(r,"top",0),o.bottom=aS(r,"bottom",0),o.left=aS(r,"left",0),o.right=aS(r,"right",0);}e.add(s,{column:1,row:1,align:aS(n,"align","center"),padding:a,expand:{width:aS(n,"expandWidth",!0),height:aS(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:qS(t,a,"y",e);break;case 1:qS(t,a,"x",e);break;default:qS(t,a,"y",e),qS(t,a,"x",e);}return a},eP=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},iP=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},nP=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},cP=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},dP=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},fP=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},pP=function(t,e){switch(lP(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},vP=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&gP.call(this);},gP=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},yP=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},kP={setText:function(t){return void 0!==t&&(this.text=t),this.lines=uP(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(cP.call(this,-this.textOY)),0),e=dP.call(this,t)+this.textOY,i=fP.call(this,t);return pP(this.textObject,i),this.textObject.rexSizer.offsetY=e,vP.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Yp.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,yP.call(this,t,r,o),vp(t,n,s,r,o,e.align),e.preOffsetY=0,vP.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},mP=Phaser.Utils.Objects.IsPlainObject,bP=Phaser.Utils.Objects.GetValue,xP=Phaser.Display.Align.TOP_LEFT,CP=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a,h){var l;r(this,i),mP(n)?(n=bP(h=n,"x",0),s=bP(h,"y",0),o=bP(h,"width",void 0),a=bP(h,"height",void 0)):mP(o)&&(o=bP(h=o,"width",void 0),a=bP(h,"height",void 0)),(l=e.call(this,t,n,s,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=bP(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(bP(h,"clamplTextOY",!0)),l.alwaysScrollable=bP(h,"alwaysScrollable",!1);var u=bP(h,"background",void 0),c=bP(h,"text",void 0);void 0===c&&(c=wP(t)),l.textCropEnable=bP(h,"textCrop",!!c.setCrop);var f=bP(h,"textMask",!l.textCropEnable);u&&l.addBackground(u),l.add(c),l.sizerChildren=[c];var p=l.getSizerConfig(c);return p.align=xP,p.padding=xp(0),p.expand=!0,l.textObject=c,l.textObjectType=lP(c),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=rx.call(d(l),l.textObject,d(l))),l.addChildrenMap("background",u),l.addChildrenMap("text",c),l}return a(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}g(u(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(cP.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=dP.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(mk),wP=function(t){return t.add.text(0,0,"")};Object.assign(CP.prototype,kP);var SP={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},PP=Phaser.Utils.Objects.GetValue,TP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=PP(n,"text",void 0),a=PP(n,"textWidth",void 0),h=PP(n,"textHeight",void 0),l=PP(n,"textCrop",!!o.setCrop),u=PP(n,"textMask",!l),c=PP(n,"content",""),d=new CP(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:PP(n,"clamplChildOY",!1),alwaysScrollable:PP(n,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),n.scrollMode=0,n.type="rexTextArea",n.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=PP(n,"space",void 0);return f&&(f.child=PP(f,"text",0)),(s=e.call(this,t,n)).addChildrenMap("text",o),s}return a(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(aP);Object.assign(TP.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},SP);var OP=Phaser.Utils.Objects.GetValue,MP=function(t,e,i){e=e?_(e):{};var n=OP(i,"background",PC),s=OP(i,"text",MC),r=OP(i,"track",PC),o=OP(i,"thumb",PC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new TP(t,e);return t.add.existing(h),h},EP=Phaser.Utils.Objects.GetValue,_P=Phaser.Utils.Objects.GetValue,RP=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;r(this,i),n=n?_(n):{},void 0===s&&(s={});var a=_P(s,"background",PC);a?n.background=a(t,n.background):delete n.background,n.title=Uw(t,n.title,s.title),n.content=function(t,e,i){var n,s=EP(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new MP(t,e,i):new Uw(t,e,i);return t.add.existing(n),n}(t,n.content,s.content),n.content instanceof TP&&Yl(n,"height")&&!Yl(n,"proportion.content")&&$(n,"proportion.content",1);var h=n.button,l=n.buttonA||h,u=n.buttonB||h,c=n.buttonMode;void 0===c&&(c=l&&u?2:l?1:0);var f=s.button,p=s.buttonA||f,v=s.buttonB||f;switch(c){case 2:n.actions=[Uw(t,l,p),Uw(t,u,v)];break;case 1:n.actions=[Uw(t,l,p)];break;case 0:break;default:n.actions=[];}var g=n.choice;g&&(n.choices=[]),(o=e.call(this,t,n)).type="rexConfirmDialog",o.buttonMode=c,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=s.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),nS.call(d(o)),o}return a(i)}(Vw);Object.assign(RP.prototype,qw),M.register("confirmDialog",(function(t,e){var i=new RP(this.scene,t,e);return this.scene.add.existing(i),i})),$(window,"RexPlugins.UI.ConfirmDialog",RP);var LP=Phaser.Utils.Objects.GetValue,BP=function(t,e,i){var n=LP(t,"proportion.".concat(e),i.proportion),s=LP(t,"align.".concat(e),"center"),r=LP(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:LP(t,"expand.".concat(e),!0)}},DP=function(t){return BP(t,"header",{proportion:0,paddingKey:"bottom"})},IP=function(t){return BP(t,"leftSide",{proportion:0,paddingKey:"right"})},jP=function(t){return BP(t,"content",{proportion:1})},zP=function(t){return BP(t,"rightSide",{proportion:0,paddingKey:"left"})},AP=function(t){return BP(t,"footer",{proportion:0,paddingKey:"top"})},FP=function(t,e){var i=new ex(t,{orientation:e});return t.add.existing(i),i},YP=Phaser.Utils.Objects.GetValue,WP=[function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,IP(t));var r=t.content;r&&n.add(r,jP(t));var o=t.rightSide;o&&n.add(o,zP(t));var a=t.footer;a&&this.add(a,AP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,IP(t));var r=FP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=FP(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,jP(t));var h=t.rightSide;h&&o.add(h,zP(t));var l=t.footer;l&&r.add(l,AP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=FP(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=FP(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,IP(t));var a=t.content;a&&r.add(a,jP(t));var h=t.footer;h&&s.add(h,AP(t));var l=t.rightSide;l&&n.add(l,zP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,DP(t));var n=FP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,IP(t));var r=FP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,jP(t));var a=t.footer;a&&r.add(a,AP(t));var h=t.rightSide;h&&n.add(h,zP(t));}],VP={FFF:0,LFF:1,FFR:2,LFR:3},XP=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={}),n.orientation=1,(s=e.call(this,t,n)).type="rexHolyGrail",s.build(n),s}return a(i)}(ex),GP={build:function(t){this.clear(!0);var e=YP(t,"background",void 0);e&&this.addBackground(e);var i=YP(t,"layoutMode",0);"string"==typeof i&&(i=VP[i.toUpperCase()]),(WP[i]||WP[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(XP.prototype,GP),M.register("holyGrail",(function(t){var e=new XP(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.HolyGrail",XP);var HP={getButtonsSizer:function(t){return this.childrenMap["".concat(t,"ButtonsSizer")]},getButton:function(t,e){var i=this.getButtonsSizer(t);return i?i.getButton(e):void 0},setButtonEnable:function(t,e,i){return this.getButtonsSizer(t).setButtonEnable(e,i),this},setLeftButtonEnable:function(t,e){return this.childrenMap.leftButtonsSizer.setButtonEnable(t,e),this},setRightButtonEnable:function(t,e){return this.childrenMap.rightButtonsSizer.setButtonEnable(t,e),this},setTopButtonEnable:function(t,e){return this.childrenMap.topButtonsSizer.setButtonEnable(t,e),this},setBottomButtonEnable:function(t,e){return this.childrenMap.bottomButtonsSizer.setButtonEnable(t,e),this},toggleButtonEnable:function(t,e){return this.getButtonsSizer(t).toggleButtonEnable(e),this},toggleLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.toggleButtonEnable(t),this},toggleRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.toggleButtonEnable(t),this},toggleTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.toggleButtonEnable(t),this},toggleBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.toggleButtonEnable(t),this},getButtonEnable:function(t,e){return this.getButtonsSizer(t).getButtonEnable(e)},getLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.getButtonEnable(t)},getRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.getButtonEnable(t)},getTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.getButtonEnable(t)},getBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.getButtonEnable(t)},emitButtonClick:function(t,e){var i=this.getButtonsSizer(t);return i?(i.emitButtonClick(e),this):this},emitLeftButtonClick:function(t){return this.childrenMap.leftButtonsSizer.emitButtonClick(t),this},emitRightButtonClick:function(t){return this.childrenMap.rightButtonsSizer.emitButtonClick(t),this},emitTopButtonClick:function(t){return this.childrenMap.topButtonsSizer.emitButtonClick(t),this},emitBottomButtonClick:function(t){return this.childrenMap.bottomButtonsSizer.emitButtonClick(t),this},getLeftButton:function(t){return this.childrenMap.leftButtonsSizer.getButton(t)},getRightButton:function(t){return this.childrenMap.rightButtonsSizer.getButton(t)},getTopButton:function(t){return this.childrenMap.topButtonsSizer.getButton(t)},getBottomButton:function(t){return this.childrenMap.bottomButtonsSizer.getButton(t)},showButton:function(t,e){return Lv(this.getButton(t,e)),this},showLeftButton:function(t){return Lv(this.getLeftButton(t)),this},showRightButton:function(t){return Lv(this.getRightButton(t)),this},showTopButton:function(t){return Lv(this.getTopButton(t)),this},showBottomButton:function(t){return Lv(this.getBottomButton(t)),this},hideButton:function(t,e){return Bv(this.getButton(t,e)),this},hideLeftButton:function(t){return Bv(this.getLeftButton(t)),this},hideRightButton:function(t){return Bv(this.getRightButton(t)),this},hideTopButton:function(t){return Bv(this.getTopButton(t)),this},hideBottomButton:function(t){return Bv(this.getBottomButton(t)),this},addButton:function(t,e){return this.getButtonsSizer(t).addButton(e),this},addLeftButton:function(t){return this.addButton("left",t),this},addRightButton:function(t){return this.addButton("right",t),this},addTopButton:function(t){return this.addButton("top",t),this},removeButton:function(t,e,i){return this.getButtonsSizer(t).removeButton(e,i),this},removeLeftButton:function(t,e){return this.removeButton("left",t,e),this},removeRightButton:function(t,e){return this.removeButton("right",t,e),this},removeTopButton:function(t,e){return this.removeButton("top",t,e),this},removeBottomButton:function(t,e){return this.removeButton("bottom",t,e),this},clearButtons:function(t,e){return this.getButtonsSizer(t).clearButtons(e),this},clearLeftButtons:function(t){return this.clearButtons("left",t),this},clearRightButtons:function(t){return this.clearButtons("right",t),this},clearTopButtons:function(t){return this.clearButtons("top",t),this},clearBottomButtonss:function(t){return this.clearButtons("bottom",t),this},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),this},forEachLeftButton:function(t,e){return this.childrenMap.leftButtonsSizer.forEachButtton(t,e),this},forEachRightButton:function(t,e){return this.childrenMap.rightButtonsSizer.forEachButtton(t,e),this},forEachTopButton:function(t,e){return this.childrenMap.topButtonsSizer.forEachButtton(t,e),this},forEachBottomButton:function(t,e){return this.childrenMap.bottomButtonsSizer.forEachButtton(t,e),this}},UP=Phaser.Utils.Objects.GetValue,NP=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),n.column=3,n.row=3,(s=e.call(this,t,n)).type="rexTabs",s.eventEmitter=UP(n,"eventEmitter",d(s));var o,a,h,l,u=UP(n,"background",void 0),c=UP(n,"panel",void 0),f=UP(n,"leftButtons",void 0),p=UP(n,"leftButtonsBackground",void 0),v=UP(n,"rightButtons",void 0),g=UP(n,"rightButtonsBackground",void 0),y=UP(n,"topButtons",void 0),k=UP(n,"topButtonsBackground",void 0),m=UP(n,"bottomButtons",void 0),b=UP(n,"bottomButtonsBackground",void 0),x=UP(n,"click",void 0);if(u&&s.addBackground(u),c&&s.add(c,1,1,"center",0,!0),f){var C=UP(n,"space.leftButtonsOffset",0),w=UP(n,"space.leftButton",0);o=new kw(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:UP(n,"align.leftButtons",void 0),click:x,eventEmitter:s.eventEmitter});var S={top:C};s.add(o,0,1,"top",S,!1);}if(v){var P=UP(n,"space.rightButtonsOffset",0),T=UP(n,"space.rightButton",0);a=new kw(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:T},align:UP(n,"align.rightButtons",void 0),click:x,eventEmitter:s.eventEmitter});S={top:P};s.add(a,2,1,"top",S,!1);}if(y){var O=UP(n,"space.topButtonsOffset",0),M=UP(n,"space.topButton",0);h=new kw(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:UP(n,"align.topButtons",void 0),click:x,eventEmitter:s.eventEmitter});S={left:O};s.add(h,1,0,"left",S,!1);}if(m){var E=UP(n,"space.bottomButtonsOffset",0),_=UP(n,"space.bottomButton",0);l=new kw(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:UP(n,"align.bottomButtons",void 0),click:x,eventEmitter:s.eventEmitter});S={left:E};s.add(l,1,2,"left",S,!1);}return s.addChildrenMap("background",u),s.addChildrenMap("panel",c),s.addChildrenMap("leftButtons",f),s.addChildrenMap("rightButtons",v),s.addChildrenMap("topButtons",y),s.addChildrenMap("bottomButtons",m),s.addChildrenMap("leftButtonsSizer",o),s.addChildrenMap("rightButtonsSizer",a),s.addChildrenMap("topButtonsSizer",h),s.addChildrenMap("bottomButtonsSizer",l),s}return a(i)}(sC);Object.assign(NP.prototype,HP),M.register("tabs",(function(t){var e=new NP(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Tabs",NP),M.register("slider",(function(t){var e=new LS(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Slider",LS);var KP=function(){function t(e,i){r(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return a(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Hf[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(KP.prototype,St);var JP=Phaser.Utils.Objects.GetValue,ZP=Phaser.Utils.Array.SpliceOne,qP=function(){function t(e,i){r(this,t),this.parent=e,this.cells=[],this.cellPool=new ot,this.resetFromJSON(i);}return a(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(JP(t,"cellsCount",0)),this.setColumnCount(JP(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===n(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=fT(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===n(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var i,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},sO={down:0,up:1},rO=Phaser.Utils.Objects.GetValue,oO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),null==n.transitIn&&(n.transitIn=function(t,e){Kp(t,e,"y","Cubic");}),null==n.transitOut&&(n.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new Up(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),n.manualClose=!0,n.clickOutsideClose=!0,n.destroy=!0,s=e.call(this,t,n),nO(t,n),t.isRexSizer&&t.layout();var o=rO(n,"touchOutsideClose",!1),a=rO(n,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,d(s)):o&&s.once("open",s.touchOutsideClose,d(s)),s.requestOpen(),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&dg(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),g(u(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),g(u(i.prototype),"onClose",this).call(this);}}]),i}(Qv),aO={openListPanel:function(){if(this.listPanel)return this;var t,e=eO.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new oO(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(aO,QT);var hO=Phaser.Utils.Objects.GetValue,lO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexDropDownList",s.timer=void 0,s.setOptions(hO(n,"options"));var o=hO(n,"list");return s.setWrapEnable(hO(o,"wrap",!1)),s.setCreateButtonCallback(hO(o,"createButtonCallback")),s.setCreateListBackgroundCallback(hO(o,"createBackgroundCallback")),s.setButtonClickCallback(hO(o,"onButtonClick")),s.setButtonOverCallback(hO(o,"onButtonOver")),s.setButtonOutCallback(hO(o,"onButtonOut")),s.setListExpandDirection(hO(o,"expandDirection")),s.setListEaseInDuration(hO(o,"easeIn",500)),s.setListEaseOutDuration(hO(o,"easeOut",100)),s.setListTransitInCallback(hO(o,"transitIn")),s.settListTransitOutCallback(hO(o,"transitOut")),s.setListSize(hO(o,"width"),hO(o,"height")),s.setListAlignmentMode(hO(o,"alignParent","text")),s.setListAlignmentSide(hO(o,"alignSide","")),s.setListBounds(hO(o,"bounds")),s.setListSpace(hO(o,"space")),s.setListDraggable(hO(o,"draggable",!1)),s.setValueChangeCallback(hO(n,"setValueCallback"),hO(n,"setValueCallbackScope")),s.setValue(hO(n,"value")),s.onClick(s.toggleListPanel,d(s)),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),g(u(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(ax);Object.assign(lO.prototype,aO),M.register("dropDownList",(function(t){var e=new lO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.DropDownList",lO);var uO=function(t,e,i){void 0===i&&(i={});var n=(e=e?_(e):{}).label||e.button,s=e.button||e.label;delete e.label,delete e.button;var r=i.label||i.button||i,o=i.button||i.label||i,a=jC(t,n,r);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=Uw(t,s,o).resetDisplayContent({text:e.text});return e.hasOwnProperty("value")&&(i.value=e.value),i},a.list.onButtonOver=function(t,e,i,n){t.setHoverState&&t.setHoverState(!0);},a.list.onButtonOut=function(t,e,i,n){t.setHoverState&&t.setHoverState(!1);},a},cO=function(t){l(i,t);var e=p(i);function i(t,n,s){var o;return r(this,i),n=uO(t,n,s),(o=e.call(this,t,n)).type="rexSimpleDropDownList",o}return a(i,[{key:"setOptions",value:function(t){void 0===t&&(t=[]);for(var e=0,n=t.length;e=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=mO(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(lP(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(ho);Object.assign(bO.prototype,yO);var xO,CO=Phaser.Utils.Objects.GetFastValue,wO=Phaser.Utils.Objects.GetValue,SO=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).timer=null,s.resetFromJSON(n),s}return a(i,[{key:"resetFromJSON",value:function(t){this.setTextWrapEnable(wO(t,"wrap",!1)),this.setTypeMode(wO(t,"typeMode",0)),this.setTypingSpeed(wO(t,"speed",333)),this.setTextCallback=CO(t,"setTextCallback",null),this.setTextCallbackScope=CO(t,"setTextCallbackScope",null),this.setTypingContent(CO(t,"text","")),this.typingIdx=CO(t,"typingIdx",0),this.insertIdx=null,this.insertChar=null;var e=CO(t,"elapsed",null);return null!==e&&this.start(void 0,void 0,this.typingIdx,e),this}},{key:"shutdown",value:function(t){this.isShutdown||(this.freeTimer(),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"setTypeMode",value:function(t){return "string"==typeof t&&(t=TO[t]),this.typeMode=t,this}},{key:"setTypeSpeed",value:function(t){return this.speed=t,this}},{key:"setTypingSpeed",value:function(t){return this.speed=t,this}},{key:"setTextWrapEnable",value:function(t){return void 0===t&&(t=!0),this.textWrapEnable=t,this}},{key:"text",get:function(){return this._text},set:function(t){var e=PO(t);this.textWrapEnable&&(e=function(t,e){switch(lP(t)){case 0:t.style.syncFont(t.canvas,t.context),e=t.runWordWrap(e);break;case 1:e=t.getText(e,void 0,void 0,!0);break;case 2:e=t.setText(e).getTextBounds().wrappedText;}return e}(this.parent,e)),this._text=e;}},{key:"isTyping",get:function(){return null!==this.getTimer()}},{key:"isLastChar",get:function(){return this.typingIdx===this.textLen}},{key:"start",value:function(t,e,i,n){return void 0!==t&&this.setTypingContent(t),void 0!==e&&(this.speed=e),void 0===i&&(i=0),this.typingIdx=i+1,0===this.speed?this.stop(!0):(this.setText(""),this.startTimer(n)),this}},{key:"appendText",value:function(t){var e=this.text.concat(PO(t));return this.isTyping?this.setTypingContent(e):this.start(e,void 0,this.textLen),this}},{key:"stop",value:function(t){if(this.getTimer()&&this.freeTimer(),t){for(;!this.isLastChar;)this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode),this.emit("typechar",this.insertChar),this.typingIdx++;this.setText(this.text),this.emit("type"),this.emit("complete",this,this.parent);}return this}},{key:"pause",value:function(){var t=this.getTimer();return t&&(t.paused=!0),this}},{key:"resume",value:function(){var t=this.getTimer();return t&&(t.paused=!1),this}},{key:"setTypingContent",value:function(t){return this.text=t,this.textLen=this.getTextLength(this.text),this}},{key:"onTyping",value:function(){var t=this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode);this.setText(t),this.emit("typechar",this.insertChar),this.emit("type"),this.isLastChar?(this.freeTimer(),this.emit("complete",this,this.parent)):(this.timer.delay=this.speed,this.typingIdx++);}},{key:"getTypingString",value:function(t,e,i,n){var s;if(0===n){var r=0,o=e;this.insertIdx=o,s=this.getSubString(t,r,o);}else if(1===n){r=(o=i)-e;this.insertIdx=0,s=this.getSubString(t,r,o);}else if(2===n){var a=i/2;o=(r=Math.floor(a-e/2))+e;this.insertIdx=e%2?e:0,s=this.getSubString(t,r,o);}else if(3===n){var h,l=Math.floor(e/2);if(l>0){r=(o=i)-l;h=this.getSubString(t,r,o);}else h="";var u,c=e-l;if(c>0){o=(r=0)+c;this.insertIdx=o,u=this.getSubString(t,r,o);}else u="",this.insertIdx=0;s=u+h;}return this.insertChar=s.charAt(this.insertIdx-1),s}},{key:"startTimer",value:function(t){var e;return this.timer&&this.freeTimer(),void 0===t?e=0:(this.speed,e=t),this.timer=this.scene.time.addEvent({delay:1e-4,startAt:e,loop:!0,callback:this.onTyping,callbackScope:this}),this}},{key:"getTimer",value:function(){return this.timer}},{key:"freeTimer",value:function(){return this.timer&&(this.timer.remove(),this.timer=null),this}},{key:"setText",value:function(t){this.setTextCallback&&(t=this.setTextCallbackScope?this.setTextCallback.call(this.setTextCallbackScope,t,this.isLastChar,this.insertIdx):this.setTextCallback(t,this.isLastChar,this.insertIdx)),this.textWrapEnable?pP(this.parent,t):this.parent.setText(t);}},{key:"getTextLength",value:function(t){var e=this.parent;return e.getPlainText?e.getPlainText(t).length:t.length}},{key:"getSubString",value:function(t,e,i){var n=this.parent;return n.getSubString?n.getSubString(t,e,i):t.slice(e,i)}}]),i}(ho),PO=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},TO={"left-to-right":0,"right-to-left":1,"middle-to-sides":2,"sides-to-middle":3},OO=Phaser.Utils.Objects.GetValue,MO=function(t){l(i,t);var e=p(i);function i(t,n){return r(this,i),void 0===n&&(n={}),n.hasOwnProperty("layoutMode")||(n.layoutMode=1),e.call(this,t,n)}return a(i)}((void 0===xO&&(xO="rexTextBox"),function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type=xO;var o=s.childrenMap.text;return s.page=new bO(o,OO(n,"page",void 0)),s.typing=new SO(o,OO(n,"typing",n.type)),s.typing.on("complete",s.onPageEnd,d(s)).on("type",s.onType,d(s)).on("typechar",s.onTypeChar,d(s)),s.textWidth=o.width,s.textHeight=o.height,s}return a(i,[{key:"start",value:function(t,e){return this.page.setText(t),void 0!==e&&this.setTypingSpeed(e),this.emit("start"),this.typeNextPage(),this}},{key:"typeNextPage",value:function(){if(this.isLastPage)this.emit("complete");else {var t=this.page.getNextPage();this.typing.start(t);}return this}},{key:"pause",value:function(){return this.isTyping&&(this.typing.pause(),this.emit("pause")),this}},{key:"resume",value:function(){return this.isTyping||(this.emit("resume"),this.typing.resume()),this}},{key:"stop",value:function(t){return this.typing.stop(t),this}},{key:"showLastPage",value:function(){return this.typing.stop(),this.page.showLastPage(),this.emit("type"),this.onPageEnd(),this}},{key:"setTypeSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"setTypingSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"isTyping",get:function(){return this.typing.isTyping}},{key:"isLastPage",get:function(){return this.page.isLastPage}},{key:"isFirstPage",get:function(){return this.page.isFirstPage}},{key:"pageCount",get:function(){return this.page.pageCount}},{key:"pageIndex",get:function(){return this.page.pageIndex}},{key:"typingSpeed",get:function(){return this.typing.speed}},{key:"onType",value:function(){var t=this.childrenMap.text;this.textWidth===t.width&&this.textHeight===t.height||(this.textWidth=t.width,this.textHeight=t.height,this.getTopmostSizer().layout()),this.emit("type");}},{key:"onTypeChar",value:function(t){this.emit("typechar",t);}},{key:"onPageEnd",value:function(){var t=this.isLastPage;this.emit("pageend"),t&&this.emit("complete");}}]),i}(XC)));M.register("textBox",(function(t){var e=new MO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.TextBox",MO);var EO=Phaser.Utils.Objects.GetValue,_O=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexNumberBar";var o,a=EO(n,"background",void 0),h=EO(n,"icon",void 0),l=EO(n,"iconMask",void 0),u=EO(n,"slider",void 0),c=EO(n,"text",void 0),f=EO(n,"space.icon",0),p=EO(n,"space.slider",0);(a&&s.addBackground(a),h)&&(0===s.orientation?(u||c)&&(v={right:f}):(u||c)&&(v={bottom:f}),s.add(h,{proportion:0,align:"center",padding:v}),l&&(l=rx.call(d(s),h,h,1)));if(u){var v,g;if(u.orientation=s.orientation,u.eventEmitter=d(s),u.value=null,u.hasOwnProperty("input")||(u.input=-1),o=new LS(t,u),t.add.existing(o),0===s.orientation?c&&(v={right:p}):c&&(v={bottom:p}),0===s.orientation)g=void 0===EO(u,"width",void 0)?1:0;else g=void 0===EO(u,"height",void 0)?1:0;s.add(o,{proportion:g,align:"center",padding:v});}c&&s.add(c),s.addChildrenMap("background",a),s.addChildrenMap("icon",h),s.addChildrenMap("iconMask",l),s.addChildrenMap("slider",o),s.addChildrenMap("text",c);var y=EO(n,"valuechangeCallback",null);if(null!==y){var k=EO(n,"valuechangeCallbackScope",void 0);s.on("valuechange",y,k);}return s.setEnable(EO(n,"enable",void 0)),s.setValue(EO(n,"value",0)),s}return a(i,[{key:"enable",get:function(){return !!this.childrenMap.slider&&this.childrenMap.slider.enable},set:function(t){this.childrenMap.slider&&this.childrenMap.slider.setEnable(t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"value",get:function(){return this.childrenMap.slider?this.childrenMap.slider.value:0},set:function(t){this.childrenMap.slider&&(this.childrenMap.slider.value=t);}},{key:"setValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.setValue(t,e,i),this}},{key:"addValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.addValue(t,e,i),this}},{key:"getValue",value:function(t,e){return this.childrenMap.slider?this.childrenMap.slider.getValue(t,e):0}},{key:"easeValueTo",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.easeValueTo(t,e,i),this}},{key:"stopEaseValue",value:function(){return this.childrenMap.slider&&this.childrenMap.slider.stopEaseValue(),this}},{key:"setEaseValueDuration",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueDuration(t),this}},{key:"setEaseValueFunction",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueFunction(t),this}},{key:"text",get:function(){var t=this.childrenMap.text;return void 0===t?"":t.text?t.text:t.getData("text")},set:function(t){var e=this.childrenMap.text;void 0!==e&&(e.setText?e.setText(t):e.setData("text",t));}},{key:"setText",value:function(t){return this.text=t,this}}]),i}(ex);M.register("numberBar",(function(t){var e=new _O(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.NumberBar",_O),M.register("scrollBar",(function(t){var e=new jS(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ScrollBar",jS);var RO=Phaser.Utils.Objects.GetValue,LO={leftTop:"left-top",centerTop:"center-top",rightTop:"right-top",leftCenter:"left-center",center:"center",rightCenter:"right-center",leftBottom:"left-bottom",centerBottom:"center-bottom",rightBottom:"right-bottom"},BO=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexBadge";var o=RO(n,"background",void 0);o&&s.addBackground(o),s.addChildrenMap("background",o);var a=RO(n,"main",void 0);for(var h in a&&s.add(a,{key:"main",align:"center",expand:!1}),s.addChildrenMap("main",a),LO){var l=RO(n,h,void 0);l&&(s.add(l,{key:h,align:LO[h],expand:!1}),s.addChildrenMap(h,l));}return s}return a(i)}(Bk);M.register("badgeLabel",(function(t){var e=new BO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.BadgeLabel",BO);var DO=Bk.prototype.add,IO=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),DO.call(this,t,e,i,n,s,r,o,a,h),this},jO={add:IO,addPage:IO},zO=Vf.prototype.setChildVisible,AO={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(zO.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(zO.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(AO,jO);var FO=Phaser.Utils.Objects.GetValue,YO=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(FO(n,"swapMode",0)),s.setFadeInDuration(FO(n,"fadeIn",0)),s}return a(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=WO[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(Bk);Object.assign(YO.prototype,AO);var WO={invisible:0,destroy:1};M.register("pages",(function(t){var e=new YO(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Pages",YO);var VO=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(mk);Object.assign(sE.prototype,tE);var rE=["top","bottom","centerY","center"],oE=["left","right","centerX","center"],aE=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=rE.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=oE.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},hE=Phaser.Utils.Objects.GetValue,lE=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={});var o=rS(n),a=hE(n,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=hE(n,"clamplChildOY",!1),a.clamplChildOX=hE(n,"clamplChildOX",!1);var h,l,u=new sE(t,a);switch(t.add.existing(u),o){case 0:h=hE(n,"expand.panel",!0),l=!0;break;case 1:h=!0,l=hE(n,"expand.panel",!0);break;default:h=!0,l=!0;}n.type="rexScrollablePanel",n.child={gameObject:u,expandWidth:h,expandHeight:l,align:hE(n,"align.panel","center")};var c=hE(n,"space",void 0);return c&&(c.child=hE(c,"panel",0)),(s=e.call(this,t,n)).addChildrenMap("panel",u.child),s.addChildrenMap("panelLayer",u.maskLayer),s.addChildrenMap("mask",u.maskGameObject),s.addChildrenMap("scrollableBlock",u),s}return a(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),gk(this.childrenMap.child,t),this}}]),i}(aP),uE={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:aE.call(this,t,"y",e);break;case 1:aE.call(this,t,"x",e);break;default:aE.call(this,t,"y",e),aE.call(this,t,"x",e);}return this}};Object.assign(lE.prototype,uE),M.register("scrollablePanel",(function(t){var e=new lE(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ScrollablePanel",lE);var cE=function(t,e){t.popUp(e);},dE=function(t,e){t.scaleDown(e);},fE=function(t,e){t.fadeIn(e);},pE=function(t,e){t.fadeOut(e);},vE=function t(e,i,n){var s,r=Ct(n,"reverse",!1);if(xg(e[0]))if(r)for(o=(a=e.length)-1;o>=0;o--)s=t(e[o],i,n);else for(var o=0,a=e.length;on?1:it)return this;for(var e=this.commands.length-1;;){var i=this.commands[this.index],n=i[1];if(xg(n)||(n=Au(bE,i,1)),vE(n,this.scope),this.emit("runcommand",n,this.scope),this.index===e)return this.complete(),this;if(this.index++,this.nextTime=this.getNextDt(this.nextTime),this.nextTime>t)return this}}},{key:"complete",value:function(){this.clock.stop(),this.state=2,this.emit("complete",this.parent,this);}},{key:"getNextDt",value:function(t){var e=this.commands[this.index][0];return 1===this.timeUnit&&(e*=1e3),1===this.dtMode&&(e+=t),e}},{key:"setDtMode",value:function(t){return "string"==typeof t&&(t=CE[t]),this.dtMode=t,this}},{key:"setTimeUnit",value:function(t){return "string"==typeof t&&(t=xE[t]),this.timeUnit=t,this}}]),i}(ho),bE=[],xE={ms:0,s:1,sec:1},CE={abs:0,absolute:0,inc:1,increment:1},wE=Phaser.Utils.Objects.GetValue,SE=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),void 0===n&&(n={text:createDefaultTextObject(t)}),(s=e.call(this,t,n)).type="rexToast",s.setTransitInTime(wE(n,"duration.in",200)),s.setDisplayTime(wE(n,"duration.hold",1200)),s.setTransitOutTime(wE(n,"duration.out",200)),s.setTransitInCallback(wE(n,"transitIn",PE.popUp)),s.setTransitOutCallback(wE(n,"transitOut",PE.scaleDown)),s.player=new mE(d(s),{dtMode:1}),s.messages=[],s.scaleX0=void 0,s.scaleY0=void 0,s.setVisible(!1),s}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.player.destroy(),this.player=void 0,this.messages=void 0,g(u(i.prototype),"destroy",this).call(this,t));}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitOutTime",value:function(t){return this.transitOutTime=t,this}},{key:"setTransitInTime",value:function(t){return this.transitInTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=PE[t]),t){case PE.popUp:t=cE;break;case PE.fadeIn:t=fE;}return t||(t=j),this.transitInCallback=t,this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=PE[t]),t){case PE.scaleDown:t=dE;break;case PE.fadeOut:t=pE;}return t||(t=j),this.transitOutCallback=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX0=t,this.scaleY0=e,g(u(i.prototype),"setScale",this).call(this,t,e),this}},{key:"showMessage",value:function(t){if(void 0===this.scaleX0&&(this.scaleX0=this.scaleX),void 0===this.scaleY0&&(this.scaleY0=this.scaleY),void 0===t){if(0===this.messages.length)return this;t=this.messages.shift();}if(this.player.isPlaying)return this.messages.push(t),this;this.setScale(this.scaleX0,this.scaleY0).setVisible(!0),"string"==typeof t?this.setText(t):t(this),this.layout();var e=[[0,[this.transitInCallback,this,this.transitInTime]],[this.transitInTime,[j]],[this.displayTime,[this.transitOutCallback,this,this.transitOutTime]],[this.transitOutTime,[this.setVisible,!1]],[30,[j]]];return this.player.load(e,this).once("complete",(function(){this.showMessage();}),this).start(),this}}]),i}(ax),PE={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1};M.register("toast",(function(t){var e=new SE(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Toast",SE);for(var TE,OE=function(t,e,i){void 0===i&&(i=!0),i?e=e?_(e):{}:e||(e={});var n=new ou(t,e);return t.add.existing(n),n},ME=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],EE=[15792383,16444375,65535,8388564,15794175,16119260,16770244,0,16772045,255,9055202,10824234,14596231,6266528,8388352,13789470,16744272,6591981,16775388,14423100,65535,139,35723,12092939,11119017,11119017,25600,12433259,9109643,5597999,16747520,10040012,9109504,15308410,9419919,4734347,3100495,3100495,52945,9699539,16716947,49151,6908265,6908265,2003199,11674146,16775920,2263842,16711935,14474460,16316671,16766720,14329120,8421504,8421504,32768,11403055,15794160,16738740,13458524,4915330,16777200,15787660,15132410,16773365,8190976,16775885,11393254,15761536,14745599,16448210,13882323,13882323,9498256,16758465,16752762,2142890,8900346,7833753,7833753,11584734,16777184,65280,3329330,16445670,16711935,8388608,6737322,205,12211667,9662683,3978097,8087790,64154,4772300,13047173,1644912,16121850,16770273,16770229,16768685,128,16643558,8421376,7048739,16753920,16729344,14315734,15657130,10025880,11529966,14381203,16773077,16767673,13468991,16761035,14524637,11591910,8388736,6697881,16711680,12357519,4286945,9127187,16416882,16032864,3050327,16774638,10506797,12632256,8900331,6970061,7372944,7372944,16775930,65407,4620980,13808780,32896,14204888,16737095,4251856,15631086,16113331,16777215,16119285,16776960,10145074],_E={},RE=0,LE=ME.length;RE0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new y_(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},m_={openColorPicker:function(){if(!this.colorPicker){var t=k_.call(this).layout(),e=new oO(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(m_,WE);var b_=Phaser.Utils.Objects.GetValue,x_=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexColorInput",n.hasOwnProperty("colorPicker")||(n.colorPicker={background:{color:0}});var o=n.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(b_(o,"width",160),b_(o,"height",170));var l=b_(o,"background");h=l?function(t){return PC(t,l)}:b_(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(b_(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(b_(o,"expandDirection")),s.setColorPickerEaseInDuration(b_(o,"easeIn",200)),s.setColorPickerEaseOutDuration(b_(o,"easeOut",200)),s.setColorPickerTransitInCallback(b_(o,"transitIn")),s.setColorPickerTransitOutCallback(b_(o,"transitOut")),s.setColorPickerBounds(b_(o,"bounds"));var u=b_(o,"space");void 0===u&&(u={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(u);}var c=n.colorComponents;if(a&&(!1!==c&&null!==c)){s.setColorComponentsHeight(b_(c,"height",30)),s.setColorComponentsFormatLabelConfig(b_(c,"formatLabel"));var f=b_(c,"inputText");f||(f=b_(n,"inputText")),s.setColorComponentsInputTextConfig(f);var p=b_(c,"space");void 0===p&&(p={item:8}),s.setColorComponentsSpace(p);}var v=s.childrenMap.swatch;return v&&a&&s.onClick(v,s.openColorPicker,d(s)),s}return a(i)}(YE);Object.assign(x_.prototype,m_),M.register("colorInput",(function(t){var e=new x_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorInput",x_),M.register("colorInputLite",(function(t){var e=new YE(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorInputBase",YE),M.register("colorPicker",(function(t){var e=new h_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorPicker",h_),M.register("colorComponents",(function(t){var e=new v_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.ColorComponents",v_);var C_=function(t,e){return function(i,n,s,r){"panel"!==n&&s.moveChild(i,r?0:t,e);}},w_=function(t,e){return function(i,n,s,r){"panel"===n&&s.moveChild(i,r?0:t,e);}},S_={visible:{show:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!0);}},hide:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!1);}}},fade:{show:function(t,e){return void 0===e&&(e=1),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}},hide:function(t,e){return void 0===e&&(e=0),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}}},move:{show:C_,hide:C_},"move-panel":{show:w_,hide:w_}},P_=Vf.prototype.setChildVisible,T_={setChildVisible:function(t,e){if("string"==typeof t){var i=t;t=this.sizerChildren[i];}else i=_k(this.sizerChildren,t);return void 0===e&&(e=this.currentChildKey===i),P_.call(this,t,e),this}},O_={fadeChild:function(t,e,i){var n;return "string"==typeof t?(n=t,t=this.sizerChildren[n]):n=_k(this.sizerChildren,t),void 0===e&&(e=500),void 0===i&&(i=this.currentChildKey===n?1:0),t.fadeIn(e,{start:t.alpha,end:i}),this},fadeChildPromise:function(t,e,i){return "string"==typeof t&&(t=this.sizerChildren[key]),this.fadeChild(t,e,i),t._fade?Oh(t._fade):Promise.resolve()}},M_={moveChild:function(t,e,i,n){var s;"string"==typeof t?(s=t,t=this.sizerChildren[s]):s=_k(this.sizerChildren,t),void 0===e&&(e=500);var r,o,a,h,l=this.currentChildKey===s;if(void 0===n)switch(s){case"leftSide":case"rightSide":n=Lr(t);break;case"topSide":case"bottomSide":n=Br(t);break;default:if(l)switch(this.previousChildKey){case"leftSide":case"rightSide":n=Lr(this.sizerChildren[this.previousChildKey]);break;case"topSide":case"bottomSide":n=Br(this.sizerChildren[this.previousChildKey]);break;default:n=0;}else switch(this.currentChildKey){case"leftSide":case"rightSide":n=Lr(this.sizerChildren[this.currentChildKey]);break;case"topSide":case"bottomSide":n=Br(this.sizerChildren[this.currentChildKey]);break;default:n=0;}}if(l)switch(s){case"panel":switch(this.previousChildKey){case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}break;case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}else switch(s){case"panel":switch(this.currentChildKey){case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}break;case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}return r?t.moveTo(e,"-=".concat(n),void 0,i):o?t.moveTo(e,"+=".concat(n),void 0,i):a?t.moveTo(e,void 0,"-=".concat(n),i):h?t.moveTo(e,void 0,"+=".concat(n),i):t.moveTo(0),this},moveChildPromise:function(t,e,i,n){return "string"==typeof t&&(t=this.sizerChildren[key]),this.moveChild(t,e,i,n),t._easeMove?Oh(t._easeMove):Promise.resolve()}},E_={};Object.assign(E_,T_,O_,M_);var __=Phaser.Utils.Objects.GetValue,R_=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),(s=e.call(this,t,n)).type="rexSides",s.childrenMap=s.sizerChildren,s.previousChildKey=void 0,s.currentChildKey=void 0;var o=__(n,"showChildCallback",void 0);if(o)if(kg(o)){var a=__(n,"showChildCallbackScope",void 0);s.on("showchild",o,a);var h=__(n,"hideChildCallback",void 0),l=__(n,"hideChildCallbackScope",void 0);s.on("hidechild",h,l);}else {var u=function(t){var e,i,n,s,r=b("string"==typeof t?[t]:t);return e=r[0],i=r.slice(1),S_.hasOwnProperty(e)?(n=S_[e].show.apply(null,i),s=S_[e].hide.apply(null,i)):(n=j,s=j),{show:n,hide:s}}(o);s.on("showchild",u.show),s.on("hidechild",u.hide);}var c=__(n,"background",void 0),d=__(n,"panel",void 0),f=__(n,"leftSide",void 0),p=__(n,"rightSide",void 0),v=__(n,"topSide",void 0),g=__(n,"bottomSide",void 0);if(c&&s.addBackground(c),d&&s.add(d,"panel","center",0,!0),f){var y=__(n,"expand.left",!0);s.add(f,"leftSide","left-top",0,{height:y});}if(p){y=__(n,"expand.right",!0);s.add(p,"rightSide","right-top",0,{height:y});}if(v){y=__(n,"expand.top",!0);s.add(v,"topSide","left-top",0,{width:y});}if(g){y=__(n,"expand.bottom",!0);s.add(g,"bottomSide","left-bottom",0,{width:y});}return s}return a(i,[{key:"reset",value:function(){return this.previousChildKey=void 0,this.currentChildKey="panel",this.showChild("panel",!0),this.hideChild("leftSide",!0),this.hideChild("rightSide",!0),this.hideChild("topSide",!0),this.hideChild("bottomSide",!0),this}}]),i}(Bk);Object.assign(R_.prototype,{showChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("showchild",i,t,this,e),this.resetChildState(i)),this},hideChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("hidechild",i,t,this,e),this.resetChildState(i)),this},swapChild:function(t,e){return this.currentChildKey===t||("panel"===this.currentChildKey||"panel"===t?(this.previousChildKey=this.currentChildKey,this.currentChildKey=t,this.hideChild(this.previousChildKey,e),this.showChild(this.currentChildKey,e)):(this.swapChild("panel",e),this.swapChild(t,e))),this},showPanel:function(t){return this.swapChild("panel",t),this},showLeftSide:function(){return this.swapChild("leftSide"),this},showRightSide:function(){return this.swapChild("rightSide"),this},showTopSide:function(){return this.swapChild("topSide"),this},showBottomSide:function(){return this.swapChild("bottomSide"),this},hideLeftSide:function(){return "leftSide"==this.currentChildKey&&this.showPanel(),this},hideRightSide:function(){return "rightSide"==this.currentChildKey&&this.showPanel(),this},hideTopSide:function(){return "topSide"==this.currentChildKey&&this.showPanel(),this},hideBottomSide:function(){return "bottomSide"==this.currentChildKey&&this.showPanel(),this},toggleLeftSide:function(){var t="panel"!==this.currentChildKey?"panel":"leftSide";return this.swapChild(t),this},toggleRightSide:function(){var t="panel"!==this.currentChildKey?"panel":"rightSide";return this.swapChild(t),this},toggleTopSide:function(){var t="panel"!==this.currentChildKey?"panel":"topSide";return this.swapChild(t),this},toggleBottomSide:function(){var t="panel"!==this.currentChildKey?"panel":"bottomSide";return this.swapChild(t),this}},E_),M.register("sides",(function(t){var e=new R_(this.scene,t);return this.scene.add.existing(e),e})),$(window,"RexPlugins.UI.Sides",R_);var L_=Phaser.Utils.Array.GetFirst,B_=Phaser.Utils.Array.Remove,D_=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),n=jC(t,n),(s=e.call(this,t,n)).type="rexTweaker.Title",s}return a(i,[{key:"setTitle",value:function(t){return (t=t?_(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(ax),I_=function(t){l(i,t);var e=p(i);function i(t,n){var s;r(this,i),void 0===n&&(n={}),(s=e.call(this,t,n)).type="rexTweaker.FolderTitle";var o=new _d(t,n.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return a(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(D_),j_=function(t,e){var i=new oR(t,e);return t.add.existing(i),i},z_=function(t,e,i){return PC(t,i)},A_=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).type="rexTweaker.Folder",s}return a(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(ZM);Object.assign(A_.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var F_=Phaser.Utils.Objects.GetValue,Y_=Phaser.Utils.Objects.GetValue,W_={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i0?0:1,s.setMinWidth(this.itemWidth)),this.add(s,{proportion:r,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),s.setAutoUpdateEnable(i.autoUpdate),s.setBindingTarget(t,e),i.monitor&&s.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,s),this},addButton:iR,addButtons:iR,addSeparator:function(t){var e=this.scene,i=nR(this.styles,"separator"),n=z_(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;is?r:-r),u.localY=d+(c>n?o:-o);}},qR=Phaser.Utils.Objects.IsPlainObject,$R=Phaser.Utils.Objects.GetValue,QR=Phaser.Math.DegToRad,tL=Phaser.Math.RadToDeg,eL=function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;if(r(this,i),qR(n)){var l=n;n=$R(l,"x",0),s=$R(l,"y",0),o=$R(l,"key",null),a=$R(l,"frame",null);}return (h=e.call(this,t,n,s,o,a)).type="rexSkewmage",h._skewX=0,h._skewY=0,h}return a(i,[{key:"skewX",get:function(){return this._skewX},set:function(t){this._skewX=t,ZR(this,this._skewX,this._skewY);}},{key:"skewXDeg",get:function(){return tL(this._skewX)},set:function(t){this.skewX=QR(t);}},{key:"skewY",get:function(){return this._skewY},set:function(t){this._skewY=t,ZR(this,this._skewX,this._skewY);}},{key:"skewYDeg",get:function(){return tL(this._skewY)},set:function(t){this.skewY=QR(t);}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"setSkewY",value:function(t){return this.skewY=t,this}},{key:"setSkew",value:function(t,e){return void 0===e&&(e=t),this.skewX=t,this.skewY=e,this}},{key:"setSkewXDeg",value:function(t){return this.skewXDeg=t,this}},{key:"setSkewYDeg",value:function(t){return this.skewYDeg=t,this}},{key:"setSkewDeg",value:function(t,e){return void 0===e&&(e=t),this.skewXDeg=t,this.skewYDeg=e,this}}]),i}(JR),iL=Phaser.Utils.Objects.IsPlainObject,nL=Phaser.Utils.Objects.GetValue,sL=function(t){l(i,t);var e=p(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"skewState",get:function(){return this.isRunning}}]),i}(OM(function(t){l(i,t);var e=p(i);function i(t,n,s,o,a){var h;if(r(this,i),iL(n)){var l=n;n=nL(l,"x",0),s=nL(l,"y",0),o=nL(l,"width",32),a=nL(l,"height",32);}var u=iM(t,o,a);return (h=e.call(this,t,n,s,u,null)).type="rexSkewRenderTexture",h.rt=h.texture,h}return a(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(g(u(i.prototype),"destroy",this).call(this,t),this.rt.destroy(),this.rt=null);}}]),i}(eL)));M.register("skew",(function(t,e){return new sL(t,e)})),$(window,"RexPlugins.UI.Skew",sL),M.register("anchor",(function(t,e){return new Vp(t,e)})),$(window,"RexPlugins.UI.Anchor",Vp),M.register("textTyping",(function(t,e){return new SO(t,e)})),$(window,"RexPlugins.UI.TextTyping",SO),M.register("textPage",(function(t,e){return new bO(t,e)})),$(window,"RexPlugins.UI.TextPage",bO);var rL=void 0,oL=Phaser.Utils.Objects.GetValue,aL=Phaser.Utils.Objects.Clone,hL=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},lL=Phaser.Utils.Objects.GetValue,uL=Phaser.Utils.Objects.Merge,cL={open:function(t,e){var i;void 0===t&&(t={}),t=uL(t,this.openConfig),(i=this)!==rL&&(void 0!==rL&&rL.close(),rL=i),kg(t)&&(e=t,t=void 0);var n=lL(t,"inputType",void 0);void 0===n&&(n=lL(t,"type","text")),void 0===e&&(e=lL(t,"onClose",void 0));var s=lL(t,"onOpen",void 0),r=lL(t,"onTextChanged",void 0);return this.inputText=function(t,e){void 0===e&&(e={}),e=aL(e);var i=t.scene,n=t.style,s=oL(e,"backgroundColor",n.backgroundColor);null===s&&(s="transparent"),e.text=oL(e,"text",t.text),e.fontFamily=oL(e,"fontFamily",n.fontFamily),e.fontSize=oL(e,"fontSize",n.fontSize),e.color=oL(e,"color",n.color),e.backgroundColor=s,e.direction=oL(e,"rtl",n.rtl)?"rtl":"ltr",e.align=oL(e,"align",hL(n)),"rtl"===e.direction&&LC(t)&&(e.align="right");var r=new pb(i,t.x,t.y,oL(e,"width",t.width),oL(e,"height",t.height),e);r.setOrigin(t.originX,t.originY).setScrollFactor(t.scrollFactorX,t.scrollFactorY);var o=t.parentContainer;return o?o.add(r):i.add.existing(r),r}(this.parent,t).on("textchange",(function(t){var e=t.text;r?r(this.parent,e):this.parent.text=e;}),this).setFocus(),this.parent.setVisible(!1),this.onClose=e,lL(t,"enterClose","textarea"!==n)&&this.scene.input.keyboard.once("keydown-ENTER",this.close,this),this.delayCall=function(t,e,i){return t.time.delayedCall(0,e,[],i)}(this.scene,(function(){this.scene.input.once("pointerdown",this.close,this),s&&s(this.parent),this.emit("open",this.parent);}),this),this},close:function(){return this===rL&&(rL=void 0),this.parent.setVisible(!0),this.inputText&&(this.inputText.destroy(),this.inputText=void 0),this.delayCall&&(this.delayCall.remove(),this.delayCall=void 0),this.scene.input.keyboard.off("keydown-ENTER",this.close,this),this.scene.input.off("pointerdown",this.close,this),this.onClose&&this.onClose(this.parent),this.emit("close",this.parent),this}},dL=Phaser.Utils.Objects.GetValue,fL=function(t){l(i,t);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t)).inputText=void 0,s.onClose=void 0,s.delayCall=void 0,s.setOpenConfig(n),dL(n,"clickEnable",!0)&&t.on("pointerdown",(function(){this.open();}),d(s)).setInteractive(),s}return a(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.close(),g(u(i.prototype),"shutdown",this).call(this,t));}},{key:"setOpenConfig",value:function(t){return void 0===t&&(t={}),this.openConfig=t,this}},{key:"isOpened",get:function(){return void 0!==this.inputText}},{key:"text",get:function(){return this.isOpened?this.inputText.text:this.parent.text}}]),i}(ho);Object.assign(fL.prototype,cL);M.register("textEdit",(function(t,e){return new fL(t,e)})),$(window,"RexPlugins.UI.TextEdit",fL);var pL=65535,vL=function(t,e,i){if(null==e)return t;if(0===e)return kL(t,0,i),t;var n=t.text.length;if(0===n)return kL(t,e,i),t;var s=Math.floor(1.5*e/n);void 0!==i&&s>i&&(s=Math.floor(i));for(var r={},o=yL(t,s,e,i,r),a=0;a<=pL&&0!==o;a++){if((s+=o)<0){s=0;break}o=yL(t,s,e,i,r);}return a===pL&&console.warn("FontSizeFit: Test count exceeds ".concat(pL)),t.setFontSize(s),kL(t,e,i),t},gL=function(t,e,i){return void 0===i[e]&&(t.setFontSize(e),i[e]={width:t.width,height:t.height}),i[e]},yL=function(t,e,i,n,s){var r,o=gL(t,e,s),a=gL(t,e+1,s);if(void 0!==n)if(o.height<=n&&a.height>n)r=0;else {if(o.height>n)return -1;r=Math.floor(n-o.height);}if(o.width<=i&&a.width>i)return 0;if(o.width>i)return -1;var h=Math.floor(i-o.width);return void 0===r?h:Math.min(h,r)},kL=function(t,e,i){var n=t.style;n&&(n.fixedWidth=e,n.parent.width=e,void 0!==i&&(n.fixedHeight=i,n.parent.height=i),n.update(!1));},mL=Phaser.Utils.Objects.GetValue,bL=function(t){l(i,Phaser.Plugins.ScenePlugin);var e=p(i);function i(t,n){var s;return r(this,i),(s=e.call(this,t,n)).add=new M(t),s}return a(i,[{key:"start",value:function(){this.scene.events.on("destroy",this.destroy,this);}},{key:"isInTouching",value:function(t,e,i,n){return !!t.visible&&bg(t,e,i,n)}},{key:"viewport",get:function(){return $r(this.scene,this.scene.cameras.main,!0)}}]),i}(),xL={getParentSizer:Fd,getTopmostSizer:Yd,hide:Bv,show:Lv,isShown:Dv,edit:function(t,e,i){return t._edit||(t._edit=new fL(t,{clickEnable:!1})),t._edit.open(e,i),t._edit},wrapExpandText:BC,fontSizeExpandText:function(t,e){"number"==typeof e&&(e={minWidth:e});var i=mL(e,"minWidth",0),n=mL(e,"minHeight",0),s=mL(e,"fitHeight",!1);return t._minWidth=i,t._minHeight=n,s?(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),t.setFontSize(1),t},t.resize=function(e,i){return vL(t,e,i),t}):(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),vL(t,e,void 0),t},t.resize=function(e,i){return t.width===e&&t.height===i||t.setFixedSize(e,i),t}),t},fontSizeResize:vL,setFontSizeToFitWidth:vL,waitEvent:Th,waitComplete:Oh,delayPromise:yb,setChildrenInteractive:gk,fadeIn:rv,fadeOutDestroy:ov,easeMoveTo:gv,easeMoveFrom:yv,modal:gg,modalPromise:function(t,e){var i=gg(t,e);return new Promise((function(t,e){i.once("close",(function(e){t(e);}));}))},modalClose:yg,requestDrag:wR,openFileChooser:xb};return Object.assign(bL.prototype,xL),bL})); diff --git a/examples/ui-imageinputlabel/image-input.js b/examples/ui-imageinputlabel/image-input.js index 0a8718bed9..386bef2abe 100644 --- a/examples/ui-imageinputlabel/image-input.js +++ b/examples/ui-imageinputlabel/image-input.js @@ -19,7 +19,7 @@ class Demo extends Phaser.Scene { var label = this.rexUI.add.imageInputLabel({ orientation: 'y', x: 400, y: 300, - width: 240, height: 320, + width: 260, space: { left: 20, right: 20, top: 20, bottom: 20, icon: 10 }, iconWidth: 200, iconHeight: 200, @@ -30,7 +30,7 @@ class Demo extends Phaser.Scene { strokeWidth: 3 }), - text: this.rexUI.wrapExpandText(this.add.text(0, 0, 'AABB')), + text: this.add.text(0, 0, 'AABB'), expandTextWidth: true, canvas: { @@ -38,14 +38,17 @@ class Demo extends Phaser.Scene { }, clickTarget: 'icon', - + domButton: false, // true }) - .on('select', function (file) { + .layout() + + label + .on('select', function (file, label) { console.log(file); - label.setText(file.name) + label.setText(label.getFileName(file)); }) - .layout() + } diff --git a/examples/ui-imageinputlabel/save-texture.bat b/examples/ui-imageinputlabel/save-texture.bat new file mode 100644 index 0000000000..511f57639e --- /dev/null +++ b/examples/ui-imageinputlabel/save-texture.bat @@ -0,0 +1,5 @@ +@echo off +set main=./examples/ui-imageinputlabel/save-texture.js +cd .. +cd .. +npm run watch \ No newline at end of file diff --git a/examples/ui-imageinputlabel/save-texture.js b/examples/ui-imageinputlabel/save-texture.js new file mode 100644 index 0000000000..ad0f773f29 --- /dev/null +++ b/examples/ui-imageinputlabel/save-texture.js @@ -0,0 +1,118 @@ +import phaser from 'phaser/src/phaser.js'; +import UIPlugin from '../../templates/ui/ui-plugin.js'; + +const COLOR_PRIMARY = 0x4e342e; +const COLOR_LIGHT = 0x7b5e57; +const COLOR_DARK = 0x260e04; + + +class Demo extends Phaser.Scene { + constructor() { + super({ + key: 'examples' + }) + } + + preload() { } + + create() { + var label = this.rexUI.add.imageInputLabel({ + orientation: 'y', + x: 400, y: 300, + width: 240, + space: { left: 20, right: 20, top: 20, bottom: 20, icon: 20, text: 20 }, + + iconWidth: 200, iconHeight: 200, + + background: this.rexUI.add.roundRectangle({ + radius: 20, + strokeColor: COLOR_DARK, + strokeWidth: 3 + }), + + // Editable text input + text: CreateCanvasInput(this), + expandTextWidth: true, + + // 'Save' button + action: this.add.text(0, 0, 'Save'), + + canvas: { + fill: 'grey' + }, + + clickTarget: 'icon', + + domButton: true, // true + }) + .layout() + + var gameObject; + + label + .on('select', function (file, label) { + console.log(file); + label.setText(label.getFileName(file)); + }) + .onClick(label.getElement('action'), function () { + var key = label.text; + label.saveTexture(key); + console.log(`Save texture ${key}`) + + // Display new texture + if (!gameObject) { + gameObject = this.add.image(0, 0, '').setOrigin(0); + } + gameObject.setTexture(key); + }, this) + + + } + + update() { } +} + +var CreateCanvasInput = function (scene) { + return scene.rexUI.add.canvasInput({ + background: { + 'focus.stroke': 'red', + }, + + style: { + fontSize: 20, + backgroundBottomY: 5, + backgroundHeight: 24, + + 'cursor.color': 'black', + 'cursor.backgroundColor': 'white', + }, + + text: 'Click icon', + + selectAll: true + }) +} + +var config = { + type: Phaser.AUTO, + parent: 'phaser-example', + width: 800, + height: 600, + scale: { + mode: Phaser.Scale.FIT, + autoCenter: Phaser.Scale.CENTER_BOTH, + }, + dom: { + createContainer: true + }, + scene: Demo, + plugins: { + scene: [{ + key: 'rexUI', + plugin: UIPlugin, + mapping: 'rexUI' + }] + } +}; + +var game = new Phaser.Game(config); \ No newline at end of file diff --git a/templates/ui/imageinputlabel/ImageInputLabel.js b/templates/ui/imageinputlabel/ImageInputLabel.js index 70c4c21925..454f17b59b 100644 --- a/templates/ui/imageinputlabel/ImageInputLabel.js +++ b/templates/ui/imageinputlabel/ImageInputLabel.js @@ -31,7 +31,7 @@ class ImageInputLabel extends Label { this.clickTarget = GetClickTarget(this, config); if (this.clickTarget) { - if (!GetValue(config, 'domButton', false)) { + if (!GetValue(config, 'domButton', true)) { this.clickBehavior = CreateClickBehavior(this, config); } else { this.fileChooser = CreateFileChooser(this, config); diff --git a/templates/ui/imageinputlabel/methods/GetFileName.js b/templates/ui/imageinputlabel/methods/GetFileName.js new file mode 100644 index 0000000000..22928640c5 --- /dev/null +++ b/templates/ui/imageinputlabel/methods/GetFileName.js @@ -0,0 +1,10 @@ +var GetFileName = function (file) { + if (!file) { + return null; + } + + var name = file.name; + return name.substr(0, name.lastIndexOf('.')); +} + +export default GetFileName; \ No newline at end of file diff --git a/templates/ui/imageinputlabel/methods/Methods.js b/templates/ui/imageinputlabel/methods/Methods.js index 22a55b416b..6cbcdc7d81 100644 --- a/templates/ui/imageinputlabel/methods/Methods.js +++ b/templates/ui/imageinputlabel/methods/Methods.js @@ -1,7 +1,9 @@ import OpenMethods from './OpenMethods.js'; +import GetFileName from './GetFileName.js'; import SaveTexture from './SaveTexture.js'; var methods = { + getFileName: GetFileName, saveTexture: SaveTexture, }; diff --git a/templates/ui/imageinputlabel/methods/OnSelectFile.js b/templates/ui/imageinputlabel/methods/OnSelectFile.js index 2ae4084456..019742b0b5 100644 --- a/templates/ui/imageinputlabel/methods/OnSelectFile.js +++ b/templates/ui/imageinputlabel/methods/OnSelectFile.js @@ -10,7 +10,7 @@ var OnSelectFile = function (parent, files) { .then(function () { imageBox.scaleImage(); - parent.emit('select', selectedFile, self); + parent.emit('select', selectedFile, parent); }) }