From 372be3df58dbfb48bb319a8c4ffd62e90c31b351 Mon Sep 17 00:00:00 2001 From: Rex Date: Thu, 12 Oct 2023 21:30:14 +0800 Subject: [PATCH] export plugin --- dist/rexgameobjectshellplugin.js | 88 ++++++++++++++++------------ dist/rexgameobjectshellplugin.min.js | 2 +- 2 files changed, 51 insertions(+), 39 deletions(-) diff --git a/dist/rexgameobjectshellplugin.js b/dist/rexgameobjectshellplugin.js index 04740244e8..a6f8382412 100644 --- a/dist/rexgameobjectshellplugin.js +++ b/dist/rexgameobjectshellplugin.js @@ -2641,7 +2641,7 @@ }; Object.assign(Methods$9, MonitorTargetMethods$1); - var DefaultConfig$2 = { + var DefaultConfig$1 = { boundsRectangle: { color: 0x555555 }, @@ -2904,7 +2904,7 @@ var _this; _classCallCheck(this, ControlPoints); if (config === undefined) { - config = DeepClone(DefaultConfig$2); + config = DeepClone(DefaultConfig$1); } _this = _super.call(this, scene, 0, 0, 1, 1); _this.childrenMap = {}; @@ -38748,7 +38748,7 @@ }(TweakerShell); var GetValue$4 = Phaser.Utils.Objects.GetValue; - function DefaultConfig$1 (colors) { + function DefaultConfig (colors) { var COLOR_PRIMARY = GetValue$4(colors, 'primary', 0x424242); var COLOR_LIGHT = GetValue$4(colors, 'light', 0x6d6d6d); var COLOR_DARK = GetValue$4(colors, 'dark', 0x1b1b1b); @@ -38929,7 +38929,7 @@ } var MergeConfig = function MergeConfig(extraConfig) { - var sourceConfig = DefaultConfig$1(extraConfig); + var sourceConfig = DefaultConfig(extraConfig); for (var key in extraConfig) { var extraData = extraConfig[key]; if (key === 'styles') { @@ -39121,44 +39121,45 @@ }, this); }; - var CreatePanPinchCameraController = function CreatePanPinchCameraController(config) { + var PanScrollPinchZoom = function PanScrollPinchZoom(panScrollEnable, pinchZoomEnable) { + if (!panScrollEnable && !pinchZoomEnable) { + return; + } var scene = this.scene; var gameObject = this.background ? this.background : scene; var pinch = new Pinch(gameObject); var camera = scene.cameras.main; - pinch.on('drag1', function (pinch) { - var drag1Vector = pinch.drag1Vector; - camera.scrollX -= drag1Vector.x; - camera.scrollY -= drag1Vector.y; - }).on('pinch', function (pinch) { - var scaleFactor = pinch.scaleFactor; - camera.zoom *= scaleFactor; - }, this); - var onWheeling = function onWheeling(pointer, currentlyOver, dx, dy, dz, event) { - camera.zoom += (dy < 0 ? 1 : -1) * 0.05; - }; - scene.input.on('wheel', onWheeling, this); + if (panScrollEnable) { + pinch.on('drag1', function (pinch) { + var drag1Vector = pinch.drag1Vector; + var zoom = camera.zoom; + camera.scrollX -= drag1Vector.x / zoom; + camera.scrollY -= drag1Vector.y / zoom; + }); + } + if (pinchZoomEnable) { + pinch.on('pinch', function (pinch) { + var scaleFactor = pinch.scaleFactor; + camera.zoom *= scaleFactor; + }); + } this.once('destroy', function () { pinch.destroy(); pinch = undefined; - scene.input.off('wheel', onWheeling, this); }); }; - var CreateCursorAtBoundsCameraController = function CreateCursorAtBoundsCameraController(config) { + var BoundsScroll = function BoundsScroll() { var scene = this.scene; + var camera = scene.cameras.main; var cursorAtBounds = new CursorAtBounds(scene); var cursorKeys = cursorAtBounds.createCursorKeys(); - var mouseWheelToUpDown = new MouseWheelToUpDown(scene); - var zoomKeys = mouseWheelToUpDown.createCursorKeys(); var cameraController = new Phaser.Cameras.Controls.SmoothedKeyControl({ - camera: scene.cameras.main, + camera: camera, left: cursorKeys.left, right: cursorKeys.right, up: cursorKeys.up, down: cursorKeys.down, - zoomIn: zoomKeys.down, - zoomOut: zoomKeys.up, acceleration: 0.06, drag: 0.003, maxSpeed: 0.3, @@ -39174,28 +39175,39 @@ scene.events.off('preupdate', UpdateCameraController); cursorAtBounds.destroy(); cursorAtBounds = undefined; - mouseWheelToUpDown.destroy(); - mouseWheelToUpDown = undefined; cameraController.destroy(); cameraController = undefined; cursorKeys = undefined; - zoomKeys = undefined; }, this); }; - var GetValue$1 = Phaser.Utils.Objects.GetValue; - var DefaultConfig = { - type: 'pan-pinch' + var MouseWheelZoom = function MouseWheelZoom() { + var scene = this.scene; + var camera = scene.cameras.main; + var onWheeling = function onWheeling(pointer, currentlyOver, dx, dy, dz, event) { + camera.zoom += (dy < 0 ? 1 : -1) * 0.05; + }; + scene.input.on('wheel', onWheeling, this); + this.once('destroy', function () { + scene.input.off('wheel', onWheeling, this); + }); }; + + var GetValue$1 = Phaser.Utils.Objects.GetValue; var CreateCameraController = function CreateCameraController(config) { - var cameraControllerConfig = GetValue$1(config, 'cameraController', DefaultConfig); - switch (cameraControllerConfig.type) { - case 'pan-pinch': - CreatePanPinchCameraController.call(this, cameraControllerConfig); - break; - case 'cursorAtBounds': - CreateCursorAtBoundsCameraController.call(this, cameraControllerConfig); - break; + var cameraControllerConfig = GetValue$1(config, 'camera'); + var panScrollEnable = GetValue$1(cameraControllerConfig, 'pan-scroll', true); + var pinchZoomEnable = GetValue$1(cameraControllerConfig, 'pinch-zoom', true); + var boundsScrollEnable = GetValue$1(cameraControllerConfig, 'bounds-scroll', true); + var mouseWheelZoomEnable = GetValue$1(cameraControllerConfig, 'mouse-wheel-zoom', true); + if (panScrollEnable || pinchZoomEnable) { + PanScrollPinchZoom.call(this, panScrollEnable, pinchZoomEnable); + } + if (boundsScrollEnable) { + BoundsScroll.call(this); + } + if (mouseWheelZoomEnable) { + MouseWheelZoom.call(this); } }; diff --git a/dist/rexgameobjectshellplugin.min.js b/dist/rexgameobjectshellplugin.min.js index f1ab5d936f..3abc5a4376 100644 --- a/dist/rexgameobjectshellplugin.min.js +++ b/dist/rexgameobjectshellplugin.min.js @@ -9,4 +9,4 @@ * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var vl=Phaser.Renderer.WebGL.Utils,pl={renderWebGL:function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,s=r.width,o=r.height,a=vl.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(r.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,r.glTexture,s,o,e.x,e.y,s/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,s,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},gl=Phaser.Display.Canvas.CanvasPool;w();var yl=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"setStyle",value:function(t){return this.style.setStyle(t)}},{key:"setFont",value:function(t){return this.style.setFont(t)}},{key:"setFontFamily",value:function(t){return this.style.setFontFamily(t)}},{key:"setFontSize",value:function(t){return this.style.setFontSize(t)}},{key:"setFontStyle",value:function(t){return this.style.setFontStyle(t)}},{key:"setTestString",value:function(t){return this.style.setTestString(t)}},{key:"setFixedSize",value:function(t,e){return this.style.setFixedSize(t,e)}},{key:"setBackgroundColor",value:function(t,e,i){return this.style.setBackgroundColor(t,e,i)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.style.setBackgroundStrokeColor(t,e)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.style.setBackgroundCornerRadius(t,e)}},{key:"setFill",value:function(t){return this.style.setFill(t)}},{key:"setColor",value:function(t){return this.style.setColor(t)}},{key:"setStroke",value:function(t,e){return this.style.setStroke(t,e)}},{key:"setShadow",value:function(t,e,i,n,r,s){return this.style.setShadow(t,e,i,n,r,s)}},{key:"setShadowOffset",value:function(t,e){return this.style.setShadowOffset(t,e)}},{key:"setShadowColor",value:function(t){return this.style.setShadowColor(t)}},{key:"setShadowBlur",value:function(t){return this.style.setShadowBlur(t)}},{key:"setShadowStroke",value:function(t){return this.style.setShadowStroke(t)}},{key:"setShadowFill",value:function(t){return this.style.setShadowFill(t)}},{key:"setWrapMode",value:function(t){return this.style.setWrapMode(t)}},{key:"setWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setWordWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setHAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setVAlign",value:function(t){return this.style.setVAlign(t)}},{key:"setLineSpacing",value:function(t){return this.style.setLineSpacing(t)}},{key:"lineSpacing",get:function(){return this.style.lineSpacing},set:function(t){this.setLineSpacing(t);}},{key:"setXOffset",value:function(t){return this.style.setXOffset(t)}},{key:"setMaxLines",value:function(t){return this.style.setMaxLines(t)}},{key:"setResolution",value:function(t){return this.style.setResolution(t)}},{key:"getTextMetrics",value:function(){return this.style.getTextMetrics()}},{key:"setTextMetrics",value:function(t,e){return this.style.setTextMetrics(t,e)}},{key:"measureTextMargins",value:function(t,e){return function(t,e,i){void 0===i&&(i={});var n=gl.create(this),r=n.getContext("2d",{willReadFrequently:!0});t.syncFont(n,r);var s=r.measureText(e),o=Math.ceil(s.width*t.baselineX),a=o,h=2*a;if(a=a*t.baselineY|0,n.width=o,n.height=h,r.fillStyle="#f00",r.fillRect(0,0,o,h),r.font=t._font,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(t.testString,0,a),i.left=0,0===o||0===h||!r.getImageData(0,0,o,h))return gl.remove(n),i;for(var l=r.getImageData(0,0,o,h).data,u=!1,c=0;ch;u--){for(c=0;c0&&this.wrapMode!==Tl&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wordWrap")){var n=t.wordWrap;n.hasOwnProperty("width")&&(t.wrap={mode:"word",width:n.width});}if(t&&t.hasOwnProperty("wrap")){var r=t.wrap;if(r.hasOwnProperty("mode")){var s=r.mode;"string"==typeof s&&(r.mode=Al[s]);}else r.hasOwnProperty("width")&&(r.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var o=this.propertyMap;for(var a in o){var h=o[a],l=h[0],u=i?h[1]:this[a],c=h[2];if("wrapCallback"===a||"wrapCallbackScope"===a)this[a]=Ll(t,l,u);else {var d=Rl(t,l,u);c&&(d=c(d)),this[a]=d;}}var f=Ll(t,"font",null);this._font=null===f?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:f;var v=Ll(t,"fill",null);null!==v&&(this.color=bl(v));var p=Ll(t,"metrics",!1);return p?this.metrics={ascent:Ll(p,"ascent",0),descent:Ll(p,"descent",0),fontSize:Ll(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=Cl(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=Cl(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Ll(t,"fontFamily","Courier"),this.fontSize=Ll(t,"fontSize","16px"),this.fontStyle=Ll(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=bl(t,this.parent.canvas,this.parent.context),this.backgroundColor2=bl(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=bl(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=bl(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=bl(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=bl(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=bl(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Al[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Ll(e,"fontFamily",this.fontFamily),this.fontSize=Ll(e,"fontSize",this.fontSize),this.fontStyle=Ll(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Al={none:Tl,word:_l,char:El,character:El},jl=Phaser.Math.DegToRad,zl=function(t){return !t.hasOwnProperty("convex")||t.convex},Bl=function(t){return t.x>0&&t.y>0},Il=function(t,e,i,n,r,s,o,a,h){if(a&&o>s?o-=360:!a&&o=f?1:n/f,g=r>=v?1:r/v,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,h,l,h,l,180,270,!1,o):Il(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,n-h,l,h,l,270,360,!1,o):Il(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,n-h,r-l,h,l,0,90,!1,o):Il(t,n,r,h,l,270,180,!0,o)):t.lineTo(n,r),a=y.bl,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,h,r-l,h,l,90,180,!1,o):Il(t,0,r,h,l,360,270,!0,o)):t.lineTo(0,r),t.lineTo(u,c),t.closePath(),t.restore();}(e,i,n,r,s,o,d),null!=a){var f;if(null!=u)(f=c?e.createLinearGradient(0,0,r,0):e.createLinearGradient(0,0,0,s)).addColorStop(0,a),f.addColorStop(1,u),a=f;e.fillStyle=a,e.fill();}null!=h&&l>0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());},Fl=function(t,e,i,n,r,s,o,a){if(null!=e||null!=i){var h=t.canvas.width,l=t.canvas.height;null==i&&(n=0);var u=n/2;h=Math.max(1,h-n),l=Math.max(1,l-n),Wl(t.canvas,t.context,u,u,h,l,r,e,i,n,s,o,a);}},Yl={draw:function(t,e,i,n){var r=this.penManager;this.hitAreaManager.clear();var s=this.context;s.save();var o=this.defaultStyle;this.clear(),Fl(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,v=o.valign,p=o.lineHeight,g=r.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===v?Math.floor((y-h)/2):"bottom"===v?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===v?Math.max((n-h*p)/2,0):"bottom"===v?Math.max(n-h*p-2,0):0,d+=e;for(var x=l;x0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(s.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,r,s){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;s.syncShadow(o,s.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=r,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var r=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(r,n.shadowStroke),r.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(r,n.shadowFill),r.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Xl=Phaser.Utils.Objects.GetValue,Gl=Sl,Vl=Pl,Hl=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){this.text=Xl(t,"text",""),this.x=Xl(t,"x",0),this.y=Xl(t,"y",0),this.width=Xl(t,"width",0);var e=Xl(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Xl(t,"newLineMode",0),this.startIndex=Xl(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Vl&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Gl&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Vl&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),Nl=Phaser.Utils.Objects.GetFastValue,Ul=Sl,Kl=Ol,Jl=function(){function t(e){n(this,t),this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.tagToText=Nl(e,"tagToText",Hn),this.tagToTextScope=Nl(e,"tagToTextScope",void 0);}return s(t,[{key:"destroy",value:function(){this.clear(),this.tagToText=void 0,this.tagToTextScope=void 0;}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),ql={},Zl=function(){function t(){n(this,t),this.items=[];}return s(t,[{key:"destroy",value:function(){this.clear(),this.items=void 0;}},{key:"pop",value:function(){return this.items.length>0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),$l=Phaser.Geom.Rectangle,Ql=new Zl,tu=function(){function t(){n(this,t),this.hitAreas=[];}return s(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;tr){""!==S?a.push(o.getLine(S,P,au)):0===T&&s>0&&a.push(o.getLine("",0,au)),a.push.apply(a,y(t(b,i,uu,r,0,o)));var E=a.pop();S=E.text,P=E.width,o.freeLine(E)," "===S&&(S="",P=0);}else (C=P+x)>l?(a.push(o.getLine(S,P,au)),S=b,P=x,l=r):(S+=b,P=C),w&&a.push(o.getLine(S,P,u));}return a},fu=Phaser.Utils.Objects.GetValue,vu=Tl,pu=Sl,gu=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=fu(e,"context",null),this.canvas=this.context.canvas,this.parser=fu(e,"parser",null),this.defaultStyle=fu(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new tu,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return s(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,r){if(void 0===r&&(r=this.penManager),r.clear(),""===t)return r;var s=this.parent.style;if(s.isWrapFitMode){var o=this.parent.padding;i=s.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,v=function(t){return f.measureText(t).width},p=0,g=0,y=s.wrapCallback,k=s.wrapCallbackScope,m=!0,b=this.parser.splitText(t),x=this.wrapTextLinesPool,w=0,C=b.length;w0&&e!==vu&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new Jl({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var r=this.parser.splitText(t,1);n="";for(var s=0,o=r.length;s0}},{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}(mc);Object.assign(Wc.prototype,jc);var Fc=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Yc=Phaser.Utils.Objects.GetValue,Xc=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Yc(r,"color",null),Yc(r,"color2",null),Yc(r,"horizontalGradient",!0)),s.setStroke(Yc(r,"stroke",null),Yc(r,"strokeThickness",2)),s.setCornerRadius(Yc(r,"cornerRadius",0),Yc(r,"cornerIteration",null)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=bl(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=bl(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=bl(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,Fc("color2",t,this),Fc("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Fc("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Fc("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return v(h(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(){Fl(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Wc),Gc=Phaser.Utils.Objects.GetValue,Vc=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(Gc(r,"color",null),Gc(r,"color2",null),Gc(r,"horizontalGradient",!0)),s.setStroke(Gc(r,"stroke",null),Gc(r,"strokeThickness",2)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=bl(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=bl(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=bl(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){v(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Gc(t,"color2",null),Gc(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Gc(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,r=this.parent.height-t.top-t.bottom,s=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?s.createLinearGradient(0,0,n,0):s.createLinearGradient(0,0,0,r)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;s.fillStyle=o,s.fillRect(e,i,n,r);}null!=this.stroke&&this.strokeThickness>0&&(s.strokeStyle=this.stroke,s.lineWidth=this.strokeThickness,s.strokeRect(e,i,n,r));}}]),i}(Wc),Hc=Phaser.Utils.Objects.GetValue,Nc=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return s(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(Hc(t,"bold",!1)),this.setItalic(Hc(t,"italic",!1)),this.setFontSize(Hc(t,"fontSize","16px")),this.setFontFamily(Hc(t,"fontFamily","Courier")),this.setColor(Hc(t,"color","#fff")),this.setStrokeStyle(Hc(t,"stroke",null),Hc(t,"strokeThickness",0)),this.setShadow(Hc(t,"shadowColor",null),Hc(t,"shadowOffsetX",0),Hc(t,"shadowOffsetY",0),Hc(t,"shadowBlur",0)),this.setOffset(Hc(t,"offsetX",0),Hc(t,"offsetY",0)),this.setSpace(Hc(t,"leftSpace",0),Hc(t,"rightSpace",0)),this.setAlign(Hc(t,"align",void 0)),this.setBackgroundColor(Hc(t,"backgroundColor",null)),this.setBackgroundHeight(Hc(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Hc(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(Fc("stroke",t,this),Fc("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Fc("shadowOffsetX",t,this),Fc("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=bl(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=bl(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=bl(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=bl(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}(),Uc=Phaser.Utils.Array.Remove,Kc=Phaser.Utils.Array.Remove,Jc="text",qc="image",Zc="drawer",$c="space",Qc="command",td=function(t){return t.type===Jc&&"\n"===t.text},ed=function(t){return t.type===Jc&&"\f"===t.text},id=function(t){return t.type===Jc},nd=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,Jc)).updateTextFlag=!1,o.style=new Nc(u(o),s),o.setText(r),o}return s(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),g(h(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),g(h(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),v(h(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&&v(h(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,r=e.backgroundBottomY;null==r&&(r=this.drawBLY);var s=e.backgroundHeight;null==s&&(s=r-this.drawTLY);var o=r-s;t.fillRect(i,o,n,s);}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}(Wc),rd=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},sd=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,qc)).setTexture(r,s),o}return s(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}(Wc),od=function(t){a(i,t);var e=d(i);function i(t,r,s,o){var a;return n(this,i),(a=e.call(this,t,Zc)).setRenderCallback(r),a.setDrawerSize(s,o),a}return s(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(){v(h(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}(Wc),ad=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,$c)).setSpaceWidth(r),s}return s(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}(Wc),hd=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a){var h;return n(this,i),(h=e.call(this,t,Qc)).setName(r).setParameter(o).setCallback(s,a),h}return s(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(){v(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(mc),ld=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)},ud=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var r=t.length,s=e,o=n.word,a=0;s0&&!a){var h=this.fixedHeight-n;if(i>0)s=h/i;else s=(l=fd.call(this)).height,o=l.ascent,i=Math.floor((h-o)/s);}else {var l;s=(l=fd.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=pd(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/s);}}else i=pd(t,"maxLines",0);void 0===o&&(o=s);var u=0===i,c=pd(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-r:1/0);for(var d=pd(t,"letterSpacing",0),f=pd(t,"hAlign",0),v=pd(t,"vAlign",0),p=pd(t,"charWrap",!1),g=ld({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:v,ascent:o,lineHeight:s,wrapWidth:c,charWrap:p}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,width:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=!L&&g.start===O,g.maxLineWidth=R,g.linesHeight=_.length*s;var W=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+r,F=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":r=(i-a)/2;break;case 2:case"bottom":r=i-a;break;default:r=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-r)/i:0;else if(this.fixedWidth>0){if(void 0===(i=kd(t,"maxLines",void 0))){var o=this.fixedWidth-r;i=Math.floor(o/s)+1;}}else i=kd(t,"maxLines",0);var a=0===i,h=kd(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=kd(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=kd(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=kd(t,"letterSpacing",0),f=kd(t,"rtl",!0),v=kd(t,"hAlign",f?2:0),p=kd(t,"vAlign",0),g=ld({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:v,vAlign:p,lineWidth:s,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,height:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=g.start===O,g.maxLineHeight=R,g.linesWidth=_.length*s;var B=this.fixedWidth>0?this.fixedWidth:g.linesWidth+r,I=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(s){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,r=i.right,s=i.top,o=i.bottom;return zr(i,t,e),this.dirty=this.dirty||n!=i.left||r!=i.right||s!=i.top||o!=i.bottom,this},getPadding:function(t){return jr(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),Uc(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 Kc(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,r,s=Array.isArray(t);void 0===e||e===this.children.length?s?(i=this.children).push.apply(i,y(t)):this.children.push(t):s?(n=this.children).splice.apply(n,[e,0].concat(y(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,s)?(r=this.lastAppendedChildren).push.apply(r,y(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Jc);return null===i?i=new nd(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,r=t.length;ne&&(n=e,r=t);})),r},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Ac(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,r=t.length;n=i.length&&(t=i.length);for(var n=0,r=0;r0,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=Mf(t,"tl",0),this.radiusTR=Mf(t,"tr",0),this.radiusBL=Mf(t,"bl",0),this.radiusBR=Mf(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,r=this.height,s=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?gh(e,e,e,e,180,270,!1,s,t):gh(0,0,e,e,90,0,!0,s,t):vh(0,0,t);(e=this.radiusTR)>0?this._convexTR?gh(n-e,e,e,e,270,360,!1,s,t):gh(n,0,e,e,180,90,!0,s,t):vh(n,0,t);(e=this.radiusBR)>0?this._convexBR?gh(n-e,r-e,e,e,0,90,!1,s,t):gh(n,r,e,e,270,180,!0,s,t):vh(n,r,t);(e=this.radiusBL)>0?this._convexBL?gh(e,r-e,e,e,90,180,!1,s,t):gh(0,r,e,e,360,270,!0,s,t):vh(0,r,t);return t.push(t[0],t[1]),vf(this.x,this.y,t),v(h(i.prototype),"updateData",this).call(this),this}}]),i}(hf);Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Phaser.Math.Wrap;var Lf=Phaser.Math.Linear,Df=function(){var t,e,i,n,r,s,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,v={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 p=v[this.direction],g=p.a,y=p.b,k=p.c;t=g.x,e=g.y,i=y.x,n=y.y,r=k.x,s=k.y;}else {var m=v[this.previousDirection],b=v[this.direction],x=this.easeDirectionProgress;t=Lf(m.a.x,b.a.x,x),e=Lf(m.a.y,b.a.y,x),i=Lf(m.b.x,b.b.x,x),n=Lf(m.b.y,b.b.y,x),r=Lf(m.c.x,b.c.x,x),s=Lf(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(r,s),this.arrowOnly?o.end():o.close();},Af=(0, Phaser.Math.DegToRad)(120),jf=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,r=this.verticeRotation;t.startAt(e+n*Math.cos(r+Af),i+n*Math.sin(r+Af)).lineTo(e+n*Math.cos(r),i+n*Math.sin(r)).lineTo(e+n*Math.cos(r-Af),i+n*Math.sin(r-Af)),this.arrowOnly?t.end():t.close();},zf={buildShapes:function(){this.addShape((new Ef).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?Df.call(this):jf.call(this);}},Bf={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new Ks(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}},If=Phaser.Utils.Objects.GetValue,Wf=Phaser.Utils.Objects.IsPlainObject,Ff=Phaser.Math.DegToRad,Yf=Phaser.Math.RadToDeg,Xf=function(t){a(r,t);var e=d(r);function r(t,i,s,o,a,h,l){var u,c,d,f,v,p,g,y,k;if(n(this,r),Wf(i)){var m=i;i=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,v=m.arrowOnly,p=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===v&&(v=!1),void 0===p&&(p=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(v),u.setDirection(p,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return s(r,[{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=Vf(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,n,r){if("object"===i(t)){var s=t,o=If(s,"x",null);null!==o?(t=o,n=o):(t=If(s,"left",0),n=If(s,"right",t));var a=If(s,"y",null);null!==a?(e=a,r=a):(e=If(s,"top",0),r=If(s,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===r&&(r=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=n||this.padding.bottom!=r,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=r,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 Yf(this.verticeRotation)},set:function(t){this.verticeRotation=Ff(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),r}(rf),Gf={right:0,down:1,left:2,up:3},Vf=function(t){return "string"==typeof t&&(t=Gf[t]),t%=4};Object.assign(Xf.prototype,zf,Bf);var Hf=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexTweaker.FolderTitle";var o=new Xf(t,r.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return s(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(Zd),Nf=function(t,e){var i=new Zp(t,e);return t.add.existing(i),i},Uf=function(t,e,i){return ul(t,i)},Kf=function(t){a(i,t);var e=d(i);function i(t,r){return n(this,i),void 0===r&&(r={}),r.destroy=!1,e.call(this,t,r)}return s(i,[{key:"onOpen",value:function(){this.emit("open",this.parent,this),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),v(h(i.prototype),"onClose",this).call(this);}}]),i}(uo),Jf={expand:function(t){if(!0===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!0;var e=this.childrenMap.title,i=this.childrenMap.child;return this.show(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),e.emit("folder.expand",t,this),i.emit("folder.expand",t,this),this.emit("expand.start",this),this.childTransition.once("open",(function(){this.emit("expand.complete",this);}),this).requestOpen(null,t),this},collapse:function(t){if(!1===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!1;var e=this.childrenMap.title,i=this.childrenMap.child;return e.emit("folder.collapse",t,this),i.emit("folder.collapse",t,this),this.emit("collapse.start",this),this.childTransition.once("close",(function(){this.setChildScale(i,1,1).hide(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),this.emit("collapse.complete",this);}),this).requestClose(null,t),this},toggle:function(t){return this.expanded?this.collapse(t):this.expand(t),this}},qf=function(t,e){ys.popUp.call(t,e,this.expandDirection);},Zf=function(t,e){ys.scaleDown.call(t,e,this.expandDirection);},$f={setTransitionDuration:function(t){return this.transitionDuration=t,this.childTransition.setTransitInTime(t).setTransitOutTime(t),this},setExpandCallback:function(t){return void 0===t&&(t=qf.bind(this)),this.childTransition.setTransitInCallback(t),this},setCollapseCallback:function(t){return void 0===t&&(t=Zf.bind(this)),this.childTransition.setTransitOutCallback(t),this}},Qf=Phaser.Utils.Objects.GetValue,tv=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),r.hasOwnProperty("orientation")||(r.orientation=1),(s=e.call(this,t,r)).type="rexFolder",s.expanded=void 0,s.expandDirection=1===s.orientation?"y":"x";var o=r.background,a=r.title,h=r.child;o&&s.addBackground(o);var l=1===s.orientation?"left":"top",c=Qf(r,"align.title",l),d=Qf(r,"expand.title",!0);s.add(a,{proportion:0,align:c,expand:d});var f=Qf(r,"toggleByTarget",void 0),v=Qf(r,"toggleClickConfig");if(void 0===f&&(f=a),f&&Ho.onClick.call(f,(function(){this.toggle();}),u(s),v),s.childTransition=new Kf(h),!Qf(r,"customChildOrigin",!1)){var p=s.rtl?1:0;h.setOrigin(p);}c=Qf(r,"align.child","left");var g=(d=Qf(r,"expand.child",!0))?1:0;s.add(h,{proportion:g,align:c,expand:d}),s.addChildrenMap("title",a),s.addChildrenMap("child",h),s.addChildrenMap("background",o);var y=r.transition;s.setTransitionDuration(Qf(y,"duration",200)),s.setExpandCallback(Qf(y,"expandCallback",void 0)),s.setCollapseCallback(Qf(y,"collapseCallback",void 0)),s.reLayoutTarget=Qf(r,"reLayoutTarget",void 0);var k=r.onExpandStart;k&&s.on("expand.start",k);var m=r.onExpandComplete;m&&s.on("expand.complete",m);var b=r.onCollapseStart;b&&s.on("collapse.start",b);var x=r.onCollapseComplete;return x&&s.on("collapse.complete",x),s}return s(i)}(Ja);Object.assign(tv.prototype,Jf,$f);var ev=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexTweaker.Folder",s}return s(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(tv);Object.assign(ev.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 iv=Phaser.Utils.Objects.GetValue,nv=Phaser.Utils.Objects.GetValue,rv=Ja.prototype.add,sv=Ja.prototype.addSpace,ov=function(t){var e=!t.isRexSpace,i=!e||this.buttonsExpand?1:0;if(0===this.sizerChildren.length)if(e){!this.buttonsExpand&&("right"===this.buttonsAlign||"center"===this.buttonsAlign||"bottom"===this.buttonsAlign)&&sv.call(this),rv.call(this,t,{proportion:i,expand:!0});var n=!this.buttonsExpand&&"center"===this.buttonsAlign;n&&sv.call(this),this.hasTailSpace=n;}else rv.call(this,t,{proportion:i,expand:!0}),this.hasTailSpace=!1;else if(this.hasTailSpace){var r=this.sizerChildren.length-1;rv.call(this,t,{index:r,proportion:i,expand:!0});}else rv.call(this,t,{proportion:i,expand:!0});return e&&this.buttonGroup.add(t),this},av={addButton:function(t){if(Eo(t))for(var e=t,i=0,n=e.length;i=0;i--)uv.call(this,e[i],t);return this}},dv=function(t,e,i){if(t){var n=this.setValueCallback,r=this.setValueCallbackScope;n&&(r?n.call(r,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},fv=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,dv.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},vv={add:function(t){return this.buttons.push(t),t._click||(t._click=new Go(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,r){this.fireEvent("button.over",t,e,r);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,r){this.fireEvent("button.down",t,e,r);}),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")),fv.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;ha.height/2)){r>(h=Mv(a.left,a.centerY,t,e))&&(r=h,n=s);var h,l=i[s+1];if(!l||l.y!==a.y)r>(h=Mv(a.right,a.centerY,t,e))&&(r=h,n=s+1);}}return n},Lv=Phaser.Utils.Objects.IsPlainObject,Dv=Phaser.Utils.Objects.GetValue,Av=Phaser.Display.Align.CENTER,jv=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var r;(Cr.call(this,t),Lv(e))&&(e=Dv(r=e,"padding",0),i=Dv(r,"key",void 0),n=Dv(r,"index",void 0));return void 0===e&&(e=0),(r=this.getSizerConfig(t)).align=Av,r.padding=xr(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},zv={add:function(t,e,i){if(Eo(t))for(var n=t,r=0,s=n.length;r=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Wa.call(this,t),this}},Wv={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,r=i.length;nr&&Nv.addNewLine(this);}else for(s=0,o=t.length;s=0;i--)Zv.call(this,e[i],t);return this}},Qv=Phaser.Utils.Objects.GetValue,tp=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={});var o=r.space;"number"==typeof o&&(r.space={item:o,line:o}),(s=e.call(this,t,r)).type="rexFixWidthButtons",s.buttonGroup=new xv({parent:u(s),eventEmitter:Qv(r,"eventEmitter",u(s)),groupName:Qv(r,"groupName",void 0),clickConfig:Qv(r,"click",void 0)}).setButtonsType(r);var a=Qv(r,"background",void 0),h=Qv(r,"buttons",void 0);return s.buttonsAlign=Qv(r,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(v(h(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}(Vv);Object.assign(tp.prototype,Kv,$v,bv,Cv);var ep=Phaser.Utils.Objects.IsPlainObject,ip=Phaser.Utils.Objects.GetValue,np=Phaser.Display.Align.CENTER,rp=Phaser.Utils.String.UUID,sp={add:function(t,e,i,n,r,s,o,a,h){(Cr.call(this,t),ep(e))&&(e=ip(l=e,"key",void 0),i=ip(l,"align",np),a=ip(l,"offsetX",0),h=ip(l,"offsetY",0),n=ip(l,"padding",0),r=ip(l,"expand",!0),t.isRexSizer||(s=ip(l,"minWidth",t._minWidth),o=ip(l,"minHeight",t._minHeighted)));var l,u=void 0!==e;return u||(e=rp()),"string"==typeof i&&(i=Vn[i]),void 0===i&&(i=np),void 0===a&&(a=0),void 0===h&&(h=0),void 0===n&&(n=0),void 0===r&&(r=!0),t.isRexSizer||(void 0===s&&(s=t._minWidth),void 0===o&&(o=t._minHeight)),(l=this.getSizerConfig(t)).align=i,l.alignOffsetX=a,l.alignOffsetY=h,l.padding=xr(n),ep(r)?(l.expandWidth=ip(r,"width",!1),l.expandHeight=ip(r,"height",!1)):(l.expandWidth=r,l.expandHeight=r),t.isRexSizer||(l.expandWidth&&(t.minWidth=void 0===s?mt(t):s),l.expandHeight&&(t.minHeight=void 0===o?bt(t):o)),this.sizerChildren.hasOwnProperty(e)&&this.sizerChildren[e].destroy(),this.sizerChildren[e]=t,u&&this.addChildrenMap(e,t),this}},op={remove:function(t,e){var i;if("string"==typeof t){if(i=t,!(t=this.sizerChildren[i]))return this}else {if(this.getParentSizer(t)!==this)return this;i=this.childToKey(t);}return i&&(delete this.sizerChildren[i],this.childrenMap.hasOwnProperty(i)&&delete this.childrenMap[i]),Mr.call(this,t,e),this},removeAll:function(t){for(var e in this.sizerChildren)this.remove(e,t);return this},clear:function(t){for(var e in this.sizerChildren)delete this.sizerChildren[e],this.childrenMap.hasOwnProperty(e)&&delete this.childrenMap[e];return Wa.call(this,t),this}},ap={getChildrenWidth:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)e=(t=r[s]).rexSizer.padding,i=this.getChildWidth(t)+e.left+e.right,n=Math.max(i,n);return n+this.space.left+this.space.right},getChildrenHeight:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)i=(t=r[s]).isRexSizer?Math.max(t.minHeight,t.childrenHeight):void 0!==t.minHeight?t.minHeight:bt(t),i+=(e=t.rexSizer.padding).top+e.bottom,n=Math.max(i,n);return n+this.space.top+this.space.bottom},getExpandedChildWidth:function(t,e){var i;void 0===e&&(e=this.width);var n=t.rexSizer;if(n.expandWidth){var r=e-this.space.left-this.space.right,s=n.padding;i=r-s.left-s.right;}return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer;if(n.expandHeight){var r=e-this.space.top-this.space.bottom,s=n.padding;i=r-s.top-s.bottom;}return i},getChildrenSizers:function(t){void 0===t&&(t=[]);var e,i=this.sizerChildren;for(var n in i)(e=i[n]).isRexSizer&&t.push(e);return t},layoutChildren:function(){var t,e,i,n,r,s,o,a,h,l=this.innerLeft,u=this.innerTop,c=this.innerWidth,d=this.innerHeight,f=this.sizerChildren;for(var v in f)(t=f[v]).rexSizer.hidden||(i=(e=t.rexSizer).padding,Io.call(this,t),t.isRexSizer?(t.runLayout(this,this.getExpandedChildWidth(t),this.getExpandedChildHeight(t)),_a(t,this)):(a=void 0,h=void 0,e.expandWidth&&(a=c-i.left-i.right),e.expandHeight&&(h=d-i.top-i.bottom),Ao(t,a,h)),n=l+i.left,s=c-i.left-i.right,r=u+i.top,o=d-i.top-i.bottom,Wo.call(this,t,n,r,s,o,e.align,e.alignOffsetX,e.alignOffsetY));}};Object.assign(ap,sp,op);var hp=Phaser.Utils.Objects.IsPlainObject,lp=Phaser.Utils.Objects.GetValue,up=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h){var l;return n(this,i),hp(r)?(r=lp(h=r,"x",0),s=lp(h,"y",0),o=lp(h,"width",void 0),a=lp(h,"height",void 0)):hp(o)&&(o=lp(h=o,"width",void 0),a=lp(h,"height",void 0)),(l=e.call(this,t,r,s,o,a,h)).type="rexOverlapSizer",l.sizerChildren={},l.addChildrenMap("items",l.sizerChildren),l}return s(i,[{key:"childToKey",value:function(t){if("string"!=typeof t)return function(t,e){if(Array.isArray(t))return t.indexOf(e);for(var i in t)if(t[i]===e)return i;return null}(this.sizerChildren,t);var e=t;return this.sizerChildren.hasOwnPropery(e)?e:null}}]),i}(Ta);Object.assign(up.prototype,ap);var cp=up.prototype.add,dp=function(t,e,i,n,r,s,o,a,h){return t.setVisible(!1),cp.call(this,t,e,i,n,r,s,o,a,h),this},fp={add:dp,addPage:dp},vp=qt.prototype.setChildVisible,pp={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?(vp.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&&(vp.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(pp,fp);var gp=Phaser.Utils.Objects.GetValue,yp=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(gp(r,"swapMode",0)),s.setFadeInDuration(gp(r,"fadeIn",0)),s}return s(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=kp[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}(up);Object.assign(yp.prototype,pp);var kp={invisible:0,destroy:1},mp=Phaser.Utils.Objects.IsPlainObject,bp=Phaser.Utils.Objects.GetValue,xp=Phaser.Utils.String.UUID,wp={swapPage:function(t,e){var i,n;null!=(i="number"==typeof t?t:this.getPageIndex(t))&&(void 0!==e&&(n=this.childrenMap.pages.fadeInDuration,this.childrenMap.pages.fadeInDuration=e),this.childrenMap.tabs.emitButtonClick(i),void 0!==n&&(this.childrenMap.pages.fadeInDuration=n));return this},swapFirstPage:function(t){return this.swapPage(0,t),this},swapLastPage:function(t){var e=this.getElement("tabs.buttons").length-1;return this.swapPage(e,t),this}},Cp={removePage:function(t,e){"number"==typeof t&&(t=this.getPageKey(t));var i=this.childrenMap.tabs,n=i.getByName(t),r=this.childrenMap.pages,s=r.getElement(t);return n&&s?(r.removeChildrenMap(t),i.removeButton(n,e),r.remove(s,e),this):this}},Sp={getPageKey:function(t){var e=this.getElement("tabs.buttons");if(!(t>=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;i0?0:1,r.setMinWidth(this.itemWidth)),this.add(r,{proportion:s,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),r.setAutoUpdateEnable(i.autoUpdate),r.setBindingTarget(t,e),i.monitor&&r.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,r),this},addButtons:function(t){var e=this.scene;void 0===t&&(t={});var i=t.bindingTarget;delete t.bindingTarget;var n=Up(this.styles,"inputRow")||{},r=Np(e,t,n);return this.add(r,{expand:!0}),i&&r.setBindingTarget(i),t.key&&this.root.addChildrenMap(t.key,r),this},addButton:function(t){return void 0===t&&(t={}),t.buttons=[{label:t.label,callback:t.callback}],delete t.label,delete t.callback,this.addButtons(t),this},addSeparator:function(t){var e=this.scene,i=Kp(this.styles,"separator"),n=Uf(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i=r&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(r=e.getCharChild(t.prevCursorPosition))&&("\n"===r.text&&r.clearTextSize(),e.emit("cursorout",r,t.prevCursorPosition,e)),null!=n&&(r=e.getCharChild(n))&&("\n"===r.text&&r.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,r=n.width,s=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>r?r-l:0,i=u<0?0-u:c>s?s-c:0,n._textOX+=e,n._textOY+=i;}(r),e.emit("cursorin",r,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(vg(this),pg(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=fg,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(dg),kg=Phaser.Utils.Objects.GetValue,mg=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],bg=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,r=0;rt.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}Cg.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 r=this;function s(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 s([{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 s(Sg(r,n.components,e,t,r.useLongestToken));u[i]=n;}else u[i]=void 0;}var p;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 r=e.length,s=i.length,o=t.newPos,a=o-n,h=0;o+1=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return qg(this.sizerChildren,null),Wa.call(this,t),this}},$g={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)qg(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var r=n*this.columnCount+t;this.sizerChildren.splice(r,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},iy={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,r,s=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=Wr.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 r in this.sizerChildren)(e=this.sizerChildren[r])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var r in this.sizerChildren)!(e=this.sizerChildren[r])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,r){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,qg(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)qg(this.columnProportions,i);else for(var s=0;s0&&(e+=t);return e},ry=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},sy=Phaser.Utils.Objects.IsPlainObject,oy=Phaser.Utils.Objects.GetValue,ay=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l,u,c,d){var f;return n(this,i),sy(r)?(r=oy(d=r,"x",0),s=oy(d,"y",0),o=oy(d,"width",void 0),a=oy(d,"height",void 0),h=oy(d,"column",d.col||0),l=oy(d,"row",0),u=oy(d,"columnProportions",0),c=oy(d,"rowProportions",0)):sy(o)?(o=oy(d=o,"width",void 0),a=oy(d,"height",void 0),h=oy(d,"column",d.col||0),l=oy(d,"row",0),u=oy(d,"columnProportions",0),c=oy(d,"rowProportions",0)):sy(h)?(h=oy(d=h,"column",d.col||0),l=oy(d,"row",0),u=oy(d,"columnProportions",0),c=oy(d,"rowProportions",0)):sy(u)&&(u=oy(d=u,"columnProportions",0),c=oy(d,"rowProportions",0)),(f=e.call(this,t,r,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(oy(d,"createCellContainerCallback")),f.setIndentLeft(oy(d,"space.indentLeftOdd",0),oy(d,"space.indentLeftEven",0)),f.setIndentTop(oy(d,"space.indentTopOdd",0),oy(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,oy(d,"space",void 0)),f}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(v(h(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=ny.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=ry.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}(Ta);Object.assign(ay.prototype,iy);var hy=Phaser.Utils.Objects.GetValue,ly=Phaser.Math.Linear,uy=Phaser.Math.Percent,cy={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=uy(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=uy(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=ly(t,e,i)),i}},dy=Phaser.Math.Percent,fy={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=dy(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new Ks(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 Ks(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},vy=Phaser.Utils.Objects.GetValue,py=Phaser.Math.Clamp;var gy=Phaser.Math.Percent,yy=function(t,e,i){var n;return t.y===e.y?n=gy(i.x,t.x,e.x):t.x===e.x&&(n=gy(i.y,t.y,e.y)),n},ky=function(t,e,i){var n,r;this.enable&&(my.x=e,my.y=i,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint()),this.value=yy(n,r,my));},my={},by=function(t,e,i){if(this.enable&&t.isDown){var n,r;xy.x=t.worldX,xy.y=t.worldY,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint());var s=yy(n,r,xy);this.stopEaseValue(),0===this.easeValueDuration||Math.abs(this.value-s)<.1?this.value=s:this.easeValueTo(s);}},xy={},wy=function(t,e){void 0===e&&(e=Cy);var i=this.childrenMap.thumb,n=i.x,r=i.y;return pr(i,this.innerLeft,this.innerTop,this.innerWidth,this.innerHeight,t),e.x=i.x,e.y=i.y,i.x=n,i.y=r,e},Cy={},Sy=Phaser.Display.Align.LEFT_CENTER,Py=Phaser.Display.Align.TOP_CENTER,Oy={},Ty=Phaser.Display.Align.RIGHT_CENTER,_y=Phaser.Display.Align.BOTTOM_CENTER,Ey={},My=Phaser.Math.Linear,Ry={},Ly=Phaser.Display.Align.LEFT_CENTER,Dy=Phaser.Display.Align.TOP_CENTER,Ay=Phaser.Display.Align.RIGHT_CENTER,jy=Phaser.Display.Align.BOTTOM_CENTER,zy=Phaser.Utils.Objects.GetValue,By=Phaser.Utils.Objects.IsPlainObject,Iy=Phaser.Math.Clamp,Wy=Phaser.Math.Snap.To,Fy=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexSlider",s.bootProgressBase(r),s.reverseAxis=zy(r,"reverseAxis",!1);var o=zy(r,"background",void 0),a=zy(r,"track",void 0),h=zy(r,"indicator",void 0),l=zy(r,"thumb",void 0);o&&(By(o)&&(o=ul(t,o)),s.addBackground(o)),a&&(By(a)&&(a=ul(t,a)),s.add(a,{proportion:1,expand:!0,minWidth:0===s.orientation?0:void 0,minHeight:1===s.orientation?0:void 0})),h&&(By(h)&&(h=ul(t,h)),s.pin(h)),l&&(By(l)&&(l=ul(t,l)),s.pin(l));var c=zy(r,"input",0);switch("string"==typeof c&&(c=Yy[c]),c){case 0:l&&(l.setInteractive(),s.scene.input.setDraggable(l),l.on("drag",ky,u(s)).on("dragstart",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("dragend",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)));break;case 1:s.on("pointerdown",by,u(s)).on("pointermove",by,u(s)).on("pointerdown",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerup",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)).on("pointerover",(function(t){t.isDown&&this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerout",(function(t){t.isDown&&this.eventEmitter.emit("inputend",t);}),u(s)).setInteractive();}return s.addChildrenMap("background",o),s.addChildrenMap("track",a),s.addChildrenMap("indicator",h),s.addChildrenMap("thumb",l),s.setEnable(zy(r,"enable",void 0)),s.setGap(zy(r,"gap",void 0)),s.setValue(zy(r,"value",0),zy(r,"min",void 0),zy(r,"max",void 0)),s}return s(i,[{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setGap",value:function(t,e,i){return t&&void 0!==e&&(t/=i-e),this.gap=t,this}},{key:"value",get:function(){return this._value},set:function(t){void 0!==this.gap&&(t=Wy(t,this.gap));var e=this._value;this._value=Iy(t,0,1),e!==this._value&&(this.updateThumb(this._value),this.updateIndicator(this._value),this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter));}},{key:"postLayout",value:function(t,e,i){return this.updateThumb(),this.updateIndicator(),this}}]),i}(function(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=vy(t,"eventEmitter",this);var e=vy(t,"valuechangeCallback",null);if(null!==e){var i=vy(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(vy(t,"easeValue.duration",0)).setEaseValueFunction(vy(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=py(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,cy,fy),e}(Ja)),Yy={pan:0,drag:0,click:1,none:-1},Xy={getStartPoint:function(t){if(void 0===t&&(t=Oy),this.childrenMap.thumb){var e=0===this.orientation?Sy:Py;wy.call(this,e,t);}else 0===this.orientation?(t.x=this.innerLeft+1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerTop+1);return t},getEndPoint:function(t){if(void 0===t&&(t=Ey),this.childrenMap.thumb){var e=0===this.orientation?Ty:_y;wy.call(this,e,t);}else 0===this.orientation?(t.x=this.innerRight-1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerBottom-1);return t},updateThumb:function(t){var e,i,n=this.childrenMap.thumb;return void 0===n||(void 0===t&&(t=this.value),this.reverseAxis?(e=this.getEndPoint(),i=this.getStartPoint()):(e=this.getStartPoint(),i=this.getEndPoint()),function(t,e,i,n){void 0===n&&(n=Ry),n.x=My(e.x,i.x,t),n.y=My(e.y,i.y,t);}(t,e,i,n),this.resetChildPositionState(n)),this},updateIndicator:function(t){var e=this.childrenMap.indicator;if(void 0===e)return this;void 0===t&&(t=this.value);var i,n,r,s=this.reverseAxis,o=this.childrenMap.thumb;if(o)if(0===this.orientation){var a=mt(o);if(s){h=o.x-a*o.originX;i=this.right-h;}else {var h;i=(h=o.x-a*o.originX)+a-this.left;}}else {var l=bt(o);if(s){u=o.y-l*o.originY;n=this.bottom-u;}else {var u;n=(u=o.y-l*o.originY)+l-this.top;}}else 0===this.orientation?i=this.width*t:n=this.height*t;Ao(e,i,n),r=s?0===this.orientation?Ay:jy:0===this.orientation?Ly:Dy,vr(e,this,r),this.resetChildPositionState(e);}};Object.assign(Fy.prototype,Xy);var Gy=Phaser.Utils.Objects.GetValue,Vy=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexScrollBar";var o,a=Gy(r,"background",void 0),h=Gy(r,"buttons",void 0),l=Gy(h,"top",Gy(h,"left",void 0)),c=Gy(h,"bottom",Gy(h,"right",void 0)),d=Gy(r,"slider",void 0);(a&&s.addBackground(a),l)&&(s.add(l),new ea(l).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?this.scrollStep:-this.scrollStep;this.value+=t;}}),u(s)));if(d){var f;if(d.orientation=s.orientation,d.eventEmitter=u(s),d.value=null,0===s.orientation)f=void 0===Gy(d,"width",void 0)?1:0;else f=void 0===Gy(d,"height",void 0)?1:0;o=new Fy(t,d),t.add.existing(o),s.add(o,{proportion:f});}c&&(s.add(c),new ea(c).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?-this.scrollStep:this.scrollStep;this.value+=t;}}),u(s)));var v=[l,c];s.addChildrenMap("background",a),s.addChildrenMap("slider",o),s.addChildrenMap("buttons",v);var p=Gy(r,"valuechangeCallback",null);if(null!==p){var g=Gy(r,"valuechangeCallbackScope",void 0);s.on("valuechange",p,g);}return s.setEnable(Gy(r,"enable",void 0)),s.setValue(Gy(r,"value",0)),s.setScrollStep(Gy(h,"step",.01)),s}return s(i,[{key:"setScrollStep",value:function(t){return this.scrollStep=t,this}},{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}}]),i}(Ja),Hy=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,r)).parent=t,s.init(),s}return s(i,[{key:"init",value:function(){this.start("IDLE");}},{key:"next_IDLE",value:function(){var t,e=this.parent;return e.dragState.isDown&&(t=0===e.dragThreshold?"DRAG":"DRAGBEGIN"),t}},{key:"update_IDLE",value:function(t,e){this.next();}},{key:"next_DRAGBEGIN",value:function(){var t=this.parent,e=t.dragState;return e.isDown?e.pointer.getDistance()>=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}(Gi),Ny=Phaser.Utils.Objects.GetValue,Uy=Phaser.Math.Distance.Between,Ky=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r))._enable=void 0,t.setInteractive(Ny(r,"inputConfig",void 0)),s.resetFromJSON(r),s.boot(),s}return s(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(Ny(t,"enable",!0)),this.holdThreshold=Ny(t,"holdThreshold",50),this.pointerOutReleaseEnable=Ny(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,v(h(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 en(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:Uy(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}(Pi),Jy=Phaser.Utils.Objects.GetValue,qy=function(){function t(e){n(this,t),this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Jy(t,"value",0)),this.setSpeed(Jy(t,"speed",0)),this.setAcceleration(Jy(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}(),Zy=function(){function t(){n(this,t),this.value,this.dir,this.movement=new qy;}return s(t,[{key:"init",value:function(t,e,i,n,r){return this.value=t,this.end=r,this.dir=void 0!==r?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,r=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,r,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}(Pi),ek={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},ik=Phaser.Utils.Objects.GetValue,nk=function(t){a(i,t);var e=d(i);function i(t,r){var s;(n(this,i),(s=e.call(this,t,r)).parent!==s.scene?s.focusMode=ik(r,"focus",!0):s.focusMode=!1,s.setSpeed(ik(r,"speed",.1)),s.setEnable(ik(r,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(ik(r,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,r){this.enable&&this.scroll(i);}),u(s)):s.scene.input.on("wheel",s.onSceneScroll,u(s));return s}return s(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,r,s){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}(Pi),rk=Phaser.Utils.Objects.GetValue,sk=function(t,e,i,n){var r,s,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(r=l||n.hasOwnProperty(c)?rk(n,c,void 0):rk(n,"slider",void 0)){var d,f,v;!0===r&&(r={}),r.orientation=h?1:0,s=function(t,e){void 0===e&&(e={});var i=jt(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 Vy(t,e);t.add.existing(n);var r=n.childrenMap.slider;return n.addChildrenMap("track",r.childrenMap.track),n.addChildrenMap("indicator",r.childrenMap.indicator),n.addChildrenMap("thumb",r.childrenMap.thumb),n}(t.scene,r);var p=rk(r,"position",0);"string"==typeof p&&(p=ok[p]);var g=rk(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=rk(n,"space.slider",void 0))&&(g=l?0:rk(n,"space.child",0));var y="number"==typeof g;h?0===p?(d=2,f=1,v=y?{left:g}:g):(d=0,f=1,v=y?{right:g}:g):0===p?(d=1,f=2,v=y?{top:g}:g):(d=1,f=0,v=y?{bottom:g}:g),e.add(s,{column:d,row:f,align:"center",padding:v,expand:!0}),t["hideUnscrollableSlider".concat(i)]=rk(r,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=rk(r,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=rk(r,"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)?rk(n,k,!0):rk(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new tk(u,o));var m,b,x,w,C=rk(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(C&&u&&(m=new nk(u,C)),t.addChildrenMap("slider".concat(i),s),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",s),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),s)&&(l?(b=h?"t":"s",w="scroll".concat(i)):(b="t",w="scroll"),s.on("valuechange",(function(e){t[b]=e,t.emit(w,t);})));a&&(l?(x="childO".concat(i),w="scroll".concat(i)):(x="childOY",w="scroll"),a.on("valuechange",(function(e){t[x]=e,t.emit(w,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},ok={right:0,left:1,bottom:0,top:1},ak=Phaser.Utils.Objects.GetValue,hk=function(t,e){var i=t.scene,n=[0,1,0],r=[0,1,0],s=ak(e,"width"),o=ak(e,"height");s||(ak(e,"child.expandWidth",!0)||(n[1]=0));o||(ak(e,"child.expandHeight",!0)||(r[1]=0));var a=new ay(i,{column:3,row:3,columnProportions:n,rowProportions:r});switch(function(t,e,i){var n=hy(i,"child"),r=hy(n,"gameObject",void 0);if(r){var s=hy(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof s)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=s,o.bottom=s,o.left=s,o.right=s;}else switch(t.scrollMode){case 0:o.top=hy(s,"top",0),o.bottom=hy(s,"bottom",0),a.left=hy(s,"left",0),a.right=hy(s,"right",0);break;case 1:o.top=hy(s,"left",0),o.bottom=hy(s,"right",0),a.top=hy(s,"top",0),a.bottom=hy(s,"bottom",0);break;default:o.top=hy(s,"top",0),o.bottom=hy(s,"bottom",0),o.left=hy(s,"left",0),o.right=hy(s,"right",0);}e.add(r,{column:1,row:1,align:hy(n,"align","center"),padding:a,expand:{width:hy(n,"expandWidth",!0),height:hy(n,"expandHeight",!0)}});}t.addChildrenMap("child",r);}(t,a,e),t.scrollMode){case 0:sk(t,a,"y",e);break;case 1:sk(t,a,"x",e);break;default:sk(t,a,"y",e),sk(t,a,"x",e);}return a},lk=function(t){var e,i,n,r;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,r=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)],r=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),r&&r.setEnable(e!==i);},uk=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);}},ck=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,r=this.minThumbSize;if(0===this.scrollMode){var s=i.displayHeight*e;void 0!==r&&s0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new km(t,{width:n,height:s,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:r,value:this.value});return t.add.existing(o),o},bm=Phaser.Utils.Objects.GetValue,xm=function(t,e){var i=bm(e,"expandDirection",void 0);"string"==typeof i&&(i=wm[i]);var n,r,s,a,h,l,u=(s="alignTargetX",bg(n=e,r="alignTarget")?Ii(n,r):s&&bg(n,s)?Ii(n,s):a),c=bm(e,"alignTargetY",u),d=bm(e,"alignOffsetX",0),f=bm(e,"alignOffsetY",0),v=bm(e,"alignSide","").includes("right"),p=bm(e,"bounds"),g=0===i,y=!g&&!(1===i),k=v?1:0,m=g||y?0:1;t.setOrigin(k,m),h=v?u.getTopRight().x:u.getTopLeft().x,l=c.getBottomLeft().y,t.setPosition(h+d,l+f);var b=p;b||(b=Ae(t.scene)),y&&t.getBottomLeft().y>b.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},wm={down:0,up:1},Cm=Phaser.Utils.Objects.GetValue,Sm=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),null==r.transitIn&&(r.transitIn=function(t,e){cs(t,e,"y","Cubic");}),null==r.transitOut&&(r.transitOut=function(t,e){!function(t,e,i,n,r){void 0===n&&(n="Linear");var s={mode:0};switch(i){case 0:case"x":s.end={x:0};break;case 1:case"y":s.end={y:0};break;default:s.end=0;}s.duration=e,s.ease=n,void 0===r?r=new ls(t,s):r.resetFromJSON(s),r.restart();}(t,e,"y","Linear");}),r.manualClose=!0,r.clickOutsideClose=!0,r.destroy=!0,s=e.call(this,t,r),xm(t,r),t.isRexSizer&&t.layout();var o=Cm(r,"touchOutsideClose",!1),a=Cm(r,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,u(s)):o&&s.once("open",s.touchOutsideClose,u(s)),s.requestOpen(),s}return s(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),v(h(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&&Co(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),v(h(i.prototype),"onClose",this).call(this);}}]),i}(uo),Pm={openColorPicker:function(){if(!this.colorPicker){var t=mm.call(this).layout(),e=new Sm(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(Pm,Wk);var Om=Phaser.Utils.Objects.GetValue,Tm=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexColorInput",r.hasOwnProperty("colorPicker")||(r.colorPicker={background:{color:0}});var o=r.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(Om(o,"width",160),Om(o,"height",170));var l=Om(o,"background");h=l?function(t){return ul(t,l)}:Om(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(Om(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(Om(o,"expandDirection")),s.setColorPickerEaseInDuration(Om(o,"easeIn",200)),s.setColorPickerEaseOutDuration(Om(o,"easeOut",200)),s.setColorPickerTransitInCallback(Om(o,"transitIn")),s.setColorPickerTransitOutCallback(Om(o,"transitOut")),s.setColorPickerBounds(Om(o,"bounds"));var c=Om(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(c);}var d=r.colorComponents;if(a&&(!1!==d&&null!==d)){s.setColorComponentsHeight(Om(d,"height",30)),s.setColorComponentsFormatLabelConfig(Om(d,"formatLabel"));var f=Om(d,"inputText");f||(f=Om(r,"inputText")),s.setColorComponentsInputTextConfig(f);var v=Om(d,"space");void 0===v&&(v={item:8}),s.setColorComponentsSpace(v);}var p=s.childrenMap.swatch;return p&&a&&s.onClick(p,s.openColorPicker,u(s)),s}return s(i)}(Ik);Object.assign(Tm.prototype,Pm);var _m={name:"ColorInput",accept:function(t){return !!t.hasOwnProperty("view")&&"color"===t.view},build:function(t,e){var i=t.scene;t.type="rexTweaker.ColorInput";var n=e.colorInput;void 0===n&&(n={}),n.hasOwnProperty("inputText")||(n.inputText=e.inputText);var r=function(t,e,i){void 0===i&&(i=!0),i?e=e?ge(e):{}:e||(e={});var n=new Tm(t,e);return t.add.existing(n),n}(i,n);t.add(r,{proportion:1,expand:!0,key:"colorInput"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("colorInput").setValue(e);}},Em={setBoxFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.boxFillColor!==t||this.boxFillAlpha!==e,this.boxFillColor=t,this.boxFillAlpha=e,this},setUncheckedBoxFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.uncheckedBoxFillColor!==t||this.uncheckedBoxFillAlpha!==e,this.uncheckedBoxFillColor=t,this.uncheckedBoxFillAlpha=e,this},setBoxStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.boxLineWidth!==t||this.boxStrokeColor!==e||this.boxStrokeAlpha!==i,this.boxLineWidth=t,this.boxStrokeColor=e,this.boxStrokeAlpha=i,this},setUncheckedBoxStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.uncheckedBoxLineWidth!==t||this.uncheckedBoxStrokeColor!==e||this.uncheckedBoxStrokeAlpha!==i,this.uncheckedBoxLineWidth=t,this.uncheckedBoxStrokeColor=e,this.uncheckedBoxStrokeAlpha=i,this},setCheckerStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.checkerColor!==t||this.checkAlpha!==e,this.checkerColor=t,this.checkAlpha=e,this},setBoxShape:function(t){return void 0===t&&(t=!1),this.isCircleShape===t||(this.isCircleShape=t,this.isSizeChanged=!0,this.dirty=!0),this}},Mm={buildShapes:function(){this.addShape((new Rf).setName("box")).addShape((new Ef).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,r=t-i,s=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(r+c+u,s+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,v=1*f,p=2*f,g=3*f;l.startAt(v,p).lineTo(p,g).lineTo(g,v).offset(r+u,s+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);}},Rm={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new Ks(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}},Lm={};Object.assign(Lm,Em,{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}},Mm,Rm);var Dm=Phaser.Utils.Objects.GetValue,Am=Phaser.Utils.Objects.IsPlainObject,jm=23730,zm=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Am(r)?(r=Dm(l=r,"x",0),s=Dm(l,"y",0),o=Dm(l,"width",2),a=Dm(l,"height",2),h=Dm(l,"color",jm)):Am(h)&&(h=Dm(l=h,"color",jm)),(u=e.call(this,t,r,s,o,a)).type="rexCheckbox",void 0===h&&(h=jm),u.setBoxShape(Dm(l,"circleBox",!1)),u.setBoxFillStyle(h,Dm(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(Dm(l,"uncheckedColor",null),Dm(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(Dm(l,"boxLineWidth",4),Dm(l,"boxStrokeColor",h),Dm(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,Dm(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),Dm(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(Dm(l,"checkerColor",16777215),Dm(l,"checkerAlpha",1)),u.setBoxSize(Dm(l,"boxSize",1)),u.setCheckerSize(Dm(l,"checkerSize",1)),u.setCheckerAnimationDuration(Dm(l,"animationDuration",150)),u.buildShapes();var c=Dm(l,"checked");return void 0===c&&(c=Dm(l,"value",!1)),u.setValue(c),u}return s(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}(rf);Object.assign(zm.prototype,Lm);var Bm=Phaser.Utils.Objects.GetValue,Im=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Go(u(c),Bm(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Bm(l,"readOnly",!1)),c}return s(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}(zm),Wm={name:"CheckboxInput",accept:function(t){return t.hasOwnProperty("view")?"boolean"===t.view:"boolean"==typeof t.value},build:function(t,e){var i=t.scene;t.type="rexTweaker.CheckboxInput";var n=e.checkbox,r=function(t,e){var i=new Im(t,e);return t.add.existing(i),i}(i,n),s=n.size;void 0!==s&&r.setSize(s,s);var o=void 0!==s?0:1;t.add(r,{proportion:0,expand:!1,fitRatio:o,key:"checkbox"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("checkbox").setValue(e);}},Fm={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}},Ym={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}},Xm={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}},Gm=function(t,e,i){return (e-t)*i+t},Vm=Phaser.Math.Linear,Hm={buildShapes:function(){this.addShape((new Rf).setName("track")).addShape((new Rf).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 r=t*this.trackWidth,s=e*this.trackHeight,o=(t-r)/2,a=(e-s)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(r,s).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Gm($e(l),$e(u),c))<<16|(255&Gm(Qe(l),Qe(u),c))<<8|255&Gm(ti(l),ti(u),c)),f=Vm(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var v=this.getShape("thumb");if(this.isSizeChanged){var p=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;v.setSize(p,g).setRadius(y);}var k=Vm(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;v.setCenterPosition(k,m),v.fillStyle(this.thumbColor,this.thumbAlpha);}},Nm={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new Ks(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}},Um={};Object.assign(Um,Fm,Ym,Xm,Hm,Nm);var Km=Phaser.Utils.Objects.GetValue,Jm=Phaser.Utils.Objects.IsPlainObject,qm=23730,Zm=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Jm(r)?(r=Km(l=r,"x",0),s=Km(l,"y",0),o=Km(l,"width",2),a=Km(l,"height",2),h=Km(l,"color",qm)):Jm(h)&&(h=Km(l=h,"color",qm)),(u=e.call(this,t,r,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=qm),u.setTrackFillStyle(h,Km(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Km(l,"falseValueTrackColor",function(t){var e=.3*$e(t)+.59*Qe(t)+.11*ti(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Km(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Km(l,"thumbColor",16777215),Km(l,"thumbAlpha",1)),u.setTrackSize(Km(l,"trackWidth",.9),Km(l,"trackHeight",.5)),u.setTrackRadius(Km(l,"trackRadius",.5*u.trackHeight));var c=Km(l,"thumbHeight",void 0),d=Km(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Km(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Km(l,"thumbLeft",.3),Km(l,"thumbRight",void 0)),u.setRTL(Km(l,"rtl",!1)),u.setToggleAnimationDuration(Km(l,"animationDuration",150)),u.buildShapes(),u.setValue(Km(l,"value",!1),0),u}return s(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}(rf);Object.assign(Zm.prototype,Um);var $m=Phaser.Utils.Objects.GetValue,Qm=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Go(u(c),$m(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly($m(l,"readOnly",!1)),c}return s(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}(Zm),tb={name:"ToggleSwitchInput",accept:function(t){return !!t.hasOwnProperty("view")&&"toggleSwitch"===t.view},build:function(t,e){var i=t.scene;t.type="rexTweaker.ToggleSwitchInput";var n=e.toggleSwitch,r=function(t,e){var i=new Qm(t,e);return t.add.existing(i),i}(i,n),s=n.size;void 0!==s&&r.setSize(s,s);var o=void 0!==s?0:1;t.addSpace().add(r,{proportion:0,expand:!1,fitRatio:o,key:"toggleSwitch"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("toggleSwitch").setValue(e);}},eb={setWrapEnable:function(t){return void 0===t&&(t=!0),this.listWrapEnable=t,this},setCreateButtonCallback:function(t){return this.listCreateButtonCallback=t,this},setCreateListBackgroundCallback:function(t){return this.listCreateBackgroundCallback=t,this},setButtonClickCallback:function(t){return this.listOnButtonClick=t,this},setButtonOverCallback:function(t){return this.listOnButtonOver=t,this},setButtonOutCallback:function(t){return this.listOnButtonOut=t,this},setListExpandDirection:function(t){return "string"==typeof t&&(t=ib[t]),this.listExpandDirection=t,this},setListEaseInDuration:function(t){return void 0===t&&(t=0),this.listEaseInDuration=t,this},setListEaseOutDuration:function(t){return void 0===t&&(t=0),this.listEaseOutDuration=t,this},setListTransitInCallback:function(t){return this.listTransitInCallback=t,this},settListTransitOutCallback:function(t){return this.listTransitOutCallback=t,this},setListBounds:function(t){return this.listBounds=t,this},setListWidth:function(t){return this.listWidth=t,this},setListHeight:function(t){return this.listHeight=t,this},setListSize:function(t,e){return this.setListWidth(t).setListHeight(e),this},setListAlignmentMode:function(t){return this.listAlignMode=t,this},setListAlignmentSide:function(t){return void 0===t&&(t=""),this.listAlignSide=t,this},setListSpace:function(t){return void 0===t&&(t={}),this.listSpace=t,this},setListDraggable:function(t){return void 0===t&&(t=!0),this.listDraggable=t,this}},ib={down:0,up:1},nb=function(){var t,e=this.scene,i=this.listCreateBackgroundCallback;i&&(t=i.call(this,e),e.add.existing(t));var n=[],r=this.listCreateButtonCallback;if(r)for(var s=this.options,o=0,a=s.length;oh;u--){for(c=0;c0&&this.wrapMode!==Tl&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wordWrap")){var n=t.wordWrap;n.hasOwnProperty("width")&&(t.wrap={mode:"word",width:n.width});}if(t&&t.hasOwnProperty("wrap")){var r=t.wrap;if(r.hasOwnProperty("mode")){var s=r.mode;"string"==typeof s&&(r.mode=Al[s]);}else r.hasOwnProperty("width")&&(r.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var o=this.propertyMap;for(var a in o){var h=o[a],l=h[0],u=i?h[1]:this[a],c=h[2];if("wrapCallback"===a||"wrapCallbackScope"===a)this[a]=Ll(t,l,u);else {var d=Rl(t,l,u);c&&(d=c(d)),this[a]=d;}}var f=Ll(t,"font",null);this._font=null===f?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:f;var v=Ll(t,"fill",null);null!==v&&(this.color=bl(v));var p=Ll(t,"metrics",!1);return p?this.metrics={ascent:Ll(p,"ascent",0),descent:Ll(p,"descent",0),fontSize:Ll(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=Cl(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=Cl(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Ll(t,"fontFamily","Courier"),this.fontSize=Ll(t,"fontSize","16px"),this.fontStyle=Ll(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=bl(t,this.parent.canvas,this.parent.context),this.backgroundColor2=bl(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=bl(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=bl(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=bl(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=bl(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=bl(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=bl(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Al[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Ll(e,"fontFamily",this.fontFamily),this.fontSize=Ll(e,"fontSize",this.fontSize),this.fontStyle=Ll(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Al={none:Tl,word:_l,char:El,character:El},jl=Phaser.Math.DegToRad,zl=function(t){return !t.hasOwnProperty("convex")||t.convex},Bl=function(t){return t.x>0&&t.y>0},Il=function(t,e,i,n,r,s,o,a,h){if(a&&o>s?o-=360:!a&&o=f?1:n/f,g=r>=v?1:r/v,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,h,l,h,l,180,270,!1,o):Il(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,n-h,l,h,l,270,360,!1,o):Il(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,n-h,r-l,h,l,0,90,!1,o):Il(t,n,r,h,l,270,180,!0,o)):t.lineTo(n,r),a=y.bl,Bl(a)?(h=a.x*p,l=a.y*g,zl(a)?Il(t,h,r-l,h,l,90,180,!1,o):Il(t,0,r,h,l,360,270,!0,o)):t.lineTo(0,r),t.lineTo(u,c),t.closePath(),t.restore();}(e,i,n,r,s,o,d),null!=a){var f;if(null!=u)(f=c?e.createLinearGradient(0,0,r,0):e.createLinearGradient(0,0,0,s)).addColorStop(0,a),f.addColorStop(1,u),a=f;e.fillStyle=a,e.fill();}null!=h&&l>0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());},Fl=function(t,e,i,n,r,s,o,a){if(null!=e||null!=i){var h=t.canvas.width,l=t.canvas.height;null==i&&(n=0);var u=n/2;h=Math.max(1,h-n),l=Math.max(1,l-n),Wl(t.canvas,t.context,u,u,h,l,r,e,i,n,s,o,a);}},Yl={draw:function(t,e,i,n){var r=this.penManager;this.hitAreaManager.clear();var s=this.context;s.save();var o=this.defaultStyle;this.clear(),Fl(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,v=o.valign,p=o.lineHeight,g=r.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===v?Math.floor((y-h)/2):"bottom"===v?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===v?Math.max((n-h*p)/2,0):"bottom"===v?Math.max(n-h*p-2,0):0,d+=e;for(var x=l;x0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(s.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,r,s){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;s.syncShadow(o,s.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=r,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var r=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(r,n.shadowStroke),r.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(r,n.shadowFill),r.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Xl=Phaser.Utils.Objects.GetValue,Gl=Sl,Vl=Pl,Hl=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){this.text=Xl(t,"text",""),this.x=Xl(t,"x",0),this.y=Xl(t,"y",0),this.width=Xl(t,"width",0);var e=Xl(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Xl(t,"newLineMode",0),this.startIndex=Xl(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Vl&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Gl&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Vl&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),Nl=Phaser.Utils.Objects.GetFastValue,Ul=Sl,Kl=Ol,Jl=function(){function t(e){n(this,t),this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.tagToText=Nl(e,"tagToText",Hn),this.tagToTextScope=Nl(e,"tagToTextScope",void 0);}return s(t,[{key:"destroy",value:function(){this.clear(),this.tagToText=void 0,this.tagToTextScope=void 0;}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),ql={},Zl=function(){function t(){n(this,t),this.items=[];}return s(t,[{key:"destroy",value:function(){this.clear(),this.items=void 0;}},{key:"pop",value:function(){return this.items.length>0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),$l=Phaser.Geom.Rectangle,Ql=new Zl,tu=function(){function t(){n(this,t),this.hitAreas=[];}return s(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;tr){""!==S?a.push(o.getLine(S,P,au)):0===T&&s>0&&a.push(o.getLine("",0,au)),a.push.apply(a,y(t(b,i,uu,r,0,o)));var E=a.pop();S=E.text,P=E.width,o.freeLine(E)," "===S&&(S="",P=0);}else (C=P+x)>l?(a.push(o.getLine(S,P,au)),S=b,P=x,l=r):(S+=b,P=C),w&&a.push(o.getLine(S,P,u));}return a},fu=Phaser.Utils.Objects.GetValue,vu=Tl,pu=Sl,gu=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=fu(e,"context",null),this.canvas=this.context.canvas,this.parser=fu(e,"parser",null),this.defaultStyle=fu(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new tu,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return s(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,r){if(void 0===r&&(r=this.penManager),r.clear(),""===t)return r;var s=this.parent.style;if(s.isWrapFitMode){var o=this.parent.padding;i=s.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,v=function(t){return f.measureText(t).width},p=0,g=0,y=s.wrapCallback,k=s.wrapCallbackScope,m=!0,b=this.parser.splitText(t),x=this.wrapTextLinesPool,w=0,C=b.length;w0&&e!==vu&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new Jl({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var r=this.parser.splitText(t,1);n="";for(var s=0,o=r.length;s0}},{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}(mc);Object.assign(Wc.prototype,jc);var Fc=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Yc=Phaser.Utils.Objects.GetValue,Xc=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Yc(r,"color",null),Yc(r,"color2",null),Yc(r,"horizontalGradient",!0)),s.setStroke(Yc(r,"stroke",null),Yc(r,"strokeThickness",2)),s.setCornerRadius(Yc(r,"cornerRadius",0),Yc(r,"cornerIteration",null)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=bl(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=bl(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=bl(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,Fc("color2",t,this),Fc("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Fc("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Fc("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return v(h(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(){Fl(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Wc),Gc=Phaser.Utils.Objects.GetValue,Vc=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(Gc(r,"color",null),Gc(r,"color2",null),Gc(r,"horizontalGradient",!0)),s.setStroke(Gc(r,"stroke",null),Gc(r,"strokeThickness",2)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=bl(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=bl(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=bl(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){v(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Gc(t,"color2",null),Gc(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Gc(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,r=this.parent.height-t.top-t.bottom,s=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?s.createLinearGradient(0,0,n,0):s.createLinearGradient(0,0,0,r)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;s.fillStyle=o,s.fillRect(e,i,n,r);}null!=this.stroke&&this.strokeThickness>0&&(s.strokeStyle=this.stroke,s.lineWidth=this.strokeThickness,s.strokeRect(e,i,n,r));}}]),i}(Wc),Hc=Phaser.Utils.Objects.GetValue,Nc=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return s(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(Hc(t,"bold",!1)),this.setItalic(Hc(t,"italic",!1)),this.setFontSize(Hc(t,"fontSize","16px")),this.setFontFamily(Hc(t,"fontFamily","Courier")),this.setColor(Hc(t,"color","#fff")),this.setStrokeStyle(Hc(t,"stroke",null),Hc(t,"strokeThickness",0)),this.setShadow(Hc(t,"shadowColor",null),Hc(t,"shadowOffsetX",0),Hc(t,"shadowOffsetY",0),Hc(t,"shadowBlur",0)),this.setOffset(Hc(t,"offsetX",0),Hc(t,"offsetY",0)),this.setSpace(Hc(t,"leftSpace",0),Hc(t,"rightSpace",0)),this.setAlign(Hc(t,"align",void 0)),this.setBackgroundColor(Hc(t,"backgroundColor",null)),this.setBackgroundHeight(Hc(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Hc(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(Fc("stroke",t,this),Fc("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Fc("shadowOffsetX",t,this),Fc("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=bl(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=bl(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=bl(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=bl(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}(),Uc=Phaser.Utils.Array.Remove,Kc=Phaser.Utils.Array.Remove,Jc="text",qc="image",Zc="drawer",$c="space",Qc="command",td=function(t){return t.type===Jc&&"\n"===t.text},ed=function(t){return t.type===Jc&&"\f"===t.text},id=function(t){return t.type===Jc},nd=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,Jc)).updateTextFlag=!1,o.style=new Nc(u(o),s),o.setText(r),o}return s(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),g(h(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),g(h(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),v(h(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&&v(h(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,r=e.backgroundBottomY;null==r&&(r=this.drawBLY);var s=e.backgroundHeight;null==s&&(s=r-this.drawTLY);var o=r-s;t.fillRect(i,o,n,s);}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}(Wc),rd=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},sd=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,qc)).setTexture(r,s),o}return s(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}(Wc),od=function(t){a(i,t);var e=d(i);function i(t,r,s,o){var a;return n(this,i),(a=e.call(this,t,Zc)).setRenderCallback(r),a.setDrawerSize(s,o),a}return s(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(){v(h(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}(Wc),ad=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,$c)).setSpaceWidth(r),s}return s(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}(Wc),hd=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a){var h;return n(this,i),(h=e.call(this,t,Qc)).setName(r).setParameter(o).setCallback(s,a),h}return s(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(){v(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(mc),ld=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)},ud=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var r=t.length,s=e,o=n.word,a=0;s0&&!a){var h=this.fixedHeight-n;if(i>0)s=h/i;else s=(l=fd.call(this)).height,o=l.ascent,i=Math.floor((h-o)/s);}else {var l;s=(l=fd.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=pd(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/s);}}else i=pd(t,"maxLines",0);void 0===o&&(o=s);var u=0===i,c=pd(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-r:1/0);for(var d=pd(t,"letterSpacing",0),f=pd(t,"hAlign",0),v=pd(t,"vAlign",0),p=pd(t,"charWrap",!1),g=ld({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:v,ascent:o,lineHeight:s,wrapWidth:c,charWrap:p}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,width:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=!L&&g.start===O,g.maxLineWidth=R,g.linesHeight=_.length*s;var W=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+r,F=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":r=(i-a)/2;break;case 2:case"bottom":r=i-a;break;default:r=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-r)/i:0;else if(this.fixedWidth>0){if(void 0===(i=kd(t,"maxLines",void 0))){var o=this.fixedWidth-r;i=Math.floor(o/s)+1;}}else i=kd(t,"maxLines",0);var a=0===i,h=kd(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=kd(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=kd(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=kd(t,"letterSpacing",0),f=kd(t,"rtl",!0),v=kd(t,"hAlign",f?2:0),p=kd(t,"vAlign",0),g=ld({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:v,vAlign:p,lineWidth:s,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,height:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=g.start===O,g.maxLineHeight=R,g.linesWidth=_.length*s;var B=this.fixedWidth>0?this.fixedWidth:g.linesWidth+r,I=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(s){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,r=i.right,s=i.top,o=i.bottom;return zr(i,t,e),this.dirty=this.dirty||n!=i.left||r!=i.right||s!=i.top||o!=i.bottom,this},getPadding:function(t){return jr(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),Uc(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 Kc(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,r,s=Array.isArray(t);void 0===e||e===this.children.length?s?(i=this.children).push.apply(i,y(t)):this.children.push(t):s?(n=this.children).splice.apply(n,[e,0].concat(y(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,s)?(r=this.lastAppendedChildren).push.apply(r,y(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Jc);return null===i?i=new nd(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,r=t.length;ne&&(n=e,r=t);})),r},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Ac(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,r=t.length;n=i.length&&(t=i.length);for(var n=0,r=0;r0,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=Mf(t,"tl",0),this.radiusTR=Mf(t,"tr",0),this.radiusBL=Mf(t,"bl",0),this.radiusBR=Mf(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,r=this.height,s=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?gh(e,e,e,e,180,270,!1,s,t):gh(0,0,e,e,90,0,!0,s,t):vh(0,0,t);(e=this.radiusTR)>0?this._convexTR?gh(n-e,e,e,e,270,360,!1,s,t):gh(n,0,e,e,180,90,!0,s,t):vh(n,0,t);(e=this.radiusBR)>0?this._convexBR?gh(n-e,r-e,e,e,0,90,!1,s,t):gh(n,r,e,e,270,180,!0,s,t):vh(n,r,t);(e=this.radiusBL)>0?this._convexBL?gh(e,r-e,e,e,90,180,!1,s,t):gh(0,r,e,e,360,270,!0,s,t):vh(0,r,t);return t.push(t[0],t[1]),vf(this.x,this.y,t),v(h(i.prototype),"updateData",this).call(this),this}}]),i}(hf);Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Phaser.Math.Wrap;var Lf=Phaser.Math.Linear,Df=function(){var t,e,i,n,r,s,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,v={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 p=v[this.direction],g=p.a,y=p.b,k=p.c;t=g.x,e=g.y,i=y.x,n=y.y,r=k.x,s=k.y;}else {var m=v[this.previousDirection],b=v[this.direction],x=this.easeDirectionProgress;t=Lf(m.a.x,b.a.x,x),e=Lf(m.a.y,b.a.y,x),i=Lf(m.b.x,b.b.x,x),n=Lf(m.b.y,b.b.y,x),r=Lf(m.c.x,b.c.x,x),s=Lf(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(r,s),this.arrowOnly?o.end():o.close();},Af=(0, Phaser.Math.DegToRad)(120),jf=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,r=this.verticeRotation;t.startAt(e+n*Math.cos(r+Af),i+n*Math.sin(r+Af)).lineTo(e+n*Math.cos(r),i+n*Math.sin(r)).lineTo(e+n*Math.cos(r-Af),i+n*Math.sin(r-Af)),this.arrowOnly?t.end():t.close();},zf={buildShapes:function(){this.addShape((new Ef).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?Df.call(this):jf.call(this);}},Bf={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new Ks(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}},If=Phaser.Utils.Objects.GetValue,Wf=Phaser.Utils.Objects.IsPlainObject,Ff=Phaser.Math.DegToRad,Yf=Phaser.Math.RadToDeg,Xf=function(t){a(r,t);var e=d(r);function r(t,i,s,o,a,h,l){var u,c,d,f,v,p,g,y,k;if(n(this,r),Wf(i)){var m=i;i=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,v=m.arrowOnly,p=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===v&&(v=!1),void 0===p&&(p=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(v),u.setDirection(p,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return s(r,[{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=Vf(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,n,r){if("object"===i(t)){var s=t,o=If(s,"x",null);null!==o?(t=o,n=o):(t=If(s,"left",0),n=If(s,"right",t));var a=If(s,"y",null);null!==a?(e=a,r=a):(e=If(s,"top",0),r=If(s,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===r&&(r=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=n||this.padding.bottom!=r,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=r,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 Yf(this.verticeRotation)},set:function(t){this.verticeRotation=Ff(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),r}(rf),Gf={right:0,down:1,left:2,up:3},Vf=function(t){return "string"==typeof t&&(t=Gf[t]),t%=4};Object.assign(Xf.prototype,zf,Bf);var Hf=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexTweaker.FolderTitle";var o=new Xf(t,r.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return s(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(Zd),Nf=function(t,e){var i=new Zp(t,e);return t.add.existing(i),i},Uf=function(t,e,i){return ul(t,i)},Kf=function(t){a(i,t);var e=d(i);function i(t,r){return n(this,i),void 0===r&&(r={}),r.destroy=!1,e.call(this,t,r)}return s(i,[{key:"onOpen",value:function(){this.emit("open",this.parent,this),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),v(h(i.prototype),"onClose",this).call(this);}}]),i}(uo),Jf={expand:function(t){if(!0===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!0;var e=this.childrenMap.title,i=this.childrenMap.child;return this.show(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),e.emit("folder.expand",t,this),i.emit("folder.expand",t,this),this.emit("expand.start",this),this.childTransition.once("open",(function(){this.emit("expand.complete",this);}),this).requestOpen(null,t),this},collapse:function(t){if(!1===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!1;var e=this.childrenMap.title,i=this.childrenMap.child;return e.emit("folder.collapse",t,this),i.emit("folder.collapse",t,this),this.emit("collapse.start",this),this.childTransition.once("close",(function(){this.setChildScale(i,1,1).hide(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),this.emit("collapse.complete",this);}),this).requestClose(null,t),this},toggle:function(t){return this.expanded?this.collapse(t):this.expand(t),this}},qf=function(t,e){ys.popUp.call(t,e,this.expandDirection);},Zf=function(t,e){ys.scaleDown.call(t,e,this.expandDirection);},$f={setTransitionDuration:function(t){return this.transitionDuration=t,this.childTransition.setTransitInTime(t).setTransitOutTime(t),this},setExpandCallback:function(t){return void 0===t&&(t=qf.bind(this)),this.childTransition.setTransitInCallback(t),this},setCollapseCallback:function(t){return void 0===t&&(t=Zf.bind(this)),this.childTransition.setTransitOutCallback(t),this}},Qf=Phaser.Utils.Objects.GetValue,tv=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),r.hasOwnProperty("orientation")||(r.orientation=1),(s=e.call(this,t,r)).type="rexFolder",s.expanded=void 0,s.expandDirection=1===s.orientation?"y":"x";var o=r.background,a=r.title,h=r.child;o&&s.addBackground(o);var l=1===s.orientation?"left":"top",c=Qf(r,"align.title",l),d=Qf(r,"expand.title",!0);s.add(a,{proportion:0,align:c,expand:d});var f=Qf(r,"toggleByTarget",void 0),v=Qf(r,"toggleClickConfig");if(void 0===f&&(f=a),f&&Ho.onClick.call(f,(function(){this.toggle();}),u(s),v),s.childTransition=new Kf(h),!Qf(r,"customChildOrigin",!1)){var p=s.rtl?1:0;h.setOrigin(p);}c=Qf(r,"align.child","left");var g=(d=Qf(r,"expand.child",!0))?1:0;s.add(h,{proportion:g,align:c,expand:d}),s.addChildrenMap("title",a),s.addChildrenMap("child",h),s.addChildrenMap("background",o);var y=r.transition;s.setTransitionDuration(Qf(y,"duration",200)),s.setExpandCallback(Qf(y,"expandCallback",void 0)),s.setCollapseCallback(Qf(y,"collapseCallback",void 0)),s.reLayoutTarget=Qf(r,"reLayoutTarget",void 0);var k=r.onExpandStart;k&&s.on("expand.start",k);var m=r.onExpandComplete;m&&s.on("expand.complete",m);var b=r.onCollapseStart;b&&s.on("collapse.start",b);var x=r.onCollapseComplete;return x&&s.on("collapse.complete",x),s}return s(i)}(Ja);Object.assign(tv.prototype,Jf,$f);var ev=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexTweaker.Folder",s}return s(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(tv);Object.assign(ev.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 iv=Phaser.Utils.Objects.GetValue,nv=Phaser.Utils.Objects.GetValue,rv=Ja.prototype.add,sv=Ja.prototype.addSpace,ov=function(t){var e=!t.isRexSpace,i=!e||this.buttonsExpand?1:0;if(0===this.sizerChildren.length)if(e){!this.buttonsExpand&&("right"===this.buttonsAlign||"center"===this.buttonsAlign||"bottom"===this.buttonsAlign)&&sv.call(this),rv.call(this,t,{proportion:i,expand:!0});var n=!this.buttonsExpand&&"center"===this.buttonsAlign;n&&sv.call(this),this.hasTailSpace=n;}else rv.call(this,t,{proportion:i,expand:!0}),this.hasTailSpace=!1;else if(this.hasTailSpace){var r=this.sizerChildren.length-1;rv.call(this,t,{index:r,proportion:i,expand:!0});}else rv.call(this,t,{proportion:i,expand:!0});return e&&this.buttonGroup.add(t),this},av={addButton:function(t){if(Eo(t))for(var e=t,i=0,n=e.length;i=0;i--)uv.call(this,e[i],t);return this}},dv=function(t,e,i){if(t){var n=this.setValueCallback,r=this.setValueCallbackScope;n&&(r?n.call(r,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},fv=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,dv.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},vv={add:function(t){return this.buttons.push(t),t._click||(t._click=new Go(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,r){this.fireEvent("button.over",t,e,r);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,r){this.fireEvent("button.down",t,e,r);}),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")),fv.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;ha.height/2)){r>(h=Mv(a.left,a.centerY,t,e))&&(r=h,n=s);var h,l=i[s+1];if(!l||l.y!==a.y)r>(h=Mv(a.right,a.centerY,t,e))&&(r=h,n=s+1);}}return n},Lv=Phaser.Utils.Objects.IsPlainObject,Dv=Phaser.Utils.Objects.GetValue,Av=Phaser.Display.Align.CENTER,jv=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var r;(Cr.call(this,t),Lv(e))&&(e=Dv(r=e,"padding",0),i=Dv(r,"key",void 0),n=Dv(r,"index",void 0));return void 0===e&&(e=0),(r=this.getSizerConfig(t)).align=Av,r.padding=xr(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},zv={add:function(t,e,i){if(Eo(t))for(var n=t,r=0,s=n.length;r=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Wa.call(this,t),this}},Wv={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,r=i.length;nr&&Nv.addNewLine(this);}else for(s=0,o=t.length;s=0;i--)Zv.call(this,e[i],t);return this}},Qv=Phaser.Utils.Objects.GetValue,tp=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={});var o=r.space;"number"==typeof o&&(r.space={item:o,line:o}),(s=e.call(this,t,r)).type="rexFixWidthButtons",s.buttonGroup=new xv({parent:u(s),eventEmitter:Qv(r,"eventEmitter",u(s)),groupName:Qv(r,"groupName",void 0),clickConfig:Qv(r,"click",void 0)}).setButtonsType(r);var a=Qv(r,"background",void 0),h=Qv(r,"buttons",void 0);return s.buttonsAlign=Qv(r,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(v(h(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}(Vv);Object.assign(tp.prototype,Kv,$v,bv,Cv);var ep=Phaser.Utils.Objects.IsPlainObject,ip=Phaser.Utils.Objects.GetValue,np=Phaser.Display.Align.CENTER,rp=Phaser.Utils.String.UUID,sp={add:function(t,e,i,n,r,s,o,a,h){(Cr.call(this,t),ep(e))&&(e=ip(l=e,"key",void 0),i=ip(l,"align",np),a=ip(l,"offsetX",0),h=ip(l,"offsetY",0),n=ip(l,"padding",0),r=ip(l,"expand",!0),t.isRexSizer||(s=ip(l,"minWidth",t._minWidth),o=ip(l,"minHeight",t._minHeighted)));var l,u=void 0!==e;return u||(e=rp()),"string"==typeof i&&(i=Vn[i]),void 0===i&&(i=np),void 0===a&&(a=0),void 0===h&&(h=0),void 0===n&&(n=0),void 0===r&&(r=!0),t.isRexSizer||(void 0===s&&(s=t._minWidth),void 0===o&&(o=t._minHeight)),(l=this.getSizerConfig(t)).align=i,l.alignOffsetX=a,l.alignOffsetY=h,l.padding=xr(n),ep(r)?(l.expandWidth=ip(r,"width",!1),l.expandHeight=ip(r,"height",!1)):(l.expandWidth=r,l.expandHeight=r),t.isRexSizer||(l.expandWidth&&(t.minWidth=void 0===s?mt(t):s),l.expandHeight&&(t.minHeight=void 0===o?bt(t):o)),this.sizerChildren.hasOwnProperty(e)&&this.sizerChildren[e].destroy(),this.sizerChildren[e]=t,u&&this.addChildrenMap(e,t),this}},op={remove:function(t,e){var i;if("string"==typeof t){if(i=t,!(t=this.sizerChildren[i]))return this}else {if(this.getParentSizer(t)!==this)return this;i=this.childToKey(t);}return i&&(delete this.sizerChildren[i],this.childrenMap.hasOwnProperty(i)&&delete this.childrenMap[i]),Mr.call(this,t,e),this},removeAll:function(t){for(var e in this.sizerChildren)this.remove(e,t);return this},clear:function(t){for(var e in this.sizerChildren)delete this.sizerChildren[e],this.childrenMap.hasOwnProperty(e)&&delete this.childrenMap[e];return Wa.call(this,t),this}},ap={getChildrenWidth:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)e=(t=r[s]).rexSizer.padding,i=this.getChildWidth(t)+e.left+e.right,n=Math.max(i,n);return n+this.space.left+this.space.right},getChildrenHeight:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)i=(t=r[s]).isRexSizer?Math.max(t.minHeight,t.childrenHeight):void 0!==t.minHeight?t.minHeight:bt(t),i+=(e=t.rexSizer.padding).top+e.bottom,n=Math.max(i,n);return n+this.space.top+this.space.bottom},getExpandedChildWidth:function(t,e){var i;void 0===e&&(e=this.width);var n=t.rexSizer;if(n.expandWidth){var r=e-this.space.left-this.space.right,s=n.padding;i=r-s.left-s.right;}return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer;if(n.expandHeight){var r=e-this.space.top-this.space.bottom,s=n.padding;i=r-s.top-s.bottom;}return i},getChildrenSizers:function(t){void 0===t&&(t=[]);var e,i=this.sizerChildren;for(var n in i)(e=i[n]).isRexSizer&&t.push(e);return t},layoutChildren:function(){var t,e,i,n,r,s,o,a,h,l=this.innerLeft,u=this.innerTop,c=this.innerWidth,d=this.innerHeight,f=this.sizerChildren;for(var v in f)(t=f[v]).rexSizer.hidden||(i=(e=t.rexSizer).padding,Io.call(this,t),t.isRexSizer?(t.runLayout(this,this.getExpandedChildWidth(t),this.getExpandedChildHeight(t)),_a(t,this)):(a=void 0,h=void 0,e.expandWidth&&(a=c-i.left-i.right),e.expandHeight&&(h=d-i.top-i.bottom),Ao(t,a,h)),n=l+i.left,s=c-i.left-i.right,r=u+i.top,o=d-i.top-i.bottom,Wo.call(this,t,n,r,s,o,e.align,e.alignOffsetX,e.alignOffsetY));}};Object.assign(ap,sp,op);var hp=Phaser.Utils.Objects.IsPlainObject,lp=Phaser.Utils.Objects.GetValue,up=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h){var l;return n(this,i),hp(r)?(r=lp(h=r,"x",0),s=lp(h,"y",0),o=lp(h,"width",void 0),a=lp(h,"height",void 0)):hp(o)&&(o=lp(h=o,"width",void 0),a=lp(h,"height",void 0)),(l=e.call(this,t,r,s,o,a,h)).type="rexOverlapSizer",l.sizerChildren={},l.addChildrenMap("items",l.sizerChildren),l}return s(i,[{key:"childToKey",value:function(t){if("string"!=typeof t)return function(t,e){if(Array.isArray(t))return t.indexOf(e);for(var i in t)if(t[i]===e)return i;return null}(this.sizerChildren,t);var e=t;return this.sizerChildren.hasOwnPropery(e)?e:null}}]),i}(Ta);Object.assign(up.prototype,ap);var cp=up.prototype.add,dp=function(t,e,i,n,r,s,o,a,h){return t.setVisible(!1),cp.call(this,t,e,i,n,r,s,o,a,h),this},fp={add:dp,addPage:dp},vp=qt.prototype.setChildVisible,pp={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?(vp.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&&(vp.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(pp,fp);var gp=Phaser.Utils.Objects.GetValue,yp=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(gp(r,"swapMode",0)),s.setFadeInDuration(gp(r,"fadeIn",0)),s}return s(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=kp[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}(up);Object.assign(yp.prototype,pp);var kp={invisible:0,destroy:1},mp=Phaser.Utils.Objects.IsPlainObject,bp=Phaser.Utils.Objects.GetValue,xp=Phaser.Utils.String.UUID,wp={swapPage:function(t,e){var i,n;null!=(i="number"==typeof t?t:this.getPageIndex(t))&&(void 0!==e&&(n=this.childrenMap.pages.fadeInDuration,this.childrenMap.pages.fadeInDuration=e),this.childrenMap.tabs.emitButtonClick(i),void 0!==n&&(this.childrenMap.pages.fadeInDuration=n));return this},swapFirstPage:function(t){return this.swapPage(0,t),this},swapLastPage:function(t){var e=this.getElement("tabs.buttons").length-1;return this.swapPage(e,t),this}},Cp={removePage:function(t,e){"number"==typeof t&&(t=this.getPageKey(t));var i=this.childrenMap.tabs,n=i.getByName(t),r=this.childrenMap.pages,s=r.getElement(t);return n&&s?(r.removeChildrenMap(t),i.removeButton(n,e),r.remove(s,e),this):this}},Sp={getPageKey:function(t){var e=this.getElement("tabs.buttons");if(!(t>=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;i0?0:1,r.setMinWidth(this.itemWidth)),this.add(r,{proportion:s,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),r.setAutoUpdateEnable(i.autoUpdate),r.setBindingTarget(t,e),i.monitor&&r.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,r),this},addButtons:function(t){var e=this.scene;void 0===t&&(t={});var i=t.bindingTarget;delete t.bindingTarget;var n=Up(this.styles,"inputRow")||{},r=Np(e,t,n);return this.add(r,{expand:!0}),i&&r.setBindingTarget(i),t.key&&this.root.addChildrenMap(t.key,r),this},addButton:function(t){return void 0===t&&(t={}),t.buttons=[{label:t.label,callback:t.callback}],delete t.label,delete t.callback,this.addButtons(t),this},addSeparator:function(t){var e=this.scene,i=Kp(this.styles,"separator"),n=Uf(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i=r&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(r=e.getCharChild(t.prevCursorPosition))&&("\n"===r.text&&r.clearTextSize(),e.emit("cursorout",r,t.prevCursorPosition,e)),null!=n&&(r=e.getCharChild(n))&&("\n"===r.text&&r.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,r=n.width,s=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>r?r-l:0,i=u<0?0-u:c>s?s-c:0,n._textOX+=e,n._textOY+=i;}(r),e.emit("cursorin",r,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(vg(this),pg(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=fg,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(dg),kg=Phaser.Utils.Objects.GetValue,mg=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],bg=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,r=0;rt.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}Cg.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 r=this;function s(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 s([{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 s(Sg(r,n.components,e,t,r.useLongestToken));u[i]=n;}else u[i]=void 0;}var p;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 r=e.length,s=i.length,o=t.newPos,a=o-n,h=0;o+1=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return qg(this.sizerChildren,null),Wa.call(this,t),this}},$g={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)qg(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var r=n*this.columnCount+t;this.sizerChildren.splice(r,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},iy={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,r,s=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=Wr.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 r in this.sizerChildren)(e=this.sizerChildren[r])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var r in this.sizerChildren)!(e=this.sizerChildren[r])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,r){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,qg(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)qg(this.columnProportions,i);else for(var s=0;s0&&(e+=t);return e},ry=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},sy=Phaser.Utils.Objects.IsPlainObject,oy=Phaser.Utils.Objects.GetValue,ay=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l,u,c,d){var f;return n(this,i),sy(r)?(r=oy(d=r,"x",0),s=oy(d,"y",0),o=oy(d,"width",void 0),a=oy(d,"height",void 0),h=oy(d,"column",d.col||0),l=oy(d,"row",0),u=oy(d,"columnProportions",0),c=oy(d,"rowProportions",0)):sy(o)?(o=oy(d=o,"width",void 0),a=oy(d,"height",void 0),h=oy(d,"column",d.col||0),l=oy(d,"row",0),u=oy(d,"columnProportions",0),c=oy(d,"rowProportions",0)):sy(h)?(h=oy(d=h,"column",d.col||0),l=oy(d,"row",0),u=oy(d,"columnProportions",0),c=oy(d,"rowProportions",0)):sy(u)&&(u=oy(d=u,"columnProportions",0),c=oy(d,"rowProportions",0)),(f=e.call(this,t,r,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(oy(d,"createCellContainerCallback")),f.setIndentLeft(oy(d,"space.indentLeftOdd",0),oy(d,"space.indentLeftEven",0)),f.setIndentTop(oy(d,"space.indentTopOdd",0),oy(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,oy(d,"space",void 0)),f}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(v(h(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=ny.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=ry.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}(Ta);Object.assign(ay.prototype,iy);var hy=Phaser.Utils.Objects.GetValue,ly=Phaser.Math.Linear,uy=Phaser.Math.Percent,cy={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=uy(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=uy(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=ly(t,e,i)),i}},dy=Phaser.Math.Percent,fy={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=dy(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new Ks(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 Ks(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},vy=Phaser.Utils.Objects.GetValue,py=Phaser.Math.Clamp;var gy=Phaser.Math.Percent,yy=function(t,e,i){var n;return t.y===e.y?n=gy(i.x,t.x,e.x):t.x===e.x&&(n=gy(i.y,t.y,e.y)),n},ky=function(t,e,i){var n,r;this.enable&&(my.x=e,my.y=i,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint()),this.value=yy(n,r,my));},my={},by=function(t,e,i){if(this.enable&&t.isDown){var n,r;xy.x=t.worldX,xy.y=t.worldY,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint());var s=yy(n,r,xy);this.stopEaseValue(),0===this.easeValueDuration||Math.abs(this.value-s)<.1?this.value=s:this.easeValueTo(s);}},xy={},wy=function(t,e){void 0===e&&(e=Cy);var i=this.childrenMap.thumb,n=i.x,r=i.y;return pr(i,this.innerLeft,this.innerTop,this.innerWidth,this.innerHeight,t),e.x=i.x,e.y=i.y,i.x=n,i.y=r,e},Cy={},Sy=Phaser.Display.Align.LEFT_CENTER,Py=Phaser.Display.Align.TOP_CENTER,Oy={},Ty=Phaser.Display.Align.RIGHT_CENTER,_y=Phaser.Display.Align.BOTTOM_CENTER,Ey={},My=Phaser.Math.Linear,Ry={},Ly=Phaser.Display.Align.LEFT_CENTER,Dy=Phaser.Display.Align.TOP_CENTER,Ay=Phaser.Display.Align.RIGHT_CENTER,jy=Phaser.Display.Align.BOTTOM_CENTER,zy=Phaser.Utils.Objects.GetValue,By=Phaser.Utils.Objects.IsPlainObject,Iy=Phaser.Math.Clamp,Wy=Phaser.Math.Snap.To,Fy=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexSlider",s.bootProgressBase(r),s.reverseAxis=zy(r,"reverseAxis",!1);var o=zy(r,"background",void 0),a=zy(r,"track",void 0),h=zy(r,"indicator",void 0),l=zy(r,"thumb",void 0);o&&(By(o)&&(o=ul(t,o)),s.addBackground(o)),a&&(By(a)&&(a=ul(t,a)),s.add(a,{proportion:1,expand:!0,minWidth:0===s.orientation?0:void 0,minHeight:1===s.orientation?0:void 0})),h&&(By(h)&&(h=ul(t,h)),s.pin(h)),l&&(By(l)&&(l=ul(t,l)),s.pin(l));var c=zy(r,"input",0);switch("string"==typeof c&&(c=Yy[c]),c){case 0:l&&(l.setInteractive(),s.scene.input.setDraggable(l),l.on("drag",ky,u(s)).on("dragstart",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("dragend",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)));break;case 1:s.on("pointerdown",by,u(s)).on("pointermove",by,u(s)).on("pointerdown",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerup",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)).on("pointerover",(function(t){t.isDown&&this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerout",(function(t){t.isDown&&this.eventEmitter.emit("inputend",t);}),u(s)).setInteractive();}return s.addChildrenMap("background",o),s.addChildrenMap("track",a),s.addChildrenMap("indicator",h),s.addChildrenMap("thumb",l),s.setEnable(zy(r,"enable",void 0)),s.setGap(zy(r,"gap",void 0)),s.setValue(zy(r,"value",0),zy(r,"min",void 0),zy(r,"max",void 0)),s}return s(i,[{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setGap",value:function(t,e,i){return t&&void 0!==e&&(t/=i-e),this.gap=t,this}},{key:"value",get:function(){return this._value},set:function(t){void 0!==this.gap&&(t=Wy(t,this.gap));var e=this._value;this._value=Iy(t,0,1),e!==this._value&&(this.updateThumb(this._value),this.updateIndicator(this._value),this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter));}},{key:"postLayout",value:function(t,e,i){return this.updateThumb(),this.updateIndicator(),this}}]),i}(function(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=vy(t,"eventEmitter",this);var e=vy(t,"valuechangeCallback",null);if(null!==e){var i=vy(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(vy(t,"easeValue.duration",0)).setEaseValueFunction(vy(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=py(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,cy,fy),e}(Ja)),Yy={pan:0,drag:0,click:1,none:-1},Xy={getStartPoint:function(t){if(void 0===t&&(t=Oy),this.childrenMap.thumb){var e=0===this.orientation?Sy:Py;wy.call(this,e,t);}else 0===this.orientation?(t.x=this.innerLeft+1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerTop+1);return t},getEndPoint:function(t){if(void 0===t&&(t=Ey),this.childrenMap.thumb){var e=0===this.orientation?Ty:_y;wy.call(this,e,t);}else 0===this.orientation?(t.x=this.innerRight-1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerBottom-1);return t},updateThumb:function(t){var e,i,n=this.childrenMap.thumb;return void 0===n||(void 0===t&&(t=this.value),this.reverseAxis?(e=this.getEndPoint(),i=this.getStartPoint()):(e=this.getStartPoint(),i=this.getEndPoint()),function(t,e,i,n){void 0===n&&(n=Ry),n.x=My(e.x,i.x,t),n.y=My(e.y,i.y,t);}(t,e,i,n),this.resetChildPositionState(n)),this},updateIndicator:function(t){var e=this.childrenMap.indicator;if(void 0===e)return this;void 0===t&&(t=this.value);var i,n,r,s=this.reverseAxis,o=this.childrenMap.thumb;if(o)if(0===this.orientation){var a=mt(o);if(s){h=o.x-a*o.originX;i=this.right-h;}else {var h;i=(h=o.x-a*o.originX)+a-this.left;}}else {var l=bt(o);if(s){u=o.y-l*o.originY;n=this.bottom-u;}else {var u;n=(u=o.y-l*o.originY)+l-this.top;}}else 0===this.orientation?i=this.width*t:n=this.height*t;Ao(e,i,n),r=s?0===this.orientation?Ay:jy:0===this.orientation?Ly:Dy,vr(e,this,r),this.resetChildPositionState(e);}};Object.assign(Fy.prototype,Xy);var Gy=Phaser.Utils.Objects.GetValue,Vy=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexScrollBar";var o,a=Gy(r,"background",void 0),h=Gy(r,"buttons",void 0),l=Gy(h,"top",Gy(h,"left",void 0)),c=Gy(h,"bottom",Gy(h,"right",void 0)),d=Gy(r,"slider",void 0);(a&&s.addBackground(a),l)&&(s.add(l),new ea(l).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?this.scrollStep:-this.scrollStep;this.value+=t;}}),u(s)));if(d){var f;if(d.orientation=s.orientation,d.eventEmitter=u(s),d.value=null,0===s.orientation)f=void 0===Gy(d,"width",void 0)?1:0;else f=void 0===Gy(d,"height",void 0)?1:0;o=new Fy(t,d),t.add.existing(o),s.add(o,{proportion:f});}c&&(s.add(c),new ea(c).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?-this.scrollStep:this.scrollStep;this.value+=t;}}),u(s)));var v=[l,c];s.addChildrenMap("background",a),s.addChildrenMap("slider",o),s.addChildrenMap("buttons",v);var p=Gy(r,"valuechangeCallback",null);if(null!==p){var g=Gy(r,"valuechangeCallbackScope",void 0);s.on("valuechange",p,g);}return s.setEnable(Gy(r,"enable",void 0)),s.setValue(Gy(r,"value",0)),s.setScrollStep(Gy(h,"step",.01)),s}return s(i,[{key:"setScrollStep",value:function(t){return this.scrollStep=t,this}},{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}}]),i}(Ja),Hy=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,r)).parent=t,s.init(),s}return s(i,[{key:"init",value:function(){this.start("IDLE");}},{key:"next_IDLE",value:function(){var t,e=this.parent;return e.dragState.isDown&&(t=0===e.dragThreshold?"DRAG":"DRAGBEGIN"),t}},{key:"update_IDLE",value:function(t,e){this.next();}},{key:"next_DRAGBEGIN",value:function(){var t=this.parent,e=t.dragState;return e.isDown?e.pointer.getDistance()>=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}(Gi),Ny=Phaser.Utils.Objects.GetValue,Uy=Phaser.Math.Distance.Between,Ky=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r))._enable=void 0,t.setInteractive(Ny(r,"inputConfig",void 0)),s.resetFromJSON(r),s.boot(),s}return s(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(Ny(t,"enable",!0)),this.holdThreshold=Ny(t,"holdThreshold",50),this.pointerOutReleaseEnable=Ny(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,v(h(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 en(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:Uy(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}(Pi),Jy=Phaser.Utils.Objects.GetValue,qy=function(){function t(e){n(this,t),this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Jy(t,"value",0)),this.setSpeed(Jy(t,"speed",0)),this.setAcceleration(Jy(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}(),Zy=function(){function t(){n(this,t),this.value,this.dir,this.movement=new qy;}return s(t,[{key:"init",value:function(t,e,i,n,r){return this.value=t,this.end=r,this.dir=void 0!==r?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,r=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,r,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}(Pi),ek={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},ik=Phaser.Utils.Objects.GetValue,nk=function(t){a(i,t);var e=d(i);function i(t,r){var s;(n(this,i),(s=e.call(this,t,r)).parent!==s.scene?s.focusMode=ik(r,"focus",!0):s.focusMode=!1,s.setSpeed(ik(r,"speed",.1)),s.setEnable(ik(r,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(ik(r,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,r){this.enable&&this.scroll(i);}),u(s)):s.scene.input.on("wheel",s.onSceneScroll,u(s));return s}return s(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,r,s){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}(Pi),rk=Phaser.Utils.Objects.GetValue,sk=function(t,e,i,n){var r,s,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(r=l||n.hasOwnProperty(c)?rk(n,c,void 0):rk(n,"slider",void 0)){var d,f,v;!0===r&&(r={}),r.orientation=h?1:0,s=function(t,e){void 0===e&&(e={});var i=jt(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 Vy(t,e);t.add.existing(n);var r=n.childrenMap.slider;return n.addChildrenMap("track",r.childrenMap.track),n.addChildrenMap("indicator",r.childrenMap.indicator),n.addChildrenMap("thumb",r.childrenMap.thumb),n}(t.scene,r);var p=rk(r,"position",0);"string"==typeof p&&(p=ok[p]);var g=rk(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=rk(n,"space.slider",void 0))&&(g=l?0:rk(n,"space.child",0));var y="number"==typeof g;h?0===p?(d=2,f=1,v=y?{left:g}:g):(d=0,f=1,v=y?{right:g}:g):0===p?(d=1,f=2,v=y?{top:g}:g):(d=1,f=0,v=y?{bottom:g}:g),e.add(s,{column:d,row:f,align:"center",padding:v,expand:!0}),t["hideUnscrollableSlider".concat(i)]=rk(r,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=rk(r,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=rk(r,"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)?rk(n,k,!0):rk(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new tk(u,o));var m,b,x,w,C=rk(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(C&&u&&(m=new nk(u,C)),t.addChildrenMap("slider".concat(i),s),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",s),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),s)&&(l?(b=h?"t":"s",w="scroll".concat(i)):(b="t",w="scroll"),s.on("valuechange",(function(e){t[b]=e,t.emit(w,t);})));a&&(l?(x="childO".concat(i),w="scroll".concat(i)):(x="childOY",w="scroll"),a.on("valuechange",(function(e){t[x]=e,t.emit(w,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},ok={right:0,left:1,bottom:0,top:1},ak=Phaser.Utils.Objects.GetValue,hk=function(t,e){var i=t.scene,n=[0,1,0],r=[0,1,0],s=ak(e,"width"),o=ak(e,"height");s||(ak(e,"child.expandWidth",!0)||(n[1]=0));o||(ak(e,"child.expandHeight",!0)||(r[1]=0));var a=new ay(i,{column:3,row:3,columnProportions:n,rowProportions:r});switch(function(t,e,i){var n=hy(i,"child"),r=hy(n,"gameObject",void 0);if(r){var s=hy(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof s)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=s,o.bottom=s,o.left=s,o.right=s;}else switch(t.scrollMode){case 0:o.top=hy(s,"top",0),o.bottom=hy(s,"bottom",0),a.left=hy(s,"left",0),a.right=hy(s,"right",0);break;case 1:o.top=hy(s,"left",0),o.bottom=hy(s,"right",0),a.top=hy(s,"top",0),a.bottom=hy(s,"bottom",0);break;default:o.top=hy(s,"top",0),o.bottom=hy(s,"bottom",0),o.left=hy(s,"left",0),o.right=hy(s,"right",0);}e.add(r,{column:1,row:1,align:hy(n,"align","center"),padding:a,expand:{width:hy(n,"expandWidth",!0),height:hy(n,"expandHeight",!0)}});}t.addChildrenMap("child",r);}(t,a,e),t.scrollMode){case 0:sk(t,a,"y",e);break;case 1:sk(t,a,"x",e);break;default:sk(t,a,"y",e),sk(t,a,"x",e);}return a},lk=function(t){var e,i,n,r;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,r=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)],r=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),r&&r.setEnable(e!==i);},uk=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);}},ck=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,r=this.minThumbSize;if(0===this.scrollMode){var s=i.displayHeight*e;void 0!==r&&s0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new km(t,{width:n,height:s,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:r,value:this.value});return t.add.existing(o),o},bm=Phaser.Utils.Objects.GetValue,xm=function(t,e){var i=bm(e,"expandDirection",void 0);"string"==typeof i&&(i=wm[i]);var n,r,s,a,h,l,u=(s="alignTargetX",bg(n=e,r="alignTarget")?Ii(n,r):s&&bg(n,s)?Ii(n,s):a),c=bm(e,"alignTargetY",u),d=bm(e,"alignOffsetX",0),f=bm(e,"alignOffsetY",0),v=bm(e,"alignSide","").includes("right"),p=bm(e,"bounds"),g=0===i,y=!g&&!(1===i),k=v?1:0,m=g||y?0:1;t.setOrigin(k,m),h=v?u.getTopRight().x:u.getTopLeft().x,l=c.getBottomLeft().y,t.setPosition(h+d,l+f);var b=p;b||(b=Ae(t.scene)),y&&t.getBottomLeft().y>b.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},wm={down:0,up:1},Cm=Phaser.Utils.Objects.GetValue,Sm=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),null==r.transitIn&&(r.transitIn=function(t,e){cs(t,e,"y","Cubic");}),null==r.transitOut&&(r.transitOut=function(t,e){!function(t,e,i,n,r){void 0===n&&(n="Linear");var s={mode:0};switch(i){case 0:case"x":s.end={x:0};break;case 1:case"y":s.end={y:0};break;default:s.end=0;}s.duration=e,s.ease=n,void 0===r?r=new ls(t,s):r.resetFromJSON(s),r.restart();}(t,e,"y","Linear");}),r.manualClose=!0,r.clickOutsideClose=!0,r.destroy=!0,s=e.call(this,t,r),xm(t,r),t.isRexSizer&&t.layout();var o=Cm(r,"touchOutsideClose",!1),a=Cm(r,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,u(s)):o&&s.once("open",s.touchOutsideClose,u(s)),s.requestOpen(),s}return s(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),v(h(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&&Co(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),v(h(i.prototype),"onClose",this).call(this);}}]),i}(uo),Pm={openColorPicker:function(){if(!this.colorPicker){var t=mm.call(this).layout(),e=new Sm(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(Pm,Wk);var Om=Phaser.Utils.Objects.GetValue,Tm=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexColorInput",r.hasOwnProperty("colorPicker")||(r.colorPicker={background:{color:0}});var o=r.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(Om(o,"width",160),Om(o,"height",170));var l=Om(o,"background");h=l?function(t){return ul(t,l)}:Om(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(Om(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(Om(o,"expandDirection")),s.setColorPickerEaseInDuration(Om(o,"easeIn",200)),s.setColorPickerEaseOutDuration(Om(o,"easeOut",200)),s.setColorPickerTransitInCallback(Om(o,"transitIn")),s.setColorPickerTransitOutCallback(Om(o,"transitOut")),s.setColorPickerBounds(Om(o,"bounds"));var c=Om(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(c);}var d=r.colorComponents;if(a&&(!1!==d&&null!==d)){s.setColorComponentsHeight(Om(d,"height",30)),s.setColorComponentsFormatLabelConfig(Om(d,"formatLabel"));var f=Om(d,"inputText");f||(f=Om(r,"inputText")),s.setColorComponentsInputTextConfig(f);var v=Om(d,"space");void 0===v&&(v={item:8}),s.setColorComponentsSpace(v);}var p=s.childrenMap.swatch;return p&&a&&s.onClick(p,s.openColorPicker,u(s)),s}return s(i)}(Ik);Object.assign(Tm.prototype,Pm);var _m={name:"ColorInput",accept:function(t){return !!t.hasOwnProperty("view")&&"color"===t.view},build:function(t,e){var i=t.scene;t.type="rexTweaker.ColorInput";var n=e.colorInput;void 0===n&&(n={}),n.hasOwnProperty("inputText")||(n.inputText=e.inputText);var r=function(t,e,i){void 0===i&&(i=!0),i?e=e?ge(e):{}:e||(e={});var n=new Tm(t,e);return t.add.existing(n),n}(i,n);t.add(r,{proportion:1,expand:!0,key:"colorInput"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("colorInput").setValue(e);}},Em={setBoxFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.boxFillColor!==t||this.boxFillAlpha!==e,this.boxFillColor=t,this.boxFillAlpha=e,this},setUncheckedBoxFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.uncheckedBoxFillColor!==t||this.uncheckedBoxFillAlpha!==e,this.uncheckedBoxFillColor=t,this.uncheckedBoxFillAlpha=e,this},setBoxStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.boxLineWidth!==t||this.boxStrokeColor!==e||this.boxStrokeAlpha!==i,this.boxLineWidth=t,this.boxStrokeColor=e,this.boxStrokeAlpha=i,this},setUncheckedBoxStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.uncheckedBoxLineWidth!==t||this.uncheckedBoxStrokeColor!==e||this.uncheckedBoxStrokeAlpha!==i,this.uncheckedBoxLineWidth=t,this.uncheckedBoxStrokeColor=e,this.uncheckedBoxStrokeAlpha=i,this},setCheckerStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.checkerColor!==t||this.checkAlpha!==e,this.checkerColor=t,this.checkAlpha=e,this},setBoxShape:function(t){return void 0===t&&(t=!1),this.isCircleShape===t||(this.isCircleShape=t,this.isSizeChanged=!0,this.dirty=!0),this}},Mm={buildShapes:function(){this.addShape((new Rf).setName("box")).addShape((new Ef).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,r=t-i,s=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(r+c+u,s+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,v=1*f,p=2*f,g=3*f;l.startAt(v,p).lineTo(p,g).lineTo(g,v).offset(r+u,s+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);}},Rm={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new Ks(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}},Lm={};Object.assign(Lm,Em,{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}},Mm,Rm);var Dm=Phaser.Utils.Objects.GetValue,Am=Phaser.Utils.Objects.IsPlainObject,jm=23730,zm=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Am(r)?(r=Dm(l=r,"x",0),s=Dm(l,"y",0),o=Dm(l,"width",2),a=Dm(l,"height",2),h=Dm(l,"color",jm)):Am(h)&&(h=Dm(l=h,"color",jm)),(u=e.call(this,t,r,s,o,a)).type="rexCheckbox",void 0===h&&(h=jm),u.setBoxShape(Dm(l,"circleBox",!1)),u.setBoxFillStyle(h,Dm(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(Dm(l,"uncheckedColor",null),Dm(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(Dm(l,"boxLineWidth",4),Dm(l,"boxStrokeColor",h),Dm(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,Dm(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),Dm(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(Dm(l,"checkerColor",16777215),Dm(l,"checkerAlpha",1)),u.setBoxSize(Dm(l,"boxSize",1)),u.setCheckerSize(Dm(l,"checkerSize",1)),u.setCheckerAnimationDuration(Dm(l,"animationDuration",150)),u.buildShapes();var c=Dm(l,"checked");return void 0===c&&(c=Dm(l,"value",!1)),u.setValue(c),u}return s(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}(rf);Object.assign(zm.prototype,Lm);var Bm=Phaser.Utils.Objects.GetValue,Im=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Go(u(c),Bm(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Bm(l,"readOnly",!1)),c}return s(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}(zm),Wm={name:"CheckboxInput",accept:function(t){return t.hasOwnProperty("view")?"boolean"===t.view:"boolean"==typeof t.value},build:function(t,e){var i=t.scene;t.type="rexTweaker.CheckboxInput";var n=e.checkbox,r=function(t,e){var i=new Im(t,e);return t.add.existing(i),i}(i,n),s=n.size;void 0!==s&&r.setSize(s,s);var o=void 0!==s?0:1;t.add(r,{proportion:0,expand:!1,fitRatio:o,key:"checkbox"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("checkbox").setValue(e);}},Fm={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}},Ym={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}},Xm={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}},Gm=function(t,e,i){return (e-t)*i+t},Vm=Phaser.Math.Linear,Hm={buildShapes:function(){this.addShape((new Rf).setName("track")).addShape((new Rf).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 r=t*this.trackWidth,s=e*this.trackHeight,o=(t-r)/2,a=(e-s)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(r,s).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Gm($e(l),$e(u),c))<<16|(255&Gm(Qe(l),Qe(u),c))<<8|255&Gm(ti(l),ti(u),c)),f=Vm(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var v=this.getShape("thumb");if(this.isSizeChanged){var p=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;v.setSize(p,g).setRadius(y);}var k=Vm(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;v.setCenterPosition(k,m),v.fillStyle(this.thumbColor,this.thumbAlpha);}},Nm={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new Ks(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}},Um={};Object.assign(Um,Fm,Ym,Xm,Hm,Nm);var Km=Phaser.Utils.Objects.GetValue,Jm=Phaser.Utils.Objects.IsPlainObject,qm=23730,Zm=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Jm(r)?(r=Km(l=r,"x",0),s=Km(l,"y",0),o=Km(l,"width",2),a=Km(l,"height",2),h=Km(l,"color",qm)):Jm(h)&&(h=Km(l=h,"color",qm)),(u=e.call(this,t,r,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=qm),u.setTrackFillStyle(h,Km(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Km(l,"falseValueTrackColor",function(t){var e=.3*$e(t)+.59*Qe(t)+.11*ti(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Km(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Km(l,"thumbColor",16777215),Km(l,"thumbAlpha",1)),u.setTrackSize(Km(l,"trackWidth",.9),Km(l,"trackHeight",.5)),u.setTrackRadius(Km(l,"trackRadius",.5*u.trackHeight));var c=Km(l,"thumbHeight",void 0),d=Km(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Km(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Km(l,"thumbLeft",.3),Km(l,"thumbRight",void 0)),u.setRTL(Km(l,"rtl",!1)),u.setToggleAnimationDuration(Km(l,"animationDuration",150)),u.buildShapes(),u.setValue(Km(l,"value",!1),0),u}return s(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}(rf);Object.assign(Zm.prototype,Um);var $m=Phaser.Utils.Objects.GetValue,Qm=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Go(u(c),$m(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly($m(l,"readOnly",!1)),c}return s(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}(Zm),tb={name:"ToggleSwitchInput",accept:function(t){return !!t.hasOwnProperty("view")&&"toggleSwitch"===t.view},build:function(t,e){var i=t.scene;t.type="rexTweaker.ToggleSwitchInput";var n=e.toggleSwitch,r=function(t,e){var i=new Qm(t,e);return t.add.existing(i),i}(i,n),s=n.size;void 0!==s&&r.setSize(s,s);var o=void 0!==s?0:1;t.addSpace().add(r,{proportion:0,expand:!1,fitRatio:o,key:"toggleSwitch"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("toggleSwitch").setValue(e);}},eb={setWrapEnable:function(t){return void 0===t&&(t=!0),this.listWrapEnable=t,this},setCreateButtonCallback:function(t){return this.listCreateButtonCallback=t,this},setCreateListBackgroundCallback:function(t){return this.listCreateBackgroundCallback=t,this},setButtonClickCallback:function(t){return this.listOnButtonClick=t,this},setButtonOverCallback:function(t){return this.listOnButtonOver=t,this},setButtonOutCallback:function(t){return this.listOnButtonOut=t,this},setListExpandDirection:function(t){return "string"==typeof t&&(t=ib[t]),this.listExpandDirection=t,this},setListEaseInDuration:function(t){return void 0===t&&(t=0),this.listEaseInDuration=t,this},setListEaseOutDuration:function(t){return void 0===t&&(t=0),this.listEaseOutDuration=t,this},setListTransitInCallback:function(t){return this.listTransitInCallback=t,this},settListTransitOutCallback:function(t){return this.listTransitOutCallback=t,this},setListBounds:function(t){return this.listBounds=t,this},setListWidth:function(t){return this.listWidth=t,this},setListHeight:function(t){return this.listHeight=t,this},setListSize:function(t,e){return this.setListWidth(t).setListHeight(e),this},setListAlignmentMode:function(t){return this.listAlignMode=t,this},setListAlignmentSide:function(t){return void 0===t&&(t=""),this.listAlignSide=t,this},setListSpace:function(t){return void 0===t&&(t={}),this.listSpace=t,this},setListDraggable:function(t){return void 0===t&&(t=!0),this.listDraggable=t,this}},ib={down:0,up:1},nb=function(){var t,e=this.scene,i=this.listCreateBackgroundCallback;i&&(t=i.call(this,e),e.add.existing(t));var n=[],r=this.listCreateButtonCallback;if(r)for(var s=this.options,o=0,a=s.length;o