UNPKG

phaser3-rex-plugins

Version:
7 lines 56.6 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rexgridtableplugin=e();}(undefined,(function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n);}}function n(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e);}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return !1}}();return function(){var i,n=s(t);if(e){var r=s(this).constructor;i=Reflect.construct(n,arguments,r);}else i=n.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}(this,i)}}function h(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=h(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},u.apply(this,arguments)}function c(t,e,i,n){return c="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,n){var r,s=h(t,e);if(s){if((r=Object.getOwnPropertyDescriptor(s,e)).set)return r.set.call(n,i),!0;if(!r.writable)return !1}if(r=Object.getOwnPropertyDescriptor(n,e)){if(!r.writable)return !1;r.value=i,Object.defineProperty(n,e,r);}else !function(t,e,i){(e=v(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;}(n,e,i);return !0},c(t,e,i,n)}function d(t,e,i,n,r){if(!c(t,e,i,n||t)&&r)throw new TypeError("failed to set property");return i}function f(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return y(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function v(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}var p,g=!1;g||(void 0===p&&(p=60),parseInt(Phaser.VERSION.match(/\.(\d+)\./)[1])<p&&console.error("Minimum supported version : 3.".concat(p)),g=!0);var C=Phaser.GameObjects.Zone,b=Phaser.Utils.Array.Add,k=Phaser.Utils.Array.Remove,m=function(t){r(o,t);var i=a(o);function o(t,n,r,s,l){var a;return e(this,o),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1),void 0===l&&(l=1),(a=i.call(this,t,n,r,s,l)).children=[],a}return n(o,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(t)for(var e,i=this.children.length-1;i>=0;i--)(e=this.children[i]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),u(s(o.prototype),"destroy",this).call(this,t);}}},{key:"contains",value:function(t){return -1!==this.children.indexOf(t)}},{key:"add",value:function(t){var e=this;return b(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return k(this.children,t,(function(t){t.off("destroy",i.onChildDestroy,i),e&&t.destroy();})),this}},{key:"onChildDestroy",value:function(t,e){this.remove(t,!1);}},{key:"clear",value:function(t){for(var e,i=0,n=this.children.length;i<n;i++)(e=this.children[i]).off("destroy",this.onChildDestroy,this),t&&e.destroy();return this.children.length=0,this}}]),o}(C),T=Phaser.GameObjects.Components;Phaser.Class.mixin(m,[T.Alpha,T.Flip]);var x,P=function t(e,i){var n;if(void 0===i)e.hasOwnProperty("rexContainer")&&(n=e.rexContainer.parent);else for(n=t(e);n&&n.name!==i;)n=t(n);return n},O=Phaser.Math.DegToRad,w=Phaser.Math.RadToDeg,R=function(t){if(!t.hasOwnProperty("rexContainer")){var e={parent:null,self:null,layer:null,x:0,y:0,syncPosition:!0,rotation:0,syncRotation:!0,scaleX:0,scaleY:0,syncScale:!0,alpha:0,syncAlpha:!0,visible:!0,active:!0};Object.defineProperty(e,"angle",{get:function(){return w(this.rotation)},set:function(t){this.rotation=O(t);}}),Object.defineProperty(e,"displayWidth",{get:function(){return t.width*this.scaleX},set:function(e){this.scaleX=e/t.width;}}),Object.defineProperty(e,"displayHeight",{get:function(){return t.height*this.scaleY},set:function(e){this.scaleY=e/t.height;}}),t.rexContainer=e;}return t.rexContainer},M={setParent:function(t,e){void 0===e&&(e=this);var i=R(t);return e?(i.parent=e,i.self=t):(i.parent=null,i.self=null),this},getParent:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),P(t,e)},getTopmostParent:function(t){return void 0===t&&(t=this),function(t){for(var e=P(t);e;)t=e,e=P(e);return t}(t)}},L=Phaser.Utils.Objects.GetValue,S=m.prototype.add,A=function(t,e){this.setParent(t);var i=R(t);return X(i,e),this.resetChildState(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),S.call(this,t),this.addToParentContainer(t),this.addToRenderLayer(t),this},Y=function(t,e){this.setParent(t);var i=R(t);return X(i,e),i.x=t.x,i.y=t.y,i.rotation=t.rotation,i.scaleX=t.scaleX,i.scaleY=t.scaleY,i.alpha=t.alpha,i.visible=t.visible,i.active=t.active,this.updateChildPosition(t).updateChildAlpha(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),S.call(this,t),this.addToRenderLayer(t),this},X=function(t,e){void 0===e&&(e=!0),"boolean"==typeof e?(t.syncPosition=e,t.syncRotation=e,t.syncScale=e,t.syncAlpha=e,t.syncScrollFactor=e):(t.syncPosition=L(e,"syncPosition",!0),t.syncRotation=L(e,"syncRotation",!0),t.syncScale=L(e,"syncScale",!0),t.syncAlpha=L(e,"syncAlpha",!0),t.syncScrollFactor=L(e,"syncScrollFactor",!0));},H={add:function(t){return Array.isArray(t)?this.addMultiple(t):A.call(this,t),this},pin:function(t,e){return Array.isArray(t)?this.addMultiple(t,e):A.call(this,t,e),this},addMultiple:function(t){for(var e=0,i=t.length;e<i;e++)A.call(this,t[e]);return this},addLocal:function(t){return Array.isArray(t)?this.addMultiple(t):Y.call(this,t),this},pinLocal:function(t,e){return Array.isArray(t)?this.addMultiple(t,e):Y.call(this,t,e),this},addLocalMultiple:function(t){for(var e=0,i=t.length;e<i;e++)Y.call(this,t[e]);return this}},_=m.prototype.remove,E=m.prototype.clear,V={remove:function(t,e){return P(t)!==this||(this.setParent(t,null),e||this.removeFromRenderLayer(t),_.call(this,t,e)),this},unpin:function(t,e){return P(t)!==this||(this.setParent(t,null),e||this.removeFromRenderLayer(t),_.call(this,t,e)),this},clear:function(t){for(var e=this.children,i=0,n=e.length;i<n;i++){var r=e[i];this.setParent(r,null),t||this.removeFromRenderLayer(r);}return E.call(this,t),this}},j={getLocalState:function(t){return R(t)},resetChildState:function(t){return this.resetChildPositionState(t).resetChildVisibleState(t).resetChildAlphaState(t).resetChildActiveState(t),this},resetChildrenState:function(t){for(var e=0,i=t.length;e<i;e++)this.resetChildState(t[e]);return this},syncProperties:function(){return this.syncPosition().syncVisible().syncAlpha().syncActive().syncScrollFactor().syncMask(),this}},F=Phaser.Math.RotateAround,D={worldToLocal:function(t){return t.x-=this.x,t.y-=this.y,F(t,0,0,-this.rotation),t.x/=this.scaleX,t.y/=this.scaleY,t},localToWorld:function(t){return t.x*=this.scaleX,t.y*=this.scaleY,F(t,0,0,this.rotation),t.x+=this.x,t.y+=this.y,t}},I=function(t,e){return t===e?1:t/e},G={updateChildPosition:function(t){t.isRexContainerLite&&(t.syncChildrenEnable=!1);var e=R(t),i=e.parent;return e.syncPosition&&(t.x=e.x,t.y=e.y,i.localToWorld(t)),e.syncRotation&&(t.rotation=e.rotation+i.rotation),e.syncScale&&(t.scaleX=e.scaleX*i.scaleX,t.scaleY=e.scaleY*i.scaleY),t.isRexContainerLite&&(t.syncChildrenEnable=!0,t.syncPosition()),this},syncPosition:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildPosition,this),this},resetChildPositionState:function(t){var e=R(t),i=e.parent;return e.x=t.x,e.y=t.y,i.worldToLocal(e),e.scaleX=I(t.scaleX,i.scaleX),e.scaleY=I(t.scaleY,i.scaleY),e.rotation=t.rotation-i.rotation,this},setChildPosition:function(t,e,i){return t.x=e,t.y=i,this.resetChildPositionState(t),this},setChildLocalPosition:function(t,e,i){var n=R(t);return n.x=e,n.y=i,this.updateChildPosition(t),this},resetLocalPositionState:function(){var t=R(this).parent;return t&&t.resetChildPositionState(this),this}},W=Phaser.Math.DegToRad,B={updateChildRotation:function(t){var e=R(t),i=e.parent;return e.syncRotation&&(t.rotation=i.rotation+e.rotation),this},syncRotation:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildRotation,this),this},resetChildRotationState:function(t){var e=R(t),i=e.parent;return e.rotation=t.rotation-i.rotation,this},setChildRotation:function(t,e){return t.rotation=e,this.resetChildRotationState(t),this},setChildAngle:function(t,e){return t.angle=e,this.resetChildRotationState(t),this},setChildLocalRotation:function(t,e){return R(t).rotation=e,this.updateChildRotation(t),this},setChildLocalAngle:function(t,e){return R(t).rotation=W(e),this.updateChildRotation(t),this},resetLocalRotationState:function(){var t=R(this).parent;return t&&t.resetChildRotationState(this),this}},U={updateChildScale:function(t){var e=R(t),i=e.parent;return e.syncScale&&(t.scaleX=i.scaleX*e.scaleX,t.scaleY=i.scaleY*e.scaleY),this},syncScale:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScale,this),this},resetChildScaleState:function(t){var e=R(t),i=e.parent;return e.scaleX=I(t.scaleX,i.scaleX),e.scaleY=I(t.scaleY,i.scaleY),this},setChildScale:function(t,e,i){return void 0===i&&(i=e),t.scaleX=e,t.scaleY=i,this.resetChildScaleState(t),this},setChildLocalScale:function(t,e,i){void 0===i&&(i=e);var n=R(t);return n.scaleX=e,n.scaleY=i,this.updateChildScale(t),this},setChildDisplaySize:function(t,e,i){return t.setDisplaySize(e,i),this.resetChildScaleState(t),this},resetLocalScaleState:function(){var t=R(this).parent;return t&&t.resetChildScaleState(this),this}},N={updateChildVisible:function(t){var e=R(t),i=e.parent,n=!e.hasOwnProperty("maskVisible")||e.maskVisible;return t.visible=i.visible&&e.visible&&n,this},syncVisible:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildVisible,this),this},resetChildVisibleState:function(t){var e=R(t);return e.hasOwnProperty("maskVisible")&&delete e.maskVisible,e.visible=t.visible,this},setChildVisible:function(t,e){return this.setChildLocalVisible(t,e),this},setChildLocalVisible:function(t,e){return void 0===e&&(e=!0),R(t).visible=e,this.updateChildVisible(t),this},setChildMaskVisible:function(t,e){return void 0===e&&(e=!0),R(t).maskVisible=e,this.updateChildVisible(t),this},resetLocalVisibleState:function(){var t=R(this).parent;return t&&t.resetChildVisibleState(this),this}},z={updateChildAlpha:function(t){var e=R(t),i=e.parent;return e.syncAlpha&&(t.alpha=i.alpha*e.alpha),this},syncAlpha:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildAlpha,this),this},resetChildAlphaState:function(t){var e=R(t),i=e.parent;return e.alpha=I(t.alpha,i.alpha),this},setChildAlpha:function(t,e){return t.alpha=e,this.resetChildAlphaState(t),this},setChildLocalAlpha:function(t,e){return R(t).alpha=e,this.updateChildAlpha(t),this},resetLocalAlphaState:function(){var t=R(this).parent;return t&&t.resetChildAlphaState(this),this}},Z={updateChildActive:function(t){var e=R(t),i=e.parent;return t.active=i.active&&e.active,this},syncActive:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildActive,this),this},resetChildActiveState:function(t){return R(t).active=t.active,this},setChildActive:function(t,e){return t.active=e,this.resetChildActiveState(t),this},setChildLocalActive:function(t,e){return void 0===e&&(e=!0),R(t).active=e,this.updateChildActive(t),this},resetLocalActiveState:function(){var t=R(this).parent;return t&&t.resetChildActiveState(this),this}},J={updateChildScrollFactor:function(t){var e=R(t),i=e.parent;return e.syncScrollFactor&&(t.scrollFactorX=i.scrollFactorX,t.scrollFactorY=i.scrollFactorY),this},syncScrollFactor:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScrollFactor,this),this}},q={updateChildMask:function(t){return null==this.mask||(this.mask.hasOwnProperty("geometryMask")?this.mask.geometryMask:this.mask.bitmapMask)!==t&&(t.mask=this.mask),this},syncMask:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildMask,this),this},setMask:function(t){return this.mask=t,this},clearMask:function(t){void 0===t&&(t=!1);var e=this;return this._mask=null,this.setChildMaskVisible(this),this.children.forEach((function(t){t.clearMask&&t.clearMask(!1),t.hasOwnProperty("isRexContainerLite")||e.setChildMaskVisible(t);})),t&&this.mask&&this.mask.destroy(),this}},$=function(t,e){if(t.length<=1)return t;var i;void 0===e&&(e=!1);var n=t[0];return (i=n.displayList?n.displayList:n.parentContainer?n.parentContainer.list:n.scene.sys.displayList).depthSort&&(i.depthSort(),i=i.list),e?t.sort((function(t,e){return i.indexOf(e)-i.indexOf(t)})):t.sort((function(t,e){return i.indexOf(t)-i.indexOf(e)})),t},K={setDepth:function(t,e){if(this.depth=t,!e&&this.children)for(var i=this.getAllChildren(),n=0,r=i.length;n<r;n++)i[n].depth=t;return this},swapDepth:function(t){var e=this.depth,i=t.depth;return this.setDepth(i),t.setDepth(e),this},incDepth:function(t){if(this.depth+=t,this.children)for(var e=this.getAllChildren(),i=0,n=e.length;i<n;i++)e[i].depth+=t;return this},bringToTop:function(){var t=this.displayList,e=this.getAllChildren([this]);$(e,!1);for(var i=0,n=e.length;i<n;i++){var r=e[i];t.exists(r)&&t.bringToTop(r);}return this},moveDepthBelow:function(t){var e=this.displayList;if(t.displayList!==e)return this;var i=this.getAllChildren([this]);$(i,!1);for(var n=0,r=i.length;n<r;n++){var s=i[n];if(e.exists(s)){e.moveBelow(t,s);break}}return this},moveDepthAbove:function(t){var e=this.displayList;if(t.displayList!==e)return this;var i=this.getAllChildren([this]);$(i,!0);for(var n=0,r=i.length;n<r;n++){var s=i[n];if(e.exists(s)){e.moveAbove(t,s);break}}return this},bringChildToTop:function(t){var e=this.getAllChildren([this]);$(e,!0);var i=e[0];return i===t||i.displayList!==t.displayList||i.displayList.moveAbove(t,i),this},sendChildToBack:function(t){var e=this.getAllChildren([this]);$(e,!1);var i=e[0];return i===t||i.displayList!==t.displayList||i.displayList.moveBelow(t,i),this}},Q=function t(e,i){if(!i(e)&&e.isRexContainerLite)for(var n=e.children,r=0,s=n.length;r<s;r++)t(n[r],i);},tt=function(t,e){for(var i=[t];i.length>0;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,f(n.children));}},et=Phaser.Utils.Array,it={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e<i;e++)t.push(this.children[e]);else t=this.children;return t},getAllChildren:function(t){void 0===t&&(t=[]);var e=this;return tt(e,(function(i){i!==e&&t.push(i);})),t},getAllVisibleChildren:function(t){void 0===t&&(t=[]);var e=this;return tt(e,(function(i){if(i!==e)return !i.visible||void t.push(i)})),t},bfs:function(t,e){return void 0===e&&(e=this),tt(e,t),this},dfs:function(t,e){return void 0===e&&(e=this),Q(e,t),this},contains:function(t){var e=P(t);return !!e&&(e===this||this.contains(e))},getByName:function(t,e){if(e){for(var i,n,r=[this];r.length;)for(var s=0,o=(i=r.shift()).children.length;s<o;s++){if((n=i.children[s]).name===t)return n;n.isRexContainerLite&&r.push(n);}return null}return et.GetFirst(this.children,"name",t)},getRandom:function(t,e){return et.GetRandom(this.children,t,e)},getFirst:function(t,e,i,n){return et.GetFirstElement(this.children,t,e,i,n)},getAll:function(t,e,i,n){return et.GetAll(this.children,t,e,i,n)},count:function(t,e,i,n){return et.CountAllMatching(this.children,t,e,i,n)},swap:function(t,e){return et.Swap(this.children,t,e),this},setAll:function(t,e,i,n){return et.SetAll(this.children,t,e,i,n),this}},nt=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];r.hasOwnProperty("rexContainer")&&e.push(r.rexContainer);}return e},rt=function(t,e,i){if(i.parent){var n=i.parent,r=i.self;switch(e){case"x":case"y":n.updateChildPosition(r);break;case"angle":case"rotation":n.updateChildRotation(r);break;case"scaleX":case"scaleY":case"displayWidth":case"displayHeight":n.updateChildScale(r);break;case"alpha":n.updateChildAlpha(r);break;default:n.updateChildPosition(r),n.updateChildRotation(r),n.updateChildScale(r),n.updateChildAlpha(r);}}else t.remove();},st={tweenChild:function(t){var e=t.targets;Array.isArray(e)||(e=[e]);var i=this.scene||function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e].scene;if(n)return n}return null}(e);if(i){t.targets=nt(e);var n=i.tweens.add(t);return n.on("update",rt),n}},tweenSelf:function(t){return t.targets=[this],this.tweenChild(t)},createTweenChildConfig:function(t){var e=t.targets;e&&(Array.isArray(e)||(e=[e]),t.targets=nt(e));var i=t.onUpdate;return t.onUpdate=function(t,e){i&&i(t,e),rt(t,void 0,e);},t},tween:function(t){var e=this.scene;return t.targets||(t.targets=this),e.tweens.add(t)}},ot=Phaser.GameObjects.Container,lt=Phaser.GameObjects.Layer,at=function(t){return t instanceof lt},ht=function(t){var e=t.getAllChildren([t]);return e=e.filter((function(t){return !!t.displayList||!!t.parentContainer}))},ut=function(t){var e=ht(this);return $(e),t.add(e),this},ct=function(t,e,i){var n=ht(this);return $(n,e),t.remove(n),i&&n.forEach((function(t){t.addToDisplayList();})),this},dt={addToContainer:function(t){return t instanceof ot?(this._setParentContainerFlag=!0,ut.call(this,t),this._setParentContainerFlag=!1,this):this},addToLayer:function(t){return at(t)?(ut.call(this,t),this):this},removeFromContainer:function(){return this.parentContainer?(this._setParentContainerFlag=!0,ct.call(this,this.parentContainer,!0,!1),this._setParentContainerFlag=!1,this):this},removeFromLayer:function(t){return void 0===t&&(t=!0),at(this.displayList)?(ct.call(this,this.displayList,!1,t),this):this},getParentContainer:function(){if(this.parentContainer)return this.parentContainer;for(var t=this.getParent();t;){var e=t.parentContainer;if(e)return e;t=t.getParent();}return null},addToParentContainer:function(t){if(!t.displayList)return this;var e=this.getParentContainer();return e?(t.isRexContainerLite?t.addToContainer(e):e.add(t),this):this}},ft={hasLayer:function(){return !!this.privateRenderLayer},enableLayer:function(){if(this.hasLayer())return this;var t=this.scene.add.layer();return this.moveDepthBelow(t),this.addToLayer(t),this.privateRenderLayer=t,this},getLayer:function(){return this.hasLayer()||this.enableLayer(),this.privateRenderLayer},getRenderLayer:function(){if(this.hasLayer())return this.privateRenderLayer;for(var t=this.getParent();t;){var e=t.privateRenderLayer;if(e)return e;t=t.getParent();}return null},addToRenderLayer:function(t){if(!t.displayList)return this;var e=this.getRenderLayer();return e?(t.isRexContainerLite?t.addToLayer(e):e.add(t),R(t).layer=e,this):this},removeFromRenderLayer:function(t){var e=R(t),i=e.layer;return i?(t.isRexContainerLite?t.removeFromLayer(!0):i.remove(t),e.layer=null,this):this}},yt=function(t){return void 0!==t.displayWidth?t.displayWidth:t.width},vt=function(t){return void 0!==t.displayHeight?t.displayHeight:t.height},pt=Phaser.Geom.Rectangle,gt=Phaser.Math.Vector2,Ct=Phaser.Math.RotateAround,bt=function(t,e){if(void 0===e?e=new pt:!0===e&&(void 0===kt&&(kt=new pt),e=kt),t.getBounds)return t.getBounds(e);var i,n,r,s,o,l,a,h;if(t.parentContainer){var u=t.parentContainer.getBoundsTransformMatrix();mt(t,e),u.transformPoint(e.x,e.y,e),i=e.x,n=e.y,Tt(t,e),u.transformPoint(e.x,e.y,e),r=e.x,s=e.y,xt(t,e),u.transformPoint(e.x,e.y,e),o=e.x,l=e.y,Pt(t,e),u.transformPoint(e.x,e.y,e),a=e.x,h=e.y;}else mt(t,e),i=e.x,n=e.y,Tt(t,e),r=e.x,s=e.y,xt(t,e),o=e.x,l=e.y,Pt(t,e),a=e.x,h=e.y;return e.x=Math.min(i,r,o,a),e.y=Math.min(n,s,l,h),e.width=Math.max(i,r,o,a)-e.x,e.height=Math.max(n,s,l,h)-e.y,e},kt=void 0,mt=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Ot&&(Ot=new gt),e=Ot),t.getTopLeft?t.getTopLeft(e):(e.x=t.x-yt(t)*t.originX,e.y=t.y-vt(t)*t.originY,wt(t,e,i))},Tt=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Ot&&(Ot=new gt),e=Ot),t.getTopRight?t.getTopRight(e):(e.x=t.x-yt(t)*t.originX+yt(t),e.y=t.y-vt(t)*t.originY,wt(t,e,i))},xt=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Ot&&(Ot=new gt),e=Ot),t.getBottomLeft?t.getBottomLeft(e):(e.x=t.x-yt(t)*t.originX,e.y=t.y-vt(t)*t.originY+vt(t),wt(t,e,i))},Pt=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Ot&&(Ot=new gt),e=Ot),t.getBottomRight?t.getBottomRight(e):(e.x=t.x-yt(t)*t.originX+yt(t),e.y=t.y-vt(t)*t.originY+vt(t),wt(t,e,i))},Ot=void 0,wt=function(t,e,i){(void 0===i&&(i=!1),0!==t.rotation&&Ct(e,t.x,t.y,t.rotation),i&&t.parentContainer)&&t.parentContainer.getBoundsTransformMatrix().transformPoint(e.x,e.y,e);return e},Rt=Phaser.Geom.Rectangle,Mt=Phaser.Geom.Rectangle.Union,Lt=function(e){if("object"!==t(e)||null===e)return e;if(Array.isArray(e))e.length=0;else for(var i in e)delete e[i];return e},St=function(t,e){var i=Array.isArray(t);if(void 0===e?e=i?[]:{}:Lt(e),i){e.length=t.length;for(var n=0,r=t.length;n<r;n++)e[n]=t[n];}else for(var s in t)e[s]=t[s];return e},At=Phaser.GameObjects.GameObject,Yt=Phaser.Utils.Objects.GetValue,Xt=Phaser.Textures.DynamicTexture,Ht=Phaser.Utils.String.UUID,_t=function(t){if(t){var e,i,n=t.gameObjects,r=t.renderTexture,s=Yt(t,"x",void 0),o=Yt(t,"y",void 0),l=Yt(t,"width",void 0),a=Yt(t,"height",void 0),h=Yt(t,"originX",0),u=Yt(t,"originY",0),c=Yt(t,"padding",0);if(void 0===l||void 0===a||void 0===s||void 0===o){var d=function(t,e){var i;void 0===e?e=new Rt:!0===e&&(void 0===x&&(x=new Rt),e=x),e.setTo(0,0,0,0);for(var n=!0,r=0,s=t.length;r<s;r++)if((i=t[r]).getBounds){var o=bt(i,!0);n?(e.setTo(o.x,o.y,o.width,o.height),n=!1):Mt(o,e,e);}return e}(n,!0);void 0!==s&&void 0!==o?(l=2*Math.max(s-d.left,d.right-s),a=2*Math.max(o-d.top,d.bottom-o),h=.5,u=.5):(s=d.x,o=d.y,l=d.width,a=d.height,h=0,u=0),e=d.x,i=d.y;}else e=s+(0-h)*l,i=o+(0-u)*a;e-=c,i-=c,l+=2*c,a+=2*c;var f=n[0].scene;y&&!r&&(r=new Xt(f.sys.textures,Ht(),l,a)),r||(r=f.add.renderTexture(0,0,l,a)),r.setPosition&&r.setPosition(s,o),r.width===l&&r.height===a||r.setSize(l,a),r.setOrigin&&r.setOrigin(h,u),r.camera.setScroll(e,i),n=$(St(n)),r.draw(n);var y=t.saveTexture;if(y)if(r instanceof At)r.saveTexture(y);else {var v=r,p=v.manager;p.exists(v.key)?p.renameTexture(v.key,key):(v.key=key,p.list[key]=v,p.emit("addtexture",key,v),p.emit("addtexture-".concat(key),v));}return r}},Et={snapshot:function(t){var e=this.scaleX,i=this.scaleY,n=1===e&&1===i;n||this.setScale(1),void 0===t&&(t={}),t.gameObjects=this.getAllVisibleChildren(),t.x=this.x,t.y=this.y,t.originX=this.originX,t.originY=this.originY;var r=_t(t),s=!!r.scene;return n||(this.setScale(e,i),s&&r.setScale(e,i)),s?r:this}},Vt=Phaser.Utils.Objects.GetValue,jt=function(t,e,i,n,r,s,o){if(t.getBounds||void 0!==t.width&&void 0!==t.height){void 0===i&&(i=16777215),void 0===n&&(n=1),void 0===r&&(r=null),void 0===s&&(s=1),void 0===o&&(o=0);var l=mt(t,Ft[0]);l.x-=o,l.y-=o;var a=Tt(t,Ft[1]);a.x+=o,a.y-=o;var h=Pt(t,Ft[2]);h.x+=o,h.y+=o;var u=xt(t,Ft[3]);u.x-=o,u.y+=o,null!==r&&e.fillStyle(r,s).fillPoints(Ft,!0,!0),null!==i&&e.lineStyle(n,i).strokePoints(Ft,!0,!0);}},Ft=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Dt=Phaser.Utils.Objects.GetValue,It=Phaser.Math.RotateAround,Gt={changeOrigin:function(t,e){this.syncChildrenEnable=!1,function(t,e,i){void 0===i&&(i=e);var n={x:(e-t.originX)*t.displayWidth,y:(i-t.originY)*t.displayHeight};It(n,0,0,t.rotation),t.originX=e,t.originY=i,t.x=t.x+n.x,t.y=t.y+n.y;}(this,t,e),this.syncChildrenEnable=!0;for(var i=this.getAllChildren(),n=0,r=i.length;n<r;n++)this.resetChildPositionState(i[n]);return this},drawBounds:function(t,e){var i=Dt(e,"drawContainer",!0),n=Dt(e,"children");return void 0===n&&(n=this.getAllVisibleChildren([this])),i||(n=n.filter((function(t){return !t.isRexContainerLite}))),function(t,e,i){var n,r,s,o,l;if("number"==typeof i?n=i:(n=Vt(i,"color"),r=Vt(i,"lineWidth"),s=Vt(i,"fillColor"),o=Vt(i,"fillAlpha",1),l=Vt(i,"padding",0)),Array.isArray(t))for(var a=0,h=t.length;a<h;a++)jt(t[a],e,n,r,s,o,l);else jt(t,e,n,r,s,o,l);}(n,t,e),this}};Object.assign(Gt,M,H,V,j,D,G,B,U,N,z,Z,J,q,K,it,st,dt,ft,Et);var Wt=function(t){r(o,t);var i=a(o);function o(t,n,r,s,l,a){var h;return e(this,o),Array.isArray(s)&&(a=s,s=void 0,l=void 0),(h=i.call(this,t,n,r,s,l)).type="rexContainerLite",h.isRexContainerLite=!0,h.syncChildrenEnable=!0,h._active=!0,h._mask=null,h._scrollFactorX=1,h._scrollFactorY=1,h.privateRenderLayer=void 0,a&&h.add(a),h}return n(o,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.syncChildrenEnable=!1,u(s(o.prototype),"destroy",this).call(this,t),this.privateRenderLayer&&(this.privateRenderLayer.list.length=0,this.privateRenderLayer.destroy()));}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.syncPosition());}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.syncPosition());}},{key:"rotation",get:function(){return u(s(o.prototype),"rotation",this)},set:function(t){this.rotation!==t&&(d(s(o.prototype),"rotation",t,this,!0),this.syncPosition());}},{key:"scaleX",get:function(){return u(s(o.prototype),"scaleX",this)},set:function(t){this.scaleX!==t&&(d(s(o.prototype),"scaleX",t,this,!0),this.syncPosition());}},{key:"scaleY",get:function(){return u(s(o.prototype),"scaleY",this)},set:function(t){this.scaleY!==t&&(d(s(o.prototype),"scaleY",t,this,!0),this.syncPosition());}},{key:"scale",get:function(){return u(s(o.prototype),"scale",this)},set:function(t){this.scale!==t&&(d(s(o.prototype),"scale",t,this,!0),this.syncPosition());}},{key:"visible",get:function(){return u(s(o.prototype),"visible",this)},set:function(t){u(s(o.prototype),"visible",this)!==t&&(d(s(o.prototype),"visible",t,this,!0),this.syncVisible());}},{key:"alpha",get:function(){return u(s(o.prototype),"alpha",this)},set:function(t){u(s(o.prototype),"alpha",this)!==t&&(d(s(o.prototype),"alpha",t,this,!0),this.syncAlpha());}},{key:"active",get:function(){return this._active},set:function(t){this._active!==t&&(this._active=t,this.syncActive());}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask!==t&&(this._mask=t,this.syncMask());}},{key:"scrollFactorX",get:function(){return this._scrollFactorX},set:function(t){this._scrollFactorX!==t&&(this._scrollFactorX=t,this.syncScrollFactor());}},{key:"scrollFactorY",get:function(){return this._scrollFactorY},set:function(t){this._scrollFactorY!==t&&(this._scrollFactorY=t,this.syncScrollFactor());}},{key:"list",get:function(){return this.children}},{key:"parentContainer",get:function(){return this._parentContainer},set:function(t){this._parentContainer||t?this.setParentContainerFlag?this._parentContainer=t:this._parentContainer&&!t?(this.removeFromContainer(),this._parentContainer=t):t?(this._parentContainer=t,this.addToContainer(t)):this._parentContainer=t:this._parentContainer=t;}},{key:"setParentContainerFlag",get:function(){if(this._setParentContainerFlag)return !0;var t=P(this);return !!t&&t.setParentContainerFlag}}],[{key:"GetParent",value:function(t){return P(t)}}]),o}(m);Object.assign(Wt.prototype,Gt); /** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ var Bt={enableData:function(){return void 0===this.data&&(this.data={}),this},setData:function(t,e){if(this.enableData(),1===arguments.length){var i=t;for(t in i)this.data[t]=i[t];}else this.data[t]=e;return this},getData:function(t,e){return this.enableData(),void 0===t?this.data:function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,s=i,o=0;o<n.length;o++){if(!r.hasOwnProperty(n[o])){s=i;break}s=r[n[o]],r=r[n[o]];}return s}return i}return i}(this.data,t,e)},incData:function(t,e,i){return void 0===i&&(i=0),this.enableData(),this.setData(t,this.getData(t,i)+e),this},mulData:function(t,e,i){return void 0===i&&(i=0),this.enableData(),this.setData(t,this.getData(t,i)*e),this},clearData:function(){return this.data&&Lt(this.data),this}},Ut=Phaser.Display.Align,Nt={center:Ut.CENTER,left:Ut.LEFT_CENTER,right:Ut.RIGHT_CENTER,top:Ut.TOP_CENTER,bottom:Ut.BOTTOM_CENTER,"left-top":Ut.TOP_LEFT,"top-left":Ut.TOP_LEFT,"left-center":Ut.LEFT_CENTER,"center-left":Ut.LEFT_CENTER,"left-bottom":Ut.BOTTOM_LEFT,"bottom-left":Ut.BOTTOM_LEFT,"center-top":Ut.TOP_CENTER,"top-center":Ut.TOP_CENTER,"center-center":Ut.CENTER,"center-bottom":Ut.BOTTOM_CENTER,"bottom-center":Ut.BOTTOM_CENTER,"right-top":Ut.TOP_RIGHT,"top-right":Ut.TOP_RIGHT,"right-center":Ut.RIGHT_CENTER,"center-right":Ut.RIGHT_CENTER,"right-bottom":Ut.BOTTOM_RIGHT,"bottom-right":Ut.BOTTOM_RIGHT},zt=function(){function t(i,n){e(this,t),this.container=null,this._deltaHeight=0,this.setParent(i);}return n(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Nt[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(zt.prototype,Bt);var Zt=function(){function t(){e(this,t),this.items=[];}return n(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}(),Jt=Phaser.Utils.Objects.GetValue,qt=Phaser.Utils.Array.SpliceOne,$t=function(){function t(i,n){e(this,t),this.parent=i,this.cells=[],this.cellPool=new Zt,this.resetFromJSON(n);}return n(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(Jt(t,"cellsCount",0)),this.setColumnCount(Jt(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i<t;i++)e[i]=null;return this}},{key:"insertNewCells",value:function(t,e){var i=this.cells;if(t===i.length){var n=t+e;i.legth=n;for(var r=t;r<n;r++)i[r]=null;}else {var s,o=[];o.length=e;for(r=0;r<e;r++)o[r]=null;(s=this.cells).splice.apply(s,[t,0].concat(o));}return this.resetTotalRowsHeight(),this}},{key:"removeCells",value:function(t,e){for(var i=t+e,n=t;n<i;n++)this.freeCell(n);return i===this.cells.length?this.cells.length=t:(1===e?qt(this.cells,t):this.cells.splice(t,e),this.buildCellIndex(t)),this.resetTotalRowsHeight(),this}},{key:"setColumnCount",value:function(t){return this.colCount=t,this.resetTotalRowsHeight(),this}},{key:"rowCount",get:function(){return Math.ceil(this.cells.length/this.colCount)}},{key:"cellsCount",get:function(){return this.cells.length}},{key:"isValidCellIdx",value:function(t){return t>=0&&t<this.cells.length}},{key:"heightToRowIndex",value:function(t,e){if(void 0===e&&(e=0),0===t)return 0;if(this.defaultCellHeightMode){var i=t/this.defaultCellHeight;if(1===e)i=Math.ceil(i);else i=Math.floor(i);return i}var n,r=this.rowCount,s=t;for(i=0;;){if(n=i>=0&&i<r,!((s-=this.getRowHeight(i))>0&&n)){if(0===s)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i<r)||(i=o);}return i}i+=1;}}},{key:"widthToColIndex",value:function(t,e){if(0===t)return 0;var i=t/this.defaultCellWidth;return i=e?Math.ceil(i):Math.floor(i)}},{key:"colRowToCellIndex",value:function(t,e){return t>=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,r=0;r<e;r++)n<(i=this.getCellHeight(this.colRowToCellIndex(r,t)))&&(n=i);return n}},{key:"getColWidth",value:function(t){return this.defaultCellWidth}},{key:"getCellHeight",value:function(t){if(!this.isValidCellIdx(t))return 0;var e;if(this.defaultCellHeightMode)e=this.defaultCellHeight;else {var i=this.getCell(t,!1),n=i?i.deltaHeight:0;e=this.defaultCellHeight+n;}return e}},{key:"resetTotalRowsHeight",value:function(){this._totalRowsHeight=null;}},{key:"totalRowsHeight",get:function(){return null===this._totalRowsHeight&&(this._totalRowsHeight=this.rowIndexToHeight(0,this.rowCount-1)),this._totalRowsHeight}},{key:"totalColumnWidth",get:function(){return this.colCount*this.defaultCellWidth}},{key:"cellIndxeToColIndex",value:function(t){return t%this.colCount}},{key:"cellIndxeToRowIndex",value:function(t){return Math.floor(t/this.colCount)}},{key:"getCell",value:function(t,e){if(!this.isValidCellIdx(t))return null;if(void 0===e&&(e=!0),null===this.cells[t]&&e){var i=this.newCell(t);this.cells[t]=i;}return this.cells[t]}},{key:"newCell",value:function(t){var e=this.cellPool.pop();return null===e?e=new zt(this):e.setParent(this),e.index=t,e}},{key:"buildCellIndex",value:function(t){void 0===t&&(t=0);for(var e,i=this.cells,n=t,r=i.length;n<r;n++)(e=i[n])&&(e.index=n);return this}},{key:"getParentContainer",value:function(){return this.parent}},{key:"freeCell",value:function(t){return "number"==typeof t&&(t=this.cells[t]),t?(t.destroy(),this.cellPool.push(t),this):this}}]),t}(),Kt=function(t){return t.hasOwnProperty("geometryMask")?t.geometryMask:t.bitmapMask},Qt=Phaser.Geom.Intersects.RectangleToRectangle,te=Phaser.Geom.Rectangle.Overlaps,ee=function(t){if(!t.displayList)return !1;for(;;){var e=t.rexContainer;if(e){if(e.visible){var i=e.parent;if(i){t=i;continue}return !0}return !1}return t.visible}},ie=function(t,e){var i=e.top,n=e.bottom,r=e.left,s=e.right,o=0;return o+=t.contains(r,i)?1:0,o+=t.contains(r,n)?1:0,o+=t.contains(s,i)?1:0,o+=t.contains(s,n)?1:0},ne=function(t,e,i){e.hasOwnProperty("isRexContainerLite")?(e.syncChildrenEnable=!1,t.setChildMaskVisible(e,!0),e.syncChildrenEnable=!0):(e.clearMask&&e.clearMask(),t.setChildMaskVisible(e,!0));},re=function(t,e,i){e.hasOwnProperty("isRexContainerLite")?(e.syncChildrenEnable=!1,t.setChildMaskVisible(e,!0),e.syncChildrenEnable=!0):(e.setMask&&e.setMask(i),t.setChildMaskVisible(e,!0));},se=function(t,e,i){e.hasOwnProperty("isRexContainerLite")?(e.syncChildrenEnable=!1,t.setChildMaskVisible(e,!1),e.syncChildrenEnable=!0):(e.clearMask&&e.clearMask(),t.setChildMaskVisible(e,!1));},oe=function(t,e,i,n,r){if(this.clear().fillStyle(16777215),1===this.shapeType){i=i.left;var s=Math.min(t,e)/2;this.fillCircle(-t*(n-.5),-e*(r-.5),s+i);}else this.fillRect(-t*n-i.left,-e*r-i.top,t+i.left+i.right,e+i.top+i.bottom);},le=Phaser.Utils.Objects.GetValue,ae=function(t,e){return void 0===t&&(t=0),void 0===e&&(e={}),"number"==typeof t?(e.left=t,e.right=t,e.top=t,e.bottom=t):(e.left=le(t,"left",0),e.right=le(t,"right",0),e.top=le(t,"top",0),e.bottom=le(t,"bottom",0)),e},he=function(t){r(o,t);var i=a(o);function o(t,n,r){var s;return e(this,o),void 0===n&&(n=0),"string"==typeof n&&(n=ue[n]),(s=i.call(this,t.scene)).parent=t,s.shapeType=n,s.padding=ae(r),s.setPosition().resize().setVisible(!1),s}return n(o,[{key:"destroy",value:function(){return this.parent=void 0,u(s(o.prototype),"destroy",this).call(this),this}},{key:"setPosition",value:function(t,e){var i=this.parent;return void 0===t&&(t=i.x),void 0===e&&(e=i.y),u(s(o.prototype),"setPosition",this).call(this,t,e),this}},{key:"resize",value:function(t,e,i){var n=this.parent;void 0===t&&(t=n.width),void 0===e&&(e=n.height),void 0===i?i=this.padding:"number"==typeof i&&(i=ae(i));var r=this.width!==t||this.height!==e,s=this.padding!==i&&!function(t,e){for(var i in t){if(!(i in e))return !1;if(t[i]!==e[i])return !1}for(var i in e)if(!(i in t))return !1;return !0}(this.padding,i);return r||s?(this.width=t,this.height=e,s&&St(i,this.padding),this.originX=n.originX,this.originY=n.originY,oe.call(this,t,e,i,n.originX,n.originY),this):this}},{key:"setOrigin",value:function(t,e){void 0===e&&(e=t);var i=this.parent;return void 0===t&&(t=i.originX),void 0===e&&(e=i.originY),this.originX===t&&this.originY===e||(this.originX=t,this.originY=e,oe.call(this,this.width,this.height,this.padding,t,e)),this}}]),o}(Phaser.GameObjects.Graphics),ue={rectangle:0,circle:1},ce=function(t,e,i,n){var r=new he(e,i,n);if(t&&!t.isRexSizer){var s=r.createGeometryMask();t.setMask(s),this.once("destroy",(function(){t.setMask(),s.destroy();}));}return this.pin(r),r},de=Phaser.Utils.Objects.GetValue,fe={update:0,everyTick:1},ye={setupChildrenMask:function(t){return !1===t||(this.setMaskUpdateMode(de(t,"updateMode",0)),this.enableChildrenMask(de(t,"padding",0)),this.setMaskLayer(de(t,"layer",void 0)),this.startMaskUpdate()),this},destroyChildrenMask:function(){return this.childrenMask?(this.stopMaskUpdate(),this.childrenMask.destroy(),this.childrenMask=void 0,this):this},setMaskUpdateMode:function(t){return "string"==typeof t&&(t=fe[t]),this.maskUpdateMode=t,this},startMaskUpdate:function(){this.scene.game.events.on("poststep",this.maskChildren,this);},stopMaskUpdate:function(){this.scene.game.events.off("poststep",this.maskChildren,this);},enableChildrenMask:function(t){var e=ce.call(this,null,this,0,t);return this.childrenMask=e.createGeometryMask(),this},setMaskChildrenFlag:function(t){return void 0===t&&(t=!0),this.maskChildrenFlag=t,this},setMaskLayer:function(t){return this.maskLayer=t,this},maskChildren:function(){return this.childrenMask&&this.maskChildrenFlag&&0!==this.alpha&&this.visible?(this.privateRenderLayer?this.privateRenderLayer.setMask(this.childrenMask):this.maskLayer?(this.addToLayer(this.maskLayer),this.maskLayer.setMask(this.childrenMask)):function(t,e,i){if(e){void 0===i&&(i=t.getAllChildren());for(var n,r,s=t.getBounds(),o=Kt(e),l=0,a=i.length;l<a;l++)if((n=i[l])!==o&&ee(n))if(n.getBounds)switch(r=n.getBounds(r),ie(s,r)){case 4:ne(t,n);break;case 0:Qt(s,r)||te(s,r)?re(t,n,e):se(t,n);break;default:re(t,n,e);}else re(t,n,e);}}(this,this.childrenMask),0===this.maskUpdateMode&&(this.maskChildrenFlag=!1),this):this},layoutChildrenMask:function(){if(!this.childrenMask)return this;var t=Kt(this.childrenMask);return t.setPosition().resize(),this.resetChildPositionState(t),this}},ve=function(){},pe=new Phaser.GameObjects.Zone({sys:{queueDepthSort:ve,events:{once:ve}}},0,0,1,1);pe.setOrigin(0);var ge=0,Ce=1,be=2,ke=4,me=6,Te=8,xe=10,Pe=12,Oe=function(t){var e=vt(t);return t.y+e-e*t.originY},we=function(t){var e=yt(t);return t.x-e*t.originX+.5*e},Re=function(t,e){var i=vt(t);return t.y=e-i+i*t.originY,t},Me=function(t,e){var i=yt(t),n=i*t.originX;return t.x=e+n-.5*i,t},Le=function(t){var e=yt(t);return t.x-e*t.originX},Se=function(t,e){var i=yt(t);return t.x=e+i*t.originX,t},Ae=function(t){var e=yt(t);return t.x+e-e*t.originX},Ye=function(t,e){var i=yt(t);return t.x=e-i+i*t.originX,t},Xe=function(t,e){var i=vt(t),n=i*t.originY;return t.y=e+n-.5*i,t},He=function(t){var e=vt(t);return t.y-e*t.originY+.5*e},_e=function(t){var e=vt(t);return t.y-e*t.originY},Ee=function(t,e){var i=vt(t);return t.y=e+i*t.originY,t},Ve=[];Ve[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Me(t,we(e)+i),Re(t,Oe(e)+n),t},Ve[xe]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Se(t,Le(e)-i),Re(t,Oe(e)+n),t},Ve[Pe]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Ye(t,Ae(e)+i),Re(t,Oe(e)+n),t},Ve[me]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){Me(t,e),Xe(t,i);}(t,we(e)+i,He(e)+n),t},Ve[ke]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Se(t,Le(e)-i),Xe(t,He(e)+n),t},Ve[Te]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Ye(t,Ae(e)+i),Xe(t,He(e)+n),t},Ve[Ce]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Me(t,we(e)+i),Ee(t,_e(e)-n),t},Ve[ge]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Se(t,Le(e)-i),Ee(t,_e(e)-n),t},Ve[be]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Ye(t,Ae(e)+i),Ee(t,_e(e)-n),t};var je=function(t,e,i,n,r,s){pe.setPosition(e,i).setSize(n,r),function(t,e,i,n,r){Ve[i](t,e,n,r);}(t,pe,s);},Fe=function(t){var e,i=null;((e=t.getContainer())?(i=e,t.popContainer()):this.cellContainersPool&&null!==(i=this.cellContainersPool.getFirstDead())&&i.setActive(!0).setVisible(!0),this.emit("cellvisible",t,i,this),this.cellContainersPool)&&((e=t.getContainer())?null===i?this.cellContainersPool.add(e):i!==e&&(this.cellContainersPool.add(e),this.cellContainersPool.killAndHide(i)):null!==i&&this.cellContainersPool.killAndHide(i));},De=function(t){if(this.emit("cellinvisible",t),this.cellContainersPool){var e=t.popContainer();e&&this.cellContainersPool.killAndHide(e);}t.destroyContainer();},Ie=function(){var t=this.preVisibleCells;this.preVisibleCells=this.visibleCells,this.visibleCells=t,this.visibleCells.clear();},Ge=function(t,e){e-=this.y+this.topLeftY,t-=this.x+this.topLeftX;var i=this.tableOY-(0===this.scrollMode?e:t),n=this.tableOX-(0===this.scrollMode?t:e),r=this.table,s=r.heightToRowIndex(-i,0),o=r.widthToColIndex(-n),l=r.colRowToCellIndex(o,s);return null===l?null:this.isCellVisible(l)?l:null},We=Phaser.Math.Clamp,Be={setTableOY:function(t){var e=this.table,i=this.topTableOY,n=this.bottomTableOY,r=t>this.topTableOY,s=t<this.bottomTableOY;this.clampTableOXY&&(e.rowCount<e.heightToRowIndex(this.instHeight,1)?t=0:r?t=i:s&&(t=n));return this._tableOY!==t&&(this._tableOY=t),r&&(this.execeedTopState||this.emit("execeedtop",this,t,i)),this.execeedTopState=r,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,n)),this.execeedBottomState=s,this},setTableOX:function(t){var e=this.table,i=this.leftTableOX,n=this.rightTableOX,r=t>this.leftTableOX,s=t<this.rightTableOX;this.clampTableOXY&&(e.colCount<e.widthToColIndex(this.instWidth,!0)?t=0:r?t=i:s&&(t=n));return this._tableOX!==t&&(this._tableOX=t),r&&(this.execeedLeftState||this.emit("execeedleft",this,t,i)),this.execeedLeftState=r,s&&(this.execeedRightState||this.emit("execeedright",this,t,n)),this.execeedRightState=s,this},showCells:function(){if(0!==this.cellsCount){var t=this.table;this.startRowIndex=Math.max(t.heightToRowIndex(-this.tableOY,2),0);for(var e=this.startRowIndex,i=Math.max(t.widthToColIndex(-this.tableOX),0),n=i,r=t.colRowToCellIndex(n,e),s=this.bottomBound,o=this.rightBound,l=t.cellsCount-1,a=t.colCount-1,h=this.getCellTLX(n),u=h,c=this.getCellTLY(e);c<s&&r<=l;){if(this.table.isValidCellIdx(r)){var d,f,y=t.getCell(r,!0);if(this.visibleCells.set(y),this.preVisibleCells.contains(y)||this.showCell(y),0===this.scrollMode?(d=u,f=c):(d=c,f=u),null==y.cellContainerAlign)y.setXY(d,f);else {var v=y.getContainer();je(v,d,f,y.width,y.height,y.cellContainerAlign),y.setXY(v.x,v.y);}}u<o&&n<a?(u+=t.getColWidth(n),n+=1):(u=h,c+=t.getRowHeight(e),n=i,e+=1),r=t.colRowToCellIndex(n,e);}}},showCell:Fe,getCellTLX:function(t){var e=0===this.scrollMode?this.topLeftX:this.topLeftY;return this.tableOX+this.table.colIndexToWidth(0,t-1)+e},getCellTLY:function(t){var e=0===this.scrollMode?this.topLeftY:this.topLeftX;return this.tableOY+this.table.rowIndexToHeight(0,t-1)+e},hideCells:function(){var t=this.preVisibleCells,e=this.visibleCells;t.iterate((function(t){e.contains(t)||this.hideCell(t);}),this);},hideCell:De,updateTable:function(t){return void 0===t&&(t=!1),t&&(Ie.call(this),this.hideCells()),Ie.call(this),this.showCells(),this.hideCells(),this.setMaskChildrenFlag(),this},isCellVisible:function(t){var e=this.table.getCell(t,!1);return e&&this.visibleCells.contains(e)},pointToCellIndex:Ge,pointToCellContainer:function(t,e){var i=Ge.call(this,t,e);if(null!==i)return this.getCellContainer(i)},eachVisibleCell:function(t,e){return this.visibleCells.each(t,e),this},iterateVisibleCell:function(t,e){return this.visibleCells.iterate(t,e),this},eachCell:function(t,e){return this.table.cells.slice().forEach(t,e),this},iterateCell:function(t,e){return this.table.cells.forEach(t,e),this},setCellsCount:function(t){var e=this.cellsCount;return e===t||(e>t?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(e,i){return "object"===t(e)&&(e=e.index),void 0===i&&(i=1),i<=0||(e=We(e,0,this.cellsCount),this.table.insertNewCells(e,i)),this},removeCells:function(e,i){if("object"===t(e)&&(e=e.index),void 0===i&&(i=1),e<0&&(i+=e,e=0),i<=0)return this;if(e>this.cellsCount)return this;for(var n,r=e,s=e+i;r<s;r++)(n=this.getCell(r,!1))&&(this.visibleCells.contains(n)&&(De.call(this,n),this.visibleCells.delete(n)),this.preVisibleCells.delete(n));return this.table.removeCells(e,i),this},setColumnCount:function(t){return this.table.colCount===t||this.table.setColumnCount(t),this},setGridSize:function(t,e){return this.setCellsCount(t*e),this.table.setColumnCount(t),this},updateVisibleCell:function(t){var e=this.table.getCell(t,!1);return e&&e.container?(Fe.call(this,e),this):this}};Object.assign(Be,ye);var Ue=Phaser.GameObject