text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rexgridtable=e():t.rexgridtable=e()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var l=e[s]={i:s,l:!1,exports:{}};return t[s].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var l in t)i.d(s,l,function(e){return t[e]}.bind(null,l));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=203)}({11:function(t,e,i){"use strict";var s=class{constructor(){this.items=[]}pop(){return this.items.length>0?this.items.pop():null}push(t){this.items.push(t)}pushMultiple(t){for(var e=0,i=t.length;e<i;e++)this.items.push(t[e]);t.length=0}};e.a=s},203:function(t,e,i){"use strict";i.r(e);var s=i(65);const l=Phaser.Utils.Objects.GetValue,h=Phaser.GameObjects.BuildGameObject;Phaser.GameObjects.GameObjectFactory.register("rexGridTable",function(t,e,i,l,h){var r=new s.a(this.scene,t,e,i,l,h);return this.displayList.add(r),r}),Phaser.GameObjects.GameObjectCreator.register("rexGridTable",function(t){var e=l(t,"width",256),i=l(t,"height",256),r=new s.a(this.scene,0,0,e,i,t);return r.syncChildrenEnable=!1,h(this.scene,r,t),r.syncChildrenEnable=!0,r.syncPosition().syncVisible().syncAlpha(),r}),e.default=s.a},28:function(t,e,i){"use strict";const s=Phaser.GameObjects.Zone,l=Phaser.GameObjects.Components,h=Phaser.Math.RotateAround,r=Phaser.Utils.Array;class n extends s{constructor(t,e,i,s,l,h){Array.isArray(s)&&(h=s,s=void 0),void 0===s&&(s=2),void 0===l&&(l=2),super(t,e,i,s,l),this.children=t.add.group(),this.type="rexContainerLite",this.isRexContainerLite=!0,this.syncChildrenEnable=!0,this._flipX=!1,this._flipY=!1,this._alpha=1,this._mask=null,this._scrollFactorX=1,this._scrollFactorY=1,h&&this.add(h)}destroy(t){this.scene&&(this.children.destroy(!0),this.children=void 0,super.destroy(t))}add(t){return Array.isArray(t)?this.addMultiple(t):this._add(t),this}addMultiple(t){return t.forEach(this._add,this),this}remove(t){return this.children.remove(t),this}clear(){return this.children.clear(),this}getChildren(){return this.children.getChildren()}getAllChildren(t){void 0===t&&(t=[]);for(var e,i=this.children.getChildren(),s=0,l=i.length;s<l;s++)e=i[s],t.push(e),e.hasOwnProperty("isRexContainerLite")&&t.push(...e.getAllChildren());return t}contains(t){if(this.children.contains(t))return!0;for(var e,i=this.children.getChildren(),s=0,l=i.length;s<l;s++)if((e=i[s]).isRexContainerLite&&e.contains(t))return!0;return!1}worldToLocal(t){return t.x-=this.x,t.y-=this.y,h(t,0,0,-this.rotation),t.x/=this.scaleX,t.y/=this.scaleY,t.x*=this.flipX?-1:1,t.y*=this.flipY?-1:1,t}localToWorld(t){return t.x*=this.flipX?-1:1,t.y*=this.flipY?-1:1,t.x*=this.scaleX,t.y*=this.scaleY,h(t,0,0,this.rotation),t.x+=this.x,t.y+=this.y,t}updateChildPosition(t){t.isRexContainerLite&&(t.syncChildrenEnable=!1);var e=this.getLocalState(t);return t.x=e.x,t.y=e.y,this.localToWorld(t),t.scaleX=e.scaleX*this.scaleX,t.scaleY=e.scaleY*this.scaleY,void 0!==t.flipX&&(t.flipX=this.flipX?!e.flipX:e.flipX,t.flipY=this.flipY?!e.flipY:e.flipY),t.rotation=e.rotation+this.rotation,t.isRexContainerLite&&(t.syncChildrenEnable=!0,t.syncPosition()),this}updateChildVisible(t){return t.visible=this.visible&&this.getLocalState(t).visible,this}updateChildAlpha(t){return t.alpha=this.alpha*this.getLocalState(t).alpha,this}updateChildMask(t){return null==this.mask?this:((this.mask.hasOwnProperty("geometryMask")?this.mask.geometryMask:this.mask.bitmapMask)!==t&&(t.mask=this.mask),this)}updateChildScrollFactor(t){return t.setScrollFactor(this.scrollFactorX,this.scrollFactorY),this}syncPosition(){return this.children&&this.syncChildrenEnable&&this.children.getChildren().forEach(this.updateChildPosition,this),this}syncVisible(){return this.children&&this.syncChildrenEnable&&this.children.getChildren().forEach(this.updateChildVisible,this),this}syncAlpha(){return this.children&&this.syncChildrenEnable&&this.children.getChildren().forEach(this.updateChildAlpha,this),this}syncMask(){return this.children&&this.syncChildrenEnable&&this.children.getChildren().forEach(this.updateChildMask,this),this}syncScrollFactor(){return this.children&&this.syncChildrenEnable&&this.children.getChildren().forEach(this.updateChildScrollFactor,this),this}syncProperties(){return this.syncPosition().syncVisible().syncAlpha().syncMask(),this}getLocalState(t){return t.hasOwnProperty("rexContainer")||(t.rexContainer={}),t.rexContainer}resetChildState(t){return this.resetChildPositionState(t).resetChildVisibleState(t).resetChildAlphaState(t),this}resetChildrenState(t){for(var e=0,i=t.length;e<i;e++)this.resetChildState(t[e]);return this}resetChildPositionState(t){var e=this.getLocalState(t);return e.x=t.x,e.y=t.y,this.worldToLocal(e),e.scaleX=a(t.scaleX,this.scaleX),e.scaleY=a(t.scaleY,this.scaleY),void 0!==t.flipX&&(e.flipX=t.flipX,e.flipY=t.flipY),e.rotation=t.rotation-this.rotation,this}resetChildVisibleState(t){return this.getLocalState(t).visible=t.visible,this}resetChildAlphaState(t){return this.getLocalState(t).alpha=a(t.alpha,this.alpha),this}setChildLocalPosition(t,e,i){var s=this.getLocalState(t);return s.x=e,s.y=i,this.updateChildPosition(t),this}setChildLocalVisible(t,e){return void 0===e&&(e=!0),this.getLocalState(t).visible=e,this.updateChildVisible(t),this}setChildLocalAlpha(t,e){return this.getLocalState(t).alpha=a(t.alpha,this.alpha),this.updateChildAlpha(t),this}_add(t){return this.children.add(t),this.resetChildState(t).updateChildVisible(t).updateChildScrollFactor(t).updateChildMask(t),this}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.syncPosition())}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.syncPosition())}get rotation(){return super.rotation}set rotation(t){this.rotation!==t&&(super.rotation=t,this.syncPosition())}get scaleX(){return super.scaleX}set scaleX(t){this.scaleX!==t&&(super.scaleX=t,this.syncPosition())}get scaleY(){return super.scaleY}set scaleY(t){this.scaleY!==t&&(super.scaleY=t,this.syncPosition())}get flipX(){return this._flipX}set flipX(t){this._flipX!==t&&(this._flipX=t,this.syncPosition())}get flipY(){return this._flipY}set flipY(t){this._flipY!==t&&(this._flipY=t,this.syncPosition())}get visible(){return super.visible}set visible(t){this.visible!==t&&(super.visible=t,this.syncVisible())}get alpha(){return this._alpha}set alpha(t){this._alpha!==t&&(this._alpha=t,this.syncAlpha())}get mask(){return this._mask}set mask(t){this._mask!==t&&(this._mask=t,this.syncMask())}setMask(t){return this.mask=t,this}clearMask(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this}get scrollFactorX(){return this._scrollFactorX}set scrollFactorX(t){this._scrollFactorX!==t&&(this._scrollFactorX=t,this.syncScrollFactor())}get scrollFactorY(){return this._scrollFactorY}set scrollFactorY(t){this._scrollFactorY!==t&&(this._scrollFactorY=t,this.syncScrollFactor())}get list(){return this.children.getChildren()}getByName(t){return r.GetFirst(this.list,"name",t)}getRandom(t,e){return r.GetRandom(this.list,t,e)}getFirst(t,e,i,s){return r.GetFirstElement(this.list,t,e,i,s)}getAll(t,e,i,s){return r.GetAll(this.list,t,e,i,s)}count(t,e,i,s){return r.CountAllMatching(this.list,t,e,i,s)}swap(t,e){return r.Swap(this.list,t,e),this}moveTo(t,e){return r.MoveTo(this.list,t,e),this}setAll(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this}resize(t,e){return this.setSize(t,e),this.updateDisplayOrigin(),this}}Object.assign(n.prototype,l.Alpha,l.Flip);var a=function(t,e){return t===e?1:t/e};e.a=n},42:function(t,e,i){"use strict";e.a=function(t,e,i){!t||void 0===e&&void 0===i||(t.resize?(void 0===e&&(e=t.width),void 0===i&&(i=t.height),t.resize(e,i)):(void 0!==e&&(t.displayWidth=e),void 0!==i&&(t.displayHeight=i)))}},45:function(t,e,i){"use strict";e.a=function(t){return t.hasOwnProperty("geometryMask")?t.geometryMask:t.bitmapMask}},46:function(t,e,i){"use strict";const s=Phaser.GameObjects.Graphics;const l={rectangle:0,circle:1};e.a=class extends s{constructor(t,e,i){void 0===e&&(e=0),"string"==typeof e&&(shaep=l[e]),void 0===i&&(i=0),super(t.scene),this.parent=t,this.shape=e,this.padding=i,this.setPosition().resize()}destroy(){return this.parent=void 0,super.destroy(),this}setPosition(t,e){var i=this.parent;return void 0===t&&(t=i.x),void 0===e&&(e=i.y),super.setPosition(t,e),this}resize(t,e,i){var s=this.parent;if(void 0===t&&(t=s.width),void 0===e&&(e=s.height),void 0===i&&(i=this.padding),this.widthSave===t&&this.heightSave===e&&this.paddingSave===i)return this;switch(this.clear().fillStyle(16777215),this.shape){case 1:var l=Math.min(t,e)/2;this.fillCircle(0,0,l+i);break;default:this.fillRect(-t*s.originX-i,-e*s.originY-i,t+2*i,e+2*i)}return this.widthSave=t,this.heightSave=e,this.paddingSave=i,this}}},5:function(t,e,i){"use strict";e.a=function(t){if(Array.isArray(t))t.length=0;else for(var e in t)delete t[e]}},65:function(t,e,i){"use strict";var s=i(28),l=i(5);var h=class{constructor(t,e){this.container=null,this.data=null,this.setParent(t),this._deltaHeight=0}setParent(t){this.parent=t,this.parentContainer=t.getParentContainer()}destroy(){var t=this.parent;0!==this.deltaHeight&&t.nonZeroDeltaHeightCount--,this.cleanData(),this.destroyContainer(),this.parent=void 0,this.parentContainer=void 0}get table(){return this.parent}get scrollMode(){return this.parentContainer.scrollMode}get colIndx(){return this.parent.cellIndxeToColIndex(this.index)}get rowIndx(){return this.parent.cellIndxeToRowIndex(this.index)}getContainer(){return this.container}setContainer(t){return this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this}destroyContainer(){this.container&&(this.container.destroy(),this.container=null)}popContainer(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}setXY(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}setData(t,e){return this.data||(this.data={}),this.data[t]=e,this}getData(t,e){this.data||(this.data={});var i=this.data;return i.hasOwnProperty(t)?i[t]:e}cleanData(){this.data&&Object(l.a)(this.data)}get deltaHeight(){return this._deltaHeight}set deltaHeight(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--,this._deltaHeight=t}setDeltaHeight(t){return this.deltaHeight=t,this}get height(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth}set height(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight)}setHeight(t){return this.height=t,this}get width(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight}set width(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight)}setWidth(t){return this.width=t,this}get scene(){return this.parentContainer.scene}},r=i(11);const n=Phaser.Utils.Objects.GetValue,a=Phaser.Utils.Array.SpliceOne;var o=new r.a;var d=class{constructor(t,e){this.parent=t,this.cells=[],this.resetFromJSON(e)}resetFromJSON(t){return this.colCount=void 0,this._nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight(),this.setDefaultCellHeight(n(t,"cellHeight",30)),this.setDefaultCellWidth(n(t,"cellWidth",30)),this.initCells(n(t,"cellsCount",0)),this.setColumnCount(n(t,"columns",1)),this}destroy(){for(var t=0,e=this.cells.length;t<e;t++)this.freeCell(this.cells[t]);this.cells=void 0,this.parent=void 0}get nonZeroDeltaHeightCount(){return this._nonZeroDeltaHeightCount}set nonZeroDeltaHeightCount(t){this._nonZeroDeltaHeightCount!==t&&(this._nonZeroDeltaHeightCount=t,this.resetTotalRowsHeight())}get defaultCellHeightMode(){return 0===this.nonZeroDeltaHeightCount}setDefaultCellHeight(t){return this.defaultCellHeight=t,this}setDefaultCellWidth(t){return this.defaultCellWidth=t,this}initCells(t){var e=this.cells;e.length=t;for(var i=0;i<t;i++)e[i]=null;return this}insertNewCell(t,e){var i=this.cells;if(t===i.length){var s=t+e;i.legth=s;for(var l=t;l<s;l++)i[l]=null}else{var h=[];for(h.length=e,l=0;l<e;l++)h[l]=null;this.cells.splice(t,0,...h)}return this.resetTotalRowsHeight(),this}removeCell(t,e){for(var i=t+e,s=t;s<i;s++)this.freeCell(s);return i===this.cells.length?this.cells.length=t:(1===e?a(this.cells,t):this.cells.splice(t,e),this.buildCellIndex(t)),this.resetTotalRowsHeight(),this}setColumnCount(t){return this.colCount=t,this.resetTotalRowsHeight(),this}get rowCount(){return Math.ceil(this.cells.length/this.colCount)}get cellsCount(){return this.cells.length}isValidCellIdx(t){return t>=0&&t<this.cells.length}heightToRowIndex(t,e){if(this.defaultCellHeightMode){var i=t/this.defaultCellHeight;return i=e?Math.ceil(i):Math.floor(i)}var s,l=this.rowCount,h=t;for(i=0;;){if(h-=this.getRowHeight(i),s=i>=0&&i<l,!(h>0&&s)){if(0===h)return i;if(e){var r=i;(s=(i+=1)>=0&&i<l)||(i=r)}return i}i+=1}}widthToColIndex(t,e){var i=t/this.defaultCellWidth;return i=e?Math.ceil(i):Math.floor(i)}colRowToCellIndex(t,e){return t>=this.colCount?null:e*this.colCount+t}rowIndexToHeight(t,e){if(this.defaultCellHeightMode)return(e-t+1)*this.defaultCellHeight;for(var i=0,s=t;s<=e;s++)i+=this.getRowHeight(s);return i}colIndexToWidth(t,e){return(e-t+1)*this.defaultCellWidth}getRowHeight(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,s=0,l=0;l<e;l++)s<(i=this.getCellHeight(this.colRowToCellIndex(l,t)))&&(s=i);return s}getColWidth(t){return this.defaultCellWidth}getCellHeight(t){if(!this.isValidCellIdx(t))return 0;var e;if(this.defaultCellHeightMode)e=this.defaultCellHeight;else{var i=this.getCell(t,!1),s=i?i.deltaHeight:0;e=this.defaultCellHeight+s}return e}resetTotalRowsHeight(){this._totalRowsHeight=null}get totalRowsHeight(){return null===this._totalRowsHeight&&(this._totalRowsHeight=this.rowIndexToHeight(0,this.rowCount-1)),this._totalRowsHeight}get totalColumnWidth(){return this.colCount*this.defaultCellWidth}cellIndxeToColIndex(t){return t%this.colCount}cellIndxeToRowIndex(t){return Math.floor(t/this.colCount)}getCell(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]}newCell(t){var e=o.pop();return null===e?e=new h(this):e.setParent(this),e.index=t,e}buildCellIndex(t){void 0===t&&(t=0);for(var e,i=this.cells,s=t,l=i.length;s<l;s++)(e=i[s])&&(e.index=s);return this}getParentContainer(){return this.parent}freeCell(t){return"number"==typeof t&&(t=this.cells[t]),t?(t.destroy(),o.push(t),this):this}},c=i(46),u=i(42),g=i(45),C=i(89);const b=s.a,p=Phaser.GameObjects.Components,f=Phaser.Structs.Set,v=Phaser.Utils.Objects.GetValue,y=Phaser.Math.Clamp;class x extends b{constructor(t,e,i,s,l,h){void 0===h&&(h={}),super(t,e,i,s,l),this.type="rexGridTable",this._tableOX=0,this._tableOY=0,this.visibleCells=new f,this.preVisibleCells=new f,this.visibleStartX=null,this.visibleEndX=null,this.visibleStartY=null,this.visibleEndY=null,this.lastVisibleCellIdx=null,this.execeedTopState=!1,this.execeedBottomState=!1,this.execeedLeftState=!1,this.execeedRightState=!1;var r=v(h,"cellVisibleCallback",null);if(null!==r){var n=v(h,"cellVisibleCallbackScope",void 0);this.on("cellvisible",r,n)}if(null!==(r=v(h,"cellInvisibleCallback",null))){n=v(h,"cellInvisibleCallbackScope",void 0);this.on("cellinvisible",r,n)}if(this.cellsMask=void 0,this.setCellsMask(v(h,"mask",!0)),this.setScrollMode(v(h,"scrollMode",0)),this.setClampMode(v(h,"clamplTableOXY",!0)),0===this.scrollMode){var a=v(h,"cellWidth",void 0);if(this.expandCellSize=void 0===a,void 0===a){var o=v(h,"columns",1);h.cellWidth=this.width/o}}else{a=v(h,"cellHeight",void 0);var c=v(h,"cellWidth",void 0);this.expandCellSize=void 0===a,h.cellWidth=a,h.cellHeight=c}this.table=new d(this,h),this.updateTable()}destroy(t){this.scene&&(this.setCellsCount(0),this.table.destroy(),this.table=void 0,super.destroy(t))}setScrollMode(t){return"string"==typeof t&&(t=m[t.toLowerCase()]),this.scrollMode=t,this}setClampMode(t){return this.clampTableOXYMode=t,this}setCellsCount(t){var e=this.cellsCount;return e===t?this:(e>t?this.removeCell(t,e-t):this.insertNewCell(e,t-e),this)}setColumnCount(t){return this.table.colCount===t?this:(this.table.setColumnCount(t),this)}setGridSize(t,e){return this.setCellsCount(t*e),this.table.setColumnCount(t),this}insertNewCell(t,e){return"object"==typeof t&&(t=t.index),void 0===e&&(e=1),e<=0?this:(t=y(t,0,this.cellsCount),this.table.insertNewCell(t,e),this)}removeCell(t,e){if("object"==typeof t&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;if(t<=this.lastVisibleCellIdx)for(var i,s=this.preVisibleCells,l=this.visibleCells,h=t,r=t+e;h<r;h++)(i=this.getCell(h,!1))&&(l.contains(i)&&(this.hideCell(i),l.delete(i)),s.delete(i));return this.table.removeCell(t,e),this}get tableOY(){return this._tableOY}get tableOX(){return this._tableOX}set tableOY(t){this.setTableOY(t).updateTable()}set tableOX(t){this.setTableOX(t).updateTable()}setTableOY(t){var e=this.table,i=this.topTableOY,s=this.bottomTableOY,l=this.tableOYExceedTop(t),h=this.tableOYExeceedBottom(t);this.clampTableOXYMode&&(e.rowCount<e.heightToRowIndex(this.instHeight,!0)?t=0:l?t=i:h&&(t=s));return this._tableOY!==t&&(this._tableOY=t),l&&(this.execeedTopState||this.emit("execeedtop",this,t,i)),this.execeedTopState=l,h&&(this.execeedBottomState||this.emit("execeedbottom",this,t,s)),this.execeedBottomState=h,this}setTableOX(t){var e=this.table,i=this.leftTableOX,s=this.rightTableOX,l=this.tableOXExeceedLeft(t),h=this.tableOXExeceedRight(t);this.clampTableOXYMode&&(e.colCount<e.widthToColIndex(this.instWidth,!0)?t=0:l?t=i:h&&(t=s));return this._tableOX!==t&&(this._tableOX=t),l&&(this.execeedLeftState||this.emit("execeedleft",this,t,i)),this.execeedLeftState=l,h&&(this.execeedRightState||this.emit("execeedright",this,t,s)),this.execeedRightState=h,this}setTableOXY(t,e){return this.setTableOY(e).setTableOX(t),this}addTableOY(t){return this.setTableOY(this.tableOY+t),this}addTableOX(t){return this.setTableOX(this.tableOX+t),this}addTableOXY(t,e){return this.addTableOY(e).addTableOX(t),this}setTableOYByPercentage(t){return this.setTableOY(-this.tableVisibleHeight*t),this}getTableOYPercentage(){var t=this.tableVisibleHeight;return 0===t?0:this.tableOY/-t}set t(t){this.setTableOYByPercentage(t).updateTable()}get t(){return this.getTableOYPercentage()}updateTable(t){return t&&(this.clearVisibleCellIndexes(),this.hideCells()),this.clearVisibleCellIndexes(),this.showCells(),this.hideCells(),this.maskCells(),this}getCell(t){return this.table.getCell(t,!0)}getCellContainer(t){var e,i=this.table.getCell(t,!1);return i&&(e=i.getContainer()),e}get cellsCount(){return this.table.cellsCount}get columnCount(){return this.table.colCount}setCellHeight(t,e){return("number"==typeof t?this.table.getCell(t,!0):t).height=e,this}setCellWidth(t,e){return("number"==typeof t?this.table.getCell(t,!0):t).width=e,this}pointerToCellIndex(t,e){e-=this.y+this.topLeftY,t-=this.x+this.topLeftX;var i=this.tableOY-(0===this.scrollMode?e:t),s=this.tableOX-(0===this.scrollMode?t:e),l=this.table,h=l.heightToRowIndex(-i),r=l.widthToColIndex(-s),n=l.colRowToCellIndex(r,h);return null===n?null:this.cellIsVisible(n)?n:null}pointerToCellContainer(t,e){var i=this.pointerToCellIndex(t,e);if(null!==i)return this.getCellContainer(i)}cellIsVisible(t){var e=this.table.getCell(t,!1);return e&&this.visibleCells.contains(e)}eachVisibleCell(t,e){return this.visibleCells.each(t,e),this}iterateVisibleCell(t,e){return this.visibleCells.iterate(t,e),this}setCellsMask(t){var e,i;if(!0===t?(e=!0,i=0):!1===t?e=!1:(e=v(t,"mask",!0),i=v(t,"padding",0)),e){var s=new c.a(this,0,i);this.cellsMask=s.createGeometryMask(),this.add(s)}return this}maskCells(){for(var t,e=[],i=this.visibleCells.entries,s=0,l=i.length;s<l;s++)(t=i[s].getContainer())&&t.getAllChildren(e);Object(C.a)(this,this.cellsMask,e)}resize(t,e){return this.width===t&&this.height===e?this:(super.resize(t,e),this.cellsMask&&Object(u.a)(Object(g.a)(this.cellsMask),t,e),this.expandCellSize&&this.table.setDefaultCellWidth(this.instWidth/this.table.colCount),this.updateTable(!0),this)}clearVisibleCellIndexes(){var t=this.preVisibleCells;this.preVisibleCells=this.visibleCells,this.visibleCells=t,this.visibleCells.clear()}showCells(){if(0!==this.cellsCount){var t=this.table,e=t.heightToRowIndex(-this.tableOY);e<0&&(e=0);var i=t.widthToColIndex(-this.tableOX);i<0&&(i=0);var s=t.colRowToCellIndex(i,e),l=this.bottomBound,h=this.rightBound,r=t.cellsCount-1,n=t.colCount-1,a=this.getTLX(i),o=a,d=this.getTLY(e);for(this.visibleStartY=null,this.visibleEndY=null,this.visibleStartX=null,this.visibleEndX=null,this.lastVisibleCellIdx=null;d<l&&s<=r;){if(this.table.isValidCellIdx(s)){null===this.visibleStartY&&(this.visibleStartY=e,this.visibleEndY=e),null===this.visibleStartX&&(this.visibleStartX=i,this.visibleEndX=i),null===this.lastVisibleCellIdx&&(this.lastVisibleCellIdx=s),this.visibleEndY<e&&(this.visibleEndY=e),this.visibleEndX<i&&(this.visibleEndX=i),this.lastVisibleCellIdx<s&&(this.lastVisibleCellIdx=s);var c=t.getCell(s,!0);this.visibleCells.set(c),this.preVisibleCells.contains(c)||this.showCell(c),0===this.scrollMode?c.setXY(o,d):c.setXY(d,o)}o<h&&i<n?(o+=t.getColWidth(i),i+=1):(o=a,d+=t.getRowHeight(e),i=this.visibleStartX,e+=1),s=t.colRowToCellIndex(i,e)}}}showCell(t){this.emit("cellvisible",t)}hideCells(){var t=this.preVisibleCells,e=this.visibleCells;t.iterate(function(t){e.contains(t)||this.hideCell(t)},this)}hideCell(t){this.emit("cellinvisible",t),t.destroyContainer()}get instHeight(){return 0===this.scrollMode?this.height:this.width}get instWidth(){return 0===this.scrollMode?this.width:this.height}get tableHeight(){return this.table.totalRowsHeight}get tableWidth(){return this.table.totalColumnWidth}get topTableOY(){return 0}get bottomTableOY(){return-this.tableVisibleHeight}get leftTableOX(){return 0}get rightTableOX(){return-this.tableVisibleWidth}tableOYExceedTop(t){return void 0===t&&(t=this.tableOY),t>this.topTableOY}tableOYExeceedBottom(t){return void 0===t&&(t=this.tableOY),t<this.bottomTableOY}tableOXExeceedLeft(t){return void 0===t&&(t=this.tableOX),t>this.leftTableOX}tableOXExeceedRight(t){return void 0===t&&(t=this.tableOX),t<this.rightTableOX}get tableVisibleHeight(){var t=this.tableHeight,e=this.instHeight;return t>e?t-e:0}get tableVisibleWidth(){var t=this.tableWidth,e=this.instWidth;return t>e?t-e:0}get bottomLeftY(){return-this.displayHeight*this.originY+this.displayHeight}get topRightX(){return-this.displayWidth*this.originX+this.displayWidth}get topLeftX(){return-this.displayWidth*this.originX}get topLeftY(){return-this.displayHeight*this.originY}get bottomBound(){return 0===this.scrollMode?this.bottomLeftY:this.topRightX}get rightBound(){return 0===this.scrollMode?this.topRightX:this.bottomLeftY}getTLX(t){var e=0===this.scrollMode?this.topLeftX:this.topLeftY;return this.tableOX+this.table.colIndexToWidth(0,t-1)+e}getTLY(t){var e=0===this.scrollMode?this.topLeftY:this.topLeftX;return this.tableOY+this.table.rowIndexToHeight(0,t-1)+e}}Object.assign(x.prototype,p.GetBounds);const m={v:0,vertical:0,h:1,horizontal:1};e.a=x},89:function(t,e,i){"use strict";var s=i(45);const l=Phaser.Geom.Intersects.RectangleToRectangle,h=Phaser.Geom.Rectangle.Overlaps;var r=function(t,e){var i=0,s=e.top,l=e.bottom,h=e.left,r=e.right;return i+=t.contains(h,s)?1:0,i+=t.contains(h,l)?1:0,i+=t.contains(r,s)?1:0,i+=t.contains(r,l)?1:0},n=function(t,e){t.setVisible(!0).clearMask()},a=function(t,e){t.setVisible(!0).setMask(e)},o=function(t,e){t.setVisible(!1).clearMask()};e.a=function(t,e,i){if(e){void 0===i&&(i=t.getAllChildren());for(var d,c,u=t.getBounds(),g=Object(s.a)(e),C=0,b=i.length;C<b;C++)if(!(d=i[C]).hasOwnProperty("isRexContainerLite")&&d!==g){if(d.getBounds)switch(c=d.getBounds(c),r(u,c)){case 4:n(d,e);break;case 0:l(u,c)||h(u,c)?a(d,e):o(d,e);break;default:a(d,e)}else a(d,e);t.resetChildVisibleState(d).updateChildVisible(d)}}}}}).default});