diff --git a/auto_rx/autorx/static/js/tabulator.min.js b/auto_rx/autorx/static/js/tabulator.min.js index ec6f0f9..516ac0d 100644 --- a/auto_rx/autorx/static/js/tabulator.min.js +++ b/auto_rx/autorx/static/js/tabulator.min.js @@ -1,8 +1,13 @@ -/* Tabulator v3.5.3 (c) Oliver Folkerd */ -"use strict";var _typeof="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};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t,o){!function(){Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],s=0;s"),this.element=t("
"),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField=[],this.scrollLeft=0,this.element.prepend(this.headersElement)};i.prototype.setRowManager=function(t){this.rowManager=t},i.prototype.getElement=function(){return this.element},i.prototype.getHeadersElement=function(){return this.headersElement},i.prototype.scrollHorizontal=function(t){var e=0,o=this.element[0].scrollWidth-this.table.element.innerWidth();this.element.scrollLeft(t),t>o?(e=t-o,this.element.css("margin-left",-e)):this.element.css("margin-left",0),this.scrollLeft=t,this.table.extExists("frozenColumns")&&this.table.extensions.frozenColumns.layout()},i.prototype.setColumns=function(t,e){var o=this;o.headersElement.empty(),o.columns=[],o.columnsByIndex=[],o.columnsByField=[],o.table.extExists("frozenColumns")&&o.table.extensions.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.extExists("responsiveLayout",!0)&&o.table.extensions.responsiveLayout.initialize(),o.redraw(!0)},i.prototype._addColumn=function(t,e,o){var i=new s(t,this),n=o?this.findColumnIndex(o):o;if(o&&n>-1){var a=this.columns.indexOf(o.getTopColumn());e?(this.columns.splice(a,0,i),o.getElement().before(i.getElement())):(this.columns.splice(a+1,0,i),o.getElement().after(i.getElement()))}else e?(this.columns.unshift(i),this.headersElement.prepend(i.getElement())):(this.columns.push(i),this.headersElement.append(i.getElement()));return i},i.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},i.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},i.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},i.prototype._verticalAlignHeaders=function(){var t=this;t.columns.forEach(function(t){t.clearVerticalAlign()}),t.columns.forEach(function(e){e.verticalAlign(t.table.options.columnVertAlign)}),t.rowManager.adjustTableSize()},i.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof s)return t;if(t instanceof n)return t._getSelf()||!1;if(t instanceof jQuery){return e.columns.find(function(e){return e.element===t})||!1}return!1},i.prototype.getColumnByField=function(t){return this.columnsByField[t]},i.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},i.prototype.getColumns=function(){return this.columns},i.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},i.prototype.getRealColumns=function(){return this.columnsByIndex},i.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},i.prototype.getDefinitions=function(t){var e=this,o=[];return e.columnsByIndex.forEach(function(e){(!t||t&&e.visible)&&o.push(e.getDefinition())}),o},i.prototype.getDefinitionTree=function(){var t=this,e=[];return t.columns.forEach(function(t){e.push(t.getDefinition(!0))}),e},i.prototype.getComponents=function(t){var e=this,o=[];return(t?e.columns:e.columnsByIndex).forEach(function(t){o.push(t.getComponent())}),o},i.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},i.prototype.moveColumn=function(t,e,o){this._moveColumnInArray(this.columns,t,e,o),this._moveColumnInArray(this.columnsByIndex,t,e,o,!0),this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved(t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistentLayout&&this.table.extExists("persistence",!0)&&this.table.extensions.persistence.save("columns")},i.prototype._moveColumnInArray=function(t,e,o,i,n){var s,a=t.indexOf(e);a>-1&&(t.splice(a,1),s=t.indexOf(o),s>-1?i&&(s+=1):s=a,t.splice(s,0,e),n&&this.table.rowManager.rows.forEach(function(t){if(t.cells.length){var e=t.cells.splice(a,1)[0];t.cells.splice(s,0,e)}}))},i.prototype.scrollToColumn=function(t,e,o){var i=0,n=0,s=0;if(void 0===e&&(e=this.table.options.scrollToColumnPosition),void 0===o&&(o=this.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":s=-this.element[0].clientWidth/2;break;case"right":s=t.element.innerWidth()-this.headersElement.innerWidth()}return!(!o&&(n=t.element.position().left)>0&&n+t.element.outerWidth()t.rowManager.element.innerHeight()&&(e-=t.rowManager.element[0].offsetWidth-t.rowManager.element[0].clientWidth),this.columnsByIndex.forEach(function(i){var n,s,a;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=a>s?a:s)}),o},i.prototype.addColumn=function(t,e,o){var i=this._addColumn(t,e,o);this._reIndexColumns(),this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.initialize(),this.table.extExists("columnCalcs")&&this.table.extensions.columnCalcs.recalc(this.table.rowManager.activeRows),this.redraw(),"fitColumns"!=this.table.extensions.layout.getMode()&&i.reinitializeWidth(),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},i.prototype.deregisterColumn=function(t){var e,o=t.getField();o&&delete this.columnsByField[o],e=this.columnsByIndex.indexOf(t),e>-1&&this.columnsByIndex.splice(e,1),e=this.columns.indexOf(t),e>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.initialize(),this.redraw()},i.prototype.redraw=function(t){t&&(this.element.is(":visible")&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),"fitColumns"==this.table.extensions.layout.getMode()?this.table.extensions.layout.layout():t?this.table.extensions.layout.layout():this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.update(),this.table.extExists("frozenColumns")&&this.table.extensions.frozenColumns.layout(),this.table.extExists("columnCalcs")&&this.table.extensions.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistentLayout&&this.table.extExists("persistence",!0)&&this.table.extensions.persistence.save("columns"),this.table.extExists("columnCalcs")&&this.table.extensions.columnCalcs.redraw()),this.table.footerManager.redraw()};var n=function(t){this.column=t,this.type="ColumnComponent"};n.prototype.getElement=function(){return this.column.getElement()},n.prototype.getDefinition=function(){return this.column.getDefinition()},n.prototype.getField=function(){return this.column.getField()},n.prototype.getCells=function(){var t=[];return this.column.cells.forEach(function(e){t.push(e.getComponent())}),t},n.prototype.getVisibility=function(){return this.column.visible},n.prototype.show=function(){this.column.isGroup?this.column.columns.forEach(function(t){t.show()}):this.column.show()},n.prototype.hide=function(){this.column.isGroup?this.column.columns.forEach(function(t){t.hide()}):this.column.hide()},n.prototype.toggle=function(){this.column.visible?this.hide():this.show()},n.prototype.delete=function(){this.column.delete()},n.prototype.getSubColumns=function(){var t=[];return this.column.columns.length&&this.column.columns.forEach(function(e){t.push(e.getComponent())}),t},n.prototype.getParentColumn=function(){return this.column.parent instanceof s&&this.column.parent.getComponent()},n.prototype._getSelf=function(){return this.column},n.prototype.scrollTo=function(){this.column.table.columManager.scrollToColumn(this.column)};var s=function e(o,i){var n=this;this.table=i.table,this.definition=o,this.parent=i,this.type="column",this.columns=[],this.cells=[],this.element=t("
"),this.contentElement=!1,this.groupElement=t("
"),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.setField(this.definition.field),this.extensions={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1},this.width=null,this.minWidth=null,this.widthFixed=!1,this.visible=!0,o.columns?(this.isGroup=!0,o.columns.forEach(function(t,o){var i=new e(t,n);n.attachColumn(i)}),n.checkColumnVisibility()):i.registerColumnField(this),o.rowHandle&&!1!==this.table.options.movableRows&&this.table.extExists("moveRow")&&this.table.extensions.moveRow.setHandle(!0),this._mapDepricatedFunctionality(),this._buildHeader()};s.prototype._mapDepricatedFunctionality=function(t){this.definition.tooltipHeader&&(console.warn("The%c tooltipHeader%c column definition property has been depricated and will be removed in version 4.0, use %c headerTooltip%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;"),void 0===this.definition.headerTooltip&&(this.definition.headerTooltip=this.definition.tooltipHeader))},s.prototype.setField=function(t){this.field=t,this.fieldStructure=t?t.split("."):[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNesteData:this._setFlatData},s.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},s.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},s.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},s.prototype.setTooltip=function(){var t=this,e=t.definition,o=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;o?!0===o?e.field?t.table.extensions.localize.bind("columns|"+e.field,function(o){t.element.attr("title",o||e.title)}):t.element.attr("title",e.title):("function"==typeof o&&!1===(o=o(t.getComponent()))&&(o=""),t.element.attr("title",o)):t.element.attr("title","")},s.prototype._buildHeader=function(){var t,e,o,i=this,n=i.definition;i.element.empty(),i.contentElement=i._buildColumnHeaderContent(),i.element.append(i.contentElement),i.isGroup?i._buildGroupHeader():i._buildColumnHeader(),i.setTooltip(),i.table.options.resizableColumns&&i.table.extExists("resizeColumns")&&i.table.extensions.resizeColumns.initializeColumn("header",i,i.element),n.headerFilter&&i.table.extExists("filter")&&i.table.extExists("edit")&&(void 0!==n.headerFilterPlaceholder&&n.field&&i.table.extensions.localize.setHeaderFilterColumnPlaceholder(n.field,n.headerFilterPlaceholder),i.table.extensions.filter.initializeColumn(i)),i.table.extExists("frozenColumns")&&i.table.extensions.frozenColumns.initializeColumn(i),i.table.options.movableColumns&&!i.isGroup&&i.table.extExists("moveColumn")&&i.table.extensions.moveColumn.initializeColumn(i),(n.topCalc||n.bottomCalc)&&i.table.extExists("columnCalcs")&&i.table.extensions.columnCalcs.initializeColumn(i),i.element.on("mouseenter",function(t){i.setTooltip()}),"function"==typeof n.headerClick&&i.element.on("click",function(t){n.headerClick(t,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.on("dblclick",function(t){n.headerDblClick(t,i.getComponent())}),"function"==typeof n.headerContext&&i.element.on("contextmenu",function(t){n.headerContext(t,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.on("touchstart",function(t){o=!0}),i.element.on("touchend",function(t){o&&n.headerTap(t,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(t=null,i.element.on("touchend",function(e){t?(clearTimeout(t),t=null,n.headerDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),"function"==typeof n.headerTapHold&&(e=null,i.element.on("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,n.headerTapHold(t,i.getComponent())},1e3)}),i.element.on("touchend",function(t){clearTimeout(e),e=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},s.prototype._buildColumnHeader=function(){var t=this,e=t.definition,o=t.table;o.extExists("sort")&&o.extensions.sort.initializeColumn(t,t.contentElement),o.extExists("format")&&o.extensions.format.initializeColumn(t),void 0!==e.editor&&o.extExists("edit")&&o.extensions.edit.initializeColumn(t),void 0!==e.validator&&o.extExists("validate")&&o.extensions.validate.initializeColumn(t),o.extExists("mutator")&&o.extensions.mutator.initializeColumn(t),o.extExists("accessor")&&o.extensions.accessor.initializeColumn(t),_typeof(o.options.responsiveLayout)&&o.extExists("responsiveLayout")&&o.extensions.responsiveLayout.initializeColumn(t),void 0!==e.visible&&(e.visible?t.show(!0):t.hide(!0)),e.cssClass&&t.element.addClass(e.cssClass),e.field&&this.element.attr("tabulator-field",e.field),t.setMinWidth(void 0===e.minWidth?t.table.options.columnMinWidth:e.minWidth),t.reinitializeWidth(),t.tooltip=t.definition.tooltip||!1===t.definition.tooltip?t.definition.tooltip:t.table.options.tooltips,t.hozAlign=void 0===t.definition.align?"":t.definition.align},s.prototype._buildColumnHeaderContent=function(){var e=this,o=(e.definition,e.table,t("
"));return o.append(e._buildColumnHeaderTitle()),o},s.prototype._buildColumnHeaderTitle=function(){var e=this,o=e.definition,i=e.table,n=t("
");if(o.editableTitle){var s=t("");s.on("click",function(e){e.stopPropagation(),t(this).focus()}),s.on("change",function(){var n=t(this).val();o.title=n,i.options.columnTitleChanged(e.getComponent())}),n.append(s),o.field?i.extensions.localize.bind("columns|"+o.field,function(t){s.val(t||o.title||" ")}):s.val(o.title||" ")}else o.field?i.extensions.localize.bind("columns|"+o.field,function(t){e._formatColumnHeaderTitle(n,t||o.title||" ")}):e._formatColumnHeaderTitle(n,o.title||" ");return n},s.prototype._formatColumnHeaderTitle=function(t,e){var o,i;this.definition.titleFormatter&&this.table.extExists("format")?(o=this.table.extensions.format.getFormatter(this.definition.titleFormatter),i=o.call(this.table.extensions.format,{getValue:function(){return e},getElement:function(){return t}},this.definition.titleFormatterParams||{}),t.append(i)):t.html(e)},s.prototype._buildGroupHeader=function(){var t=this,e=t.definition;t.table;t.element.addClass("tabulator-col-group").attr("role","columngroup").attr("aria-title",e.title),t.element.append(t.groupElement)},s.prototype._getFlatData=function(t){return t[this.field]},s.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,s=0;se&&(e=o)}),e&&t.setWidthActual(e+1))},s.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},s.prototype.getComponent=function(){return new n(this)};var a=function(e){this.table=e,this.element=t("
"),this.tableElement=t("
"),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="classic",this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]};a.prototype.getElement=function(){return this.element},a.prototype.getTableElement=function(){return this.tableElement},a.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},a.prototype.setColumnManager=function(t){this.columnManager=t},a.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.append(t.tableElement),t.firstRender=!0,t.element.scroll(function(){var e=t.element[0].scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.extensions.groupRows.scrollHeaders(e),t.table.extExists("columnCalcs")&&t.table.extensions.columnCalcs.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.scroll(function(){var e=t.element[0].scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.extensions.ajax.nextPage(t.element[0].scrollHeight-t.element[0].clientHeight-e)):t.scrollTop=e})},a.prototype.findRow=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t))){if(void 0===t||null===t)return!1;return e.rows.find(function(o){return o.data[e.table.options.index]==t})||!1}if(t instanceof l)return t;if(t instanceof r)return t._getSelf()||!1;if(t instanceof jQuery){return e.rows.find(function(e){return e.element===t})||!1}return!1},a.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},a.prototype.scrollToRow=function(t,e,o){var i=this.getDisplayRows().indexOf(t),n=0;if(i>-1){if(void 0===e&&(e=this.table.options.scrollToRowPosition),void 0===o&&(o=this.table.options.scrollToRowIfVisible),"nearest"===e)switch(this.renderMode){case"classic":e=Math.abs(this.element.scrollTop()-t.element.position().top)>Math.abs(this.element.scrollTop()+this.element[0].clientHeight-t.element.position().top)?"bottom":"top";break;case"virtual":e=Math.abs(this.vDomTop-i)>Math.abs(this.vDomBottom-i)?"bottom":"top"}if(!o&&t.element.is(":visible")&&(n=t.element.offset().top-this.element.offset().top)>0&&n-1&&this.activeRows.splice(o,1),e>-1&&this.rows.splice(e,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(e){var o=e.indexOf(t);o>-1&&e.splice(o,1)}),this.reRenderInPosition(),this.table.options.rowDeleted(t.getComponent()),this.table.options.dataEdited(this.getData()),this.table.options.groupBy&&this.table.extExists("groupRows")?this.table.extensions.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.extExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.extExists("page")&&this.refreshActiveData("page")},a.prototype.addRow=function(t,e,o,i){var n=this.addRowActual(t,e,o,i);return this.table.options.history&&this.table.extExists("history")&&this.table.extensions.history.action("rowAdd",n,{data:t,pos:e,index:o}),n},a.prototype.addRows=function(t,e,o){var i=this,n=[];return e=this.findAddRowPos(e),Array.isArray(t)||(t=[t]),t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach(function(t,s){var a=i.addRow(t,e,o,!0);n.push(a)}),this.table.options.groupBy&&this.table.extExists("groupRows")?this.table.extensions.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.extExists("page")?this.refreshActiveData(!1,!1,!0):this.reRenderInPosition(),this.table.extExists("columnCalcs")&&this.table.extensions.columnCalcs.recalc(this.table.rowManager.activeRows),n},a.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},a.prototype.addRowActual=function(t,e,o,i){var n,s=new l(t||{},this),a=this.findAddRowPos(e);if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(n=this.getDisplayRows(),a?n.length?o=n[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],a=!1):n.length&&(o=n[n.length-1],a=!(n.length1&&(!o||o&&-1==r.indexOf(o)?a?r[0]!==s&&(o=r[0],this._moveRowInArray(s.getGroup().rows,s,o,a)):r[r.length-1]!==s&&(o=r[r.length-1],this._moveRowInArray(s.getGroup().rows,s,o,a)):this._moveRowInArray(s.getGroup().rows,s,o,a))}if(o){var c=this.rows.indexOf(o),u=this.activeRows.indexOf(o);this.displayRowIterator(function(t){var e=t.indexOf(o);e>-1&&t.splice(a?e:e+1,0,s)}),u>-1&&this.activeRows.splice(a?u:u+1,0,s),c>-1&&this.rows.splice(a?c:c+1,0,s)}else a?(this.displayRowIterator(function(t){t.unshift(s)}),this.activeRows.unshift(s),this.rows.unshift(s)):(this.displayRowIterator(function(t){t.push(s)}),this.activeRows.push(s),this.rows.push(s));return this.setActiveRows(this.activeRows),this.table.options.rowAdded(s.getComponent()),this.table.options.dataEdited(this.getData()),i||this.reRenderInPosition(),s},a.prototype.moveRow=function(t,e,o){this.table.options.history&&this.table.extExists("history")&&this.table.extensions.history.action("rowMove",t,{pos:this.getRowPosition(t),to:e,after:o}),this.moveRowActual(t,e,o),this.table.options.rowMoved(t.getComponent())},a.prototype.moveRowActual=function(t,e,o){var i=this;if(this._moveRowInArray(this.rows,t,e,o),this._moveRowInArray(this.activeRows,t,e,o),this.displayRowIterator(function(n){i._moveRowInArray(n,t,e,o)}),this.table.options.groupBy&&this.table.extExists("groupRows")){var n=e.getGroup(),s=t.getGroup();n===s?this._moveRowInArray(n.rows,t,e,o):(s&&s.removeRow(t),n.insertRow(t,e,o))}},a.prototype._moveRowInArray=function(t,e,o,i){var n,s,a,r;if(e!==o&&(n=t.indexOf(e),n>-1&&(t.splice(n,1),s=t.indexOf(o),s>-1?i?t.splice(s+1,0,e):t.splice(s,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){a=nn?s:n+1;for(var l=a;l<=r;l++)t[l]&&this.styleRow(t[l],l)}},a.prototype.clearData=function(){this.setData([])},a.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},a.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},a.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o-1)&&o},a.prototype.getData=function(t,e){var o=this,i=[];return(t?o.activeRows:o.rows).forEach(function(t){i.push(t.getData(e||"data"))}),i},a.prototype.getHtml=function(t){var e=this.getData(t),o=[],i="",n="";return this.table.columnManager.getColumns().forEach(function(t){var e=t.getDefinition();t.visible&&!e.hideInHtml&&(i+=""+(e.title||"")+"",o.push(t))}),e.forEach(function(t){var e="";o.forEach(function(o){var i=o.getFieldValue(t);void 0!==i&&null!==i||(i=":"),e+=""+i+""}),n+=""+e+""}),"\n\n \t\t\t\t\n\n \t\t\t\t"+i+"\n\n \t\t\t\t\n\n \t\t\t\t"+n+"\n\n \t\t\t\t
"},a.prototype.getComponents=function(t){var e=this,o=[];return(t?e.activeRows:e.rows).forEach(function(t){o.push(t.getComponent())}),o},a.prototype.getDataCount=function(t){return t?this.rows.length:this.activeRows.length},a.prototype._genRemoteRequest=function(){var t=this,e=t.table,o=e.options,i={};if(e.extExists("page")){if(o.ajaxSorting){var n=t.table.extensions.sort.getSort();n.forEach(function(t){delete t.column}),i[t.table.extensions.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=t.table.extensions.filter.getFilters(!0,!0);i[t.table.extensions.page.paginationDataSentNames.filters]=s}t.table.extensions.ajax.setParams(i,!0)}e.extensions.ajax.sendRequest(function(e){t.setData(e)})},a.prototype.filterRefresh=function(){var t=this.table,e=t.options,o=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.extExists("page")?(t.extensions.page.reset(!0),t.extensions.page.setPage(1)):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},a.prototype.sorterRefresh=function(){var t=this.table,e=this.table.options,o=this.scrollLeft;e.ajaxSorting?"remote"==e.pagination&&t.extExists("page")?(t.extensions.page.reset(!0),t.extensions.page.setPage(1)):this._genRemoteRequest():this.refreshActiveData("sort"),this.scrollHorizontal(o)},a.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft(t),this.table.options.groupBy&&this.table.extensions.groupRows.scrollHeaders(t),this.table.extExists("columnCalcs")&&this.table.extensions.columnCalcs.scrollHorizontal(t)},a.prototype.refreshActiveData=function(t,e,o){var i,n=this,s=this.table;switch(t||(t="all"),s.options.selectable&&!s.options.selectablePersistence&&s.extExists("selectRow")&&s.extensions.selectRow.deselectRows(),t){case"all":case"filter":e?e=!1:s.extExists("filter")?n.setActiveRows(s.extensions.filter.filter(n.rows)):n.setActiveRows(n.rows.slice(0));case"sort":e?e=!1:s.extExists("sort")&&s.extensions.sort.sort();case"display":this.resetDisplayRows();case"freeze":e?e=!1:this.table.extExists("frozenRows")&&s.extensions.frozenRows.isFrozen()&&(s.extensions.frozenRows.getDisplayIndex()||s.extensions.frozenRows.setDisplayIndex(this.getNextDisplayIndex()),i=s.extensions.frozenRows.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.extensions.frozenRows.getRows(this.getDisplayRows(i-1)),i))&&s.extensions.frozenRows.setDisplayIndex(i));case"group":e?e=!1:s.options.groupBy&&s.extExists("groupRows")&&(s.extensions.groupRows.getDisplayIndex()||s.extensions.groupRows.setDisplayIndex(this.getNextDisplayIndex()),i=s.extensions.groupRows.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.extensions.groupRows.getRows(this.getDisplayRows(i-1)),i))&&s.extensions.groupRows.setDisplayIndex(i)),s.options.pagination&&s.extExists("page")&&!o&&"local"==s.extensions.page.getMode()&&s.extensions.page.reset();case"page":e?e=!1:s.options.pagination&&s.extExists("page")&&(s.extensions.page.getDisplayIndex()||s.extensions.page.setDisplayIndex(this.getNextDisplayIndex()),i=s.extensions.page.getDisplayIndex(),"local"==s.extensions.page.getMode()&&s.extensions.page.setMaxRows(this.getDisplayRows(i-1).length),!0!==(i=n.setDisplayRows(s.extensions.page.getRows(this.getDisplayRows(i-1)),i))&&s.extensions.page.setDisplayIndex(i))}n.element.is(":visible")&&(o?n.reRenderInPosition():(n.renderTable(),s.options.layoutColumnsOnNewData&&n.table.columnManager.redraw(!0))),s.extExists("columnCalcs")&&s.extensions.columnCalcs.recalc(this.activeRows)},a.prototype.setActiveRows=function(t){this.activeRows=t,this.activeRowsCount=this.activeRows.length},a.prototype.resetDisplayRows=function(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length,this.table.extExists("frozenRows")&&this.table.extensions.frozenRows.setDisplayIndex(0),this.table.options.groupBy&&this.table.extExists("groupRows")&&this.table.extensions.groupRows.setDisplayIndex(0),this.table.options.pagination&&this.table.extExists("page")&&this.table.extensions.page.setDisplayIndex(0)},a.prototype.getNextDisplayIndex=function(){return this.displayRows.length},a.prototype.setDisplayRows=function(t,e){var o=!0;return e&&void 0!==this.displayRows[e]?(this.displayRows[e]=t,o=!0):(this.displayRows.push(t),o=e=this.displayRows.length-1),e==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),o},a.prototype.getDisplayRows=function(t){return void 0===t?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]},a.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},a.prototype.getRows=function(){return this.rows},a.prototype.reRenderInPosition=function(t){if("virtual"==this.getRenderMode()){for(var e=this.element.scrollTop(),o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(s[a]){var r=e-s[a].getElement().position().top;if(!(!1===i||Math.abs(r)this.element[0].offsetWidt&&(this.scrollTop+=this.element[0].offsetHeight-this.element[0].clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop(this.scrollTop),i.table.options.groupBy&&"fitDataFill"!=i.table.extensions.layout.getMode()&&i.displayRowsCount==i.table.extensions.groupRows.countGroups()&&i.tableElement.css({"min-width":i.table.columnManager.getWidth()})}else this.renderEmptyScroll()},a.prototype.scrollVertical=function(t){var e=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-e>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element[0].scrollTop/this.element[0].scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else t?(e<0&&this._addTopRow(-e),e<0&&this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer&&this._removeBottomRow(-o)):(e>=0&&this.scrollTop>this.vDomWindowBuffer&&this._removeTopRow(e),o>=0&&this._addBottomRow(o))},a.prototype._addTopRow=function(t){var e=arguments.length>1&&arguments[1]!==o?arguments[1]:0,i=this.tableElement,n=this.getDisplayRows();if(this.vDomTop){var s=this.vDomTop-1,a=n[s],r=a.getHeight()||this.vDomRowHeight;t>=r&&(this.styleRow(a,s),i.prepend(a.getElement()),a.initialized&&a.heightInitialized||(this.vDomTopNewRows.push(a),a.heightInitialized||a.clearCellHeight()),a.initialize(),this.vDomTopPad-=r,this.vDomTopPad<0&&(this.vDomTopPad=s*this.vDomRowHeight),s||(this.vDomTopPad=0),i[0].style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=r,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),e=(n[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},a.prototype._removeTopRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;t>=i&&(o.element.detach(),this.vDomTopPad+=i,e[0].style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t))},a.prototype._addBottomRow=function(t){var e=arguments.length>1&&arguments[1]!==o?arguments[1]:0,i=this.tableElement,n=this.getDisplayRows();if(this.vDomBottom=r&&(this.styleRow(a,s),i.append(a.getElement()),a.initialized&&a.heightInitialized||(this.vDomBottomNewRows.push(a),a.heightInitialized||a.clearCellHeight()),a.initialize(),this.vDomBottomPad-=r,(this.vDomBottomPad<0||s==this.displayRowsCount-1)&&(this.vDomBottomPad=0),i[0].style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=r,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,e=(n[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},a.prototype._removeBottomRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;t>=i&&(o.element.detach(),this.vDomBottomPad+=i,this.vDomBottomPad<0&&this.vDomBottomPad,e[0].style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t))},a.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},a.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},a.prototype.adjustTableSize=function(){var t=this;if("virtual"===this.renderMode){t.height=t.element.innerHeight(),t.vDomWindowBuffer=t.table.options.virtualDomBuffer||t.height;var e=t.columnManager.getElement().outerHeight()+(t.table.footerManager?t.table.footerManager.getElement().outerHeight():0);t.element.css({"min-height":"calc(100% - "+e+"px)",height:"calc(100% - "+e+"px)","max-height":"calc(100% - "+e+"px)"})}},a.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize()})},a.prototype.redraw=function(t){var e=this.scrollLeft;this.adjustTableSize(),t?this.renderTable():("classic"==self.renderMode?self.table.options.groupBy?self.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(e)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().append(this.table.options.placeholder))},a.prototype.resetScroll=function(){this.element.scrollLeft(0),this.element.scrollTop(0),this.element.scroll()};var r=function(t){this.row=t};r.prototype.getData=function(t){return this.row.getData(t)},r.prototype.getElement=function(){return this.row.getElement()},r.prototype.getCells=function(){var t=[];return this.row.getCells().forEach(function(e){t.push(e.getComponent())}),t},r.prototype.getCell=function(t){return this.row.getCell(t).getComponent()},r.prototype.getIndex=function(){return this.row.getData("data")[this.row.table.options.index]},r.prototype.getPosition=function(t){return this.row.table.rowManager.getRowPosition(this.row,t)},r.prototype.delete=function(){this.row.delete()},r.prototype.scrollTo=function(){this.row.table.rowManager.scrollToRow(this.row)},r.prototype.update=function(t){this.row.updateData(t)},r.prototype.normalizeHeight=function(){this.row.normalizeHeight(!0)},r.prototype.select=function(){this.row.table.extensions.selectRow.selectRows(this.row)},r.prototype.deselect=function(){this.row.table.extensions.selectRow.deselectRows(this.row)},r.prototype.toggleSelect=function(){this.row.table.extensions.selectRow.toggleRow(this.row)},r.prototype._getSelf=function(){return this.row},r.prototype.freeze=function(){this.row.table.extExists("frozenRows",!0)&&this.row.table.extensions.frozenRows.freezeRow(this.row)},r.prototype.unfreeze=function(){this.row.table.extExists("frozenRows",!0)&&this.row.table.extensions.frozenRows.unfreezeRow(this.row)},r.prototype.reformat=function(){return this.row.reinitialize()},r.prototype.getGroup=function(){return this.row.getGroup().getComponent()};var l=function(e,o){this.table=o.table,this.parent=o,this.data={},this.type="row",this.element=t("
"),this.extensions={},this.cells=[],this.height=0,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(e),this.generateElement()};l.prototype.getElement=function(){return this.element},l.prototype.generateElement=function(){var t,e,o,i=this;!1!==i.table.options.selectable&&i.table.extExists("selectRow")&&i.table.extensions.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.extExists("moveRow")&&i.table.extensions.moveRow.initializeRow(this),i.table.options.rowClick&&i.element.on("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.on("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.on("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.on("touchstart",function(t){o=!0}),i.element.on("touchend",function(t){o&&i.table.options.rowTap(t,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(t=null,i.element.on("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.on("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)}),i.element.on("touchend",function(t){clearTimeout(e),e=null}))},l.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},l.prototype.initialize=function(t){var e=this;e.initialized&&!t||(e.deleteCells(),e.element.empty(),this.table.extExists("frozenColumns")&&this.table.extensions.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.append(t.getElement())}),t&&e.normalizeHeight(),"collapse"===e.table.options.responsiveLayout&&e.table.extExists("responsiveLayout")&&e.table.extensions.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.extExists("resizeRows")&&e.table.extensions.resizeRows.initializeRow(e),e.initialized=!0)},l.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element[0].offsetParent&&this.normalizeHeight(!0)},l.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.height=0,null!==this.element[0].offsetParent&&this.initialize(!0)},l.prototype.calcHeight=function(){var t=0,e=this.element[0].clientHeight;this.cells.forEach(function(e){var o=e.getHeight();o>t&&(t=o)}),this.height=Math.max(t,e),this.outerHeight=this.element[0].offsetHeight},l.prototype.setCellHeight=function(){var t=this.height;this.cells.forEach(function(e){e.setHeight(t)}),this.heightInitialized=!0},l.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},l.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(),this.setCellHeight()},l.prototype.setHeight=function(t){this.height=t,this.setCellHeight()},l.prototype.setHeight=function(t,e){(this.height!=t||e)&&(this.height=t,this.setCellHeight(),this.outerHeight=this.element[0].offsetHeight)},l.prototype.getHeight=function(){return this.outerHeight},l.prototype.getWidth=function(){return this.element.outerWidth()},l.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},l.prototype.setData=function(t){var e=this;e.table.extExists("mutator")?e.data=e.table.extensions.mutator.transformRow(t,"data"):e.data=t},l.prototype.updateData=function(t){var e=this;"string"==typeof t&&(t=JSON.parse(t)),e.table.extExists("mutator")&&(t=e.table.extensions.mutator.transformRow(t,"data"));for(var o in t)e.data[o]=t[o];for(var o in t){var i=this.getCell(o);i&&i.getValue()!=t[o]&&i.setValueProcessData(t[o])}this.element.is(":visible")?(e.normalizeHeight(),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent())):(this.initialized=!1,this.height=0),e.table.options.rowUpdated(e.getComponent())},l.prototype.getData=function(t){var e=this;return t?e.table.extExists("accessor")?e.table.extensions.accessor.transformRow(e.data,t):void 0:this.data},l.prototype.getCell=function(t){var t=this.table.columnManager.findColumn(t);return this.cells.find(function(e){return e.column===t})},l.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},l.prototype.findNextEditableCell=function(t){var e=!1;if(t0)for(var o=t-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.extensions.edit&&i.getElement().is(":visible")&&("function"==typeof i.column.extensions.edit.check&&(n=i.column.extensions.edit.check(i.getComponent())),n)){e=i;break}}return e},l.prototype.getCells=function(){return this.cells},l.prototype.delete=function(){var t=this.table.rowManager.getRowIndex(this);this.deleteActual(),this.table.options.history&&this.table.extExists("history")&&(t&&(t=this.table.rowManager.rows[t-1]),this.table.extensions.history.action("rowDelete",this,{data:this.getData(),pos:!t,index:t}))},l.prototype.deleteActual=function(){this.table.rowManager.getRowIndex(this);this.table.extExists("selectRow")&&this.table.extensions.selectRow._deselectRow(this.row,!0),this.table.rowManager.deleteRow(this),this.deleteCells(),this.extensions.group&&this.extensions.group.removeRow(this),this.table.extExists("columnCalcs")&&(this.table.options.groupBy&&this.table.extExists("groupRows")?this.table.extensions.columnCalcs.recalcRowGroup(this):this.table.extensions.columnCalcs.recalc(this.table.rowManager.activeRows))},l.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e"),this.links=[],this._initialize()};h.prototype._initialize=function(t){this.table.options.footerElement&&(this.element=this.table.options.footerElement)},h.prototype.getElement=function(){return this.element},h.prototype.append=function(t,e){this.activate(e),this.element.append(t),this.table.rowManager.adjustTableSize()},h.prototype.prepend=function(t,e){this.activate(e),this.element.prepend(t),this.table.rowManager.adjustTableSize()},h.prototype.remove=function(t){t.remove(),this.deactivate()},h.prototype.deactivate=function(t){(this.element.is(":empty")||t)&&(this.element.remove(),this.active=!1)},h.prototype.activate=function(t){this.active||(this.active=!0,this.table.element.append(this.getElement()),this.table.element.show()),t&&this.links.push(t)},h.prototype.redraw=function(){this.links.forEach(function(t){t.footerRedraw()})},window.Tabulator={columnManager:null,rowManager:null,footerManager:null,browser:"",browserSlow:!1,options:{height:!1,layout:"fitData",layoutColumnsOnNewData:!1,fitColumns:!1,columnMinWidth:40,columnVertAlign:"top",resizableColumns:!0,resizableRows:!1,autoResize:!0,columns:[],data:[],tooltips:!1,tooltipsHeader:!1,tooltipGenerationMode:"load",initialSort:!1,footerElement:!1,index:"id",keybindings:[],clipboard:!1,clipboardCopySelector:"active",clipboardCopyFormatter:"table",clipboardCopyHeader:!0,clipboardPasteParser:"table",clipboardPasteAction:"insert",clipboardCopied:function(){},clipboardPasted:function(){},clipboardPasteError:function(){},downloadDataFormatter:!1,downloadReady:function(t,e){return e},downloadComplete:!1,addRowPos:"bottom",selectable:"highlight",selectableRollingSelection:!0,selectablePersistence:!0,selectableCheck:function(t,e){return!0},headerFilterPlaceholder:!1,history:!1,locale:!1,langs:{},virtualDom:!0,persistentLayout:!1,persistentSort:!1,persistentFilter:!1,persistenceID:"",persistenceMode:!0,persistentLayoutID:"",responsiveLayout:!1,responsiveLayoutCollapseStartOpen:!0,responsiveLayoutCollapseUseFormatters:!0,responsiveLayoutCollapseFormatter:!1,pagination:!1,paginationSize:!1,paginationButtonCount:5,paginationElement:!1,paginationDataSent:{},paginationDataReceived:{},paginator:!1,paginationAddRow:"page",ajaxURL:!1,ajaxParams:{},ajaxConfig:"get",ajaxLoader:!0,ajaxLoaderLoading:!1,ajaxLoaderError:!1,ajaxFiltering:!1,ajaxSorting:!1,ajaxProgressiveLoad:!1,ajaxProgressiveLoadDelay:0,ajaxProgressiveLoadScrollMargin:0,groupBy:!1,groupStartOpen:!0,groupHeader:!1,movableColumns:!1,movableRows:!1,movableRowsConnectedTables:!1,movableRowsSender:!1, -movableRowsReceiver:"insert",movableRowsSendingStart:function(){},movableRowsSent:function(){},movableRowsSentFailed:function(){},movableRowsSendingStop:function(){},movableRowsReceivingStart:function(){},movableRowsReceived:function(){},movableRowsReceivedFailed:function(){},movableRowsReceivingStop:function(){},scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,placeholder:!1,tableBuilding:function(){},tableBuilt:function(){},renderStarted:function(){},renderComplete:function(){},rowClick:!1,rowDblClick:!1,rowContext:!1,rowTap:!1,rowDblTap:!1,rowTapHold:!1,rowAdded:function(){},rowDeleted:function(){},rowMoved:function(){},rowUpdated:function(){},rowSelectionChanged:function(){},rowSelected:function(){},rowDeselected:function(){},rowResized:function(){},cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellEditing:function(){},cellEdited:function(){},cellEditCancelled:function(){},columnMoved:!1,columnResized:function(){},columnTitleChanged:function(){},columnVisibilityChanged:function(){},htmlImporting:function(){},htmlImported:function(){},dataLoading:function(){},dataLoaded:function(){},dataEdited:function(){},ajaxRequesting:function(){},ajaxResponse:!1,ajaxError:function(){},dataFiltering:!1,dataFiltered:!1,dataSorting:function(){},dataSorted:function(){},groupToggleElement:"arrow",groupClosedShowCalcs:!1,dataGrouping:function(){},dataGrouped:!1,groupVisibilityChanged:function(){},groupClick:!1,groupDblClick:!1,groupContext:!1,groupTap:!1,groupDblTap:!1,groupTapHold:!1,columnCalcs:!0,pageLoaded:function(){},localized:function(){},validationFailed:function(){},historyUndo:function(){},historyRedo:function(){}},_mapDepricatedFunctionality:function(){this.options.fitColumns&&(this.options.layout="fitColumns",console.warn("The%c fitColumns:true%c option has been depricated and will be removed in version 4.0, use %c layout:'fitColumns'%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")),this.options.persistentLayoutID&&(this.options.persistenceID=this.options.persistentLayoutID,console.warn("The%c persistentLayoutID%c option has been depricated and will be removed in version 4.0, use %c persistenceID%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")),"cookie"!==this.options.persistentLayout&&"local"!==this.options.persistentLayout||(this.options.persistenceMode=this.options.persistentLayout,this.options.persistentLayout=!0,console.warn("Setting the persistent storage mode on the%c persistentLayout%c option has been depricated and will be removed in version 4.0, use %c persistenceMode%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")),this.options.downloadDataMutator&&(this.options.downloadDataFormatter=this.options.downloadDataMutator,console.warn("The%c downloadDataMutator%c option has been depricated and will be removed in version 4.0, use %cdownloadDataFormatter%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;"))},_create:function(){var t=this,e=this.element;t._clearObjectPointers(),t._mapDepricatedFunctionality(),t.bindExtensions(),e.is("table")?this.extExists("htmlTableImport",!0)&&t.extensions.htmlTableImport.parseTable():(t.columnManager=new i(t),t.rowManager=new a(t),t.footerManager=new h(t),t.columnManager.setRowManager(t.rowManager),t.rowManager.setColumnManager(t.columnManager),t._buildElement(),this._loadInitialData())},_clearObjectPointers:function(){this.options.columns=this.options.columns.slice(0),this.options.data=this.options.data.slice(0)},_buildElement:function(){var e=this.element,o=this.extensions,i=this.options;i.tableBuilding(),e.addClass("tabulator").attr("role","grid").empty(),i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",this.element.css({height:i.height})),this.rowManager.initialize(),this._detectBrowser(),this.extExists("layout",!0)&&o.layout.initialize(i.layout),!1!==i.headerFilterPlaceholder&&o.localize.setHeaderFilterPlaceholder(i.headerFilterPlaceholder);for(var n in i.langs)o.localize.installLang(n,i.langs[n]);if(o.localize.setLocale(i.locale),"string"==typeof i.placeholder&&(i.placeholder=t("
"+i.placeholder+"
")),e.append(this.columnManager.getElement()),e.append(this.rowManager.getElement()),i.footerElement&&this.footerManager.activate(),(i.persistentLayout||i.persistentSort||i.persistentFilter)&&this.extExists("persistence",!0)&&o.persistence.initialize(i.persistenceMode,i.persistenceID),i.persistentLayout&&this.extExists("persistence",!0)&&(i.columns=o.persistence.load("columns",i.columns)),i.movableRows&&this.extExists("moveRow")&&o.moveRow.initialize(),this.extExists("columnCalcs")&&o.columnCalcs.initialize(),this.columnManager.setColumns(i.columns),this.extExists("frozenRows")&&this.extensions.frozenRows.initialize(),(i.persistentSort||i.initialSort)&&this.extExists("sort",!0)){var s=[];i.persistentSort&&this.extExists("persistence",!0)?!1===(s=o.persistence.load("sort"))&&i.initialSort&&(s=i.initialSort):i.initialSort&&(s=i.initialSort),o.sort.setSort(s)}if(i.persistentFilter&&this.extExists("persistence",!0)){var a=o.persistence.load("filter");!1!==a&&this.setFilter(a)}this.extExists("ajax")&&o.ajax.initialize(),i.pagination&&this.extExists("page",!0)&&o.page.initialize(),i.groupBy&&this.extExists("groupRows",!0)&&o.groupRows.initialize(),this.extExists("keybindings")&&o.keybindings.initialize(),this.extExists("selectRow")&&o.selectRow.clearSelectionData(!0),i.autoResize&&this.extExists("resizeTable")&&o.resizeTable.initialize(),this.extExists("clipboard")&&o.clipboard.initialize(),i.tableBuilt()},_loadInitialData:function(){var t=this;t.options.pagination&&t.extExists("page")?(t.extensions.page.reset(!0),"local"==t.options.pagination?t.options.data.length?t.rowManager.setData(t.options.data):t.options.ajaxURL&&t.extExists("ajax")?t.extensions.ajax.loadData():t.rowManager.setData(t.options.data):t.extensions.page.setPage(1)):t.options.data.length?t.rowManager.setData(t.options.data):t.options.ajaxURL&&t.extExists("ajax")?t.extensions.ajax.loadData():t.rowManager.setData(t.options.data)},_setOption:function(t,e){console.error("Options Error - Tabulator does not allow options to be set after initialization unless there is a function defined for that purpose")},_destroy:function(){var t=this.element;this.rowManager.rows.forEach(function(t){t.wipe()}),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[],this.options.autoResize&&this.extExists("resizeTable")&&this.extensions.resizeTable.clearBindings(),this.extExists("keybindings")&&this.extensions.keybindings.clearBindings(),t.empty(),t.removeClass("tabulator")},_detectBrowser:function(){var t=navigator.userAgent;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1)},setData:function(t,e,o){this.extExists("ajax")&&this.extensions.ajax.blockActiveRequest(),this._setData(t,e,o)},_setData:function(t,e,o,i){var n=this;"string"==typeof t?0==t.indexOf("{")||0==t.indexOf("[")?n.rowManager.setData(JSON.parse(t),i):n.extExists("ajax",!0)&&(e&&n.extensions.ajax.setParams(e),o&&n.extensions.ajax.setConfig(o),n.extensions.ajax.setUrl(t),"remote"==n.options.pagination&&n.extExists("page",!0)?(n.extensions.page.reset(!0),n.extensions.page.setPage(1)):n.extensions.ajax.loadData(i)):t?n.rowManager.setData(t,i):n.extExists("ajax")&&n.extensions.ajax.getUrl?"remote"==n.options.pagination&&n.extExists("page",!0)?(n.extensions.page.reset(!0),n.extensions.page.setPage(1)):n.extensions.ajax.loadData(i):n.rowManager.setData([],i)},clearData:function(){this.extExists("ajax")&&this.extensions.ajax.blockActiveRequest(),this.rowManager.clearData()},getData:function(t){return this.rowManager.getData(t)},getDataCount:function(t){return this.rowManager.getDataCount(t)},getHtml:function(t){return this.rowManager.getHtml(t)},getAjaxUrl:function(){if(this.extExists("ajax",!0))return this.extensions.ajax.getUrl()},replaceData:function(t,e,o){this.extExists("ajax")&&this.extensions.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},updateData:function(t){var e=this;this.extExists("ajax")&&this.extensions.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var o=e.rowManager.findRow(t[e.options.index]);o&&o.updateData(t)}):console.warn("Update Error - No data provided")},addData:function(t,e,o){var i=[],n=[];if(this.extExists("ajax")&&this.extensions.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t)return i=this.rowManager.addRows(t,e,o),i.forEach(function(t){n.push(t.getComponent())}),n;console.warn("Update Error - No data provided")},updateOrAddData:function(t){var e=this,o=[];if(this.extExists("ajax")&&this.extensions.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t)return t.forEach(function(t){var i=e.rowManager.findRow(t[e.options.index]);i?(i.updateData(t),o.push(i.getComponent())):o.push(e.rowManager.addRows(t)[0].getComponent())}),o;console.warn("Update Error - No data provided")},getRow:function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},getRowFromPosition:function(t,e){var o=this.rowManager.getRowFromPosition(t,e);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},deleteRow:function(t){var e=this.rowManager.findRow(t);return e?(e.delete(),!0):(console.warn("Delete Error - No matching row found:",t),!1)},addRow:function(t,e,o){var i;return"string"==typeof t&&(t=JSON.parse(t)),i=this.rowManager.addRows(t,e,o)[0],this.extExists("columnCalcs")&&this.extensions.columnCalcs.recalc(this.rowManager.activeRows),i.getComponent()},updateOrAddRow:function(t,e){var o=this.rowManager.findRow(t);return"string"==typeof e&&(e=JSON.parse(e)),o?o.updateData(e):(o=this.rowManager.addRows(e)[0],this.extExists("columnCalcs")&&this.extensions.columnCalcs.recalc(this.rowManager.activeRows)),o.getComponent()},updateRow:function(t,e){var o=this.rowManager.findRow(t);return"string"==typeof e&&(e=JSON.parse(e)),o?(o.updateData(e),o.getComponent()):(console.warn("Update Error - No matching row found:",t),!1)},scrollToRow:function(t,e,o){var i=this.rowManager.findRow(t);return i?this.rowManager.scrollToRow(i,e,o):(console.warn("Scroll Error - No matching row found:",t),!1)},getRows:function(t){return this.rowManager.getComponents(t)},getRowPosition:function(t,e){var o=this.rowManager.findRow(t);return o?this.rowManager.getRowPosition(o,e):(console.warn("Position Error - No matching row found:",t),!1)},copyToClipboard:function(t,e,o,i){this.extExists("clipboard",!0)&&this.extensions.clipboard.copy(t,e,o,i)},setColumns:function(t){this.columnManager.setColumns(t)},getColumns:function(t){return this.columnManager.getComponents(t)},getColumnDefinitions:function(){return this.columnManager.getDefinitionTree()},getColumnLayout:function(){if(this.extExists("persistence",!0))return this.extensions.persistence.parseColumns(this.columnManager.getColumns())},setColumnLayout:function(t){return!!this.extExists("persistence",!0)&&(this.columnManager.setColumns(this.extensions.persistence.mergeDefinition(this.options.columns,t)),!0)},showColumn:function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show(),this.options.responsiveLayout&&this.extExists("responsiveLayout",!0)&&this.extensions.responsiveLayout.update()},hideColumn:function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide(),this.options.responsiveLayout&&this.extExists("responsiveLayout",!0)&&this.extensions.responsiveLayout.update()},toggleColumn:function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()},addColumn:function(t,e,o){var i=this.columnManager.findColumn(o);this.columnManager.addColumn(t,e,i)},deleteColumn:function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Delete Error - No matching column found:",t),!1;e.delete()},scrollToColumn:function(t,e,o){var i=this.columnManager.findColumn(t);return i?this.columnManager.scrollToColumn(i,e,o):(console.warn("Scroll Error - No matching column found:",t),!1)},setLocale:function(t){this.extensions.localize.setLocale(t)},getLocale:function(){return this.extensions.localize.getLocale()},getLang:function(t){return this.extensions.localize.getLang(t)},redraw:function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},setHeight:function(t){this.options.height=isNaN(t)?t:t+"px",this.element.css({height:this.options.height}),this.rowManager.redraw()},setSort:function(t,e){this.extExists("sort",!0)&&(this.extensions.sort.setSort(t,e),this.rowManager.sorterRefresh())},getSort:function(){if(this.extExists("sort",!0))return console.warn("The%c getSort%c function has been depricated and will be removed in version 4.0, use %c getSorters%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;"),this.getSorters()},getSorters:function(){if(this.extExists("sort",!0))return this.extensions.sort.getSort()},clearSort:function(){this.extExists("sort",!0)&&(this.extensions.sort.clear(),this.rowManager.sorterRefresh())},setFilter:function(t,e,o){this.extExists("filter",!0)&&(this.extensions.filter.setFilter(t,e,o),this.rowManager.filterRefresh())},addFilter:function(t,e,o){this.extExists("filter",!0)&&(this.extensions.filter.addFilter(t,e,o),this.rowManager.filterRefresh())},getFilter:function(t){console.warn("The%c getFilter%c function has been depricated and will be removed in version 4.0, use %c getFilters%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;"),this.getFilters(t)},getFilters:function(t){if(this.extExists("filter",!0))return this.extensions.filter.getFilters(t)},setHeaderFilterFocus:function(t){if(this.extExists("filter",!0)){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.extensions.filter.setHeaderFilterFocus(e)}},setHeaderFilterValue:function(t,e){if(this.extExists("filter",!0)){var o=this.columnManager.findColumn(t);if(!o)return console.warn("Column Filter Error - No matching column found:",t),!1;this.extensions.filter.setHeaderFilterValue(o,e)}},getHeaderFilters:function(){if(this.extExists("filter",!0))return this.extensions.filter.getHeaderFilters()},removeFilter:function(t,e,o){this.extExists("filter",!0)&&(this.extensions.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},clearFilter:function(t){this.extExists("filter",!0)&&(this.extensions.filter.clearFilter(t),this.rowManager.filterRefresh())},clearHeaderFilter:function(){this.extExists("filter",!0)&&(this.extensions.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},selectRow:function(t){this.extExists("selectRow",!0)&&this.extensions.selectRow.selectRows(t)},deselectRow:function(t){this.extExists("selectRow",!0)&&this.extensions.selectRow.deselectRows(t)},toggleSelectRow:function(t){this.extExists("selectRow",!0)&&this.extensions.selectRow.toggleRow(t)},getSelectedRows:function(){if(this.extExists("selectRow",!0))return this.extensions.selectRow.getSelectedRows()},getSelectedData:function(){if(this.extExists("selectRow",!0))return this.extensions.selectRow.getSelectedData()},setMaxPage:function(t){if(!this.options.pagination||!this.extExists("page"))return!1;this.extensions.page.setMaxPage(t)},setPage:function(t){if(!this.options.pagination||!this.extExists("page"))return!1;this.extensions.page.setPage(t)},setPageSize:function(t){if(!this.options.pagination||!this.extExists("page"))return!1;this.extensions.page.setPageSize(t),this.extensions.page.setPage(1)},getPageSize:function(){if(this.options.pagination&&this.extExists("page",!0))return this.extensions.page.getPageSize()},previousPage:function(){if(!this.options.pagination||!this.extExists("page"))return!1;this.extensions.page.previousPage()},nextPage:function(){if(!this.options.pagination||!this.extExists("page"))return!1;this.extensions.page.nextPage()},getPage:function(){return!(!this.options.pagination||!this.extExists("page"))&&this.extensions.page.getPage()},getPageMax:function(){return!(!this.options.pagination||!this.extExists("page"))&&this.extensions.page.getPageMax()},setGroupBy:function(t){if(!this.extExists("groupRows",!0))return!1;this.options.groupBy=t,this.extensions.groupRows.initialize(),this.rowManager.refreshActiveData("display")},setGroupStartOpen:function(t){if(!this.extExists("groupRows",!0))return!1;this.options.groupStartOpen=t,this.extensions.groupRows.initialize(),this.options.groupBy?this.rowManager.refreshActiveData("group"):console.warn("Grouping Update - cant refresh view, no groups have been set")},setGroupHeader:function(t){if(!this.extExists("groupRows",!0))return!1;this.options.groupHeader=t,this.extensions.groupRows.initialize(),this.options.groupBy?this.rowManager.refreshActiveData("group"):console.warn("Grouping Update - cant refresh view, no groups have been set")},getGroups:function(t){return!!this.extExists("groupRows",!0)&&this.extensions.groupRows.getGroups()},getCalcResults:function(){return!!this.extExists("columnCalcs",!0)&&this.extensions.columnCalcs.getResults()},navigatePrev:function(){var t=!1;return!(!this.extExists("edit",!0)||!(t=this.extensions.edit.currentCell))&&(e.preventDefault(),t.nav().prev())},navigateNext:function(){var t=!1;return!(!this.extExists("edit",!0)||!(t=this.extensions.edit.currentCell))&&(e.preventDefault(),t.nav().next())},navigateLeft:function(){var t=!1;return!(!this.extExists("edit",!0)||!(t=this.extensions.edit.currentCell))&&(e.preventDefault(),t.nav().left())},navigateRight:function(){var t=!1;return!(!this.extExists("edit",!0)||!(t=this.extensions.edit.currentCell))&&(e.preventDefault(),t.nav().right())},navigateUp:function(){var t=!1;return!(!this.extExists("edit",!0)||!(t=this.extensions.edit.currentCell))&&(e.preventDefault(),t.nav().up())},navigateDown:function(){var t=!1;return!(!this.extExists("edit",!0)||!(t=this.extensions.edit.currentCell))&&(e.preventDefault(),t.nav().dpwn())},undo:function(){return!(!this.options.history||!this.extExists("history",!0))&&this.extensions.history.undo()},redo:function(){return!(!this.options.history||!this.extExists("history",!0))&&this.extensions.history.redo()},download:function(t,e,o){this.extExists("download",!0)&&this.extensions.download.download(t,e,o)},tableComms:function(t,e,o,i){this.extensions.comms.receive(t,e,o,i)},extensions:{},extensionBindings:{},extendExtension:function(t,e,o){if(this.extensionBindings[t]){var i=this.extensionBindings[t].prototype[e];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Extension Error - Invalid value type, it must be an object");else console.warn("Extension Error - property does not exist:",e)}else console.warn("Extension Error - extension does not exist:",t)},registerExtension:function(t,e){this.extensionBindings[t]=e},bindExtensions:function(){var t=this;this.extensions={};for(var e in t.extensionBindings)t.extensions[e]=new t.extensionBindings[e](t)},extExists:function(t,e){return!!this.extensions[t]||(e&&console.error("Tabulator Plugin Not Installed: "+t),!1)}};var p=function(t){this.table=t,this.mode=null};p.prototype.initialize=function(t){this.modes[t]?this.mode=t:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+t),this.mode="fitData"),this.table.element.attr("tabulator-layout",this.mode)},p.prototype.getMode=function(){return this.mode},p.prototype.layout=function(){this.modes[this.mode].call(this,this.table.columnManager.columnsByIndex)},p.prototype.modes={fitData:function(t){t.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.update()},fitDataFill:function(t){t.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.update()},fitColumns:function(t){function e(t){return"string"==typeof t?t.indexOf("%")>-1?n/100*parseInt(t):parseInt(t):t}function o(t,i,n,s){function a(t){return n*(t.column.definition.widthGrow||1)}function r(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var l=[],c=0,u=0,h=0,p=0,d=0,f=[];return t.forEach(function(t,e){var o=s?r(t):a(t);t.column.minWidth>=o?l.push(t):(f.push(t),d+=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),l.length?(l.forEach(function(t){c+=s?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),u=i-c,h=d?Math.floor(u/d):u,p=u-h*d,p+=o(f,u,h,s)):(p=d?i-Math.floor(i/d)*d:i,f.forEach(function(t){t.width=s?r(t):a(t)})),p}var i=this,n=i.table.element.innerWidth(),s=0,a=0,r=0,l=0,c=[],u=[],h=0,p=0,d=0;this.table.options.responsiveLayout&&this.table.extExists("responsiveLayout",!0)&&this.table.extensions.responsiveLayout.update(),this.table.rowManager.element[0].scrollHeight>this.table.rowManager.element.innerHeight()&&(n-=this.table.rowManager.element[0].offsetWidth-this.table.rowManager.element[0].clientWidth),t.forEach(function(t){var o,i,n;t.visible&&(o=t.definition.width,i=parseInt(t.minWidth),o?(n=e(o),s+=n>i?n:i,t.definition.widthShrink&&(u.push({column:t,width:n>i?n:i}),h+=t.definition.widthShrink)):(c.push({column:t,width:0}),r+=t.definition.widthGrow||1))}),a=n-s,l=Math.floor(a/r);var d=o(c,a,l,!1);c.length&&d>0&&(c[c.length-1].width+=+d),c.forEach(function(t){a-=t.width}),p=Math.abs(d)+a,p>0&&h&&(d=o(u,p,Math.floor(p/h),!0)),u.length&&(u[u.length-1].width-=d),c.forEach(function(t){t.column.setWidth(t.width)}),u.forEach(function(t){t.column.setWidth(t.width)})}},Tabulator.registerExtension("layout",p);var d=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};d.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},d.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langs.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},d.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},d.prototype._setLangProp=function(t,e){for(var o in e)t[o]&&"object"==_typeof(t[o])?this._setLangProp(t[o],e[o]):t[o]=e[o]},d.prototype.setLocale=function(e){function o(t,e){for(var i in t)"object"==_typeof(t[i])?(e[i]||(e[i]={}),o(t[i],e[i])):e[i]=t[i]}var i=this;if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!i.langs[e]){var n=e.split("-")[0];i.langs[n]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,n),e=n):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}i.locale=e,i.lang=t.extend(!0,{},i.langs.default),"default"!=e&&o(i.langs[e],i.lang),i.table.options.localized(i.locale,i.lang),i._executeBindings()},d.prototype.getLocale=function(t){return self.locale},d.prototype.getLang=function(t){return t?this.langs[t]:this.lang},d.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},d.prototype._getLangElement=function(t,e){var o=this,i=o.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i},d.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},d.prototype._executeBindings=function(){var t=this;for(var e in t.bindings)!function(e){t.bindings[e].forEach(function(o){o(t.getText(e),t.lang)})}(e)},d.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page"},headerFilters:{default:"filter column...",columns:{}}}},Tabulator.registerExtension("localize",d);var f=function(t){this.table=t};f.prototype.getConnections=function(e){var o,i=this,n=[];return Array.isArray(e)?n=e:(o="string"==typeof e?t(e):e,o.each(function(){i.table.element[0]!==this&&n.push(t(this))})),n},f.prototype.send=function(t,e,o,i){var n=this,s=this.getConnections(t);s.forEach(function(t){t.tabulator("tableComms",n.table.element,e,o,i)}),!s.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},f.prototype.receive=function(t,e,o,i){if(this.table.extExists(e))return this.table.extensions[e].commsReceived(t,o,i);console.warn("Inter-table Comms Error - no such extension:",e)},Tabulator.registerExtension("comms",f);var g=function(t){this.table=t,this.allowedTypes=["","data","download","clipboard"]};g.prototype.initializeColumn=function(t){var e=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,a="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[a]&&(s=e.lookupAccessor(t.definition[a]))&&(o=!0,i[a]={accessor:s,params:t.definition[a+"Params"]||{}})}),o&&(t.extensions.accessor=i)},g.prototype.lookupAccessor=function(t){var e=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.accessors[t]?e=this.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e},g.prototype.transformRow=function(e,o){var i=this,n="accessor"+(o.charAt(0).toUpperCase()+o.slice(1)),s=t.extend(!0,{},e||{});return i.table.columnManager.traverse(function(t){var e,i;t.extensions.accessor&&(i=t.extensions.accessor[n]||t.extensions.accessor.accessor||!1)&&"undefined"!=(e=t.getFieldValue(s))&&t.setFieldValue(s,i.accessor(e,s,o,i.params,t.getComponent()))}),s},g.prototype.accessors={},Tabulator.registerExtension("accessor",g);var m=function(e){this.table=e,this.config=!1,this.url="",this.params=!1,this.loaderElement=t("
"),this.msgElement=t(""),this.loadingElement=!1,this.errorElement=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};m.prototype.initialize=function(){this.loaderElement.append(this.msgElement),this.table.options.ajaxLoaderLoading&&(this.loadingElement=this.table.options.ajaxLoaderLoading),this.table.options.ajaxLoaderError&&(this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.extExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.extensions.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},m.prototype.setParams=function(t,e){if(e){this.params=this.params||{};for(var o in t)this.params[o]=t[o]}else this.params=t},m.prototype.getParams=function(){return this.params||{}},m.prototype.setConfig=function(t){if(this._loadDefaultConfig(),"string"==typeof t)this.config.type=t;else for(var e in t)this.config[e]=t[e]},m.prototype._loadDefaultConfig=function(t){var e=this;if(!e.config||t){e.config={};for(var o in e.defaultConfig)e.config[o]=e.defaultConfig[o]}},m.prototype.setUrl=function(t){this.url=t},m.prototype.getUrl=function(){return this.url},m.prototype.loadData=function(t){this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(t)},m.prototype.nextPage=function(t){var e;this.loading||(e=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.element[0].clientHeight,t"),this.botElement=t("
"),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};b.prototype.initialize=function(){this.genColumn=new s({field:"value"},this)},b.prototype.registerColumnField=function(){},b.prototype.initializeColumn=function(t){var e=t.definition,o={topCalcParams:e.topCalcParams||{},botCalcParams:e.bottomCalcParams||{}};if(e.topCalc){switch(_typeof(e.topCalc)){case"string":this.calculations[e.topCalc]?o.topCalc=this.calculations[e.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.topCalc);break;case"function":o.topCalc=e.topCalc}o.topCalc&&(t.extensions.columnCalcs=o,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(e.bottomCalc){switch(_typeof(e.bottomCalc)){case"string":this.calculations[e.bottomCalc]?o.botCalc=this.calculations[e.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.bottomCalc);break;case"function":o.botCalc=e.bottomCalc}o.botCalc&&(t.extensions.columnCalcs=o,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},b.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.remove(),t=!0),this.botInitialized&&(this.botInitialized=!1, -this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},b.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.headersElement.after(this.topElement),this.topInitialized=!0)},b.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},b.prototype.scrollHorizontal=function(t){this.table.columnManager.element[0].scrollWidth,this.table.element.innerWidth();this.botInitialized&&this.botRow.getElement().css("margin-left",-t)},b.prototype.recalc=function(t){var e;(this.topInitialized||this.botInitialized)&&(this.rowsToData(t),this.topInitialized&&(e=this.generateRow("top",this.rowsToData(t)),this.topRow=e,this.topElement.empty(),this.topElement.append(e.getElement()),e.initialize(!0)),this.botInitialized&&(e=this.generateRow("bottom",this.rowsToData(t)),this.botRow=e,this.botElement.empty(),this.botElement.append(e.getElement()),e.initialize(!0)),this.table.rowManager.adjustTableSize(),this.table.extExists("frozenColumns")&&this.table.extensions.frozenColumns.layout())},b.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.extensions.groupRows.getRowGroup(t))},b.prototype.recalcGroup=function(t){var e,o;t&&t.calcs&&(t.calcs.bottom&&(e=this.rowsToData(t.rows),o=this.generateRowData("bottom",e),t.calcs.bottom.updateData(o),t.calcs.bottom.reinitialize()),t.calcs.top&&(e=this.rowsToData(t.rows),o=this.generateRowData("top",e),t.calcs.top.updateData(o),t.calcs.top.reinitialize()))},b.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},b.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},b.prototype.rowsToData=function(t){var e=[];return t.forEach(function(t){e.push(t.getData())}),e},b.prototype.generateRow=function(t,e){var o=this,i=this.generateRowData(t,e),n=new l(i,this);return n.getElement().addClass("tabulator-calcs").addClass("tabulator-calcs-"+t),n.type="calc",n.generateCells=function(){var e=[];o.table.columnManager.columnsByIndex.forEach(function(i){if(i.visible){o.genColumn.setField(i.getField()),o.genColumn.hozAlign=i.hozAlign,i.definition[t+"CalcFormatter"]&&o.table.extExists("format")?o.genColumn.extensions.format={formatter:o.table.extensions.format.getFormatter(i.definition[t+"CalcFormatter"]),params:i.definition[t+"CalcFormatterParams"]}:o.genColumn.extensions.format={formatter:o.table.extensions.format.getFormatter("plaintext"),params:{}};var s=new u(o.genColumn,n);s.column=i,s.setWidth(i.width),i.cells.push(s),e.push(s)}}),this.cells=e},n},b.prototype.generateRowData=function(t,e){var o={},i="top"==t?this.topCalcs:this.botCalcs,n="top"==t?"topCalc":"botCalc";return i.forEach(function(t){var i=[];t.extensions.columnCalcs&&t.extensions.columnCalcs[n]&&(e.forEach(function(e){i.push(t.getFieldValue(e))}),t.setFieldValue(o,t.extensions.columnCalcs[n](i,e,t.extensions.columnCalcs[n+"Params"])))}),o},b.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},b.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},b.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},b.prototype.getResults=function(){var t,e=this,o={};return this.table.options.groupBy&&this.table.extExists("groupRows")?(t=this.table.extensions.groupRows.getGroups(),t.forEach(function(t){o[t.getKey()]=e.getGroupResults(t)})):o={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},o},b.prototype.getGroupResults=function(t){var e=this,o=t._getSelf(),i=t.getSubGroups(),n={};return i.forEach(function(t){n[t.getKey()]=e.getGroupResults(t)}),{top:o.calcs.top?o.calcs.top.getData():{},bottom:o.calcs.bottom?o.calcs.bottom.getData():{},groups:n}},b.prototype.calculations={avg:function(t,e,o){var i=0,n=void 0!==o.precision?o.precision:2;return t.length&&(i=t.reduce(function(t,e){return e=Number(e),t+e}),i/=t.length,i=!1!==n?i.toFixed(n):i),parseFloat(i).toString()},max:function(t,e,o){var i=null,n=void 0!==o.precision&&o.precision;return t.forEach(function(t){((t=Number(t))>i||null===i)&&(i=t)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(t,e,o){var i=null,n=void 0!==o.precision&&o.precision;return t.forEach(function(t){((t=Number(t))");return a.css({padding:"4px",width:"100%","box-sizing":"border-box"}).val(e.getValue()),o(function(){a.focus(),a.css("height","100%")}),a.on("change blur",function(t){a.val()!=e.getValue()?i(a.val()):n()}),a.on("keydown",function(t){13==t.keyCode&&i(a.val()),27==t.keyCode&&n()}),a},textarea:function(e,o,i,n,s){var a=e.getValue(),r=String("null"==typeof a||void 0===a?"":a),l=(r.match(/(?:\r\n|\r|\n)/g),t("")),c=0;return l.css({display:"block",height:"100%",width:"100%",padding:"2px","box-sizing":"border-box","white-space":"pre-wrap",resize:"none"}).val(r),o(function(){l.focus(),l.css("height","100%")}),l.on("change blur",function(t){l.val()!=e.getValue()?(i(l.val()),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}),l.on("keyup",function(){l.css({height:""});var t=l[0].scrollHeight;l.css({height:t}),t!=c&&(c=t,e.getRow().normalizeHeight())}),l.on("keydown",function(t){27==t.keyCode&&n()}),l},number:function(e,o,i,n,s){var a=void 0!==s.max?"max='"+s.max+"'":"",r=void 0!==s.min?"min='"+s.min+"'":"",l="step='"+(void 0!==s.step?s.step:1)+"'",c=t("");return c.css({padding:"4px",width:"100%","box-sizing":"border-box"}).val(e.getValue()),o(function(){c.css("height","100%"),setTimeout(function(){c.focus()},10)}),c.on("blur",function(t){var o=c.val();isNaN(o)||(o=Number(o)),o!=e.getValue()?i(o):n()}),c.on("keydown",function(t){var e;13==t.keyCode&&(e=c.val(),isNaN(e)||(e=Number(e)),i(e)),27==t.keyCode&&n()}),c},range:function(e,o,i,n,s){var a="max='"+(void 0!==s.max?s.max:10)+"'",r="min='"+(void 0!==s.min?s.min:0)+"'",l="step='"+(void 0!==s.step?s.step:1)+"'",c=t("");return c.css({padding:"4px",width:"100%","box-sizing":"border-box"}).val(e.getValue()),o(function(){c.css("height","100%"),setTimeout(function(){c.focus()},10)}),c.on("blur",function(t){var o=c.val();isNaN(o)||(o=Number(o)),o!=e.getValue()?i(o):n()}),c.on("keydown",function(t){var e;13==t.keyCode&&(e=c.val(),isNaN(e)||(e=Number(e)),i(e)),27==t.keyCode&&n()}),c},select:function(e,o,i,n,s){function a(e,o,i,n){var s=t("").attr("value",i).text(o);n&&s.prop("disabled",!0),e.append(s)}function r(e,o){var i;o.options?(i=t("").attr("label",o.label),o.options.forEach(function(t){r(i,t)}),e.append(i)):a(e,void 0===o.label?o.value:o.label,void 0===o.value?o.label:o.value,o.disabled)}var l=t(""),c=Array.isArray(s);if("function"==typeof s&&(s=s(e),c=Array.isArray(s)),c||"object"!==(void 0===s?"undefined":_typeof(s)))c&&s.forEach(function(t){r(l,t)});else for(var u in s)a(l,s[u],u);return l.css({padding:"4px",width:"100%","box-sizing":"border-box","font-family":""}).val(e.getValue()),o(function(){l.focus().click()}),l.on("change blur",function(t){i(l.val())}),l.on("keydown",function(t){13===t.keyCode&&i(l.val())}),l},star:function(e,o,i,n,s){var a=e.getElement(),r=e.getValue(),l=t("svg",a).length||5,c=t("svg:first",a).attr("width")||14,u=t("
"),h=t(''),p=t(''),d=function(e){t(".tabulator-star-active",e.closest("div")).length!=e.prevAll("svg").length+1&&(e.prevAll("svg").replaceWith(h.clone()),e.nextAll("svg").replaceWith(p.clone()),e.replaceWith(h.clone()))};r=parseInt(r)"),d=function(){var t=u*Math.round(a.outerWidth()/(r.width()/100))+c;i(t),r.attr("aria-valuenow",t).attr("aria-label",h)};return h=parseFloat(h)<=l?parseFloat(h):l,h=parseFloat(h)>=c?parseFloat(h):c,h=100-Math.round((h-c)/u),a=t("
"),r.css({padding:"0 4px"}),r.attr("aria-valuemin",c).attr("aria-valuemax",l),a.append(p),p.on("mousedown",function(t){a.data("mouseDrag",t.screenX),a.data("mouseDragWidth",a.outerWidth())}),p.on("mouseover",function(){t(this).css({cursor:"ew-resize"})}),r.on("mousemove",function(t){a.data("mouseDrag")&&a.css({width:a.data("mouseDragWidth")+(t.screenX-a.data("mouseDrag"))})}),r.on("mouseup",function(t){a.data("mouseDrag")&&(t.stopPropagation(),t.stopImmediatePropagation(),a.data("mouseDragOut",!0),a.data("mouseDrag",!1),a.data("mouseDragWidth",!1),d())}),r.on("keydown",function(t){switch(t.keyCode){case 39:a.css({width:a.width()+r.width()/100});break;case 37:a.css({width:a.width()-r.width()/100});break;case 13:d();break;case 27:n()}}),r.on("blur",function(){n()}),a},tickCross:function(e,o,i,n,s){var a=e.getValue(),r=t("");return r.css({"margin-top":"5px","box-sizing":"border-box"}).val(a),"firefox"!=this.table.browser&&o(function(){r.focus()}),!0===a||"true"===a||"True"===a||1===a?r.prop("checked",!0):r.prop("checked",!1),r.on("change blur",function(t){i(r.is(":checked"))}),r.on("keydown",function(t){13==t.keyCode&&i(r.is(":checked")),27==t.keyCode&&n()}),r},tick:function(e,o,i,n,s){var a=e.getValue(),r=t("");return r.css({"margin-top":"5px","box-sizing":"border-box"}).val(a),"firefox"!=this.table.browser&&o(function(){r.focus()}),!0===a||"true"===a||"True"===a||1===a?r.prop("checked",!0):r.prop("checked",!1),r.on("change blur",function(t){i(r.is(":checked"))}),r.on("keydown",function(t){13==t.keyCode&&i(r.is(":checked")),27==t.keyCode&&n()}),r}},Tabulator.registerExtension("edit",y);var x=function(t){this.table=t,this.filterList=[],this.headerFilters={},this.headerFilterElements=[],this.changed=!1};x.prototype.initializeColumn=function(e){function o(t){var o,i="input"==c&&"text"==u||"textarea"==c?"partial":"match",n="";if(t){switch(_typeof(e.definition.headerFilterFunc)){case"string":h.filters[e.definition.headerFilterFunc]?(n=e.definition.headerFilterFunc,o=function(o){return h.filters[e.definition.headerFilterFunc](t,e.getFieldValue(o))}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":o=function(o){return e.definition.headerFilterFunc(t,e.getFieldValue(o),o,e.definition.headerFilterFuncParams||{})},n=o}if(!o)switch(i){case"partial":o=function(o){return String(e.getFieldValue(o)).toLowerCase().indexOf(String(t).toLowerCase())>-1},n="like";break;default:o=function(o){return e.getFieldValue(o)==t},n="="}h.headerFilters[p]={value:t,func:o,type:n}}else delete h.headerFilters[p];h.changed=!0,h.table.rowManager.filterRefresh()}function i(){}var n,s,a,r,l,c,u,h=this,p=e.getField();if(e.extensions.filter={success:o},p){switch(n=t("
"),_typeof(e.definition.headerFilter)){case"string":h.table.extensions.edit.editors[e.definition.headerFilter]?s=h.table.extensions.edit.editors[e.definition.headerFilter]:console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":s=e.definition.headerFilter;break;case"boolean":s=e.extensions.edit&&e.extensions.edit.editor?e.extensions.edit.editor:e.definition.formatter&&h.table.extensions.edit.editors[e.definition.formatter]?h.table.extensions.edit.editors[e.definition.formatter]:h.table.extensions.edit.editors.input}s&&(r={getValue:function(){return""},getField:function(){return e.definition.field},getElement:function(){return n},getRow:function(){return{normalizeHeight:function(){}}}},a=s.call(h,r,function(){},o,i,e.definition.headerFilterParams||{}),p?h.table.extensions.localize.bind("headerFilters|columns|"+e.definition.field,function(t){a.attr("placeholder",void 0!==t&&t?t:h.table.extensions.localize.getText("headerFilters|default"))}):h.table.extensions.localize.bind("headerFilters|default",function(t){a.attr("placeholdder",void 0!==h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:t)}),a.on("click",function(e){e.stopPropagation(),t(this).focus()}),l=!1,a.on("keyup search",function(e){var i=t(this);l&&clearTimeout(l),l=setTimeout(function(){o(i.val())},300)}),e.extensions.filter.headerElement=a,u=a.attr("type")?a.attr("type").toLowerCase():"","number"==u&&a.on("change",function(e){o(t(this).val())}),"text"==u&&"ie"!==this.table.browser&&(a.attr("type","search"),a.off("change blur")),c=a.prop("tagName").toLowerCase(),"input"!=c&&"select"!=c&&"textarea"!=c||a.on("mousedown",function(t){t.stopPropagation()}),n.append(a),e.contentElement.append(n),h.headerFilterElements.push(a))}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},x.prototype.hideHeaderFilterElements=function(){this.headerFilterElements.forEach(function(t){t.hide()})},x.prototype.showHeaderFilterElements=function(){this.headerFilterElements.forEach(function(t){t.show()})},x.prototype.setHeaderFilterFocus=function(t){t.extensions.filter&&t.extensions.filter.headerElement?t.extensions.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())},x.prototype.setHeaderFilterValue=function(t,e){t&&(t.extensions.filter&&t.extensions.filter.headerElement?(t.extensions.filter.headerElement.val(e),t.extensions.filter.success(e)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},x.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},x.prototype.setFilter=function(t,e,o){var i=this;i.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:o}]),i.addFilter(t)},x.prototype.addFilter=function(t,e,o){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:o}]),t.forEach(function(t){(t=i.findFilter(t))&&(i.filterList.push(t),i.changed=!0)}),this.table.options.persistentFilter&&this.table.extExists("persistence",!0)&&this.table.extensions.persistence.save("filter")},x.prototype.findFilter=function(t){var e,o=this;if(Array.isArray(t))return this.findSubFilters(t);var i=!1;return"function"==typeof t.field?i=function(e){return t.field(e,t.type||{})}:o.filters[t.type]?(e=o.table.columnManager.getColumnByField(t.field),i=e?function(i){return o.filters[t.type](t.value,e.getFieldValue(i))}:function(e){return o.filters[t.type](t.value,e[t.field])}):console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=i,!!t.func&&t},x.prototype.findSubFilters=function(t){var e=this,o=[];return t.forEach(function(t){(t=e.findFilter(t))&&o.push(t)}),!!o.length&&o},x.prototype.getFilters=function(t,e){var o=this,i=[];return t&&(i=o.getHeaderFilters()),o.filterList.forEach(function(t){i.push({field:t.field,type:t.type,value:t.value})}),e&&i.forEach(function(t){"function"==typeof t.type&&(t.type="function")}),i},x.prototype.getHeaderFilters=function(){var t=[];for(var e in this.headerFilters)t.push({field:e,type:this.headerFilters[e].type,value:this.headerFilters[e].value});return t},x.prototype.removeFilter=function(t,e,o){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:o}]),t.forEach(function(t){var e=-1;e="object"==_typeof(t.field)?i.filterList.findIndex(function(e){return t===e}):i.filterList.findIndex(function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value}),e>-1?(i.filterList.splice(e,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}),this.table.options.persistentFilter&&this.table.extExists("persistence",!0)&&this.table.extensions.persistence.save("filter")},x.prototype.clearFilter=function(t){this.filterList=[],t&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistentFilter&&this.table.extExists("persistence",!0)&&this.table.extensions.persistence.save("filter")},x.prototype.clearHeaderFilter=function(){this.headerFilters={}, -this.headerFilterElements.forEach(function(t){t.val("")}),this.changed=!0},x.prototype.filter=function(t){var e=this,o=[],i=[];return e.table.options.dataFiltering&&e.table.options.dataFiltering(e.getFilters()),e.table.options.ajaxFiltering||!e.filterList.length&&!Object.keys(e.headerFilters).length?o=t.slice(0):t.forEach(function(t){e.filterRow(t)&&o.push(t)}),e.table.options.dataFiltered&&(o.forEach(function(t){i.push(t.getComponent())}),e.table.options.dataFiltered(e.getFilters(),i)),o},x.prototype.filterRow=function(t){var e=this,o=!0,i=t.getData();e.filterList.forEach(function(t){e.filterRecurse(t,i)||(o=!1)});for(var n in e.headerFilters)e.headerFilters[n].func(i)||(o=!1);return o},x.prototype.filterRecurse=function(t,e){var o=this,i=!1;return Array.isArray(t)?t.forEach(function(t){o.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i},x.prototype.filters={"=":function(t,e){return e==t},"<":function(t,e){return e":function(t,e){return e>t},">=":function(t,e){return e>=t},"!=":function(t,e){return e!=t},like:function(t,e){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},in:function(t,e){return Array.isArray(t)?t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}},Tabulator.registerExtension("filter",x);var C=function(t){this.table=t};C.prototype.initializeColumn=function(t){var e=this,o={params:t.definition.formatterParams||{}};switch(_typeof(t.definition.formatter)){case"string":e.formatters[t.definition.formatter]?(o.formatter=e.formatters[t.definition.formatter],"email"===t.definition.formatter&&console.warn("The%c email%c formatter has been depricated and will be removed in version 4.0, use the %clink %cformatter with %cformatterParams:{urlPrefix:'mailto:'} %cinstead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")):(console.warn("Formatter Error - No such formatter found: ",t.definition.formatter),o.formatter=e.formatters.plaintext);break;case"function":o.formatter=t.definition.formatter;break;default:o.formatter=e.formatters.plaintext}t.extensions.format=o},C.prototype.formatValue=function(t){return t.column.extensions.format.formatter.call(this,t.getComponent(),t.column.extensions.format.params)},C.prototype.sanitizeHTML=function(t){if(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}return t},C.prototype.emptyToSpace=function(t){return null===t?" ":t},C.prototype.getFormatter=function(t){var t;switch(void 0===t?"undefined":_typeof(t)){case"string":this.formatters[t]?t=this.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=this.formatters.plaintext);break;case"function":t=t;break;default:t=this.formatters.plaintext}return t},C.prototype.formatters={plaintext:function(t,e){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e){return t.getValue()},textarea:function(t,e){return t.getElement().css({"white-space":"pre-wrap"}),this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e){var o,i,n,s,a=parseFloat(t.getValue()),r=e.decimal||".",l=e.thousand||",",c=e.symbol||"",u=!!e.symbolAfter,h=void 0!==e.precision?e.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));for(o=!1!==h?a.toFixed(h):a,o=o.split("."),i=o[0],n=o.length>1?r+o[1]:"",s=/(\d+)(\d{3})/;s.test(i);)i=i.replace(s,"$1"+l+"$2");return u?i+n+c:c+i+n},email:function(t,e){var o=this.sanitizeHTML(t.getValue());return""+this.emptyToSpace(o)+""},link:function(t,e){var o,i=this.sanitizeHTML(t.getValue()),n=e.urlPrefix||"",s=this.emptyToSpace(i);if(e.labelField&&(o=t.getData(),s=o[e.labelField]),e.label)switch(_typeof(e.label)){case"string":s=e.label;break;case"function":s=e.label(t)}if(e.urlField&&(o=t.getData(),i=o[e.urlField]),e.url)switch(_typeof(e.url)){case"string":i=e.url;break;case"function":i=e.url(t)}return""+s+""},image:function(e,o){var i=this.sanitizeHTML(e.getValue()),n=t("");return n.on("load",function(){e.getRow().normalizeHeight()}),n},tick:function(t,e){var o=t.getValue(),i=t.getElement();return!0===o||"true"===o||"True"===o||1===o||"1"===o?(i.attr("aria-checked",!0),''):(i.attr("aria-checked",!1),"")},tickCross:function(t,e){var o=t.getValue(),i=t.getElement();return!0===o||"true"===o||"True"===o||1===o||"1"===o?(i.attr("aria-checked",!0),''):(i.attr("aria-checked",!1),'')},lookup:function(t,e){var o=t.getValue();return void 0===e[o]?(console.warn("Missing display value for "+o),o):e[o]},star:function(e,o){var i=e.getValue(),n=e.getElement(),s=o&&o.stars?o.stars:5,a=t(""),r=t(''),l=t('');i=parseInt(i)=u?parseFloat(i):u,o=(c-u)/100,i=Math.round((i-u)/o),_typeof(e.color)){case"string":n=e.color;break;case"function":n=e.color(r);break;case"object":if(Array.isArray(e.color)){var p=100/e.color.length,d=Math.floor(i/p);d=Math.min(d,e.color.length-1),d=Math.max(d,0),n=e.color[d];break}default:n="#2DC214"}switch(_typeof(e.legend)){case"string":s=e.legend;break;case"function":s=e.legend(r);break;case"boolean":s=r;break;default:s=!1}switch(_typeof(e.legendColor)){case"string":a=e.legendColor;break;case"function":a=e.legendColor(r);break;case"object":if(Array.isArray(e.legendColor)){var p=100/e.legendColor.length,d=Math.floor(i/p);d=Math.min(d,e.legendColor.length-1),d=Math.max(d,0),a=e.legendColor[d];break}default:a="#000"}return l.css({"min-width":"30px",position:"relative"}),l.attr("aria-label",i),"
"+(s?"
"+s+"
":"")},color:function(t,e){return t.getElement().css({"background-color":this.sanitizeHTML(t.getValue())}),""},buttonTick:function(t,e){return''},buttonCross:function(t,e){return''},rownum:function(t,e){return this.table.rowManager.activeRows.indexOf(t.getRow()._getSelf())+1},handle:function(t,e){return t.getElement().addClass("tabulator-row-handle"),"
"},responsiveCollapse:function(e,o){var i=this,n=t("
+-
");return e.getElement().addClass("tabulator-row-handle"),i.table.options.responsiveLayoutCollapseStartOpen&&n.addClass("open"),n.click(function(){t(this).toggleClass("open"),t(this).closest(".tabulator-row").find(".tabulator-responsive-collapse").toggle()}),n}},Tabulator.registerExtension("format",C);var E=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.initializationMode="left",this.active=!1};E.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1},E.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.definition.frozen?t.parent.isGroup?console.warn("Frozen Column Error - Grouped columns cannot be frozen"):t.isGroup?console.warn("Frozen Column Error - Column Groups cannot be frozen"):(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.extensions.frozen=e):this.initializationMode="right"},E.prototype.layout=function(){var t=this,e=this.table.rowManager.element,o=0;t.active&&(t.leftMargin=t._calcSpace(t.leftColumns,t.leftColumns.length),t.table.columnManager.headersElement.css("margin-left",t.leftMargin),t.rightMargin=t._calcSpace(t.rightColumns,t.rightColumns.length),t.table.columnManager.element.css("padding-right",t.rightMargin),t.table.rowManager.activeRows.forEach(function(e){t.layoutRow(e)}),t.table.extExists("columnCalcs")&&(t.table.extensions.columnCalcs.topInitialized&&t.table.extensions.columnCalcs.topRow&&t.layoutRow(t.table.extensions.columnCalcs.topRow),t.table.extensions.columnCalcs.botInitialized&&t.table.extensions.columnCalcs.botRow&&t.layoutRow(t.table.extensions.columnCalcs.botRow)),t.leftColumns.forEach(function(e,o){e.extensions.frozen.margin=t._calcSpace(t.leftColumns,o)+t.table.columnManager.scrollLeft,o==t.leftColumns.length-1?e.extensions.frozen.edge=!0:e.extensions.frozen.edge=!1,t.layoutColumn(e)}),o=t.table.rowManager.element.innerWidth()+t.table.columnManager.scrollLeft,e[0].scrollHeight>e.innerHeight()&&(o-=e[0].offsetWidth-e[0].clientWidth),t.rightColumns.forEach(function(e,i){e.extensions.frozen.margin=o-t._calcSpace(t.rightColumns,i+1),i==t.rightColumns.length-1?e.extensions.frozen.edge=!0:e.extensions.frozen.edge=!1,t.layoutColumn(e)}))},E.prototype.layoutColumn=function(t){var e=this;e.layoutElement(t.element,t),t.cells.forEach(function(o){e.layoutElement(o.element,t)})},E.prototype.layoutRow=function(t){t.getElement().css({"padding-left":this.leftMargin,"padding-right":this.rightMargin})},E.prototype.layoutElement=function(t,e){if(e.extensions.frozen){var o={position:"absolute",left:e.extensions.frozen.margin};t.css(o),t.addClass("tabulator-frozen"),e.extensions.frozen.edge&&t.addClass("tabulator-frozen-"+e.extensions.frozen.position)}},E.prototype._calcSpace=function(t,e){for(var o=0,i=0;i"),this.rows=[],this.displayIndex=0};R.prototype.initialize=function(){this.rows=[],this.table.columnManager.element.append(this.topElement)},R.prototype.setDisplayIndex=function(t){this.displayIndex=t},R.prototype.getDisplayIndex=function(){return this.displayIndex},R.prototype.isFrozen=function(){return!!this.rows.length},R.prototype.getRows=function(t){var e=t.slice(0);return this.rows.forEach(function(t){var o=e.indexOf(t);o>-1&&e.splice(o,1)}),e},R.prototype.freezeRow=function(t){t.extensions.frozen?console.warn("Freeze Error - Row is already frozen"):(t.extensions.frozen=!0,this.topElement.append(t.getElement()),t.initialize(),t.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(t),this.table.rowManager.refreshActiveData("display"),this.styleRows())},R.prototype.unfreezeRow=function(t){var e=this.rows.indexOf(t);t.extensions.frozen?(t.extensions.frozen=!1,t.getElement().detach(),this.table.rowManager.adjustTableSize(),this.rows.splice(e,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")},R.prototype.styleRows=function(t){var e=this;this.rows.forEach(function(t,o){e.table.rowManager.styleRow(t,o)})},Tabulator.registerExtension("frozenRows",R);var D=function(t){this.group=t,this.type="GroupComponent"};D.prototype.getKey=function(){return this.group.key},D.prototype.getElement=function(){return this.group.element},D.prototype.getRows=function(){var t=[];return this.group.rows.forEach(function(e){t.push(e.getComponent())}),t},D.prototype.getSubGroups=function(){var t=[];return this.group.groupList.forEach(function(e){t.push(e.getComponent())}),t},D.prototype.getParentGroup=function(){return!!this.group.parent&&this.group.parent.getComponent()},D.prototype.getVisibility=function(){return this.group.visible},D.prototype.show=function(){this.group.show()},D.prototype.hide=function(){this.group.hide()},D.prototype.toggle=function(){this.group.toggleVisibility()},D.prototype._getSelf=function(){return this.group};var M=function(e,o,i,n,s,a,r){this.groupManager=e,this.parent=o,this.key=n,this.level=i,this.field=s,this.hasSubGroups=i"),this.elementContents=t(""),this.arrowElement=t("
"),this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.extensions={},this.visible=r?r.visible:void 0!==e.startOpen[i]?e.startOpen[i]:e.startOpen[0],this.addBindings()};M.prototype.addBindings=function(){var t,e,o,i,n=this;n.groupManager.table.options.groupClick&&n.element.on("click",function(t){n.groupManager.table.options.groupClick(t,n.getComponent())}),n.groupManager.table.options.groupDblClick&&n.element.on("dblclick",function(t){n.groupManager.table.options.groupDblClick(t,n.getComponent())}),n.groupManager.table.options.groupContext&&n.element.on("contextmenu",function(t){n.groupManager.table.options.groupContext(t,n.getComponent())}),n.groupManager.table.options.groupTap&&(o=!1,n.element.on("touchstart",function(t){o=!0}),n.element.on("touchend",function(t){o&&n.groupManager.table.options.groupTap(t,n.getComponent()),o=!1})),n.groupManager.table.options.groupDblTap&&(t=null,n.element.on("touchend",function(e){t?(clearTimeout(t),t=null,n.groupManager.table.options.groupDblTap(e,n.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),n.groupManager.table.options.groupTapHold&&(e=null,n.element.on("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,n.groupManager.table.options.groupTapHold(t,n.getComponent())},1e3)}),n.element.on("touchend",function(t){clearTimeout(e),e=null})),n.groupManager.table.options.groupToggleElement&&(i="arrow"==n.groupManager.table.options.groupToggleElement?n.arrowElement:n.element,i.on("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),n.toggleVisibility()}))},M.prototype._addRowToGroup=function(t){var e=this.level+1;if(this.hasSubGroups){var o=this.groupManager.groupIDLookups[e].func(t.getData());if(!this.groups[o]){var i=new M(this.groupManager,this,e,o,this.groupManager.groupIDLookups[e].field,this.groupManager.headerGenerator[e]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[o]);this.groups[o]=i,this.groupList.push(i)}this.groups[o].addRow(t)}},M.prototype._addRow=function(t){this.rows.push(t),t.extensions.group=this},M.prototype.insertRow=function(t,e,o){var i=this.conformRowData({});t.updateData(i);var n=this.rows.indexOf(e);n>-1?o?this.rows.splice(n+1,0,t):this.rows.splice(n,0,t):o?this.rows.push(t):this.rows.unshift(t),t.extensions.group=this,this.generateGroupHeaderContents(),this.groupManager.table.extExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.extensions.columnCalcs.recalcGroup(this)},M.prototype.getRowIndex=function(t){},M.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},M.prototype.removeRow=function(t){var e=this.rows.indexOf(t);e>-1&&this.rows.splice(e,1),this.rows.length?(this.generateGroupHeaderContents(),this.groupManager.table.extExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.extensions.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},M.prototype.removeGroup=function(t){var e;this.groups[t.key]&&(delete this.groups[t.key],e=this.groupList.indexOf(t),e>-1&&this.groupList.splice(e,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},M.prototype.getHeadersAndRows=function(){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(e){t=t.concat(e.getHeadersAndRows())}):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.extExists("columnCalcs")&&this.groupManager.table.extensions.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.extensions.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.extExists("columnCalcs")&&this.groupManager.table.extensions.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.extensions.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):!this.groupList.length&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.options.groupClosedShowCalcs&&this.groupManager.table.extExists("columnCalcs")&&(this.groupManager.table.extensions.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.extensions.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),this.groupManager.table.extensions.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.extensions.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))),t},M.prototype.getRows=function(){return this._visSet(),this.visible?this.rows:[]},M.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(e){t+=e.getRowCount()}):t=this.rows.length,t},M.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},M.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.removeClass("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){t.calcs.top&&t.calcs.top.getElement().detach(),t.calcs.bottom&&t.calcs.bottom.getElement().detach(),t.getHeadersAndRows().forEach(function(t){t.getElement().detach()})}):this.rows.forEach(function(t){t.getElement().detach()}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex())),this.groupManager.table.options.groupVisibilityChanged(this.getComponent(),!1)},M.prototype.show=function(){var t=this;if(t.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.addClass("tabulator-group-visible");var e=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){e.after(t.getElement()),t.initialize(),e=t.getElement()})}):t.rows.forEach(function(t){e.after(t.getElement()),t.initialize(),e=t.getElement()}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex())}this.groupManager.table.options.groupVisibilityChanged(this.getComponent(),!0)},M.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(e){t.push(e.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getRowCount()))},M.prototype.getRowGroup=function(t){var e=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(t);i&&(e=i)}):this.rows.find(function(e){return e===t})&&(e=this),e},M.prototype.generateGroupHeaderContents=function(){var t=[];this.rows.forEach(function(e){t.push(e.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent()),this.element.empty().append(this.elementContents).prepend(this.arrowElement)},M.prototype.getElement=function(){return this.addBindingsd=!1,this._visSet(),this.visible?this.element.addClass("tabulator-group-visible"):this.element.removeClass("tabulator-group-visible"),this.element.children().detach(),this.generateGroupHeaderContents(),this.element},M.prototype.normalizeHeight=function(){this.setHeight(this.element.innerHeight())},M.prototype.initialize=function(t){this.initialized&&!t||(this.normalizeHeight(),this.initialized=!0)},M.prototype.reinitialize=function(){this.initialized=!1,this.height=0,this.element.is(":visible")&&this.initialize(!0)},M.prototype.setHeight=function(t){this.height!=t&&(this.height=t,this.outerHeight=this.element.outerHeight())},M.prototype.getHeight=function(){return this.outerHeight},M.prototype.getGroup=function(){return this},M.prototype.reinitializeHeight=function(){},M.prototype.calcHeight=function(){},M.prototype.setCellHeight=function(){},M.prototype.clearCellHeight=function(){},M.prototype.getComponent=function(){return new D(this)};var T=function(t){this.table=t,this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.groups={},this.displayIndex=0};T.prototype.initialize=function(){var t=this,e=t.table.options.groupBy,o=t.table.options.groupStartOpen,i=t.table.options.groupHeader;if(t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.extensions.localize.bind("groups|item",function(e,o){t.headerGenerator[0]=function(t,i,n){return(void 0===t?"":t)+"("+i+" "+(1===i?e:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(e)||e)this.table.extExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.extensions.columnCalcs.removeCalcs();else if(this.table.extExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach(function(e){e.definition.topCalc&&t.table.extensions.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&t.table.extensions.columnCalcs.initializeBottomRow()})}Array.isArray(e)||(e=[e]),e.forEach(function(e){var o,i;"function"==typeof e?o=e:(i=t.table.columnManager.getColumnByField(e),o=i?function(t){return i.getFieldValue(t)}:function(t){return t[e]}),t.groupIDLookups.push({field:"function"!=typeof e&&e,func:o})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=o),i&&(t.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},T.prototype.setDisplayIndex=function(t){this.displayIndex=t},T.prototype.getDisplayIndex=function(){return this.displayIndex},T.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping(),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped(this.getGroups()),this.updateGroupRows()):t.slice(0)},T.prototype.getGroups=function(){var t=[];return this.groupList.forEach(function(e){t.push(e.getComponent())}),t},T.prototype.getRowGroup=function(t){var e=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(t);i&&(e=i)}),e},T.prototype.countGroups=function(){return this.groupList.length},T.prototype.generateGroups=function(t){var e=this,o=e.groups;e.groups={},e.groupList=[],t.forEach(function(t){e.assignRowToGroup(t,o)})},T.prototype.assignRowToGroup=function(t,e){var o=this.groupIDLookups[0].func(t.getData()),e=e||[],i=!this.groups[o];if(i){var n=new M(this,!1,0,o,this.groupIDLookups[0].field,this.headerGenerator[0],e[o]);this.groups[o]=n,this.groupList.push(n)}return this.groups[o].addRow(t),!i},T.prototype.updateGroupRows=function(t){var e=this,o=[];if(e.groupList.forEach(function(t){o=o.concat(t.getHeadersAndRows())}),t){var i=e.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),e.table.rowManager.refreshActiveData("group",!0,!0)}return o},T.prototype.scrollHeaders=function(t){this.groupList.forEach(function(e){e.arrowElement.css("margin-left",t)})},T.prototype.removeGroup=function(t){var e;this.groups[t.key]&&(delete this.groups[t.key],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1))},Tabulator.registerExtension("groupRows",T);var z=function(t){this.table=t,this.history=[],this.index=-1};z.prototype.clear=function(){this.history=[],this.index=-1},z.prototype.action=function(t,e,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:o}),this.index++},z.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo(t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},z.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo(t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},z.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,e)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},z.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,e)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},z.prototype._rebindRow=function(t,e){this.history.forEach(function(o){if(o.component instanceof l)o.component===t&&(o.component=e);else if(o.component instanceof u&&o.component.row===t){var i=o.component.column.getField();i&&(o.component=e.getCell(i))}})},Tabulator.registerExtension("history",z);var k=function(t){this.table=t,this.hasIndex=!1};k.prototype.parseTable=function(){var e=this,o=e.table.element,i=e.table.options,n=(i.columns,t("th",o)),s=t("tbody tr",o),a=[];e.hasIndex=!1,e.table.options.htmlImporting(),e._extractOptions(o,i),n.length?e._extractHeaders(o):e._generateBlankHeaders(o),s.each(function(o){var n={};e.hasIndex||(n[i.index]=o),t("td",t(this)).each(function(e){n[t(this).data("field")]=t(this).html()}),a.push(n)});var r=t("
"),l=o.prop("attributes");t.each(l,function(){r.attr(this.name,this.value)}),o.replaceWith(r),i.data=a,e.table.options.htmlImported(),r.tabulator(i)},k.prototype._extractOptions=function(t,e){var o=this,i=t[0].attributes;for(var n in i){var s,a=i[n];if(a&&a.name&&0===a.name.indexOf("tabulator-")){s=a.name.replace("tabulator-","");for(var r in e)r.toLowerCase()==s&&(e[r]=o._attribValue(a.value))}}},k.prototype._attribValue=function(t){return"true"===t||"false"!==t&&t},k.prototype._findCol=function(t){return this.table.options.columns.find(function(e){return e.title===t})||!1},k.prototype._extractHeaders=function(e){var o=this,i=t("th",e),n=t("tbody tr",e);i.each(function(e){var i,s,a=t(this),r=!1,l=o._findCol(a.text());l?r=!0:l={title:a.text().trim()},l.field||(l.field=a.text().trim().toLowerCase().replace(" ","_")),i=a.attr("width"),i&&!l.width&&(l.width=i),s=a[0].attributes,o._extractOptions(a,l);for(var c in s){var u,h=s[c];h&&h.name&&0===h.name.indexOf("tabulator-")&&(u=h.name.replace("tabulator-",""),l[u]=o._attribValue(h.value))}t("td:eq("+e+")",n).data("field",l.field),l.field==o.table.options.index&&(o.hasIndex=!0),r||o.table.options.columns.push(l)})},k.prototype._generateBlankHeaders=function(e){ -var o=this,i=t("tr:first td",e),n=t("tbody tr",e);i.each(function(e){var i={title:"",field:"col"+e};t("td:eq("+e+")",n).data("field",i.field);var s=t(this).attr("width");s&&(i.width=s),o.table.options.columns.push(i)})},Tabulator.registerExtension("htmlTableImport",k);var S=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};S.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var o in this.bindings)e[o]=this.bindings[o];if(Object.keys(t).length)for(var i in t)e[i]=t[i];this.mapBindings(e),this.bindEvents()}},S.prototype.mapBindings=function(t){var e=this,o=this;for(var i in t)!function(i){e.actions[i]?t[i]&&("object"!==_typeof(t[i])&&(t[i]=[t[i]]),t[i].forEach(function(t){o.mapBinding(i,t)})):console.warn("Key Binding Error - no such action:",i)}(i)},S.prototype.mapBinding=function(t,e){var o=this,i={action:this.actions[t],keys:[],ctrl:!1,shift:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;default:t=parseInt(t),i.keys.push(t),o.watchKeys[t]||(o.watchKeys[t]=[]),o.watchKeys[t].push(i)}})},S.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var o=e.keyCode,i=t.watchKeys[o];i&&(t.pressedKeys.push(o),i.forEach(function(o){t.checkBinding(e,o)}))},this.keydownBinding=function(e){var o=e.keyCode;if(t.watchKeys[o]){var i=t.pressedKeys.indexOf(o);i>-1&&t.pressedKeys.splice(i,1)}},this.table.element.on("keydown",this.keyupBinding),this.table.element.on("keyup",this.keydownBinding)},S.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.off("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.off("keyup",this.keydownBinding)},S.prototype.checkBinding=function(t,e){var o=this,i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&(e.keys.forEach(function(t){-1==o.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(o,t),!0)},S.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},S.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,o=e.scrollTop-e.height;e.element[0].scrollHeight;t.preventDefault(),e.displayRowsCount&&(o>=0?e.element.scrollTop(o):e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,o=e.scrollTop+e.height,i=e.element[0].scrollHeight;t.preventDefault(),e.displayRowsCount&&(o<=i?e.element.scrollTop(o):e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().next())},navLeft:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.extExists("history")&&this.table.extExists("edit")&&(this.table.extensions.edit.currentCell||(t.preventDefault(),this.table.extensions.history.undo()))},redo:function(t){this.table.options.history&&this.table.extExists("history")&&this.table.extExists("edit")&&(this.table.extensions.edit.currentCell||(t.preventDefault(),this.table.extensions.history.redo()))},copyToClipboard:function(t){this.table.extensions.edit.currentCell||this.table.extExists("clipboard",!0)&&this.table.extensions.clipboard.copy(this.table.options.selectable&&"highlight"!=this.table.options.selectable?"selected":"active",null,null,null,!0)}},Tabulator.registerExtension("keybindings",S);var F=function(e){this.table=e,this.placeholderElement=t("
"),this.hoverElement=t(),this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};F.prototype.initializeColumn=function(t){var e=this,o={};t.extensions.frozen||(o.mousemove=function(o){t.parent===e.moving.parent&&(o.pageX-t.element.offset().left+e.table.columnManager.element.scrollLeft()>t.getWidth()/2?e.toCol===t&&e.toColAfter||(t.element.after(e.placeholderElement),e.moveColumn(t,!0)):(e.toCol!==t||e.toColAfter)&&(t.element.before(e.placeholderElement),e.moveColumn(t,!1)))}.bind(e),t.getElement().on("mousedown",function(o){e.checkTimeout=setTimeout(function(){e.startMove(o,t)},e.checkPeriod)}),t.getElement().on("mouseup",function(t){e.checkTimeout&&clearTimeout(e.checkTimeout)})),t.extensions.moveColumn=o},F.prototype.startMove=function(e,o){var i=this,n=o.getElement();i.moving=o,i.startX=e.pageX-n.offset().left,i.table.element.addClass("tabulator-block-select"),i.placeholderElement.css({width:o.getWidth(),height:o.getHeight()}),n.before(i.placeholderElement),n.detach(),i.hoverElement=n.clone(),i.hoverElement.addClass("tabulator-moving"),i.table.columnManager.getElement().append(i.hoverElement),i.hoverElement.css({left:0,bottom:0}),i._bindMouseMove(),t("body").on("mousemove",i.moveHover),t("body").on("mouseup",i.endMove),i.moveHover(e)},F.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.extensions.moveColumn.mousemove&&t.element.on("mousemove",t.extensions.moveColumn.mousemove)})},F.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.extensions.moveColumn.mousemove&&t.element.off("mousemove",t.extensions.moveColumn.mousemove)})},F.prototype.moveColumn=function(t,e){var o=this,i=this.moving.getCells();o.toCol=t,o.toColAfter=e,e?t.getCells().forEach(function(t,e){t.getElement().after(i[e].getElement())}):t.getCells().forEach(function(t,e){t.getElement().before(i[e].getElement())})},F.prototype.endMove=function(e){var o=this;o._unbindMouseMove(),o.placeholderElement.after(o.moving.getElement()),o.placeholderElement.detach(),o.hoverElement.detach(),o.table.element.removeClass("tabulator-block-select"),o.toCol&&o.table.columnManager.moveColumn(o.moving,o.toCol,o.toColAfter),o.moving=!1,o.toCol=!1,o.toColAfter=!1,t("body").off("mousemove",o.moveHover),t("body").off("mouseup",o.endMove)},F.prototype.moveHover=function(t){var e,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft(),s=t.pageX-i.offset().left+n;o.hoverElement.css({left:s-o.startX}),s-n"),this.hoverElement=t(),this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.connection=!1,this.connections=[],this.connectedTable=!1,this.connectedRow=!1};P.prototype.initialize=function(t){this.connection=this.table.options.movableRowsConnectedTables},P.prototype.setHandle=function(t){this.hasHandle=t},P.prototype.initializeRow=function(t){var e=this,o={};o.mouseup=function(o){e.tableRowDrop(o,t)}.bind(e),o.mousemove=function(o){o.pageY-t.element.offset().top+e.table.rowManager.element.scrollTop()>t.getHeight()/2?e.toRow===t&&e.toRowAfter||(t.element.after(e.placeholderElement),e.moveRow(t,!0)):(e.toRow!==t||e.toRowAfter)&&(t.element.before(e.placeholderElement),e.moveRow(t,!1))}.bind(e),this.hasHandle||(t.getElement().on("mousedown",function(o){e.checkTimeout=setTimeout(function(){e.startMove(o,t)},e.checkPeriod)}),t.getElement().on("mouseup",function(t){e.checkTimeout&&clearTimeout(e.checkTimeout)})),t.extensions.moveRow=o},P.prototype.initializeCell=function(t){var e=this;t.getElement().on("mousedown",function(o){e.checkTimeout=setTimeout(function(){e.startMove(o,t.row)},e.checkPeriod)}),t.getElement().on("mouseup",function(t){e.checkTimeout&&clearTimeout(e.checkTimeout)})},P.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.extensions.moveRow.mousemove&&t.element.on("mousemove",t.extensions.moveRow.mousemove)})},P.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.extensions.moveRow.mousemove&&t.element.off("mousemove",t.extensions.moveRow.mousemove)})},P.prototype.startMove=function(e,o){var i=o.getElement();this.setStartPosition(e,o),this.moving=o,this.table.element.addClass("tabulator-block-select"),this.placeholderElement.css({width:o.getWidth(),height:o.getHeight()}),this.connection?(this.table.element.addClass("tabulator-movingrow-sending"),this.connectToTables(o)):(i.before(this.placeholderElement),i.detach()),this.hoverElement=i.clone(),this.hoverElement.addClass("tabulator-moving"),this.connection?(t("body").append(this.hoverElement),this.hoverElement.css({left:0,top:0,width:this.table.element.innerWidth(),"white-space":"nowrap",overflow:"hidden","pointer-events":"none"})):(this.table.rowManager.getTableElement().append(this.hoverElement),this.hoverElement.css({left:0,top:0}),this._bindMouseMove()),t("body").on("mousemove",this.moveHover),t("body").on("mouseup",this.endMove),this.moveHover(e)},P.prototype.setStartPosition=function(t,e){var o,i;o=e.getElement(),this.connection?(i=o[0].getBoundingClientRect(),this.startX=i.left-t.pageX+window.scrollX,this.startY=i.top-t.pageY+window.scrollY):this.startY=t.pageY-o.offset().top},P.prototype.endMove=function(e){this._unbindMouseMove(),this.connection||(this.placeholderElement.after(this.moving.getElement()),this.placeholderElement.detach()),this.hoverElement.detach(),this.table.element.removeClass("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,t("body").off("mousemove",this.moveHover),t("body").off("mouseup",this.endMove),this.connection&&(this.table.element.removeClass("tabulator-movingrow-sending"),this.disconnectFromTables())},P.prototype.moveRow=function(t,e){this.toRow=t,this.toRowAfter=e},P.prototype.moveHover=function(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)},P.prototype.moveHoverTable=function(t){var e=this.table.rowManager.getElement(),o=e.scrollTop(),i=t.pageY-e.offset().top+o;this.hoverElement.css({top:i-this.startY})},P.prototype.moveHoverConnections=function(t){this.hoverElement.css({left:this.startX+t.pageX,top:this.startY+t.pageY})},P.prototype.connectToTables=function(t){var e=this.table.extensions.comms.getConnections(this.connection);this.table.options.movableRowsSendingStart(e),this.table.extensions.comms.send(this.connection,"moveRow","connect",{row:t})},P.prototype.disconnectFromTables=function(){var t=this.table.extensions.comms.getConnections(this.connection);this.table.options.movableRowsSendingStop(t),this.table.extensions.comms.send(this.connection,"moveRow","disconnect")},P.prototype.connect=function(t,e){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=e,this.table.element.addClass("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.extensions.moveRow&&t.extensions.moveRow.mouseup&&t.element.on("mouseup",t.extensions.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.on("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart(e,t),!0)},P.prototype.disconnect=function(t){var e=this;t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.removeClass("tabulator-movingrow-receiving"),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.extensions.moveRow&&t.extensions.moveRow.mouseup&&t.element.off("mouseup",t.extensions.moveRow.mouseup)}),e.table.element.off("mouseup",e.tableRowDropEvent),this.table.options.movableRowsReceivingStop(t)):console.warn("Move Row Error - trying to disconnect from non connected table")},P.prototype.dropComplete=function(t,e,i){var n=!1;if(i){switch(_typeof(this.table.options.movableRowsSender)){case"string":n=this.senders[this.table.options.movableRowsSender];break;case"function":n=this.table.options.movableRowsSender}n?n.call(this,this.moving.getComponent(),e?e.getComponent():o,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent(this.moving.getComponent(),e?e.getComponent():o,t)}else this.table.options.movableRowsSentFailed(this.moving.getComponent(),e?e.getComponent():o,t);this.endMove()},P.prototype.tableRowDrop=function(t,e){var i=!1,n=!1;switch(t.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":i=this.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?n=i.call(this,this.connectedRow.getComponent(),e?e.getComponent():o,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),n?this.table.options.movableRowsReceived(this.connectedRow.getComponent(),e?e.getComponent():o,this.connectedTable):this.table.options.movableRowsReceivedFailed(this.connectedRow.getComponent(),e?e.getComponent():o,this.connectedTable),this.table.extensions.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:e,success:n})},P.prototype.receivers={insert:function(t,e,i){return this.table.addRow(t.getData(),o,e),!0},add:function(t,e,o){return this.table.addRow(t.getData()),!0},update:function(t,e,o){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,i){return!!e&&(this.table.addRow(t.getData(),o,e),e.delete(),!0)}},P.prototype.senders={delete:function(t,e,o){t.delete()}},P.prototype.commsReceived=function(t,e,o){switch(e){case"connect":return this.connect(t,o.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,o.row,o.success)}},Tabulator.registerExtension("moveRow",P);var H=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"]};H.prototype.initializeColumn=function(t){var e=this,o=!1,i={};this.mapDepricatedFunctionality(t),this.allowedTypes.forEach(function(n){var s,a="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[a]&&(s=e.lookupMutator(t.definition[a]))&&(o=!0,i[a]={mutator:s,params:t.definition[a+"Params"]||{}})}),o&&(t.extensions.mutate=i)},H.prototype.mapDepricatedFunctionality=function(t){var e="";t.definition.mutateType&&("all"!=t.definition.mutateType?(e="mutator"+(type.charAt(0).toUpperCase()+type.slice(1)),t.defintion[e]=t.definition.mutator,delete t.definition.mutator,console.warn("The %cmutateType='"+t.definition.mutateType+"'' %coption has been depricated and will be removed in version 4.0, use the %c "+e+"%c option instead","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")):console.warn("The %cmutateType='all'' %coption has been depricated and will be removed in version 4.0, it is no longer needed","font-weight:bold;","font-weight:regular;"))},H.prototype.lookupMutator=function(t){var e=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?e=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e},H.prototype.transformRow=function(t,e){var o=this,i="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return o.table.columnManager.traverse(function(o){var n;o.extensions.mutate&&(n=o.extensions.mutate[i]||o.extensions.mutate.mutator||!1)&&o.setFieldValue(t,n.mutator(o.getFieldValue(t),t,e,n.params,o.getComponent()))}),t},H.prototype.transformCell=function(t,e){var o=t.column.extensions.mutate.mutatorEdit||t.column.extensions.mutate.mutator||!1;return o?o.mutator(e,t.row.getData(),"edit",o.params,t.getComponent()):e},H.prototype.mutators={},Tabulator.registerExtension("mutator",H);var L=function(e){this.table=e,this.element=t(""),this.pagesElement=t(""),this.firstBut=t(""),this.prevBut=t(""),this.nextBut=t(""),this.lastBut=t(""),this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.paginator=!1,this.displayIndex=0};L.prototype.initialize=function(t){var e=this;for(var o in e.table.options.paginationDataSent)e.paginationDataSentNames[o]=e.table.options.paginationDataSent[o];for(var i in e.table.options.paginationDataReceived)e.paginationDataReceivedNames[i]=e.table.options.paginationDataReceived[i];e.table.options.paginator&&(e.paginator=e.table.options.paginator),e.table.extensions.localize.bind("pagination|first",function(t){e.firstBut.html(t)}),e.table.extensions.localize.bind("pagination|first_title",function(t){e.firstBut.attr("aria-label",t).attr("title",t)}),e.table.extensions.localize.bind("pagination|prev",function(t){e.prevBut.html(t)}),e.table.extensions.localize.bind("pagination|prev_title",function(t){e.prevBut.attr("aria-label",t).attr("title",t)}),e.table.extensions.localize.bind("pagination|next",function(t){e.nextBut.html(t)}),e.table.extensions.localize.bind("pagination|next_title",function(t){e.nextBut.attr("aria-label",t).attr("title",t)}),e.table.extensions.localize.bind("pagination|last",function(t){e.lastBut.html(t)}),e.table.extensions.localize.bind("pagination|last_title",function(t){e.lastBut.attr("aria-label",t).attr("title",t)}),e.firstBut.on("click",function(){e.setPage(1)}),e.prevBut.on("click",function(){e.previousPage()}),e.nextBut.on("click",function(){e.nextPage()}),e.lastBut.on("click",function(){e.setPage(e.max)}),e.table.options.paginationElement&&(e.element=e.table.options.paginationElement),e.element.append(e.firstBut),e.element.append(e.prevBut),e.element.append(e.pagesElement),e.element.append(e.nextBut),e.element.append(e.lastBut),e.table.options.paginationElement||t||e.table.footerManager.append(e.element,e),e.mode=e.table.options.pagination,e.size=e.table.options.paginationSize||Math.floor(e.table.rowManager.getElement().innerHeight()/24),e.count=e.table.options.paginationButtonCount},L.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0},L.prototype.setDisplayIndex=function(t){this.displayIndex=t},L.prototype.getDisplayIndex=function(){return this.displayIndex},L.prototype.setMaxRows=function(t){this.max=t?Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)},L.prototype.reset=function(t){return("local"==this.mode||t)&&(this.page=1),!0},L.prototype.setMaxPage=function(t){this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())},L.prototype.setPage=function(t){return t>0&&t<=this.max?(this.page=t,this.trigger(),!0):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",t),!1)},L.prototype.setPageSize=function(t){t>0&&(this.size=t)},L.prototype._setPageButtons=function(){var t=this,e=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&s<=t.max&&t.pagesElement.append(t._generatePageButton(s));this.footerRedraw()},L.prototype._generatePageButton=function(e){var o=this,i=t("");return i.on("click",function(t){o.setPage(e)}),i},L.prototype.previousPage=function(){return this.page>1?(this.page--,this.trigger(),!0):(console.warn("Pagination Error - Previous page would be less than page 1:",0),!1)},L.prototype.nextPage=function(){return this.page-1&&(i=i.substr(n),s=i.indexOf(";"),s>-1&&(i=i.substr(0,s)),e=i.replace(o+"=",""));break;default:console.warn("Persistance Load Error - invalid mode selected",this.mode)}return!!e&&JSON.parse(e)},_.prototype.mergeDefinition=function(t,e){var o=this,i=[];return e=e||[],e.forEach(function(e,n){var s=o._findColumn(t,e);s&&(s.width=e.width,s.visible=e.visible,s.columns&&(s.columns=o.mergeDefinition(s.columns,e.columns)),i.push(s))}),t.forEach(function(t,n){o._findColumn(e,t)||(i.length>n?i.splice(n,0,t):i.push(t))}),i},_.prototype._findColumn=function(t,e){var o=e.columns?"group":e.field?"field":"object";return t.find(function(t){switch(o){case"group":return t.title===e.title&&t.columns.length===e.columns.length;case"field":return t.field===e.field;case"object":return t===e}})},_.prototype.save=function(t){var e={};switch(t){case"columns":e=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":e=this.table.extensions.filter.getFilters();break;case"sort":e=this.validateSorters(this.table.extensions.sort.getSort())}var o=this.id+("columns"===t?"":"-"+t);this.saveData(o,e)},_.prototype.validateSorters=function(t){return t.forEach(function(t){t.column=t.field,delete t.field}),t},_.prototype.saveData=function(t,e){switch(e=JSON.stringify(e),this.mode){case"local":localStorage.setItem(t,e);break;case"cookie":var o=new Date;o.setDate(o.getDate()+1e4),document.cookie=t+"="+e+"; expires="+o.toUTCString();break;default:console.warn("Persistance Save Error - invalid mode selected",this.mode)}},_.prototype.parseColumns=function(t){var e=this,o=[];return t.forEach(function(t){var i={};t.isGroup?(i.title=t.getDefinition().title,i.columns=e.parseColumns(t.getColumns())):(i.title=t.getDefinition().title,i.field=t.getField(),i.width=t.getWidth(),i.visible=t.visible),o.push(i)}),o},Tabulator.registerExtension("persistence",_);var B=function(t){this.table=t,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};B.prototype.initializeColumn=function(t,e,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===t&&(n="textarea"==e.definition.formatter||e.definition.variableHeight,e.extensions.resize={variableHeight:n}),!0===s||s==t){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var r=document.createElement("div");r.className="tabulator-col-resize-handle prev",a.addEventListener("click",function(t){t.stopPropagation()}),a.addEventListener("mousedown",function(t){var o=e.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=e,i._mouseDown(t,o))}),a.addEventListener("dblclick",function(t){i._checkResizability(e)&&e.reinitializeWidth(!0)}),r.addEventListener("click",function(t){t.stopPropagation()}),r.addEventListener("mousedown",function(t){var o,n,s;(o=e.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=e,i._mouseDown(t,s)))}),r.addEventListener("dblclick",function(t){var o,n,s;(o=e.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&s.reinitializeWidth(!0))}),o.append(a).append(r)}},B.prototype._checkResizability=function(t){return void 0!==t.definition.resizable?t.definition.resizable:this.table.options.resizableColumns},B.prototype._mouseDown=function(e,o){function i(t){o.setWidth(s.startWidth+(t.screenX-s.startX)),!s.table.browserSlow&&o.extensions.resize&&o.extensions.resize.variableHeight&&o.checkCellHeights()}function n(e){s.startColumn.extensions.edit&&(s.startColumn.extensions.edit.blocked=!1),s.table.browserSlow&&o.extensions.resize&&o.extensions.resize.variableHeight&&o.checkCellHeights(),t("body").off("mouseup",i),t("body").off("mousemove",i),s.table.element.removeClass("tabulator-block-select"),s.table.options.persistentLayout&&s.table.extExists("persistence",!0)&&s.table.extensions.persistence.save("columns"),s.table.options.columnResized(s.startColumn.getComponent())}var s=this;s.table.element.addClass("tabulator-block-select"),e.stopPropagation(),s.startColumn.extensions.edit&&(s.startColumn.extensions.edit.blocked=!0),s.startX=e.screenX,s.startWidth=o.getWidth(),t("body").on("mousemove",i),t("body").on("mouseup",n)},Tabulator.registerExtension("resizeColumns",B);var A=function(t){this.table=t,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};A.prototype.initializeRow=function(t){var e=this,o=document.createElement("div");o.className="tabulator-row-resize-handle";var i=document.createElement("div");i.className="tabulator-row-resize-handle prev",o.addEventListener("click",function(t){t.stopPropagation()}),o.addEventListener("mousedown",function(o){e.startRow=t,e._mouseDown(o,t)}),i.addEventListener("click",function(t){t.stopPropagation()}),i.addEventListener("mousedown",function(o){var i=e.table.rowManager.prevDisplayRow(t);i&&(e.startRow=i,e._mouseDown(o,i))}),t.getElement().append(o).append(i)},A.prototype._mouseDown=function(e,o){function i(t){o.setHeight(s.startHeight+(t.screenY-s.startY))}function n(e){t("body").off("mouseup",i),t("body").off("mousemove",i),s.table.element.removeClass("tabulator-block-select"),s.table.options.rowResized(o.getComponent())}var s=this -;s.table.element.addClass("tabulator-block-select"),e.stopPropagation(),s.startY=e.screenY,s.startHeight=o.getHeight(),t("body").on("mousemove",i),t("body").on("mouseup",n)},Tabulator.registerExtension("resizeRows",A);var I=function(t){this.table=t,this.binding=!1,this.observer=!1};I.prototype.initialize=function(e){var o=this.table;"undefined"!=typeof ResizeObserver&&"virtual"===o.rowManager.getRenderMode()?(this.observer=new ResizeObserver(function(t){o.redraw()}),this.observer.observe(o.element[0])):(this.binding=function(){o.element.tabulator("redraw")},t(window).resize(this.binding))},I.prototype.clearBindings=function(e){this.binding&&t(window).off("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element[0])},Tabulator.registerExtension("resizeTable",I);var N=function(t){this.table=t,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0};N.prototype.initialize=function(){var t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(e,o){e.extensions.responsive&&e.extensions.responsive.order&&e.extensions.responsive.visible&&(e.extensions.responsive.index=o,t.push(e),e.visible||"collapse"!==this.mode||this.hiddenColumns.push(e))}),t=t.reverse(),t=t.sort(function(t,e){return e.extensions.responsive.order-t.extensions.responsive.order||e.extensions.responsive.index-t.extensions.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent()},N.prototype.initializeColumn=function(t){var e=t.getDefinition();t.extensions.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}},N.prototype.layoutRow=function(e){var o=e.getElement(),i=t("
");o.hasClass("tabulator-calcs")||(e.extensions.responsiveLayout={element:i},this.collapseStartOpen||i.hide(),e.getElement().append(i),this.generateCollapsedRowContent(e))},N.prototype.updateColumnVisibility=function(t,e){t.extensions.responsive&&(t.extensions.responsive.visible=e,this.initialize())},N.prototype.hideColumn=function(t){t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent())},N.prototype.showColumn=function(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&(e=this.hiddenColumns.indexOf(t),e>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent())},N.prototype.update=function(){for(var t=this,e=!0;e;){var o="fitColumns"==t.table.extensions.layout.getMode()?t.table.columnManager.getFlexBaseWidth():t.table.columnManager.getWidth(),i=t.table.columnManager.element.innerWidth()-o;if(i<0){var n=t.columns[t.index];n?(t.hideColumn(n),t.index++):e=!1}else{var s=t.columns[t.index-1];s&&i>0&&i>=s.getWidth()?(t.showColumn(s),t.index--):e=!1}t.table.rowManager.activeRowsCount||t.table.rowManager.renderEmptyScroll()}},N.prototype.generateCollapsedContent=function(){var t=this;this.table.rowManager.getDisplayRows().forEach(function(e){t.generateCollapsedRowContent(e)})},N.prototype.generateCollapsedRowContent=function(t){var e;t.extensions.responsiveLayout&&(e=t.extensions.responsiveLayout.element,e.empty(),e.append(this.collapseFormatter(this.generateCollapsedRowData(t))))},N.prototype.generateCollapsedRowData=function(e){var o,i=this,n=e.getData(),s={};return this.hiddenColumns.forEach(function(a){var r=a.getFieldValue(n);a.definition.title&&a.field&&(a.extensions.format&&i.table.options.responsiveLayoutCollapseUseFormatters?(o={value:!1,data:{},getValue:function(){return r},getData:function(){return n},getElement:function(){return t()},getRow:function(){return e.getComponent()},getColumn:function(){return a.getComponent()}},s[a.definition.title]=a.extensions.format.formatter.call(i.table.extensions.format,o,a.extensions.format.params)):s[a.definition.title]=r)}),s},N.prototype.formatCollapsedData=function(e){var o=t("
");for(var i in e)o.append(""+i+""+e[i]+"");return Object.keys(e).length?o:""},Tabulator.registerExtension("responsiveLayout",N);var V=function(t){this.table=t,this.selecting=!1,this.selectPrev=[],this.selectedRows=[]};V.prototype.clearSelectionData=function(t){this.selecting=!1,this.selectPrev=[],this.selectedRows=[],t||this._rowSelectionChanged()},V.prototype.initializeRow=function(e){var o=this,i=e.getElement(),n=function e(){setTimeout(function(){o.selecting=!1},50),t("body").off("mouseup",e)};e.extensions.select={selected:!1},o.table.options.selectableCheck(e.getComponent())?(i.addClass("tabulator-selectable").removeClass("tabulator-unselectable"),o.table.options.selectable&&"highlight"!=o.table.options.selectable&&(i.on("click",function(t){o.selecting||o.toggleRow(e)}),i.on("mousedown",function(i){if(i.shiftKey)return o.selecting=!0,o.selectPrev=[],t("body").on("mouseup",n),t("body").on("keyup",n),o.toggleRow(e),!1}),i.on("mouseenter",function(t){o.selecting&&(o.toggleRow(e),o.selectPrev[1]==e&&o.toggleRow(o.selectPrev[0]))}),i.on("mouseout",function(t){o.selecting&&o.selectPrev.unshift(e)}))):e.getElement().addClass("tabulator-unselectable").removeClass("tabulator-selectable")},V.prototype.toggleRow=function(t){this.table.options.selectableCheck(t.getComponent())&&(t.extensions.select.selected?this._deselectRow(t):this._selectRow(t))},V.prototype.selectRows=function(t){var e=this;switch(void 0===t?"undefined":_typeof(t)){case"undefined":e.table.rowManager.rows.forEach(function(t){e._selectRow(t,!1,!0)}),e._rowSelectionChanged();break;case"boolean":!0===t&&(e.table.rowManager.activeRows.forEach(function(t){e._selectRow(t,!1,!0)}),e._rowSelectionChanged());break;default:Array.isArray(t)?(t.forEach(function(t){e._selectRow(t)}),e._rowSelectionChanged()):e._selectRow(t)}},V.prototype._selectRow=function(t,e,o){var i=this;if(!isNaN(i.table.options.selectable)&&!0!==i.table.options.selectable&&!o&&i.selectedRows.length>=i.table.options.selectable){if(!i.table.options.selectableRollingSelection)return!1;i._deselectRow(i.selectedRows[0])}var n=i.table.rowManager.findRow(t);if(n){if(-1==i.selectedRows.indexOf(n)){var i=this;n.extensions.select.selected=!0,n.getElement().addClass("tabulator-selected"),i.selectedRows.push(n),e||(i.table.options.rowSelected(n.getComponent()),i._rowSelectionChanged())}}else e||console.warn("Selection Error - No such row found, ignoring selection:"+t)},V.prototype.deselectRows=function(t){var e=this;if(void 0===t){for(var o=e.selectedRows.length,i=0;i-1&&(n.extensions.select.selected=!1,n.getElement().removeClass("tabulator-selected"),i.selectedRows.splice(o,1),e||(i.table.options.rowDeselected(n.getComponent()),i._rowSelectionChanged())):e||console.warn("Deselection Error - No such row found, ignoring selection:"+t)},V.prototype.getSelectedData=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getData())}),t},V.prototype.getSelectedRows=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getComponent())}),t},V.prototype._rowSelectionChanged=function(){this.table.options.rowSelectionChanged(this.getSelectedData(),this.getSelectedRows())},Tabulator.registerExtension("selectRow",V);var j=function(t){this.table=t,this.sortList=[],this.changed=!1};j.prototype.initializeColumn=function(e,o){var i=this,n=!1;switch(_typeof(e.definition.sorter)){case"string":i.sorters[e.definition.sorter]?n=i.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":n=e.definition.sorter}e.extensions.sort={sorter:n,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc"},!1!==e.definition.headerSort&&(e.element.addClass("tabulator-sortable"),o.append(t("
")),e.element.on("click",function(t){var o="",n=[],s=!1;e.extensions.sort&&(o="asc"==e.extensions.sort.dir?"desc":"desc"==e.extensions.sort.dir?"asc":e.extensions.sort.startingDir,t.shiftKey||t.ctrlKey?(n=i.getSort(),s=n.findIndex(function(t){return t.field===e.getField()}),s>-1?(n[s].dir="asc"==n[s].dir?"desc":"asc",s!=n.length-1&&n.push(n.splice(s,1)[0])):n.push({column:e,dir:o}),i.setSort(n)):i.setSort(e,o),i.table.rowManager.sorterRefresh())}))},j.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},j.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},j.prototype.setSort=function(t,e){var o=this,i=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;e=o.table.columnManager.findColumn(t.column),e?(t.column=e,i.push(t),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),o.sortList=i,this.table.options.persistentSort&&this.table.extExists("persistence",!0)&&this.table.extensions.persistence.save("sort")},j.prototype.clear=function(){this.setSort([])},j.prototype.findSorter=function(t){var e,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),t.getField()))switch(e=t.getFieldValue(o),void 0===e?"undefined":_typeof(e)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},j.prototype.sort=function(){var t=this;t.table.options.dataSorting&&t.table.options.dataSorting(t.getSort()),t.clearColumnHeaders(),t.table.options.ajaxSorting?t.sortList.forEach(function(e,o){t.setColumnHeader(e.column,e.dir)}):t.sortList.forEach(function(e,o){e.column&&e.column.extensions.sort&&(e.column.extensions.sort.sorter||(e.column.extensions.sort.sorter=t.findSorter(e.column)),t._sortItem(e.column,e.dir,t.sortList,o)),t.setColumnHeader(e.column,e.dir)}),t.table.options.dataSorted&&t.table.options.dataSorted(t.getSort(),t.table.rowManager.getComponents(!0))},j.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.extensions.sort&&(t.extensions.sort.dir="none",t.element.attr("aria-sort","none"))})},j.prototype.setColumnHeader=function(t,e){t.extensions.sort.dir=e,t.element.attr("aria-sort",e)},j.prototype._sortItem=function(t,e,o,i){var n=this;n.table.rowManager.activeRows.sort(function(s,a){var r=n._sortRow(s,a,t,e);if(0==r&&i)for(var l=i-1;l>=0&&0==(r=n._sortRow(s,a,o[l].column,o[l].dir));l--);return r})},j.prototype._sortRow=function(t,e,o,i){var n=this,s="asc"==i?t:e,a="asc"==i?e:t;return t=o.getFieldValue(s.getData()),e=o.getFieldValue(a.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",o.extensions.sort.sorter.call(n,t,e,s.getComponent(),a.getComponent(),o.getComponent(),i,o.extensions.sort.params)},j.prototype.sorters={number:function(t,e,o,i,n,s,a){var r=a.alignEmptyValues,l=0,t=parseFloat(String(t).replace(",","")),e=parseFloat(String(e).replace(",",""));if(isNaN(t))l=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;l=1}return("top"===r&&"desc"===s||"bottom"===r&&"asc"===s)&&(l*=-1),l},string:function(t,e,o,i,n,s,a){var r,l=a.alignEmptyValues,c=0;if(t){if(e){switch(_typeof(a.locale)){case"boolean":a.locale&&(r=this.table.extensions.localize.getLocale());break;case"string":r=a.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),r)}c=1}else c=e?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(t,e,o,i,n,s,a){var r=a.format||"DD/MM/YYYY",l=a.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(t=moment(t,r),e=moment(e,r),t.isValid()){if(e.isValid())return t-e;c=1}else c=e.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'date' sorter is dependant on moment.js")},time:function(t,e,o,i,n,s,a){var r=a.format||"hh:mm",l=a.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(t=moment(t,r),e=moment(e,r),t.isValid()){if(e.isValid())return t-e;c=1}else c=e.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'date' sorter is dependant on moment.js")},datetime:function(t,e,o,i,n,s,a){var r=a.format||"DD/MM/YYYY hh:mm:ss",l=a.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(t=moment(t,r),e=moment(e,r),t.isValid()){if(e.isValid())return t-e;c=1}else c=e.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'date' sorter is dependant on moment.js")},boolean:function(t,e,o,i,n,s,a){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,o,i,n,s,a){function r(t){switch(u){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}var l=0,c=0,u=a.type||"length",h=a.alignEmptyValues,p=0;if(Array.isArray(t)){if(Array.isArray(e))return l=t?r(t):0,c=e?r(e):0,l-c;h=1}else h=Array.isArray(e)?-1:0;return("top"===h&&"desc"===s||"bottom"===h&&"asc"===s)&&(p*=-1),p},exists:function(t,e,o,i,n,s,a){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,o,i,n,s,a){var r,l,c,u,h,p=0,d=/(\d+)|(\D+)/g,f=/\d/,g=a.alignEmptyValues,m=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if(r=String(t).toLowerCase(),l=String(e).toLowerCase(),r===l)return 0;if(!f.test(r)||!f.test(l))return r>l?1:-1;for(r=r.match(d),l=l.match(d),h=r.length>l.length?l.length:r.length;pu?1:-1;return r.length>l.length}m=1}else m=e||0===e?-1:0;return("top"===g&&"desc"===s||"bottom"===g&&"asc"===s)&&(m*=-1),m}},Tabulator.registerExtension("sort",j);var W=function(t){this.table=t};W.prototype.initializeColumn=function(t){var e,o=this,i=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(e=o._extractValidator(t))&&i.push(e)}):(e=this._extractValidator(t.definition.validator))&&i.push(e),t.extensions.validate=!!i.length&&i)},W.prototype._extractValidator=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":var e=t.split(":"),o=e.shift(),i=e.join();return this._buildValidator(o,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},W.prototype._buildValidator=function(t,e){var o="function"==typeof t?t:this.validators[t];return o?{type:"function"==typeof t?"function":t,func:o,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},W.prototype.validate=function(t,e,o){var i=this,n=[];return t&&t.forEach(function(t){t.func.call(i,e,o,t.params)||n.push({type:t.type,parameters:t.params})}),!n.length||n},W.prototype.validators={integer:function(t,e,o){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&Math.floor(e)===e},float:function(t,e,o){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&e%1!=0},numeric:function(t,e,o){return""===e||null===e||void 0===e||!isNaN(e)},string:function(t,e,o){return""===e||null===e||void 0===e||isNaN(e)},max:function(t,e,o){return""===e||null===e||void 0===e||parseFloat(e)<=o},min:function(t,e,o){return""===e||null===e||void 0===e||parseFloat(e)>=o},minLength:function(t,e,o){return""===e||null===e||void 0===e||String(e).length>=o},maxLength:function(t,e,o){return""===e||null===e||void 0===e||String(e).length<=o},in:function(t,e,o){return""===e||null===e||void 0===e||("string"==typeof o&&(o=o.split("|")),""===e||o.indexOf(e)>-1)},regex:function(t,e,o){return""===e||null===e||void 0===e||new RegExp(o).test(e)},unique:function(t,e,o){if(""===e||null===e||void 0===e)return!0;var i=!0,n=t.getData(),s=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var o=t.getData();o!==n&&e==s.getFieldValue(o)&&(i=!1)}),i},required:function(t,e,o){return""!==e&null!==e&&void 0!==e}},Tabulator.registerExtension("validate",W)}(),t.widget("ui.tabulator",Tabulator)}); \ No newline at end of file +/* Tabulator v4.9.3 (c) Oliver Folkerd */ +var _typeof="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};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Tabulator=e()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if(0===i)return!1;for(var n=0|e,s=Math.max(n>=0?n:i-Math.abs(n),0);so?(e=t-o,this.element.style.marginLeft=-e+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(t){var e,o,i=[],n=this.table.options.autoColumnsDefinitions;if(t&&t.length){e=t[0];for(var s in e){var a={field:s,title:s},r=e[s];switch(void 0===r?"undefined":_typeof(r)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(r)?"array":"string";break;default:o=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}a.sorter=o,i.push(a)}if(n)switch(void 0===n?"undefined":_typeof(n)){case"function":this.table.options.columns=n.call(this.table,i);break;case"object":Array.isArray(n)?i.forEach(function(t){var e=n.find(function(e){return e.field===t.field});e&&Object.assign(t,e)}):i.forEach(function(t){n[t.field]&&Object.assign(t,n[t.field])}),this.table.options.columns=i}else this.table.options.columns=i;this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(t,e){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!1,!0),o.redraw(!0)},t.prototype._addColumn=function(t,e,o){var i=new n(t,this),s=i.getElement(),a=o?this.findColumnIndex(o):o;if(o&&a>-1){var r=this.columns.indexOf(o.getTopColumn()),l=o.getElement();e?(this.columns.splice(r,0,i),l.parentNode.insertBefore(s,l)):(this.columns.splice(r+1,0,i),l.parentNode.insertBefore(s,l.nextSibling))}else e?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},t.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},t.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach(function(t){var o;t.clearVerticalAlign(),(o=t.getHeight())>e&&(e=o)}),t.columns.forEach(function(o){o.verticalAlign(t.table.options.columnHeaderVertAlign,e)}),t.rowManager.adjustTableSize()},t.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof n)return t;if(t instanceof o)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.columns.find(function(e){return e.element===t})||!1}return!1},t.prototype.getColumnByField=function(t){return this.columnsByField[t]},t.prototype.getColumnsByFieldRoot=function(t){var e=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===t&&o.push(e.columnsByField[i])}),o},t.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},t.prototype.getFirstVisibileColumn=function(t){var t=this.columnsByIndex.findIndex(function(t){return t.visible});return t>-1&&this.columnsByIndex[t]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},t.prototype.getDefinitions=function(t){var e=this,o=[];return e.columnsByIndex.forEach(function(e){(!t||t&&e.visible)&&o.push(e.getDefinition())}),o},t.prototype.getDefinitionTree=function(){var t=this,e=[];return t.columns.forEach(function(t){e.push(t.getDefinition(!0))}),e},t.prototype.getComponents=function(t){var e=this,o=[];return(t?e.columns:e.columnsByIndex).forEach(function(t){o.push(t.getComponent())}),o},t.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},t.prototype.moveColumn=function(t,e,o){this.moveColumnActual(t,e,o),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),e.element.parentNode.insertBefore(t.element,e.element),o&&e.element.parentNode.insertBefore(e.element,t.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(t,e,o){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,o):this._moveColumnInArray(this.columns,t,e,o),this._moveColumnInArray(this.columnsByIndex,t,e,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!0),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")},t.prototype._moveColumnInArray=function(t,e,o,i,n){var s,a=this,r=t.indexOf(e),l=[];r>-1&&(t.splice(r,1),s=t.indexOf(o),s>-1?i&&(s+=1):s=r,t.splice(s,0,e),n&&(this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.rowManager.rows.forEach(function(t){l=l.concat(a.table.modules.dataTree.getTreeChildren(t,!1,!0))}),l=l.concat(this.table.rowManager.rows),l.forEach(function(t){if(t.cells.length){var e=t.cells.splice(r,1)[0];t.cells.splice(s,0,e)}})))},t.prototype.scrollToColumn=function(t,e,o){var i=this,n=0,s=0,a=0,r=t.getElement();return new Promise(function(l,c){if(void 0===e&&(e=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":a=-i.element.clientWidth/2;break;case"right":a=r.clientWidth-i.headersElement.clientWidth}if(!o&&(s=r.offsetLeft)>0&&s+r.offsetWidtht.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,a;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=a>s?a:s)}),o},t.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var a=i._addColumn(t,e,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(!0),"fitColumns"!=i.table.modules.layout.getMode()&&a.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),i.table.options.virtualDomHoz&&i.table.vdomHoz.reinitialize(),n(a)})},t.prototype.deregisterColumn=function(t){var e,o=t.getField();o&&delete this.columnsByField[o],e=this.columnsByIndex.indexOf(t),e>-1&&this.columnsByIndex.splice(e,1),e=this.columns.indexOf(t),e>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this._verticalAlignHeaders(),this.redraw()},t.prototype.redraw=function(t){t&&(h.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var o=function(t){this._column=t,this.type="ColumnComponent"};o.prototype.getElement=function(){return this._column.getElement()},o.prototype.getDefinition=function(){return this._column.getDefinition()},o.prototype.getField=function(){return this._column.getField()},o.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t},o.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},o.prototype.isVisible=function(){return this._column.visible},o.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()},o.prototype.toggle=function(){this._column.visible?this.hide():this.show()},o.prototype.delete=function(){return this._column.delete()},o.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t},o.prototype.getParentColumn=function(){return this._column.parent instanceof n&&this._column.parent.getComponent()},o.prototype._getSelf=function(){return this._column},o.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},o.prototype.getTable=function(){return this._column.table},o.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},o.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},o.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},o.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},o.prototype.move=function(t,e){var o=this._column.table.columnManager.findColumn(t);o?this._column.table.columnManager.moveColumn(this._column,o,e):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var t=this._column.nextColumn();return!!t&&t.getComponent()},o.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return!!t&&t.getComponent()},o.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)},o.prototype.getWidth=function(){return this._column.getWidth()},o.prototype.setWidth=function(t){var e;return e=!0===t?this._column.reinitializeWidth(!0):this._column.setWidth(t),this._column.table.options.virtualDomHoz&&this._column.table.vdomHoz.reinitialize(!0),e},o.prototype.validate=function(){return this._column.validate()};var n=function t(e,o){var i=this;this.table=o.table,this.definition=e,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),e.columns?(this.isGroup=!0,e.columns.forEach(function(e,o){var n=new t(e,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),e.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};n.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},n.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},n.prototype.checkDefinition=function(){var t=this;Object.keys(this.definition).forEach(function(e){-1===t.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(t.field||t.definition.title)+"' column:",e)})},n.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},n.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},n.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},n.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},n.prototype._mapDepricatedFunctionality=function(){void 0!==this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),void 0!==this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),void 0!==this.definition.downloadTitle&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))},n.prototype.setTooltip=function(){var t=this,e=t.definition,o=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;o?!0===o?e.field?t.table.modules.localize.bind("columns|"+e.field,function(o){t.element.setAttribute("title",o||e.title)}):t.element.setAttribute("title",e.title):("function"==typeof o&&!1===(o=o(t.getComponent()))&&(o=""),t.element.setAttribute("title",o)):t.element.setAttribute("title","")},n.prototype._buildHeader=function(){for(var t=this,e=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);e.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),e.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(void 0!==e.headerFilterPlaceholder&&e.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(e.field,e.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(e.topCalc||e.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.table.modExists("persistence")&&t.table.modules.persistence.config.columns&&t.table.modules.persistence.initializeColumn(t),t.element.addEventListener("mouseenter",function(e){t.setTooltip()})},n.prototype._bindEvents=function(){var t,e,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(t){n.headerClick(t,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(t){n.headerDblClick(t,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(t){n.headerContext(t,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&n.headerTap(t,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,n.headerDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),"function"==typeof n.headerTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,n.headerTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},n.prototype._buildColumnHeader=function(){var t=this,e=this.definition,o=this.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(this,this.titleHolderElement),(e.headerContextMenu||e.headerClickMenu||e.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(this),o.modExists("format")&&o.modules.format.initializeColumn(this),void 0!==e.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(this),void 0!==e.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(this),o.modExists("mutator")&&o.modules.mutator.initializeColumn(this),o.modExists("accessor")&&o.modules.accessor.initializeColumn(this),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){e.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(void 0===e.minWidth?this.table.options.columnMinWidth:parseInt(e.minWidth)),(e.maxWidth||this.table.options.columnMaxWidth)&&!1!==e.maxWidth&&this.setMaxWidth(void 0===e.maxWidth?this.table.options.columnMaxWidth:parseInt(e.maxWidth)),this.reinitializeWidth(),this.tooltip=this.definition.tooltip||!1===this.definition.tooltip?this.definition.tooltip:this.table.options.tooltips,this.hozAlign=void 0===this.definition.hozAlign?this.table.options.cellHozAlign:this.definition.hozAlign,this.vertAlign=void 0===this.definition.vertAlign?this.table.options.cellVertAlign:this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign},n.prototype._buildColumnHeaderContent=function(){var t=(this.definition,this.table,document.createElement("div"));return t.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),t.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),t},n.prototype._buildColumnHeaderTitle=function(){var t=this,e=t.definition,o=t.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),e.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(t){t.stopPropagation(),n.focus()}),n.addEventListener("change",function(){e.title=n.value,o.options.columnTitleChanged.call(t.table,t.getComponent())}),i.appendChild(n),e.field?o.modules.localize.bind("columns|"+e.field,function(t){n.value=t||e.title||" "}):n.value=e.title||" "}else e.field?o.modules.localize.bind("columns|"+e.field,function(o){t._formatColumnHeaderTitle(i,o||e.title||" ")}):t._formatColumnHeaderTitle(i,e.title||" ");return i},n.prototype._formatColumnHeaderTitle=function(t,e){var o,i,n,s,a,r=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),a=function(t){r.titleFormatterRendered=t},s={getValue:function(){return e},getElement:function(){return t}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,s,n,a),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?t.appendChild(i):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=i}else t.innerHTML=e},n.prototype._buildGroupHeader=function(){var t=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){this.definition.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign,this.element.appendChild(this.groupElement)},n.prototype._getFlatData=function(t){return t[this.field]},n.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,s=0;s-1&&this.columns.splice(e,1),this.columns.length||this.delete()},n.prototype.setWidth=function(t){this.widthFixed=!0,this.setWidthActual(t)},n.prototype.setWidthActual=function(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.maxWidth&&(t=Math.min(this.maxWidth,t)),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()},n.prototype.checkCellHeights=function(){var t=[] +;this.cells.forEach(function(e){e.row.heightInitialized&&(null!==e.row.getElement().offsetParent?(t.push(e.row),e.row.clearCellHeight()):e.row.heightInitialized=!1)}),t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()})},n.prototype.getWidth=function(){var t=0;return this.isGroup?this.columns.forEach(function(e){e.visible&&(t+=e.getWidth())}):t=this.width,t},n.prototype.getHeight=function(){return this.element.offsetHeight},n.prototype.setMinWidth=function(t){this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})},n.prototype.setMaxWidth=function(t){this.maxWidth=t,this.maxWidthStyled=t?t+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(t){t.setMaxWidth()})},n.prototype.delete=function(){var t=this;return new Promise(function(e,o){t.isGroup&&t.columns.forEach(function(t){t.delete()}),t.table.modExists("edit")&&t.table.modules.edit.currentCell.column===t&&t.table.modules.edit.cancelEdit();for(var i=t.cells.length,n=0;n-1&&this._nextVisibleColumn(t+1)},n.prototype._nextVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)},n.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)},n.prototype._prevVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)},n.prototype.reinitializeWidth=function(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},n.prototype.fitToData=function(){var t=this;this.widthFixed||(this.element.style.width="",t.cells.forEach(function(t){t.clearWidth()}));var e=this.element.offsetWidth;t.width&&this.widthFixed||(t.cells.forEach(function(t){var o=t.getWidth();o>e&&(e=o)}),e&&t.setWidthActual(e+1))},n.prototype.updateDefinition=function(t){var e=this;return new Promise(function(o,i){var n;e.isGroup?(console.warn("Column Update Error - The updateDefinition function is only available on ungrouped columns"),i("Column Update Error - The updateDefinition function is only available on columns, not column groups")):e.parent.isGroup?(console.warn("Column Update Error - The updateDefinition function is only available on ungrouped columns"),i("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(n=Object.assign({},e.getDefinition()),n=Object.assign(n,t),e.table.columnManager.addColumn(n,!1,e).then(function(t){n.field==e.field&&(e.field=!1),e.delete().then(function(){o(t.getComponent())}).catch(function(t){i(t)})}).catch(function(t){i(t)}))})},n.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},n.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","maxWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","headerHozAlign","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","clickMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],n.prototype.getComponent=function(){return this.component||(this.component=new o(this)),this.component};var s=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};s.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},s.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},s.prototype.getElement=function(){return this.element},s.prototype.getTableElement=function(){return this.tableElement},s.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},s.prototype.setColumnManager=function(t){this.columnManager=t},s.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e),t.table.options.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.addEventListener("scroll",function(){var e=t.element.scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e),t.table.options.scrollVertical(e)):t.scrollTop=e})},s.prototype.findRow=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t))){if(void 0===t||null===t)return!1;return e.rows.find(function(o){return o.data[e.table.options.index]==t})||!1}if(t instanceof l)return t;if(t instanceof r)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.rows.find(function(e){return e.getElement()===t})||!1}return!1},s.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},s.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},s.prototype.scrollToRow=function(t,e,o){var i,n=this,s=this.getDisplayRows().indexOf(t),a=t.getElement(),r=0;return new Promise(function(t,l){if(s>-1){if(void 0===e&&(e=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===e)switch(n.renderMode){case"classic":i=h.prototype.helpers.elOffset(a).top,e=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":e=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&h.prototype.helpers.elVisible(a)&&(r=h.prototype.helpers.elOffset(a).top-h.prototype.helpers.elOffset(n.element).top)>0&&r-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(e){var o=e.indexOf(t);o>-1&&e.splice(o,1)}),e||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},s.prototype.addRow=function(t,e,o,i){var n=this.addRowActual(t,e,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:t,pos:e,index:o}),n},s.prototype.addRows=function(t,e,o){var i=this,n=this,s=0,a=[];return new Promise(function(r,l){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),s=t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach(function(t,i){var s=n.addRow(t,e,o,!0);a.push(s)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),r(a)})},s.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},s.prototype.addRowActual=function(t,e,o,i){var n,s,a=t instanceof l?t:new l(t||{},this),r=this.findAddRowPos(e),c=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),r?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],r=!1):s.length&&(o=s[s.length-1],r=!(s.length1&&(!o||o&&-1==u.indexOf(o)?r?u[0]!==a&&(o=u[0],this._moveRowInArray(a.getGroup().rows,a,o,!r)):u[u.length-1]!==a&&(o=u[u.length-1],this._moveRowInArray(a.getGroup().rows,a,o,!r)):this._moveRowInArray(a.getGroup().rows,a,o,!r))}return o&&(c=this.rows.indexOf(o)),o&&c>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(t){var e=t.indexOf(o);e>-1&&t.splice(r?e:e+1,0,a)}),n>-1&&this.activeRows.splice(r?n:n+1,0,a),this.rows.splice(r?c:c+1,0,a)):r?(this.displayRowIterator(function(t){t.unshift(a)}),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator(function(t){t.push(a)}),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,a.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),i||this.reRenderInPosition(),a},s.prototype.moveRow=function(t,e,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{posFrom:this.getRowPosition(t),posTo:this.getRowPosition(e),to:e,after:o}),this.moveRowActual(t,e,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,t.getComponent())},s.prototype.moveRowActual=function(t,e,o){var i=this;if(this._moveRowInArray(this.rows,t,e,o),this._moveRowInArray(this.activeRows,t,e,o),this.displayRowIterator(function(n){i._moveRowInArray(n,t,e,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&e instanceof H&&(e=this.table.rowManager.prevDisplayRow(t)||e);var n=e.getGroup(),s=t.getGroup();n===s?this._moveRowInArray(n.rows,t,e,o):(s&&s.removeRow(t),n.insertRow(t,e,o))}},s.prototype._moveRowInArray=function(t,e,o,i){var n,s,a,r;if(e!==o&&(n=t.indexOf(e),n>-1&&(t.splice(n,1),s=t.indexOf(o),s>-1?i?t.splice(s+1,0,e):t.splice(s,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){a=nn?s:n+1;for(var l=a;l<=r;l++)t[l]&&this.styleRow(t[l],l)}},s.prototype.clearData=function(){this.setData([])},s.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},s.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},s.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o-1)&&o},s.prototype.getData=function(t,e){var o=[];return this.getRows(t).forEach(function(t){"row"==t.type&&o.push(t.getData(e||"data"))}),o},s.prototype.getComponents=function(t){var e=[];return this.getRows(t).forEach(function(t){e.push(t.getComponent())}),e},s.prototype.getDataCount=function(t){return this.getRows(t).length},s.prototype._genRemoteRequest=function(){var t=this,e=this.table,o=e.options,i={};if(e.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(t){delete t.column}),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=s}this.table.modules.ajax.setParams(i,!0)}e.modules.ajax.sendRequest().then(function(e){t._setDataActual(e,!0)}).catch(function(t){})},s.prototype.filterRefresh=function(){var t=this.table,e=t.options,o=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):e.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},s.prototype.sorterRefresh=function(t){var e=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(i)},s.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)},s.prototype.refreshActiveData=function(t,e,o){var i,n=this,s=this.table,a=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||a.indexOf(t)=0))break;s=r}else if(e-a[r].getElement().offsetTop>=0)n=r;else{if(i=!0,!(o-a[r].getElement().offsetTop>=0))break;s=r}}else n=this.vDomTop,s=this.vDomBottom;return a.slice(n,s+1)},s.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},s.prototype.getRows=function(t){var e;switch(t){case"active":e=this.activeRows;break;case"display":e=this.table.rowManager.getDisplayRows();break;case"visible":e=this.getVisibleRows(!0);break;case"selected":e=this.table.modules.selectRow.selectedRows;break;default:e=this.rows}return e},s.prototype.reRenderInPosition=function(t){if("virtual"==this.getRenderMode())if(this.redrawBlock)t?t():this.redrawBlockRederInPosition=!0;else{for(var e=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(s[a]){var r=e-s[a].getElement().offsetTop;if(!(!1===i||Math.abs(r)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(u=!1),i.vDomBottom++,c++}t?(i.vDomTopPad=e?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-r-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((r+l)/c),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+r+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",e&&(this.scrollTop=i.vDomTopPad+l+o-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&e&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=u?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},s.prototype.scrollVertical=function(t){var e=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-e>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else t?(e<0&&this._addTopRow(-e),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(e>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(e):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},s.prototype._addTopRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],a=s.getHeight()||this.vDomRowHeight;t>=a&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=a,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=a,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),e=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},s.prototype._removeTopRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,e.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}},s.prototype._addBottomRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=a&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=a,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=a,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),e=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},s.prototype._removeBottomRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),e.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}},s.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},s.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},s.prototype.adjustTableSize=function(){var t,e=this.element.clientHeight;if("virtual"===this.renderMode){ +var o=Math.floor(this.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,this.fixedHeight||e==this.element.clientHeight||((t=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!t)&&this.redraw()}},s.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize(!0)})},s.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},s.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1},s.prototype.redraw=function(t){var e=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(e)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},s.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var a=function(t){this.table=t,this.element=this.table.rowManager.tableElement,this.holderEl=this.table.rowManager.element,this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.window=200,this.initialized=!1,this.columns=[],this.compatabilityCheck()&&this.initialize()};a.prototype.compatabilityCheck=function(){var t=this.table.options,e=!0;return"fitDataTable"==t.layout&&(console.warn("Horizontal Vitrual DOM is not compatible with fitDataTable layout mode"),e=!1),t.responsiveLayout&&(console.warn("Horizontal Vitrual DOM is not compatible with responsive columns"),e=!1),this.table.rtl&&(console.warn("Horizontal Vitrual DOM is not currently compatible with RTL text direction"),e=!1),t.columns&&t.columns.find(function(t){return t.frozen})&&(console.warn("Horizontal Vitrual DOM is not compatible with frozen columns"),e=!1),e||(t.virtualDomHoz=!1),e},a.prototype.initialize=function(){var t=this;this.holderEl.addEventListener("scroll",function(){var e=t.holderEl.scrollLeft;t.scrollLeft!=e&&(t.scrollLeft=e,t.scroll(e-(t.vDomScrollPosLeft+t.window)))})},a.prototype.deinitialize=function(){this.initialized=!1},a.prototype.clear=function(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0},a.prototype.dataChange=function(){var t,e,o,i=!1,n=0,s=0;if("fitData"===this.table.options.layout){if(this.table.columnManager.columnsByIndex.forEach(function(t){!t.definition.width&&t.visible&&(i=!0)}),i&&i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.holderEl.clientWidth+this.window,this.table.options.groupBy?(t=this.table.modules.groupRows.getGroups(!1)[0],e=t.getRows(!1)[0]):e=this.table.rowManager.getDisplayRows()[0],e)){o=e.getElement(),e.generateCells(),this.element.appendChild(o);for(var s=0;sthis.vDomScrollPosRight)break}for(o.parentNode.removeChild(o),this.fitDataColAvg=Math.floor(n/(s+1)),s;so.vDomScrollPosLeft&&n.8*this.holderEl.clientWidth?this.reinitialize():t>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())},a.prototype.colPositionAdjust=function(t,e,o){for(var i=t;i=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=e.getWidth(),this.element.style.paddingRight=this.vDomPadRight+"px",this.addColRight())},a.prototype.addColLeft=function(){var t=this.columns[this.leftCol-1];if(t&&t.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){this.table.rowManager.getVisibleRows().forEach(function(e){if("group"!==e.type){var o=e.getCell(t);e.getElement().prepend(o.getElement()),o.cellRendered()}}),this.fitDataColActualWidthCheck(t),this.leftCol?this.vDomPadLeft-=t.getWidth():this.vDomPadLeft=0,this.element.style.paddingLeft=this.vDomPadLeft+"px",this.leftCol--,this.addColLeft()}},a.prototype.removeColRight=function(t){var e,t=this.columns[this.rightCol];t&&t.modules.vdomHoz.leftPos>this.vDomScrollPosRight&&(e=this.table.rowManager.getVisibleRows(),t.modules.vdomHoz.visible=!1,e.forEach(function(e){if("group"!==e.type){var o=e.getCell(t);e.getElement().removeChild(o.getElement())}}),this.vDomPadRight+=t.getWidth(),this.element.style.paddingRight=this.vDomPadRight+"px",this.rightCol--,this.removeColRight())},a.prototype.removeColLeft=function(){var t,e=this.columns[this.leftCol];e&&e.modules.vdomHoz.rightPos-1}return!1},r.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},r.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},r.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},r.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},r.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row,!0)},r.prototype.addTreeChild=function(t,e,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,t,e,o)},r.prototype.reformat=function(){return this._row.reinitialize()},r.prototype.getGroup=function(){return this._row.getGroup().getComponent()},r.prototype.getTable=function(){return this._row.table},r.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},r.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var l=function(t,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=e.table,this.parent=e,this.data={},this.type=o,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.created=!1,this.setData(t)};l.prototype.create=function(){this.created||(this.created=!0,this.generateElement())},l.prototype.createElement=function(){var t=document.createElement("div");t.classList.add("tabulator-row"),t.setAttribute("role","row"),this.element=t},l.prototype.getElement=function(){return this.create(),this.element},l.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},l.prototype.generateElement=function(){var t,e,o,i=this;this.createElement(),!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),(i.table.options.rowContextMenu||i.table.options.rowClickMenu)&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(t){i.table.options.rowMouseEnter(t,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(t){i.table.options.rowMouseLeave(t,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(t){i.table.options.rowMouseOver(t,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(t){i.table.options.rowMouseOut(t,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(t){i.table.options.rowMouseMove(t,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&i.table.options.rowTap(t,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null}))},l.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},l.prototype.initialize=function(t){var e=this;if(this.create(),!this.initialized||t){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),this.table.options.virtualDomHoz&&this.table.vdomHoz.initialized?this.table.vdomHoz.initializeRow(this):this.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&this.normalizeHeight(),this.table.options.dataTree&&this.table.modExists("dataTree")&&this.table.modules.dataTree.layoutRow(this),"collapse"===this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout")&&this.table.modules.responsiveLayout.layoutRow(this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.table.options.resizableRows&&this.table.modExists("resizeRows")&&this.table.modules.resizeRows.initializeRow(this),this.initialized=!0}else this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitializeRow(this)},l.prototype.reinitializeHeight=function(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)},l.prototype.reinitialize=function(t){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.getTreeChildren(this,!1,!0).forEach(function(t){t.reinitialize(!0)})},l.prototype.calcHeight=function(t){var e=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(t){var o=t.getHeight();o>e&&(e=o)}),this.height=t?Math.max(e,o):this.manualHeight?this.height:Math.max(e,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},l.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},l.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},l.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},l.prototype.setHeight=function(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},l.prototype.getHeight=function(){return this.outerHeight},l.prototype.getWidth=function(){return this.element.offsetWidth},l.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},l.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},l.prototype.updateData=function(t){var e,o=this,i=this.element&&h.prototype.helpers.elVisible(this.element),n={};return new Promise(function(s,a){"string"==typeof t&&(t=JSON.parse(t)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,t),e=o.table.modules.mutator.transformRow(n,"data",t)):e=t;for(var r in e)o.data[r]=e[r];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var r in t){o.table.columnManager.getColumnsByFieldRoot(r).forEach(function(t){var n=o.getCell(t.getField());if(n){var s=t.getFieldValue(e);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}})}o.table.options.groupUpdateOnCellEdit&&o.table.options.groupBy&&o.table.modExists("groupRows")&&o.table.modules.groupRows.reassignRowToGroup(o.row),i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(t)&&(o.table.modules.dataTree.initializeRow(o),i&&(o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0))),o.table.options.rowUpdated.call(o.table,o.getComponent()),o.table.options.dataChanged&&o.table.options.dataChanged.call(o.table,o.table.rowManager.getData()),s()})},l.prototype.getData=function(t){return t&&this.table.modExists("accessor")?this.table.modules.accessor.transformRow(this,t):this.data},l.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},l.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},l.prototype.findNextEditableCell=function(t){var e=!1;if(t0)for(var o=t-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&h.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){e=i;break}}return e},l.prototype.getCells=function(){return this.cells},l.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},l.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},l.prototype.moveToRow=function(t,e){var o=this.table.rowManager.findRow(t);o?(this.table.rowManager.moveRowActual(this,o,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)},l.prototype.validate=function(){var t=[];return this.cells.forEach(function(e){e.validate()||t.push(e.getComponent())}),!t.length||t},l.prototype.delete=function(){var t=this;return new Promise(function(e,o){var i,n;t.table.options.history&&t.table.modExists("history")&&(t.table.options.groupBy&&t.table.modExists("groupRows")?(n=t.getGroup().rows,(i=n.indexOf(t))&&(i=n[i-1])):(i=t.table.rowManager.getRowIndex(t))&&(i=t.table.rowManager.rows[i-1]),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!i,index:i})),t.deleteActual(),e()})},l.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);this.detatchModules(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.rowDelete(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},l.prototype.detatchModules=function(){this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.modExists("frozenRows")&&this.table.modules.frozenRows.detachRow(this)},l.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e",footerElement:!1,index:"id",textDirection:"auto",keybindings:[],tabEndNewRow:!1,invalidOptionWarnings:!0,clipboard:!1,clipboardCopyStyled:!0,clipboardCopyConfig:!1,clipboardCopyFormatter:!1,clipboardCopyRowRange:"active",clipboardPasteParser:"table",clipboardPasteAction:"insert",clipboardCopied:function(){},clipboardPasted:function(){},clipboardPasteError:function(){},downloadDataFormatter:!1,downloadReady:function(t,e){return e},downloadComplete:!1,downloadConfig:{},downloadRowRange:"active",dataTree:!1,dataTreeFilter:!0,dataTreeSort:!0,dataTreeElementColumn:!1,dataTreeBranchElement:!0,dataTreeChildIndent:9,dataTreeChildField:"_children",dataTreeCollapseElement:!1,dataTreeExpandElement:!1,dataTreeStartExpanded:!1,dataTreeRowExpanded:function(){},dataTreeRowCollapsed:function(){},dataTreeChildColumnCalcs:!1,dataTreeSelectPropagate:!1,printAsHtml:!1,printFormatter:!1,printHeader:!1,printFooter:!1,printCopyStyle:!0,printStyled:!0,printVisibleRows:!0,printRowRange:"visible",printConfig:{},addRowPos:"bottom",selectable:"highlight",selectableRangeMode:"drag",selectableRollingSelection:!0,selectablePersistence:!0,selectableCheck:function(t,e){return!0},headerFilterLiveFilterDelay:300,headerFilterPlaceholder:!1,headerVisible:!0,history:!1,locale:!1,langs:{},virtualDom:!0,virtualDomBuffer:0,virtualDomHoz:!1,persistentLayout:!1,persistentSort:!1,persistentFilter:!1,persistenceID:"",persistenceMode:!0,persistenceReaderFunc:!1,persistenceWriterFunc:!1,persistence:!1,responsiveLayout:!1,responsiveLayoutCollapseStartOpen:!0,responsiveLayoutCollapseUseFormatters:!0,responsiveLayoutCollapseFormatter:!1,pagination:!1,paginationSize:!1,paginationInitialPage:1,paginationButtonCount:5,paginationSizeSelector:!1,paginationElement:!1,paginationDataSent:{},paginationDataReceived:{},paginationAddRow:"page",ajaxURL:!1,ajaxURLGenerator:!1,ajaxParams:{},ajaxConfig:"get",ajaxContentType:"form",ajaxRequestFunc:!1,ajaxLoader:!0,ajaxLoaderLoading:!1,ajaxLoaderError:!1,ajaxFiltering:!1,ajaxSorting:!1,ajaxProgressiveLoad:!1,ajaxProgressiveLoadDelay:0,ajaxProgressiveLoadScrollMargin:0,groupBy:!1,groupStartOpen:!0,groupValues:!1,groupUpdateOnCellEdit:!1,groupHeader:!1,groupHeaderPrint:null,groupHeaderClipboard:null,groupHeaderHtmlOutput:null,groupHeaderDownload:null,htmlOutputConfig:!1,movableColumns:!1,movableRows:!1,movableRowsConnectedTables:!1,movableRowsConnectedElements:!1,movableRowsSender:!1,movableRowsReceiver:"insert",movableRowsSendingStart:function(){},movableRowsSent:function(){},movableRowsSentFailed:function(){},movableRowsSendingStop:function(){},movableRowsReceivingStart:function(){},movableRowsReceived:function(){},movableRowsReceivedFailed:function(){},movableRowsReceivingStop:function(){},movableRowsElementDrop:function(){},scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,placeholder:!1,tableBuilding:function(){},tableBuilt:function(){},renderStarted:function(){},renderComplete:function(){},rowClick:!1,rowDblClick:!1,rowContext:!1,rowTap:!1,rowDblTap:!1,rowTapHold:!1,rowMouseEnter:!1,rowMouseLeave:!1,rowMouseOver:!1,rowMouseOut:!1,rowMouseMove:!1,rowContextMenu:!1,rowClickMenu:!1,rowAdded:function(){},rowDeleted:function(){},rowMoved:function(){},rowUpdated:function(){},rowSelectionChanged:function(){},rowSelected:function(){},rowDeselected:function(){},rowResized:function(){},cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1,cellEditing:function(){},cellEdited:function(){},cellEditCancelled:function(){},columnMoved:!1,columnResized:function(){},columnTitleChanged:function(){},columnVisibilityChanged:function(){},htmlImporting:function(){},htmlImported:function(){},dataLoading:function(){},dataLoaded:function(){},dataEdited:!1,dataChanged:!1,ajaxRequesting:function(){},ajaxResponse:!1,ajaxError:function(){},dataFiltering:!1,dataFiltered:!1,dataSorting:function(){},dataSorted:function(){},groupToggleElement:"arrow",groupClosedShowCalcs:!1,dataGrouping:function(){},dataGrouped:!1,groupVisibilityChanged:function(){},groupClick:!1,groupDblClick:!1,groupContext:!1,groupContextMenu:!1,groupClickMenu:!1,groupTap:!1,groupDblTap:!1,groupTapHold:!1,columnCalcs:!0,pageLoaded:function(){},localized:function(){},validationMode:"blocking",validationFailed:function(){},historyUndo:function(){},historyRedo:function(){},scrollHorizontal:function(){},scrollVertical:function(){}},h.prototype.initializeOptions=function(t){if(!1!==t.invalidOptionWarnings)for(var e in t)void 0===this.defaultOptions[e]&&console.warn("Invalid table constructor option:",e);for(var e in this.defaultOptions)e in t?this.options[e]=t[e]:Array.isArray(this.defaultOptions[e])?this.options[e]=Object.assign([],this.defaultOptions[e]):"object"===_typeof(this.defaultOptions[e])&&null!==this.defaultOptions[e]?this.options[e]=Object.assign({},this.defaultOptions[e]):this.options[e]=this.defaultOptions[e]},h.prototype.initializeElement=function(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?(this.element=t,!0):"string"==typeof t?(this.element=document.querySelector(t),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",t),!1)},h.prototype.rtlCheck=function(){var t=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==t.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}},h.prototype._mapDepricatedFunctionality=function(){(this.options.persistentLayout||this.options.persistentSort||this.options.persistentFilter)&&(this.options.persistence||(this.options.persistence={})),this.options.dataEdited&&(console.warn("DEPRECATION WARNING - dataEdited option has been deprecated, please use the dataChanged option instead"),this.options.dataChanged=this.options.dataEdited),this.options.downloadDataFormatter&&console.warn("DEPRECATION WARNING - downloadDataFormatter option has been deprecated"),void 0!==this.options.clipboardCopyHeader&&(this.options.columnHeaders=this.options.clipboardCopyHeader,console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option")),!0!==this.options.printVisibleRows&&(console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"),this.options.persistence.printRowRange="active"),!0!==this.options.printCopyStyle&&(console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"),this.options.persistence.printStyled=this.options.printCopyStyle),this.options.persistentLayout&&(console.warn("persistentLayout option is deprecated, you should now use the persistence option"),!0!==this.options.persistence&&void 0===this.options.persistence.columns&&(this.options.persistence.columns=!0)),this.options.persistentSort&&(console.warn("persistentSort option is deprecated, you should now use the persistence option"),!0!==this.options.persistence&&void 0===this.options.persistence.sort&&(this.options.persistence.sort=!0)),this.options.persistentFilter&&(console.warn("persistentFilter option is deprecated, you should now use the persistence option"),!0!==this.options.persistence&&void 0===this.options.persistence.filter&&(this.options.persistence.filter=!0)),this.options.columnVertAlign&&(console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"),this.options.columnHeaderVertAlign=this.options.columnVertAlign)},h.prototype._clearSelection=function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")},h.prototype._create=function(){this._clearObjectPointers(),this._mapDepricatedFunctionality(),this.bindModules(),this.rtlCheck(),"TABLE"===this.element.tagName&&this.modExists("htmlTableImport",!0)&&this.modules.htmlTableImport.parseTable(),this.columnManager=new t(this),this.rowManager=new s(this),this.footerManager=new d(this),this.columnManager.setRowManager(this.rowManager),this.rowManager.setColumnManager(this.columnManager),this.options.virtualDomHoz&&(this.vdomHoz=new a(this)),this._buildElement(),this._loadInitialData()},h.prototype._clearObjectPointers=function(){this.options.columns=this.options.columns.slice(0),this.options.reactiveData||(this.options.data=this.options.data.slice(0))},h.prototype._buildElement=function(){var t=this,e=this.element,o=this.modules,i=this.options;for(i.tableBuilding.call(this),e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",e.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",e.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",e.style.maxHeight=i.maxHeight),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modExists("layout",!0)&&o.layout.initialize(i.layout),o.localize.initialize(),!1!==i.headerFilterPlaceholder&&o.localize.setHeaderFilterPlaceholder(i.headerFilterPlaceholder);for(var n in i.langs)o.localize.installLang(n,i.langs[n]);if(o.localize.setLocale(i.locale),"string"==typeof i.placeholder){var s=document.createElement("div");s.classList.add("tabulator-placeholder");var a=document.createElement("span");a.innerHTML=i.placeholder,s.appendChild(a),i.placeholder=s}if(e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),i.footerElement&&this.footerManager.activate(),i.persistence&&this.modExists("persistence",!0)&&o.persistence.initialize(),i.movableRows&&this.modExists("moveRow")&&o.moveRow.initialize(),i.autoColumns&&this.options.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modExists("columnCalcs")&&o.columnCalcs.initialize(),this.columnManager.setColumns(i.columns),i.dataTree&&this.modExists("dataTree",!0)&&o.dataTree.initialize(),this.modExists("frozenRows")&&this.modules.frozenRows.initialize(),(i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.sort||i.initialSort)&&this.modExists("sort",!0)){var r=[];i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.sort?!1===(r=o.persistence.load("sort"))&&i.initialSort&&(r=i.initialSort):i.initialSort&&(r=i.initialSort),o.sort.setSort(r)}if((i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.filter||i.initialFilter)&&this.modExists("filter",!0)){var l=[];i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.filter?!1===(l=o.persistence.load("filter"))&&i.initialFilter&&(l=i.initialFilter):i.initialFilter&&(l=i.initialFilter),o.filter.setFilter(l)}i.initialHeaderFilter&&this.modExists("filter",!0)&&i.initialHeaderFilter.forEach(function(e){var i=t.columnManager.findColumn(e.field);if(!i)return console.warn("Column Filter Error - No matching column found:",e.field),!1;o.filter.setHeaderFilterValue(i,e.value)}),this.modExists("ajax")&&o.ajax.initialize(),i.pagination&&this.modExists("page",!0)&&o.page.initialize(),i.groupBy&&this.modExists("groupRows",!0)&&o.groupRows.initialize(),this.modExists("keybindings")&&o.keybindings.initialize(),this.modExists("selectRow")&&o.selectRow.clearSelectionData(!0),i.autoResize&&this.modExists("resizeTable")&&o.resizeTable.initialize(),this.modExists("clipboard")&&o.clipboard.initialize(),i.printAsHtml&&this.modExists("print")&&o.print.initialize(),i.tableBuilt.call(this)},h.prototype._loadInitialData=function(){var t=this;if(t.options.pagination&&t.modExists("page"))if(t.modules.page.reset(!0,!0),"local"==t.options.pagination){if(t.options.data.length)t.rowManager.setData(t.options.data,!1,!0);else{if((t.options.ajaxURL||t.options.ajaxURLGenerator)&&t.modExists("ajax"))return void t.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){t.options.paginationInitialPage&&t.modules.page.setPage(t.options.paginationInitialPage)});t.rowManager.setData(t.options.data,!1,!0)}t.options.paginationInitialPage&&t.modules.page.setPage(t.options.paginationInitialPage)}else t.options.ajaxURL?t.modules.page.setPage(t.options.paginationInitialPage).then(function(){}).catch(function(){}):t.rowManager.setData([],!1,!0);else t.options.data.length?t.rowManager.setData(t.options.data):(t.options.ajaxURL||t.options.ajaxURLGenerator)&&t.modExists("ajax")?t.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){}):t.rowManager.setData(t.options.data,!1,!0)},h.prototype.destroy=function(){var t=this.element;for(h.prototype.comms.deregister(this),this.options.reactiveData&&this.modExists("reactiveData",!0)&&this.modules.reactiveData.unwatchData(),this.rowManager.rows.forEach(function(t){t.wipe()}),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[],this.options.autoResize&&this.modExists("resizeTable")&&this.modules.resizeTable.clearBindings(),this.modExists("keybindings")&&this.modules.keybindings.clearBindings();t.firstChild;)t.removeChild(t.firstChild);t.classList.remove("tabulator")},h.prototype._detectBrowser=function(){var t=navigator.userAgent||navigator.vendor||window.opera;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))},h.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},h.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},h.prototype.setDataFromLocalFile=function(t){var e=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=t||".json,application/json",n.addEventListener("change",function(t){var s,a=n.files[0],r=new FileReader;r.readAsText(a),r.onload=function(t){try{s=JSON.parse(r.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e.setData(s).then(function(t){o(t)}).catch(function(t){o(t)})},r.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},h.prototype.setData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!1,!0)},h.prototype._setData=function(t,e,o,i,n){var s=this;return"string"!=typeof t?t?s.rowManager.setData(t,i,n):s.modExists("ajax")&&(s.modules.ajax.getUrl||s.options.ajaxURLGenerator)?"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n):s.rowManager.setData([],i,n):0==t.indexOf("{")||0==t.indexOf("[")?s.rowManager.setData(JSON.parse(t),i,n):s.modExists("ajax",!0)?(e&&s.modules.ajax.setParams(e),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(t),"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n)):void 0},h.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},h.prototype.getData=function(t){return!0===t&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getData(t)},h.prototype.getDataCount=function(t){return!0===t&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getDataCount(t)},h.prototype.searchRows=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,o)},h.prototype.searchData=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,o)},h.prototype.getHtml=function(t,e,o){if(this.modExists("export",!0))return this.modules.export.getHtml(t,e,o)},h.prototype.print=function(t,e,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,e,o)},h.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},h.prototype.replaceData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},h.prototype.updateData=function(t){var e=this,o=this,i=0;return new Promise(function(n,s){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);e&&(i++,e.updateData(t).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},h.prototype.addData=function(t,e,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?i.rowManager.addRows(t,e,o).then(function(t){var e=[];t.forEach(function(t){e.push(t.getComponent())}),n(e)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},h.prototype.updateOrAddData=function(t){var e=this,o=this,i=[],n=0;return new Promise(function(s,a){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);n++,e?e.updateData(t).then(function(){n--,i.push(e.getComponent()),n||s(i)}):o.rowManager.addRows(t).then(function(t){n--,i.push(t[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))})},h.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},h.prototype.getRowFromPosition=function(t,e){var o=this.rowManager.getRowFromPosition(t,e);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},h.prototype.deleteRow=function(t){var e=this;return new Promise(function(o,i){function n(){++a==t.length&&r&&(s.rowManager.reRenderInPosition(),o())}var s=e,a=0,r=0,l=[];Array.isArray(t)||(t=[t]),t.forEach(function(t){var o=e.rowManager.findRow(t,!0);o?l.push(o):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"),n())}),l.sort(function(t,o){return e.rowManager.rows.indexOf(t)>e.rowManager.rows.indexOf(o)?1:-1}),l.forEach(function(t){t.delete().then(function(){r++,n()}).catch(function(t){n(),i(t)})})})},h.prototype.addRow=function(t,e,o){var i=this;return new Promise(function(n,s){"string"==typeof t&&(t=JSON.parse(t)),i.rowManager.addRows(t,e,o).then(function(t){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(t[0].getComponent())})})},h.prototype.updateOrAddRow=function(t,e){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),s?s.updateData(e).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(t){n(t)}):s=o.rowManager.addRows(e).then(function(t){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(t[0].getComponent())}).catch(function(t){n(t)})})},h.prototype.updateRow=function(t,e){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),s?s.updateData(e).then(function(){i(s.getComponent())}).catch(function(t){n(t)}):(console.warn("Update Error - No matching row found:",t),n("Update Error - No matching row found"))})},h.prototype.scrollToRow=function(t,e,o){var i=this;return new Promise(function(n,s){var a=i.rowManager.findRow(t);a?i.rowManager.scrollToRow(a,e,o).then(function(){n()}).catch(function(t){s(t)}):(console.warn("Scroll Error - No matching row found:",t),s("Scroll Error - No matching row found"))})},h.prototype.moveRow=function(t,e,o){var i=this.rowManager.findRow(t);i?i.moveToRow(e,o):console.warn("Move Error - No matching row found:",t)},h.prototype.getRows=function(t){return!0===t&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getComponents(t)},h.prototype.getRowPosition=function(t,e){var o=this.rowManager.findRow(t);return o?this.rowManager.getRowPosition(o,e):(console.warn("Position Error - No matching row found:",t),!1)},h.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)},h.prototype.setColumns=function(t){this.columnManager.setColumns(t)},h.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},h.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},h.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},h.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},h.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},h.prototype.showColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.hideColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.toggleColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()},h.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var a=i.columnManager.findColumn(o);i.columnManager.addColumn(t,e,a).then(function(t){n(t.getComponent())}).catch(function(t){s(t)})})}, +h.prototype.deleteColumn=function(t){var e=this;return new Promise(function(o,i){var n=e.columnManager.findColumn(t);n?n.delete().then(function(){o()}).catch(function(t){i(t)}):(console.warn("Column Delete Error - No matching column found:",t),i())})},h.prototype.updateColumnDefinition=function(t,e){var o=this;return new Promise(function(i,n){var s=o.columnManager.findColumn(t);s?s.updateDefinition(e).then(function(t){i(t)}).catch(function(t){n(t)}):(console.warn("Column Update Error - No matching column found:",t),n())})},h.prototype.moveColumn=function(t,e,o){var i=this.columnManager.findColumn(t),n=this.columnManager.findColumn(e);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",t)},h.prototype.scrollToColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var a=i.columnManager.findColumn(t);a?i.columnManager.scrollToColumn(a,e,o).then(function(){n()}).catch(function(t){s(t)}):(console.warn("Scroll Error - No matching column found:",t),s("Scroll Error - No matching column found"))})},h.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},h.prototype.getLocale=function(){return this.modules.localize.getLocale()},h.prototype.getLang=function(t){return this.modules.localize.getLang(t)},h.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},h.prototype.setHeight=function(t){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")},h.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},h.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},h.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},h.prototype.setFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,o,i),this.rowManager.filterRefresh())},h.prototype.refreshFilter=function(){this.modExists("filter",!0)&&this.rowManager.filterRefresh()},h.prototype.addFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,o,i),this.rowManager.filterRefresh())},h.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},h.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterFocus(e)}},h.prototype.getHeaderFilterValue=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(e)return this.modules.filter.getHeaderFilterValue(e);console.warn("Column Filter Error - No matching column found:",t)}},h.prototype.setHeaderFilterValue=function(t,e){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(!o)return console.warn("Column Filter Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterValue(o,e)}},h.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},h.prototype.removeFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},h.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},h.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},h.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&(!0===t&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),t="active"),this.modules.selectRow.selectRows(t))},h.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},h.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},h.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},h.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},h.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},h.prototype.clearCellValidation=function(t){var e=this;this.modExists("validate",!0)&&(t||(t=this.modules.validate.getInvalidCells()),Array.isArray(t)||(t=[t]),t.forEach(function(t){e.modules.validate.clearValidation(t._getSelf())}))},h.prototype.validate=function(t){var e=[];return this.rowManager.rows.forEach(function(t){var o=t.validate();!0!==o&&(e=e.concat(o))}),!e.length||e},h.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},h.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},h.prototype.setPageToRow=function(t){var e=this;return new Promise(function(o,i){e.options.pagination&&e.modExists("page")?(t=e.rowManager.findRow(t),t?e.modules.page.setPageToRow(t).then(function(){o()}).catch(function(){i()}):i()):i()})},h.prototype.setPageSize=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){})},h.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},h.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},h.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},h.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},h.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},h.prototype.setGroupBy=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")},h.prototype.setGroupValues=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupValues=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")},h.prototype.setGroupStartOpen=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},h.prototype.setGroupHeader=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},h.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},h.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},h.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},h.prototype.clearCellEdited=function(t){var e=this;this.modExists("edit",!0)&&(t||(t=this.modules.edit.getEditedCells()),Array.isArray(t)||(t=[t]),t.forEach(function(t){e.modules.edit.clearEdited(t._getSelf())}))},h.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},h.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},h.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},h.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},h.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},h.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},h.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},h.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},h.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},h.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},h.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},h.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},h.prototype.clearHistory=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.clear()},h.prototype.download=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i)},h.prototype.downloadToTab=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i,!0)},h.prototype.tableComms=function(t,e,o,i){this.modules.comms.receive(t,e,o,i)},h.prototype.moduleBindings={},h.prototype.extendModule=function(t,e,o){if(h.prototype.moduleBindings[t]){var i=h.prototype.moduleBindings[t].prototype[e];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)},h.prototype.registerModule=function(t,e){h.prototype.moduleBindings[t]=e},h.prototype.bindModules=function(){this.modules={};for(var t in h.prototype.moduleBindings)this.modules[t]=new h.prototype.moduleBindings[t](this)},h.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},h.prototype.helpers={elVisible:function(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)},elOffset:function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(t){var e=Object.assign(Array.isArray(t)?[]:{},t);for(var o in t)null!=t[o]&&"object"===_typeof(t[o])&&(t[o]instanceof Date?e[o]=new Date(t[o]):e[o]=this.deepClone(t[o]));return e}},h.prototype.comms={tables:[],register:function(t){h.prototype.comms.tables.push(t)},deregister:function(t){var e=h.prototype.comms.tables.indexOf(t);e>-1&&h.prototype.comms.tables.splice(e,1)},lookupTable:function(t,e){var o,i,n=[];if("string"==typeof t){if(o=document.querySelectorAll(t),o.length)for(var s=0;s0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t){function e(t){return"string"==typeof t?t.indexOf("%")>-1?n/100*parseInt(t):parseInt(t):t}function o(t,i,n,s){function a(t){return n*(t.column.definition.widthGrow||1)}function l(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var c=[],u=0,d=0,h=0,p=r,m=0,f=0,g=[];return t.forEach(function(t,e){var o=s?l(t):a(t);t.column.minWidth>=o?c.push(t):t.column.maxWidth&&t.column.maxWidththis.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var o,i,n;t.visible&&(o=t.definition.width,i=parseInt(t.minWidth),o?(n=e(o),s+=n>i?n:i,t.definition.widthShrink&&(u.push({column:t,width:n>i?n:i}),d+=t.definition.widthShrink)):(c.push({column:t,width:0}),r+=t.definition.widthGrow||1))}),a=n-s,l=Math.floor(a/r);var p=o(c,a,l,!1);c.length&&p>0&&(c[c.length-1].width+=+p),c.forEach(function(t){a-=t.width}),h=Math.abs(p)+a,h>0&&d&&(p=o(u,h,Math.floor(h/d),!0)),u.length&&(u[u.length-1].width-=p),c.forEach(function(t){t.column.setWidth(t.width)}),u.forEach(function(t){t.column.setWidth(t.width)})}},h.prototype.registerModule("layout",p);var m=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={},this.langList={}};m.prototype.initialize=function(){this.langList=h.prototype.helpers.deepClone(this.langs)},m.prototype.setHeaderFilterPlaceholder=function(t){this.langList.default.headerFilters.default=t},m.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langList.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},m.prototype.installLang=function(t,e){this.langList[t]?this._setLangProp(this.langList[t],e):this.langList[t]=e},m.prototype._setLangProp=function(t,e){for(var o in e)t[o]&&"object"==_typeof(t[o])?this._setLangProp(t[o],e[o]):t[o]=e[o]},m.prototype.setLocale=function(t){function e(t,o){for(var i in t)"object"==_typeof(t[i])?(o[i]||(o[i]={}),e(t[i],o[i])):o[i]=t[i]}var o=this;if(t=t||"default",!0===t&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langList[t]){var i=t.split("-")[0];o.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}o.locale=t,o.lang=h.prototype.helpers.deepClone(o.langList.default||{}),"default"!=t&&e(o.langList[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},m.prototype.getLocale=function(t){return self.locale},m.prototype.getLang=function(t){return t?this.langList[t]:this.lang},m.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},m.prototype._getLangElement=function(t,e){var o=this,i=o.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i},m.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},m.prototype._executeBindings=function(){var t=this;for(var e in t.bindings)!function(e){t.bindings[e].forEach(function(o){o(t.getText(e),t.lang)})}(e)},m.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All"},headerFilters:{default:"filter column...",columns:{}}}},h.prototype.registerModule("localize",m);var f=function(t){this.table=t};f.prototype.getConnections=function(t){var e,o=this,i=[];return e=h.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},f.prototype.send=function(t,e,o,i){var n=this,s=this.getConnections(t);s.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!s.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},f.prototype.receive=function(t,e,o,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,o,i);console.warn("Inter-table Comms Error - no such module:",e)},h.prototype.registerModule("comms",f);var g=function(t){this.table=t,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};g.prototype.initializeColumn=function(t){var e=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,a="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[a]&&(s=e.lookupAccessor(t.definition[a]))&&(o=!0,i[a]={accessor:s,params:t.definition[a+"Params"]||{}})}),o&&(t.modules.accessor=i)},g.prototype.lookupAccessor=function(t){var e=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.accessors[t]?e=this.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e},g.prototype.transformRow=function(t,e){var o="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),i=t.getComponent(),n=h.prototype.helpers.deepClone(t.data||{});return this.table.columnManager.traverse(function(t){var s,a,r,l;t.modules.accessor&&(a=t.modules.accessor[o]||t.modules.accessor.accessor||!1)&&"undefined"!=(s=t.getFieldValue(n))&&(l=t.getComponent(),r="function"==typeof a.params?a.params(s,n,e,l,i):a.params,t.setFieldValue(n,a.accessor(s,n,e,r,l,i)))}),n},g.prototype.accessors={},h.prototype.registerModule("accessor",g);var b=function(t){this.table=t,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};b.prototype.initialize=function(){var t;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=t.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&("string"==typeof this.table.options.ajaxLoaderError?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=t.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},b.prototype.createLoaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader"),t},b.prototype.createMsgElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader-msg"),t.setAttribute("role","alert"),t},b.prototype.setParams=function(t,e){if(e){this.params=this.params||{};for(var o in t)this.params[o]=t[o]}else this.params=t},b.prototype.getParams=function(){return this.params||{}},b.prototype.setConfig=function(t){if(this._loadDefaultConfig(),"string"==typeof t)this.config.method=t;else for(var e in t)this.config[e]=t[e]},b.prototype._loadDefaultConfig=function(t){var e=this;if(!e.config||t){e.config={};for(var o in e.defaultConfig)e.config[o]=e.defaultConfig[o]}},b.prototype.setUrl=function(t){this.url=t},b.prototype.getUrl=function(){return this.url},b.prototype.loadData=function(t,e){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(t,e)},b.prototype.nextPage=function(t){var e;this.loading||(e=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ti||null===i)&&(i=t)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(t,e,o){var i=null,n=void 0!==o.precision&&o.precision;return t.forEach(function(t){((t=Number(t))"),o.dataTreeExpandElement?"string"==typeof o.dataTreeExpandElement?(t=document.createElement("div"),t.innerHTML=o.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=o.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),_typeof(o.dataTreeStartExpanded)){case"boolean":this.startOpen=function(t,e){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(t,e){return o.dataTreeStartExpanded[e]}}},E.prototype.initializeRow=function(t){var e=t.getData()[this.field],o=Array.isArray(e),i=o||!o&&"object"===(void 0===e?"undefined":_typeof(e))&&null!==e;!i&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!i&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!i&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!i)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!i)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:i}},E.prototype.layoutRow=function(t){var e=this.elementField?t.getCell(this.elementField):t.getCells()[0],o=e.getElement(),i=t.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(t,o),t.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?o.style.paddingRight=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},E.prototype.generateControlElement=function(t,e){var o=this,i=t.modules.dataTree,e=e||t.getCells()[0].getElement(),n=i.controlEl;!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(e){e.stopPropagation(),o.collapseRow(t)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(e){e.stopPropagation(),o.expandRow(t)})),i.controlEl.addEventListener("mousedown",function(t){t.stopPropagation()}),n&&n.parentNode===e?n.parentNode.replaceChild(i.controlEl,n):e.insertBefore(i.controlEl,e.firstChild))},E.prototype.setDisplayIndex=function(t){this.displayIndex=t},E.prototype.getDisplayIndex=function(){return this.displayIndex},E.prototype.getRows=function(t){var e=this,o=[];return t.forEach(function(t,i){var n,s;o.push(t),t instanceof l&&(t.create(),n=t.modules.dataTree.children,n.index||!1===n.children||(s=e.getChildren(t),s.forEach(function(t){t.create(),o.push(t)})))}),o},E.prototype.getChildren=function(t,e){var o=this,i=t.modules.dataTree,n=[],s=[];return!1!==i.children&&(i.open||e)&&(Array.isArray(i.children)||(i.children=this.generateChildren(t)),n=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(i.children):i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n),n.forEach(function(t){s.push(t),o.getChildren(t).forEach(function(t){s.push(t)})})),s},E.prototype.generateChildren=function(t){var e=this,o=[],i=t.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var n=new l(i||{},e.table.rowManager);n.create(),n.modules.dataTree.index=t.modules.dataTree.index+1,n.modules.dataTree.parent=t,n.modules.dataTree.children&&(n.modules.dataTree.open=e.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)}),o},E.prototype.expandRow=function(t,e){var o=t.modules.dataTree;!1!==o.children&&(o.open=!0,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(t.getComponent(),t.modules.dataTree.index))},E.prototype.collapseRow=function(t){var e=t.modules.dataTree;!1!==e.children&&(e.open=!1,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(t.getComponent(),t.modules.dataTree.index))},E.prototype.toggleRow=function(t){var e=t.modules.dataTree;!1!==e.children&&(e.open?this.collapseRow(t):this.expandRow(t))},E.prototype.getTreeParent=function(t){return!!t.modules.dataTree.parent&&t.modules.dataTree.parent.getComponent()},E.prototype.getFilteredTreeChildren=function(t){var e,o=t.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(t)),e=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(o.children):o.children,e.forEach(function(t){t instanceof l&&i.push(t)})),i},E.prototype.rowDelete=function(t){var e,o=t.modules.dataTree.parent;o&&(e=this.findChildIndex(t,o),!1!==e&&o.data[this.field].splice(e,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)},E.prototype.addTreeChildRow=function(t,e,o,i){var n=!1;"string"==typeof e&&(e=JSON.parse(e)),Array.isArray(t.data[this.field])||(t.data[this.field]=[],t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)),void 0!==i&&!1!==(n=this.findChildIndex(i,t))&&t.data[this.field].splice(o?n:n+1,0,e),!1===n&&(o?t.data[this.field].unshift(e):t.data[this.field].push(e)),this.initializeRow(t),this.layoutRow(t),this.table.rowManager.refreshActiveData("tree",!1,!0)},E.prototype.findChildIndex=function(t,e){var o=this,i=!1;return"object"==(void 0===t?"undefined":_typeof(t))?t instanceof l?i=t.data:t instanceof r?i=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&e.modules.dataTree&&(i=e.modules.dataTree.children.find(function(e){return e instanceof l&&e.element===t}))&&(i=i.data):i=void 0!==t&&null!==t&&e.data[this.field].find(function(e){return e.data[o.table.options.index]==t}),i&&(Array.isArray(e.data[this.field])&&(i=e.data[this.field].indexOf(i)),-1==i&&(i=!1)),i},E.prototype.getTreeChildren=function(t,e,o){var i=this,n=t.modules.dataTree,s=[];return n.children&&(Array.isArray(n.children)||(n.children=this.generateChildren(t)),n.children.forEach(function(t){t instanceof l&&(s.push(e?t.getComponent():t),o&&(s=s.concat(i.getTreeChildren(t,e,o))))})),s},E.prototype.checkForRestyle=function(t){t.row.cells.indexOf(t)||t.row.reinitialize()},E.prototype.getChildField=function(){return this.field},E.prototype.redrawNeeded=function(t){return!!this.field&&void 0!==t[this.field]||!!this.elementField&&void 0!==t[this.elementField]},h.prototype.registerModule("dataTree",E);var C=function(t){this.table=t};C.prototype.download=function(t,e,o,i,n){function s(o,i){n?!0===n?a.triggerDownload(o,i,t,e,!0):n(o):a.triggerDownload(o,i,t,e)}var a=this,r=!1;if("function"==typeof t?r=t:a.downloaders[t]?r=a.downloaders[t]:console.warn("Download Error - No such download type found: ",t),r){var l=this.generateExportList(i);r.call(this.table,l,o||{},s)}},C.prototype.generateExportList=function(t){var e=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,t||this.table.options.downloadRowRange,"download"),o=this.table.options.groupHeaderDownload;return o&&!Array.isArray(o)&&(o=[o]),e.forEach(function(t){var e;"group"===t.type&&(e=t.columns[0],o&&o[t.indent]&&(e.value=o[t.indent](e.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)))}),e},C.prototype.triggerDownload=function(t,e,o,i,n){var s=document.createElement("a"),a=new Blob([t],{type:e}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(a=this.table.options.downloadReady.call(this.table,t,a))&&(n?window.open(window.URL.createObjectURL(a)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,i):(s.setAttribute("href",window.URL.createObjectURL(a)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},C.prototype.commsReceived=function(t,e,o){switch(e){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept)}},C.prototype.downloaders={csv:function(t,e,o){var i=e&&e.delimiter?e.delimiter:",",n=[],s=[];t.forEach(function(t){var e=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach(function(t,e){t&&1===t.depth&&(s[e]=void 0===t.value||null===t.value?"":'"'+String(t.value).split('"').join('""')+'"')});break;case"row":t.columns.forEach(function(t){if(t){switch(_typeof(t.value)){case"object":t.value=JSON.stringify(t.value);break;case"undefined":case"null":t.value=""}e.push('"'+String(t.value).split('"').join('""')+'"')}}),n.push(e.join(i))}}),s.length&&n.unshift(s.join(i)),n=n.join("\n"),e.bom&&(n="\ufeff"+n),o(n,"text/csv")},json:function(t,e,o){var i=[];t.forEach(function(t){var e={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach(function(t){t&&(e[t.component.getField()]=t.value)}),i.push(e)}}),i=JSON.stringify(i,null,"\t"),o(i,"application/json")},pdf:function(t,e,o){function i(t,e){var o=[];return t.columns.forEach(function(t){var i;if(t){switch(_typeof(t.value)){case"object":t.value=JSON.stringify(t.value);break;case"undefined":case"null":t.value=""}i={content:t.value,colSpan:t.width,rowSpan:t.height},e&&(i.styles=e),o.push(i)}else o.push("")}),o}var n=[],s=[],a={},r=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=e.jsPDF||{},u=e&&e.title?e.title:"";c.orientation||(c.orientation=e.orientation||"landscape"),c.unit||(c.unit="pt"),t.forEach(function(t){switch(t.type){case"header":n.push(i(t));break;case"group":s.push(i(t,r));break;case"calc":s.push(i(t,l));break;case"row":s.push(i(t))}});var d=new jsPDF(c);e&&e.autoTable&&(a="function"==typeof e.autoTable?e.autoTable(d)||{}:e.autoTable),u&&(a.addPageContent=function(t){d.text(u,40,30)}),a.head=n,a.body=s,d.autoTable(a),e&&e.documentProcessing&&e.documentProcessing(d),o(d.output("arraybuffer"),"application/pdf")},xlsx:function(t,e,o){function i(){var e=[],o=[],i={},n={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(function(t,e){return t+(e&&e.width?e.width:1)},0):0,r:t.length}};return t.forEach(function(t,i){var n=[];t.columns.forEach(function(t,e){t?(n.push(t.value instanceof Date||"object"!==_typeof(t.value)?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&o.push({s:{r:i,c:e},e:{r:i+t.height-1,c:e+t.width-1}})):n.push("")}),e.push(n)}),XLSX.utils.sheet_add_aoa(i,e),i["!ref"]=XLSX.utils.encode_range(n),o.length&&(i["!merges"]=o),i}var n,s=this,a=e.sheetName||"Sheet1",r=XLSX.utils.book_new();if(r.SheetNames=[],r.Sheets={},e.sheetOnly)return void o(i());if(e.sheets)for(var l in e.sheets)!0===e.sheets[l]?(r.SheetNames.push(l),r.Sheets[l]=i()):(r.SheetNames.push(l),this.modules.comms.send(e.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:s.active,intercept:function(t){r.Sheets[l]=t}}));else r.SheetNames.push(a),r.Sheets[a]=i();e.documentProcessing&&(r=e.documentProcessing(r)),n=XLSX.write(r,{bookType:"xlsx",bookSST:!0,type:"binary"}),o(function(t){for(var e=new ArrayBuffer(t.length),o=new Uint8Array(e),i=0;i!=t.length;++i)o[i]=255&t.charCodeAt(i);return e}(n),"application/octet-stream")},html:function(t,e,o){this.modExists("export",!0)&&o(this.modules.export.genereateHTMLTable(t),"text/html")}},h.prototype.registerModule("download",C);var x=function(t){this.table=t,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};x.prototype.initializeColumn=function(t){var e=this,o={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(_typeof(t.definition.editor)){case"string":"tick"===t.definition.editor&&(t.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),e.editors[t.definition.editor]?o.editor=e.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":o.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?("tick"===t.definition.formatter&&(t.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),e.editors[t.definition.formatter]?o.editor=e.editors[t.definition.formatter]:o.editor=e.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}o.editor&&(t.modules.edit=o)},x.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},x.prototype.clearEditor=function(t){var e,o=this.currentCell;if(this.invalidEdit=!1,o){for(this.currentCell=!1,e=o.getElement(),t?o.validate():e.classList.remove("tabulator-validation-fail"),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}},x.prototype.cancelEdit=function(){if(this.currentCell){var t=this.currentCell,e=this.currentCell.getComponent();this.clearEditor(!0),t.setValueActual(t.getValue()),t.cellRendered(),("textarea"==t.column.definition.editor||t.column.definition.variableHeight)&&t.row.normalizeHeight(!0),t.column.cellEvents.cellEditCancelled&&t.column.cellEvents.cellEditCancelled.call(this.table,e),this.table.options.cellEditCancelled.call(this.table,e)}},x.prototype.bindEditor=function(t){var e=this,o=t.getElement(!0);o.setAttribute("tabindex",0),o.addEventListener("click",function(t){o.classList.contains("tabulator-editing")||o.focus({preventScroll:!0})}),o.addEventListener("mousedown",function(t){2===t.button?t.preventDefault():e.mouseClick=!0}),o.addEventListener("focus",function(o){e.recursionBlock||e.edit(t,o,!1)})},x.prototype.focusCellNoEvent=function(t,e){this.recursionBlock=!0,e&&"ie"===this.table.browser||t.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},x.prototype.editCell=function(t,e){this.focusCellNoEvent(t),this.edit(t,!1,e)},x.prototype.focusScrollAdjust=function(t){if("virtual"==this.table.rowManager.getRenderMode()){var e=this.table.rowManager.element.scrollTop,o=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=t.row.getElement();i.offsetTop;i.offsetTopo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o);var n=this.table.rowManager.element.scrollLeft,s=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,a=t.getElement();a.offsetLeft;this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin),s-=parseInt(this.table.modules.frozenColumns.rightMargin)),this.table.options.virtualDomHoz&&(n-=parseInt(this.table.vdomHoz.vDomPadLeft),s-=parseInt(this.table.vdomHoz.vDomPadLeft)),a.offsetLefts&&(this.table.rowManager.element.scrollLeft+=a.offsetLeft+a.offsetWidth-s)}},x.prototype.edit=function(t,e,o){function i(e){if(c.currentCell===t){var o=!0;return t.column.modules.validate&&c.table.modExists("validate")&&"manual"!=c.table.options.validationMode&&(o=c.table.modules.validate.validate(t.column.modules.validate,t,e)),!0===o||"highlight"===c.table.options.validationMode?(c.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,-1==c.editedCells.indexOf(t)&&c.editedCells.push(t),t.setValue(e,!0),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(t),!0===o||(h.classList.add("tabulator-validation-fail"),c.table.options.validationFailed.call(c.table,t.getComponent(),e,o),!1)):(c.invalidEdit=!0,h.classList.add("tabulator-validation-fail"),c.focusCellNoEvent(t,!0),d(),c.table.options.validationFailed.call(c.table,t.getComponent(),e,o),!1)}}function n(){c.currentCell===t&&(c.cancelEdit(),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(t))}function s(t){d=t}var a,r,l,c=this,u=!0,d=function(){},h=t.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(t.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(e&&e.stopPropagation(),_typeof(t.column.modules.edit.check)){case"function":u=t.column.modules.edit.check(t.getComponent());break;case"boolean":u=t.column.modules.edit.check}if(u||o){if(c.cancelEdit(),c.currentCell=t,this.focusScrollAdjust(t),r=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.cellEvents.cellClick&&t.column.cellEvents.cellClick.call(this.table,e,r)),t.column.cellEvents.cellEditing&&t.column.cellEvents.cellEditing.call(this.table,r),c.table.options.cellEditing.call(this.table,r),l="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(r):t.column.modules.edit.params,!1===(a=t.column.modules.edit.editor.call(c,r,s,i,n,l)))return h.blur(),!1;if(!(a instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",a),h.blur(),!1;for(h.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-row-editing");h.firstChild;)h.removeChild(h.firstChild);h.appendChild(a),d();for(var p=h.children,m=0;m46){if(o>=i.length)return e.preventDefault(),e.stopPropagation(),r=!1,!1;switch(i[o]){case n:if(l.toUpperCase()==l.toLowerCase())return e.preventDefault(),e.stopPropagation(),r=!1,!1;break;case s:if(isNaN(l))return e.preventDefault(),e.stopPropagation(),r=!1,!1;break;case a:break;default:if(l!==i[o])return e.preventDefault(),e.stopPropagation(),r=!1,!1}r=!0}}),t.addEventListener("keyup",function(i){i.keyCode>46&&e.maskAutoFill&&o(t.value.length)}),t.placeholder||(t.placeholder=i),e.maskAutoFill&&o(t.value.length)},x.prototype.getEditedCells=function(){var t=[];return this.editedCells.forEach(function(e){t.push(e.getComponent())}),t},x.prototype.clearEdited=function(t){var e;t.modules.edit&&t.modules.edit.edited&&(t.modules.edit.edited=!1,t.modules.validate&&(t.modules.validate.invalid=!1)),(e=this.editedCells.indexOf(t))>-1&&this.editedCells.splice(e,1)},x.prototype.editors={input:function(t,e,o,i,n){function s(t){(null===a||void 0===a)&&""!==r.value||r.value!==a?o(r.value)&&(a=r.value):i()}var a=t.getValue(),r=document.createElement("input");if(r.setAttribute("type",n.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),r.setAttribute(l,r.getAttribute(l)+n.elementAttributes["+"+l])):r.setAttribute(l,n.elementAttributes[l]);return r.value=void 0!==a?a:"",e(function(){r.focus({preventScroll:!0}),r.style.height="100%"}),r.addEventListener("change",s),r.addEventListener("blur",s),r.addEventListener("keydown",function(t){switch(t.keyCode){case 13:s(t);break;case 27:i();break;case 35:case 36:t.stopPropagation()}}),n.mask&&this.table.modules.edit.maskInput(r,n),r},textarea:function(t,e,o,i,n){function s(e){(null===a||void 0===a)&&""!==c.value||c.value!==a?(o(c.value)&&(a=c.value),setTimeout(function(){t.getRow().normalizeHeight()},300)):i()}var a=t.getValue(),r=n.verticalNavigation||"hybrid",l=String(null!==a&&void 0!==a?a:""),c=(l.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),u=0;if(c.style.display="block",c.style.padding="2px",c.style.height="100%", +c.style.width="100%",c.style.boxSizing="border-box",c.style.whiteSpace="pre-wrap",c.style.resize="none",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),c.setAttribute(d,c.getAttribute(d)+n.elementAttributes["+"+d])):c.setAttribute(d,n.elementAttributes[d]);return c.value=l,e(function(){c.focus({preventScroll:!0}),c.style.height="100%",c.scrollHeight,c.style.height=c.scrollHeight+"px",t.getRow().normalizeHeight()}),c.addEventListener("change",s),c.addEventListener("blur",s),c.addEventListener("keyup",function(){c.style.height="";var e=c.scrollHeight;c.style.height=e+"px",e!=u&&(u=e,t.getRow().normalizeHeight())}),c.addEventListener("keydown",function(t){switch(t.keyCode){case 27:i();break;case 38:("editor"==r||"hybrid"==r&&c.selectionStart)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&c.selectionStart!==c.value.length)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 35:case 36:t.stopPropagation()}}),n.mask&&this.table.modules.edit.maskInput(c,n),c},number:function(t,e,o,i,n){function s(){var t=l.value;isNaN(t)||""===t||(t=Number(t)),t!==a?o(t)&&(a=t):i()}var a=t.getValue(),r=n.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==n.max&&l.setAttribute("max",n.max),void 0!==n.min&&l.setAttribute("min",n.min),void 0!==n.step&&l.setAttribute("step",n.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var c in n.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+n.elementAttributes["+"+c])):l.setAttribute(c,n.elementAttributes[c]);l.value=a;var u=function(t){s()};return e(function(){l.removeEventListener("blur",u),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",u)}),l.addEventListener("keydown",function(t){switch(t.keyCode){case 13:s();break;case 27:i();break;case 38:case 40:"editor"==r&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 35:case 36:t.stopPropagation()}}),n.mask&&this.table.modules.edit.maskInput(l,n),l},range:function(t,e,o,i,n){function s(){var t=r.value;isNaN(t)||""===t||(t=Number(t)),t!=a?o(t)&&(a=t):i()}var a=t.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==n.max&&r.setAttribute("max",n.max),void 0!==n.min&&r.setAttribute("min",n.min),void 0!==n.step&&r.setAttribute("step",n.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),r.setAttribute(l,r.getAttribute(l)+n.elementAttributes["+"+l])):r.setAttribute(l,n.elementAttributes[l]);return r.value=a,e(function(){r.focus({preventScroll:!0}),r.style.height="100%"}),r.addEventListener("blur",function(t){s()}),r.addEventListener("keydown",function(t){switch(t.keyCode){case 13:s();break;case 27:i()}}),r},select:function(t,e,o,i,n){function s(e){var o,i={},n=x.table.getData();return o=e?x.table.columnManager.getColumnByField(e):t.getColumn()._getSelf(),o?n.forEach(function(t){var e=o.getFieldValue(t);null!==e&&void 0!==e&&""!==e&&(i[e]=!0)}):console.warn("unable to find matching column to create select lookup list:",e),Object.keys(i)}function a(e,o){function i(t){var t={label:t.label,value:t.value,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1};return o.indexOf(t.value)>-1&&c(t),s.push(t),a.push(t),t}var s=[],a=[];if("function"==typeof e&&(e=e(t)),Array.isArray(e))e.forEach(function(t){var e;"object"===(void 0===t?"undefined":_typeof(t))?t.options?(e={label:t.label,group:!0,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1},a.push(e),t.options.forEach(function(t){i(t)})):i(t):(e={label:t,value:t,element:!1},o.indexOf(e.value)>-1&&c(e),s.push(e),a.push(e))});else for(var l in e){var u={label:e[l],value:l,element:!1};o.indexOf(u.value)>-1&&c(u),s.push(u),a.push(u)}n.sortValuesList&&(s.sort(function(t,e){return t.labele.label?1:0}),a.sort(function(t,e){return t.labele.label?1:0}),"asc"!==n.sortValuesList&&(s.reverse(),a.reverse())),S=s,P=a,r()}function r(){for(;k.firstChild;)k.removeChild(k.firstChild);P.forEach(function(e){var o=e.element;if(!o){if(o=document.createElement("div"),e.label=n.listItemFormatter?n.listItemFormatter(e.value,e.label,t,o,e.itemParams):e.label,e.group?(o.classList.add("tabulator-edit-select-list-group"),o.tabIndex=0,o.innerHTML=""===e.label?" ":e.label):(o.classList.add("tabulator-edit-select-list-item"),o.tabIndex=0,o.innerHTML=""===e.label?" ":e.label,o.addEventListener("click",function(){F=!0,setTimeout(function(){F=!1},10),z?(d(e),T.focus()):p(e)}),A.indexOf(e)>-1&&o.classList.add("active")),e.elementAttributes&&"object"==_typeof(e.elementAttributes))for(var i in e.elementAttributes)"+"==i.charAt(0)?(i=i.slice(1),o.setAttribute(i,T.getAttribute(i)+e.elementAttributes["+"+i])):o.setAttribute(i,e.elementAttributes[i]);o.addEventListener("mousedown",function(){_=!1,setTimeout(function(){_=!0},10)}),e.element=o}k.appendChild(o)})}function l(t,e){!z&&H&&H.element&&H.element.classList.remove("active"),H&&H.element&&H.element.classList.remove("focused"),H=t,t.element&&(t.element.classList.add("focused"),e&&t.element.classList.add("active")),t&&t.element&&t.element.scrollIntoView&&t.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}function c(t){-1==A.indexOf(t)&&(A.push(t),l(t,!0)),f()}function u(t){var e=A[t];t>-1&&(A.splice(t,1),e.element&&e.element.classList.remove("active"))}function d(t){t||(t=H);var e=A.indexOf(t);e>-1?u(e):(!0!==z&&A.length>=z&&u(0),c(t)),f()}function p(t){y(),t||(t=H),t&&(T.value=t.label,o(t.value)),D=[t.value]}function m(t){t||y();var e=[];A.forEach(function(t){e.push(t.value)}),D=e,o(e)}function f(){var t=[];A.forEach(function(e){t.push(e.label)}),T.value=t.join(", "),!1===x.currentCell&&m(!0)}function g(){for(var t=A.length,e=0;e0&&l(S[e-1],!z));break;case 40:e=S.indexOf(H),("editor"==L||"hybrid"==L&&e=38&&t.keyCode<=90&&E(t.keyCode)}}),T.addEventListener("blur",function(t){_&&(z?m():b())}),T.addEventListener("focus",function(t){F||v()}),k=document.createElement("div"),k.classList.add("tabulator-edit-select-list"),e(function(){T.style.height="100%",T.focus({preventScroll:!0})}),setTimeout(function(){C.table.rowManager.element.addEventListener("scroll",b)},10),T},autocomplete:function(t,e,o,i,n){function s(){!0===n.values?S=a():"string"==typeof n.values&&(S=a(n.values))}function a(e){var o,i={},s=E.table.getData();return o=e?E.table.columnManager.getColumnByField(e):t.getColumn()._getSelf(),o?(s.forEach(function(t){var e=o.getFieldValue(t);null!==e&&void 0!==e&&""!==e&&(i[e]=!0)}),i=n.sortValuesList?"asc"==n.sortValuesList?Object.keys(i).sort():Object.keys(i).sort().reverse():Object.keys(i)):console.warn("unable to find matching column to create autocomplete lookup list:",e),i}function r(t,e){var o,i,s=[];o=S||(n.values||[]),n.searchFunc?(s=n.searchFunc(t,o),s instanceof Promise?(l(void 0!==n.searchingPlaceholder?n.searchingPlaceholder:"Searching..."),s.then(function(t){d(c(t),e)}).catch(function(t){console.err("error in autocomplete search promise:",t)})):d(c(s),e)):(i=c(o),""===t?n.showListOnEmpty&&(s=i):i.forEach(function(e){null===e.value&&void 0===e.value||(String(e.value).toLowerCase().indexOf(String(t).toLowerCase())>-1||String(e.title).toLowerCase().indexOf(String(t).toLowerCase())>-1)&&s.push(e)}),d(s,e))}function l(t){var e=document.createElement("div");u(),!1!==t&&(e.classList.add("tabulator-edit-select-list-notice"),e.tabIndex=0,t instanceof Node?e.appendChild(t):e.innerHTML=t,D.appendChild(e))}function c(t){var e=[];if(Array.isArray(t))t.forEach(function(t){var o={};"object"===(void 0===t?"undefined":_typeof(t))?(o.title=n.listItemFormatter?n.listItemFormatter(t.value,t.label):t.label,o.value=t.value):(o.title=n.listItemFormatter?n.listItemFormatter(t,t):t,o.value=t),e.push(o)});else for(var o in t){var i={title:n.listItemFormatter?n.listItemFormatter(o,t[o]):t[o],value:o};e.push(i)}return e}function u(){for(;D.firstChild;)D.removeChild(D.firstChild)}function d(t,e){t.length?p(t,e):n.emptyPlaceholder&&l(n.emptyPlaceholder)}function p(t,e){var o=!1;u(),T=t,T.forEach(function(t){var i=t.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=t.title,i.addEventListener("click",function(e){g(t),m()}),i.addEventListener("mousedown",function(t){z=!1,setTimeout(function(){z=!0},10)}),t.element=i,e&&t.value==x&&(L.value=t.title,t.element.classList.add("active"),o=!0),t===k&&(t.element.classList.add("active"),o=!0)),D.appendChild(i)}),o||g(!1)}function m(){b(),k?x!==k.value?(x=k.value,L.value=k.title,o(k.value)):i():n.freetext?(x=L.value,o(L.value)):n.allowEmpty&&""===L.value?(x=L.value,o(L.value)):i()}function f(){if(!D.parentNode){for(console.log("show",M);D.firstChild;)D.removeChild(D.firstChild);var t=h.prototype.helpers.elOffset(C);D.style.minWidth=C.offsetWidth+"px",D.style.top=t.top+C.offsetHeight+"px",D.style.left=t.left+"px",document.body.appendChild(D)}}function g(t,e){k&&k.element&&k.element.classList.remove("active"),k=t,t&&t.element&&t.element.classList.add("active"),t&&t.element&&t.element.scrollIntoView&&t.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}function b(){D.parentNode&&D.parentNode.removeChild(D),y()}function v(){b(),i()}function y(){E.table.rowManager.element.removeEventListener("scroll",v)}var w=this,E=this,C=t.getElement(),x=t.getValue(),R=n.verticalNavigation||"editor",M=void 0!==x||null===x?x:void 0!==n.defaultValue?n.defaultValue:"",L=document.createElement("input"),D=document.createElement("div"),T=[],k=!1,z=!0,S=!1;if(L.setAttribute("type","search"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var H in n.elementAttributes)"+"==H.charAt(0)?(H=H.slice(1),L.setAttribute(H,L.getAttribute(H)+n.elementAttributes["+"+H])):L.setAttribute(H,n.elementAttributes[H]);return D.classList.add("tabulator-edit-select-list"),D.addEventListener("mousedown",function(t){z=!1,setTimeout(function(){z=!0},10)}),L.addEventListener("keydown",function(t){var e;switch(t.keyCode){case 38:e=T.indexOf(k),("editor"==R||"hybrid"==R&&e)&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),g(e>0?T[e-1]:!1));break;case 40:e=T.indexOf(k),("editor"==R||"hybrid"==R&&e'):("ie"==r.table.browser?e.setAttribute("class","tabulator-star-inactive"):e.classList.replace("tabulator-star-active","tabulator-star-inactive"),e.innerHTML='')})}function a(t){c=t,s(t)}var r=this,l=t.getElement(),c=t.getValue(),u=l.getElementsByTagName("svg").length||5,d=l.getElementsByTagName("svg")[0]?l.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],p=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.style.whiteSpace="nowrap",l.style.overflow="hidden",l.style.textOverflow="ellipsis",p.style.verticalAlign="middle",p.style.display="inline-block",p.style.padding="4px",m.setAttribute("width",d),m.setAttribute("height",d),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var f in n.elementAttributes)"+"==f.charAt(0)?(f=f.slice(1),p.setAttribute(f,p.getAttribute(f)+n.elementAttributes["+"+f])):p.setAttribute(f,n.elementAttributes[f]);for(var g=1;g<=u;g++)!function(t){var e=document.createElement("span"),i=m.cloneNode(!0);h.push(i),e.addEventListener("mouseenter",function(e){e.stopPropagation(),e.stopImmediatePropagation(),s(t)}),e.addEventListener("mousemove",function(t){t.stopPropagation(),t.stopImmediatePropagation()}),e.addEventListener("click",function(e){e.stopPropagation(),e.stopImmediatePropagation(),o(t),l.blur()}),e.appendChild(i),p.appendChild(e)}(g);return c=Math.min(parseInt(c),u),s(c),p.addEventListener("mousemove",function(t){s(0)}),p.addEventListener("click",function(t){o(0)}),l.addEventListener("blur",function(t){i()}),l.addEventListener("keydown",function(t){switch(t.keyCode){case 39:a(c+1);break;case 37:a(c-1);break;case 13:o(c);break;case 27:i()}}),p},progress:function(t,e,o,i,n){function s(){var t=window.getComputedStyle(l,null),e=d*Math.round(m.offsetWidth/((l.clientWidth-parseInt(t.getPropertyValue("padding-left"))-parseInt(t.getPropertyValue("padding-right")))/100))+u;o(e),l.setAttribute("aria-valuenow",e),l.setAttribute("aria-label",h)}var a,r,l=t.getElement(),c=void 0===n.max?l.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,u=void 0===n.min?l.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,d=(c-u)/100,h=t.getValue()||0,p=document.createElement("div"),m=document.createElement("div");if(p.style.position="absolute",p.style.right="0",p.style.top="0",p.style.bottom="0",p.style.width="5px",p.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var f in n.elementAttributes)"+"==f.charAt(0)?(f=f.slice(1),m.setAttribute(f,m.getAttribute(f)+n.elementAttributes["+"+f])):m.setAttribute(f,n.elementAttributes[f]);return l.style.padding="4px 4px",h=Math.min(parseFloat(h),c),h=Math.max(parseFloat(h),u),h=Math.round((h-u)/d),m.style.width=h+"%",l.setAttribute("aria-valuemin",u),l.setAttribute("aria-valuemax",c),m.appendChild(p),p.addEventListener("mousedown",function(t){a=t.screenX,r=m.offsetWidth}),p.addEventListener("mouseover",function(){p.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(t){a&&(m.style.width=r+t.screenX-a+"px")}),l.addEventListener("mouseup",function(t){a&&(t.stopPropagation(),t.stopImmediatePropagation(),a=!1,r=!1,s())}),l.addEventListener("keydown",function(t){switch(t.keyCode){case 39:t.preventDefault(),m.style.width=m.clientWidth+l.clientWidth/100+"px";break;case 37:t.preventDefault(),m.style.width=m.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:s();break;case 27:i()}}),l.addEventListener("blur",function(){i()}),m},tickCross:function(t,e,o,i,n){function s(t){return l?t?u?c:r.checked:r.checked&&!u?(r.checked=!1,r.indeterminate=!0,u=!0,c):(u=!1,r.checked):r.checked}var a=t.getValue(),r=document.createElement("input"),l=n.tristate,c=void 0===n.indeterminateValue?null:n.indeterminateValue,u=!1;if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),r.setAttribute(d,r.getAttribute(d)+n.elementAttributes["+"+d])):r.setAttribute(d,n.elementAttributes[d]);return r.value=a,!l||void 0!==a&&a!==c&&""!==a||(u=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&e(function(){r.focus({preventScroll:!0})}),r.checked=!0===a||"true"===a||"True"===a||1===a,e(function(){r.focus()}),r.addEventListener("change",function(t){o(s())}),r.addEventListener("blur",function(t){o(s(!0))}),r.addEventListener("keydown",function(t){13==t.keyCode&&o(s()),27==t.keyCode&&i()}),r}},h.prototype.registerModule("edit",x);var R=function(t,e,o,i){this.type=t,this.columns=e,this.component=o||!1,this.indent=i||0},M=function(t,e,o,i,n){this.value=t,this.component=e||!1,this.width=o,this.height=i,this.depth=n},L=function(t){this.table=t,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};L.prototype.generateExportList=function(t,e,o,i){this.cloneTableStyle=e,this.config=t||{},this.colVisProp=i;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],s=this.bodyToExportRows(this.rowLookup(o));return n.concat(s)},L.prototype.genereateTable=function(t,e,o,i){var n=this.generateExportList(t,e,o,i);return this.genereateTableElement(n)},L.prototype.rowLookup=function(t){var e=this,o=[];if("function"==typeof t)t.call(this.table).forEach(function(t){(t=e.table.rowManager.findRow(t))&&o.push(t)});else switch(t){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],o)},L.prototype.generateColumnGroupHeaders=function(){var t=this,e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var i=t.processColumnGroup(o);i&&e.push(i)}),e},L.prototype.processColumnGroup=function(t){var e=this,o=t.columns,i=0,n=t.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||t.definition.title,s={title:n,column:t,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o&&(s.width+=o.width,s.subGroups.push(o),o.depth>i&&(i=o.depth))}),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(t))return!1;s.width=1}return s},L.prototype.columnVisCheck=function(t){return!1!==t.definition[this.colVisProp]&&(t.visible||!t.visible&&t.definition[this.colVisProp])},L.prototype.headersToExportRows=function(t){function e(t,n){var s=i-n;if(void 0===o[n]&&(o[n]=[]),t.height=t.subGroups?1:s-t.depth+1,o[n].push(t),t.height>1)for(var a=1;a1)for(var r=1;ri&&(i=t.depth)}),t.forEach(function(t){e(t,0)}),o.forEach(function(t){var e=[];t.forEach(function(t){t?e.push(new M(t.title,t.column.getComponent(),t.width,t.height,t.depth)):e.push(null)}),n.push(new R("header",e))}),n},L.prototype.bodyToExportRows=function(t){var e=this,o=[],i=[];return this.table.columnManager.columnsByIndex.forEach(function(t){e.columnVisCheck(t)&&o.push(t.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),t=t.filter(function(t){switch(t.type){case"group":return!1!==e.config.rowGroups;case"calc":return!1!==e.config.columnCalcs;case"row":return!(e.table.options.dataTree&&!1===e.config.dataTree&&t.modules.dataTree.parent)}return!0}),t.forEach(function(t,n){var s=t.getData(e.colVisProp),a=[],r=0;switch(t.type){case"group":r=t.level,a.push(new M(t.key,t.getComponent(),o.length,1));break;case"calc":case"row":o.forEach(function(t){a.push(new M(t._column.getFieldValue(s),t,1,1))}),e.table.options.dataTree&&!1!==e.config.dataTree&&(r=t.modules.dataTree.index)}i.push(new R(t.type,a,t.getComponent(),r))}),i},L.prototype.genereateTableElement=function(t){var e=this,o=document.createElement("table"),i=document.createElement("thead"),n=document.createElement("tbody"),s=this.lookupTableStyles(),a=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==a?a:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),o.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach(function(t,o){switch(t.type){case"header":i.appendChild(e.genereateHeaderElement(t,r,s));break;case"group":n.appendChild(e.genereateGroupElement(t,r,s));break;case"calc":n.appendChild(e.genereateCalcElement(t,r,s));break;case"row":var a=e.genereateRowElement(t,r,s);e.mapElementStyles(o%2&&s.evenRow?s.evenRow:s.oddRow,a,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(a)}}),i.innerHTML&&o.appendChild(i),o.appendChild(n),this.mapElementStyles(this.table.element,o,["border-top","border-left","border-right","border-bottom"]),o},L.prototype.lookupTableStyles=function(){var t={};return this.cloneTableStyle&&window.getComputedStyle&&(t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],t.firstRow&&(t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell"),t.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t},L.prototype.genereateHeaderElement=function(t,e,o){var i=this,n=document.createElement("tr");return t.columns.forEach(function(t){if(t){var e=document.createElement("th"),o=t.component._column.definition.cssClass?t.component._column.definition.cssClass.split(" "):[];e.colSpan=t.width,e.rowSpan=t.height,e.innerHTML=t.value,i.cloneTableStyle&&(e.style.boxSizing="border-box"),o.forEach(function(t){e.classList.add(t)}),i.mapElementStyles(t.component.getElement(),e,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),i.mapElementStyles(t.component._column.contentElement,e,["padding-top","padding-left","padding-right","padding-bottom"]),t.component._column.visible?i.mapElementStyles(t.component.getElement(),e,["width"]):t.component._column.definition.width&&(e.style.width=t.component._column.definition.width+"px"),t.component._column.parent&&i.mapElementStyles(t.component._column.parent.groupElement,e,["border-top"]),n.appendChild(e)}}),n},L.prototype.genereateGroupElement=function(t,e,o){var i=document.createElement("tr"),n=document.createElement("td"),s=t.columns[0];return i.classList.add("tabulator-print-table-row"),e.groupHeader&&e.groupHeader[t.indent]?s.value=e.groupHeader[t.indent](s.value,t.component._group.getRowCount(),t.component._group.getData(),t.component):!1===e.groupHeader?s.value=s.value:s.value=t.component._group.generator(s.value,t.component._group.getRowCount(),t.component._group.getData(),t.component),n.colSpan=s.width,n.innerHTML=s.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+t.indent),s.component.isVisible()&&i.classList.add("tabulator-group-visible"),this.mapElementStyles(o.firstGroup,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(o.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),i.appendChild(n),i},L.prototype.genereateCalcElement=function(t,e,o){var i=this.genereateRowElement(t,e,o);return i.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(o.calcRow,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),i},L.prototype.genereateRowElement=function(t,e,o){var n=this,s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),t.columns.forEach(function(a){if(a){var r=document.createElement("td"),l=a.component._column,c=a.value,u={modules:{},getValue:function(){return c},getField:function(){return l.definition.field},getElement:function(){return r},getColumn:function(){return l.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return u},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach(function(t){r.classList.add(t)}),n.table.modExists("format")&&!1!==n.config.formatCells)c=n.table.modules.format.formatExportValue(u,n.colVisProp);else switch(void 0===c?"undefined":_typeof(c)){case"object":c=JSON.stringify(c);break;case"undefined":case"null":c="";break;default:c=c}c instanceof Node?r.appendChild(c):r.innerHTML=c,o.firstCell&&(n.mapElementStyles(o.firstCell,r,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),l.definition.align&&(r.style.textAlign=l.definition.align)),n.table.options.dataTree&&!1!==n.config.dataTree&&(e.treeElementField&&e.treeElementField==l.field||!e.treeElementField&&0==i)&&(t.component._row.modules.dataTree.controlEl&&r.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),r.firstChild),t.component._row.modules.dataTree.branchEl&&r.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),r.firstChild)),s.appendChild(r),u.modules.format&&u.modules.format.renderedCallback&&u.modules.format.renderedCallback(),e.rowFormatter&&!1!==n.config.formatCells&&e.rowFormatter(t.component)}}),s},L.prototype.genereateHTMLTable=function(t){var e=document.createElement("div");return e.appendChild(this.genereateTableElement(t)),e.innerHTML},L.prototype.getHtml=function(t,e,o,i){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,e,t,i||"htmlOutput");return this.genereateHTMLTable(n)},L.prototype.mapElementStyles=function(t,e,o){if(this.cloneTableStyle&&t&&e){var i={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(t);o.forEach(function(t){e.style[i[t]]=n.getPropertyValue(t)})}}},h.prototype.registerModule("export",L);var D=function(t){this.table=t,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};D.prototype.initializeColumn=function(t,e){function o(e){var o,a="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",r="",l="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==e){if(t.modules.filter.prevSuccess=e,t.modules.filter.emptyFunc(e))delete n.headerFilters[s];else{switch(t.modules.filter.value=e,_typeof(t.definition.headerFilterFunc)){case"string":n.filters[t.definition.headerFilterFunc]?(r=t.definition.headerFilterFunc,o=function(o){var i=t.definition.headerFilterFuncParams||{},s=t.getFieldValue(o);return i="function"==typeof i?i(e,s,o):i,n.filters[t.definition.headerFilterFunc](e,s,o,i)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":o=function(o){var i=t.definition.headerFilterFuncParams||{},n=t.getFieldValue(o);return i="function"==typeof i?i(e,n,o):i,t.definition.headerFilterFunc(e,n,o,i)},r=o}if(!o)switch(a){case"partial":o=function(o){var i=t.getFieldValue(o);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(e).toLowerCase())>-1},r="like" +;break;default:o=function(o){return t.getFieldValue(o)==e},r="="}n.headerFilters[s]={value:e,func:o,type:r,params:i||{}}}l=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==l&&(n.prevHeaderFilterChangeCheck=l,n.changed=!0,n.table.rowManager.filterRefresh())}return!0}var i,n=this,s=t.getField();t.modules.filter={success:o,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)},D.prototype.generateHeaderFilterElement=function(t,e,o){function i(){}var n,s,a,r,l,c,u,d=this,h=this,p=t.modules.filter.success,m=t.getField();if(t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),m){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&"0"!==t&&0!==t},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(t.definition.headerFilter)){case"string":h.table.modules.edit.editors[t.definition.headerFilter]?(s=h.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":s=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?s=t.modules.edit.editor:t.definition.formatter&&h.table.modules.edit.editors[t.definition.formatter]?(s=h.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):s=h.table.modules.edit.editors.input}if(s){if(r={getValue:function(){return void 0!==e?e:""},getField:function(){return t.definition.field},getElement:function(){return n},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=t.definition.headerFilterParams||{},u="function"==typeof u?u.call(h.table):u,!(a=s.call(this.table.modules.edit,r,function(){},p,i,u)))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(a instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",a);m?h.table.modules.localize.bind("headerFilters|columns|"+t.definition.field,function(t){a.setAttribute("placeholder",void 0!==t&&t?t:h.table.modules.localize.getText("headerFilters|default"))}):h.table.modules.localize.bind("headerFilters|default",function(t){a.setAttribute("placeholder",void 0!==h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:t)}),a.addEventListener("click",function(t){t.stopPropagation(),a.focus()}),a.addEventListener("focus",function(t){var e=d.table.columnManager.element.scrollLeft;e!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(e),d.table.columnManager.scrollHorizontal(e))}),l=!1,c=function(t){l&&clearTimeout(l),l=setTimeout(function(){p(a.value)},h.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=a,t.modules.filter.attrType=a.hasAttribute("type")?a.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=a.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter&&("autocomplete"!==t.definition.editor&&"tickCross"!==t.definition.editor||!0!==t.definition.headerFilter)&&(a.addEventListener("keyup",c),a.addEventListener("search",c),"number"==t.modules.filter.attrType&&a.addEventListener("change",function(t){p(a.value)}),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&a.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||a.addEventListener("mousedown",function(t){t.stopPropagation()})),n.appendChild(a),t.contentElement.appendChild(n),o||h.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)},D.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="none")})},D.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="")})},D.prototype.setHeaderFilterFocus=function(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())},D.prototype.getHeaderFilterValue=function(t){if(t.modules.filter&&t.modules.filter.headerElement)return t.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",t.getField())},D.prototype.setHeaderFilterValue=function(t,e){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,e,!0),t.modules.filter.success(e)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},D.prototype.reloadHeaderFilter=function(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},D.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},D.prototype.setFilter=function(t,e,o,i){var n=this;n.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:o,params:i}]),n.addFilter(t)},D.prototype.addFilter=function(t,e,o,i){var n=this;Array.isArray(t)||(t=[{field:t,type:e,value:o,params:i}]),t.forEach(function(t){(t=n.findFilter(t))&&(n.filterList.push(t),n.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},D.prototype.findFilter=function(t){var e,o=this;if(Array.isArray(t))return this.findSubFilters(t);var i=!1;return"function"==typeof t.field?i=function(e){return t.field(e,t.type||{})}:o.filters[t.type]?(e=o.table.columnManager.getColumnByField(t.field),i=e?function(i){return o.filters[t.type](t.value,e.getFieldValue(i),i,t.params||{})}:function(e){return o.filters[t.type](t.value,e[t.field],e,t.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=i,!!t.func&&t},D.prototype.findSubFilters=function(t){var e=this,o=[];return t.forEach(function(t){(t=e.findFilter(t))&&o.push(t)}),!!o.length&&o},D.prototype.getFilters=function(t,e){var o=[];return t&&(o=this.getHeaderFilters()),e&&o.forEach(function(t){"function"==typeof t.type&&(t.type="function")}),o=o.concat(this.filtersToArray(this.filterList,e))},D.prototype.filtersToArray=function(t,e){var o=this,i=[];return t.forEach(function(t){var n;Array.isArray(t)?i.push(o.filtersToArray(t,e)):(n={field:t.field,type:t.type,value:t.value},e&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},D.prototype.getHeaderFilters=function(){var t=[];for(var e in this.headerFilters)t.push({field:e,type:this.headerFilters[e].type,value:this.headerFilters[e].value});return t},D.prototype.removeFilter=function(t,e,o){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:o}]),t.forEach(function(t){var e=-1;e="object"==_typeof(t.field)?i.filterList.findIndex(function(e){return t===e}):i.filterList.findIndex(function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value}),e>-1?(i.filterList.splice(e,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},D.prototype.clearFilter=function(t){this.filterList=[],t&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},D.prototype.clearHeaderFilter=function(){var t=this;this.headerFilters={},t.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(e){void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,t.reloadHeaderFilter(e)}),this.changed=!0},D.prototype.search=function(t,e,o,i){var n=this,s=[],a=[];return Array.isArray(e)||(e=[{field:e,type:o,value:i}]),e.forEach(function(t){(t=n.findFilter(t))&&a.push(t)}),this.table.rowManager.rows.forEach(function(e){var o=!0;a.forEach(function(t){n.filterRecurse(t,e.getData())||(o=!1)}),o&&s.push("data"===t?e.getData("data"):e.getComponent())}),s},D.prototype.filter=function(t,e){var o=this,i=[],n=[];return o.table.options.dataFiltering&&o.table.options.dataFiltering.call(o.table,o.getFilters()),o.table.options.ajaxFiltering||!o.filterList.length&&!Object.keys(o.headerFilters).length?i=t.slice(0):t.forEach(function(t){o.filterRow(t)&&i.push(t)}),o.table.options.dataFiltered&&(i.forEach(function(t){n.push(t.getComponent())}),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},D.prototype.filterRow=function(t,e){var o=this,i=!0,n=t.getData();o.filterList.forEach(function(t){o.filterRecurse(t,n)||(i=!1)});for(var s in o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},D.prototype.filterRecurse=function(t,e){var o=this,i=!1;return Array.isArray(t)?t.forEach(function(t){o.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i},D.prototype.filters={"=":function(t,e,o,i){return e==t},"<":function(t,e,o,i){return e":function(t,e,o,i){return e>t},">=":function(t,e,o,i){return e>=t},"!=":function(t,e,o,i){return e!=t},regex:function(t,e,o,i){return"string"==typeof t&&(t=new RegExp(t)),t.test(e)},like:function(t,e,o,i){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},keywords:function(t,e,o,i){var n=t.toLowerCase().split(void 0===i.separator?" ":i.separator),s=String(null===e||void 0===e?"":e).toLowerCase(),a=[];return n.forEach(function(t){s.includes(t)&&a.push(!0)}),i.matchAll?a.length===n.length:!!a.length},starts:function(t,e,o,i){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().startsWith(t.toLowerCase())},ends:function(t,e,o,i){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().endsWith(t.toLowerCase())},in:function(t,e,o,i){return Array.isArray(t)?!t.length||t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}},h.prototype.registerModule("filter",D);var T=function(t){this.table=t};T.prototype.initializeColumn=function(t){t.modules.format=this.lookupFormatter(t,""),void 0!==t.definition.formatterPrint&&(t.modules.format.print=this.lookupFormatter(t,"Print")),void 0!==t.definition.formatterClipboard&&(t.modules.format.clipboard=this.lookupFormatter(t,"Clipboard")),void 0!==t.definition.formatterHtmlOutput&&(t.modules.format.htmlOutput=this.lookupFormatter(t,"HtmlOutput"))},T.prototype.lookupFormatter=function(t,e){var o={params:t.definition["formatter"+e+"Params"]||{}},i=t.definition["formatter"+e];switch(void 0===i?"undefined":_typeof(i)){case"string":"tick"===i&&(i="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[i]?o.formatter=this.formatters[i]:(console.warn("Formatter Error - No such formatter found: ",i),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=i;break;default:o.formatter=this.formatters.plaintext}return o},T.prototype.cellRendered=function(t){t.modules.format&&t.modules.format.renderedCallback&&!t.modules.format.rendered&&(t.modules.format.renderedCallback(),t.modules.format.rendered=!0)},T.prototype.formatValue=function(t){function e(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1}var o=t.getComponent(),i="function"==typeof t.column.modules.format.params?t.column.modules.format.params(o):t.column.modules.format.params;return t.column.modules.format.formatter.call(this,o,i,e)},T.prototype.formatExportValue=function(t,e){var o,i=t.column.modules.format[e];if(i){var n=function(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1};return o="function"==typeof i.params?i.params(component):i.params,i.formatter.call(this,t.getComponent(),o,n)}return this.formatValue(t)},T.prototype.sanitizeHTML=function(t){if(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}return t},T.prototype.emptyToSpace=function(t){return null===t||void 0===t||""===t?" ":t},T.prototype.getFormatter=function(t){var t;switch(void 0===t?"undefined":_typeof(t)){case"string":this.formatters[t]?t=this.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=this.formatters.plaintext);break;case"function":t=t;break;default:t=this.formatters.plaintext}return t},T.prototype.formatters={plaintext:function(t,e,o){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e,o){return t.getValue()},textarea:function(t,e,o){return t.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e,o){var i,n,s,a,r=parseFloat(t.getValue()),l=e.decimal||".",c=e.thousand||",",u=e.symbol||"",d=!!e.symbolAfter,h=void 0!==e.precision?e.precision:2;if(isNaN(r))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));for(i=!1!==h?r.toFixed(h):r,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",a=/(\d+)(\d{3})/;a.test(n);)n=n.replace(a,"$1"+c+"$2");return d?n+s+u:u+n+s},link:function(t,e,o){var i,n=t.getValue(),s=e.urlPrefix||"",a=e.download,r=n,l=document.createElement("a");if(e.labelField&&(i=t.getData(),r=i[e.labelField]),e.label)switch(_typeof(e.label)){case"string":r=e.label;break;case"function":r=e.label(t)}if(r){if(e.urlField&&(i=t.getData(),n=i[e.urlField]),e.url)switch(_typeof(e.url)){case"string":n=e.url;break;case"function":n=e.url(t)}return l.setAttribute("href",s+n),e.target&&l.setAttribute("target",e.target),e.download&&(a="function"==typeof a?a(t):!0===a?"":a,l.setAttribute("download",a)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),l}return" "},image:function(t,e,o){var i=document.createElement("img"),n=t.getValue();switch(e.urlPrefix&&(n=e.urlPrefix+t.getValue()),e.urlSuffix&&(n+=e.urlSuffix),i.setAttribute("src",n),_typeof(e.height)){case"number":i.style.height=e.height+"px";break;case"string":i.style.height=e.height}switch(_typeof(e.width)){case"number":i.style.width=e.width+"px";break;case"string":i.style.width=e.width}return i.addEventListener("load",function(){t.getRow().normalizeHeight()}),i},tickCross:function(t,e,o){var i=t.getValue(),n=t.getElement(),s=e.allowEmpty,a=e.allowTruthy,r=void 0!==e.tickElement?e.tickElement:'',l=void 0!==e.crossElement?e.crossElement:'';return a&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),r||""):!s||"null"!==i&&""!==i&&null!==i&&void 0!==i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(t,e,o){var i=e.inputFormat||"YYYY-MM-DD hh:mm:ss",n=e.outputFormat||"DD/MM/YYYY hh:mm:ss",s=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",a=t.getValue(),r=moment(a,i);return r.isValid()?e.timezone?r.tz(e.timezone).format(n):r.format(n):!0===s?a:"function"==typeof s?s(a):s},datetimediff:function(t,e,o){var i=e.inputFormat||"YYYY-MM-DD hh:mm:ss",n=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",s=void 0!==e.suffix&&e.suffix,a=void 0!==e.unit?e.unit:void 0,r=void 0!==e.humanize&&e.humanize,l=void 0!==e.date?e.date:moment(),c=t.getValue(),u=moment(c,i);return u.isValid()?r?moment.duration(u.diff(l)).humanize(s):u.diff(l,a)+(s?" "+s:""):!0===n?c:"function"==typeof n?n(c):n},lookup:function(t,e,o){var i=t.getValue();return void 0===e[i]?(console.warn("Missing display value for "+i),i):e[i]},star:function(t,e,o){var i=t.getValue(),n=t.getElement(),s=e&&e.stars?e.stars:5,a=document.createElement("span"),r=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.verticalAlign="middle",r.setAttribute("width","14"),r.setAttribute("height","14"),r.setAttribute("viewBox","0 0 512 512"),r.setAttribute("xml:space","preserve"),r.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,s));for(var l=1;l<=s;l++){var c=r.cloneNode(!0);c.innerHTML=l<=i?'':'',a.appendChild(c)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),a},traffic:function(t,e,o){var i,n,s=this.sanitizeHTML(t.getValue())||0,a=document.createElement("span"),r=e&&e.max?e.max:100,l=e&&e.min?e.min:0,c=e&&void 0!==e.color?e.color:["red","orange","green"],u="#666666";if(!isNaN(s)&&void 0!==t.getValue()){switch(a.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=r?parseFloat(s):r,n=parseFloat(n)>=l?parseFloat(n):l,i=(r-l)/100,n=Math.round((n-l)/i),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(s);break;case"object":if(Array.isArray(c)){var d=100/c.length,h=Math.floor(n/d);h=Math.min(h,c.length-1),h=Math.max(h,0),u=c[h];break}}return a.style.backgroundColor=u,a}},progress:function(t,e,o){var i,n,s,a,r,l=this.sanitizeHTML(t.getValue())||0,u=t.getElement(),d=e&&e.max?e.max:100,h=e&&e.min?e.min:0,p=e&&e.legendAlign?e.legendAlign:"center";switch(n=parseFloat(l)<=d?parseFloat(l):d,n=parseFloat(n)>=h?parseFloat(n):h,i=(d-h)/100,n=Math.round((n-h)/i),_typeof(e.color)){case"string":s=e.color;break;case"function":s=e.color(l);break;case"object":if(Array.isArray(e.color)){var m=100/e.color.length,f=Math.floor(n/m);f=Math.min(f,e.color.length-1),f=Math.max(f,0),s=e.color[f];break}default:s="#2DC214"}switch(_typeof(e.legend)){case"string":a=e.legend;break;case"function":a=e.legend(l);break;case"boolean":a=l;break;default:a=!1}switch(_typeof(e.legendColor)){case"string":r=e.legendColor;break;case"function":r=e.legendColor(l);break;case"object":if(Array.isArray(e.legendColor)){var m=100/e.legendColor.length,f=Math.floor(n/m);f=Math.min(f,e.legendColor.length-1),f=Math.max(f,0),r=e.legendColor[f]}break;default:r="#000"}u.style.minWidth="30px",u.style.position="relative",u.setAttribute("aria-label",n);var g=document.createElement("div");if(g.style.display="inline-block",g.style.position="relative",g.style.width=n+"%",g.style.backgroundColor=s,g.style.height="100%",g.setAttribute("data-max",d),g.setAttribute("data-min",h),a){var b=document.createElement("div");b.style.position="absolute",b.style.top="4px",b.style.left=0,b.style.textAlign=p,b.style.width="100%",b.style.color=r,b.innerHTML=a}return o(function(){if(!(t instanceof c)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",u.appendChild(e),u=e}u.appendChild(g),a&&u.appendChild(b)}),""},color:function(t,e,o){return t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue()),""},buttonTick:function(t,e,o){return''},buttonCross:function(t,e,o){return''},rownum:function(t,e,o){return this.table.rowManager.activeRows.indexOf(t.getRow()._getSelf())+1},handle:function(t,e,o){return t.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(t,e,o){function i(t){var e=s.element;s.open=t,e&&(s.open?(n.classList.add("open"),e.style.display=""):(n.classList.remove("open"),e.style.display="none"))}var n=document.createElement("div"),s=t.getRow()._row.modules.responsiveLayout;return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",t.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(t){t.stopImmediatePropagation(),i(!s.open)}),i(s.open),n},rowSelection:function(t,e,o){var i=this,n=document.createElement("input");if(n.type="checkbox",this.table.modExists("selectRow",!0))if(n.addEventListener("click",function(t){t.stopPropagation()}),"function"==typeof t.getRow){var s=t.getRow();s instanceof r?(n.addEventListener("change",function(t){s.toggleSelect()}),n.checked=s.isSelected&&s.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(s,n)):n=""}else n.addEventListener("change",function(t){i.table.modules.selectRow.selectedRows.length?i.table.deselectRow():i.table.selectRow(e.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(n);return n}},h.prototype.registerModule("format",T);var k=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};k.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0},k.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right")},k.prototype.frozenCheck=function(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen},k.prototype.scrollHorizontal=function(){var t,e=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){e.layout()},100),t=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),t.forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},k.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},k.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))},k.prototype.layoutColumnPosition=function(t){var e=this,o=[];this.leftColumns.forEach(function(i,n){if(i.modules.frozen.margin=e._calcSpace(e.leftColumns,n)+e.table.columnManager.scrollLeft+"px",n==e.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=e.getColGroupParentElement(i);o.includes(s)||(e.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else e.layoutElement(i.getElement(),i);t&&i.cells.forEach(function(t){e.layoutElement(t.getElement(!0),i)})}),this.rightColumns.forEach(function(o,i){o.modules.frozen.margin=e.rightPadding-e._calcSpace(e.rightColumns,i+1)+"px",i==e.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?e.layoutElement(e.getColGroupParentElement(o),o):e.layoutElement(o.getElement(),o),t&&o.cells.forEach(function(t){e.layoutElement(t.getElement(!0),o)})})},k.prototype.getColGroupParentElement=function(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()},k.prototype.layout=function(){var t=this;t.active&&(this.calcMargins(),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},k.prototype.layoutRow=function(t){var e=this;t.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var i=t.getCell(o);i&&e.layoutElement(i.getElement(!0),o)}),this.rightColumns.forEach(function(o){var i=t.getCell(o);i&&e.layoutElement(i.getElement(!0),o)})},k.prototype.layoutElement=function(t,e){e.modules.frozen&&(t.style.position="absolute",t.style.left=e.modules.frozen.margin,t.classList.add("tabulator-frozen"),e.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+e.modules.frozen.position))},k.prototype._calcSpace=function(t,e){for(var o=0,i=0;i-1&&e.splice(o,1)}),e},z.prototype.freezeRow=function(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(t),this.table.rowManager.refreshActiveData("display"),this.styleRows())},z.prototype.unfreezeRow=function(t){this.rows.indexOf(t);t.modules.frozen?(t.modules.frozen=!1,this.detachRow(t),this.table.rowManager.adjustTableSize(),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")},z.prototype.detachRow=function(t){var e=this.rows.indexOf(t);if(e>-1){var o=t.getElement();o.parentNode.removeChild(o),this.rows.splice(e,1)}},z.prototype.styleRows=function(t){var e=this;this.rows.forEach(function(t,o){e.table.rowManager.styleRow(t,o)})},h.prototype.registerModule("frozenRows",z);var S=function(t){this._group=t,this.type="GroupComponent"};S.prototype.getKey=function(){return this._group.key},S.prototype.getField=function(){return this._group.field},S.prototype.getElement=function(){return this._group.element},S.prototype.getRows=function(){return this._group.getRows(!0)},S.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},S.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},S.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},S.prototype.isVisible=function(){return this._group.visible},S.prototype.show=function(){this._group.show()},S.prototype.hide=function(){this._group.hide()},S.prototype.toggle=function(){this._group.toggleVisibility()},S.prototype._getSelf=function(){return this._group},S.prototype.getTable=function(){return this._group.groupManager.table};var H=function(t,e,o,i,n,s,a){this.groupManager=t,this.parent=e,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,t):this.rows.splice(n,0,t):o?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},H.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(e){e.scrollHeader(t)})},H.prototype.getRowIndex=function(t){},H.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},H.prototype.removeRow=function(t){var e=this.rows.indexOf(t),o=t.getElement();e>-1&&this.rows.splice(e,1),this.groupManager.table.options.groupValues||this.rows.length?(o.parentNode&&o.parentNode.removeChild(o),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},H.prototype.removeGroup=function(t){var e,o=t.level+"_"+t.key;this.groups[o]&&(delete this.groups[o],e=this.groupList.indexOf(t),e>-1&&this.groupList.splice(e,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},H.prototype.getHeadersAndRows=function(t){var e=[];return e.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){e=e.concat(o.getHeadersAndRows(t))}):(!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top))),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom)))),e},H.prototype.getData=function(t,e){var o=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){o.push(t.getData(e||"data"))}),o},H.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(e){t+=e.getRowCount()}):t=this.rows.length,t},H.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},H.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){t.detachElement()})}):this.rows.forEach(function(t){var e=t.getElement();e.parentNode.removeChild(e)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},H.prototype.show=function(){var t=this;if(t.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var o=t.getElement();e.parentNode.insertBefore(o,e.nextSibling),t.initialize(),e=o})}):t.rows.forEach(function(t){var o=t.getElement();e.parentNode.insertBefore(o,e.nextSibling),t.initialize(),e=o}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},H.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(e){t.push(e.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},H.prototype.getRowGroup=function(t){var e=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(t);i&&(e=i)}):this.rows.find(function(e){return e===t})&&(e=this),e},H.prototype.getSubGroups=function(t){var e=[];return this.groupList.forEach(function(o){e.push(t?o.getComponent():o)}),e},H.prototype.getRows=function(t){var e=[];return this.rows.forEach(function(o){e.push(t?o.getComponent():o)}),e},H.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(e){t.push(e.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},H.prototype.getPath=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.unshift(this.key),this.parent&&this.parent.getPath(t),t},H.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;ti.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(e,o){t.headerGenerator[0]=function(t,i,n){return(void 0===t?"":t)+"("+i+" "+(1===i?e:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(e)||e)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach(function(e){e.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(e)||(e=[e]),e.forEach(function(e,o){var i,n;"function"==typeof e?i=e:(n=t.table.columnManager.getColumnByField(e),i=n?function(t){return n.getFieldValue(t)}:function(t){return t[e]}),t.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!t.allowedValues&&t.allowedValues[o]})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=o),i&&(t.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},P.prototype.setDisplayIndex=function(t){this.displayIndex=t},P.prototype.getDisplayIndex=function(){return this.displayIndex},P.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)},P.prototype.getGroups=function(t){var e=[];return this.groupList.forEach(function(o){e.push(t?o.getComponent():o)}),e},P.prototype.getChildGroups=function(t){var e=this,o=[];return t||(t=this),t.groupList.forEach(function(t){t.groupList.length?o=o.concat(e.getChildGroups(t)):o.push(t)}),o},P.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})},P.prototype.pullGroupListData=function(t){var e=this,o=[];return t.forEach(function(t){var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];t.hasSubGroups?(n=e.pullGroupListData(t.groupList),i.level=t.level,i.rowCount=n.length-t.groupList.length,i.headerContent=t.generator(t.key,i.rowCount,t.rows,t),o.push(i),o=o.concat(n)):(i.level=t.level,i.headerContent=t.generator(t.key,t.rows.length,t.rows,t),i.rowCount=t.getRows().length,o.push(i),t.getRows().forEach(function(t){o.push(t.getData("data"))}))}),o},P.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},P.prototype.getRowGroup=function(t){var e=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(t);i&&(e=i)}),e},P.prototype.countGroups=function(){return this.groupList.length},P.prototype.generateGroups=function(t){var e=this,o=e.groups;e.groups={},e.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){e.createGroup(t,0,o)}),t.forEach(function(t){e.assignRowToExistingGroup(t,o)})):t.forEach(function(t){e.assignRowToGroup(t,o)})},P.prototype.createGroup=function(t,e,o){var i,n=e+"_"+t;o=o||[],i=new H(this,!1,e,t,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},P.prototype.assignRowToExistingGroup=function(t,e){var o=this.groupIDLookups[0].func(t.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(t)},P.prototype.assignRowToGroup=function(t,e){var o=this.groupIDLookups[0].func(t.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,e),this.groups["0_"+o].addRow(t),!i},P.prototype.reassignRowToGroup=function(t){var e=t.getGroup(),o=e.getPath(),i=this.getExpectedPath(t);o.length==i.length&&o.every(function(t,e){return t===i[e]})||(e.removeRow(t),this.assignRowToGroup(t,self.groups),this.table.rowManager.refreshActiveData("group",!1,!0))},P.prototype.getExpectedPath=function(t){var e=[],o=t.getData();return this.groupIDLookups.forEach(function(t){e.push(t.func(o))}),e},P.prototype.updateGroupRows=function(t){var e=this,o=[];if(e.groupList.forEach(function(t){o=o.concat(t.getHeadersAndRows())}),t){var i=e.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),e.table.rowManager.refreshActiveData("group",!0,!0)}return o},P.prototype.scrollHeaders=function(t){this.table.options.virtualDomHoz&&(t-=this.table.vdomHoz.vDomPadLeft),t+="px",this.groupList.forEach(function(e){e.scrollHeader(t)})},P.prototype.removeGroup=function(t){var e,o=t.level+"_"+t.key;this.groups[o]&&(delete this.groups[o],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1))},h.prototype.registerModule("groupRows",P);var A=function(t){this.table=t,this.history=[],this.index=-1};A.prototype.clear=function(){this.history=[],this.index=-1},A.prototype.action=function(t,e,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:o}),this.index++},A.prototype.getHistoryUndoSize=function(){return this.index+1},A.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},A.prototype.clearComponentHistory=function(t){var e=this.history.findIndex(function(e){return e.component===t});e>-1&&(this.history.splice(e,1),e<=this.index&&this.index--,this.clearComponentHistory(t))},A.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},A.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},A.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,e)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posFrom],!t.data.after),this.table.rowManager.redraw()}},A.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,e)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posTo],t.data.after),this.table.rowManager.redraw()}},A.prototype._rebindRow=function(t,e){this.history.forEach(function(o){if(o.component instanceof l)o.component===t&&(o.component=e);else if(o.component instanceof u&&o.component.row===t){var i=o.component.column.getField();i&&(o.component=e.getCell(i))}})},h.prototype.registerModule("history",A);var _=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};_.prototype.parseTable=function(){var t=this,e=t.table.element,o=t.table.options,i=(o.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],s=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],t._extractOptions(e,o),i.length?t._extractHeaders(i,n):t._generateBlankHeaders(i,n);for(var a=0;a-1&&t.pressedKeys.splice(i,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},F.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},F.prototype.checkBinding=function(t,e){var o=this,i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach(function(t){-1==o.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(o,t),!0)},F.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},F.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,o=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(o>=0?e.element.scrollTop=o:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,o=e.scrollTop+e.height,i=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(o<=i?e.element.scrollTop=o:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e,o=!1,i=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell)&&(t.preventDefault(),e=o.nav(),e.next()||i&&(o.getElement().firstChild.blur(),i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(o.row.getComponent())):this.table.addRow(Object.assign({},i)),i.then(function(){setTimeout(function(){e.next()})})))},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},h.prototype.registerModule("keybindings",F);var N=function(t){this.table=t,this.menuElements=[],this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1,this.positionReversedX=!1};N.prototype.initializeColumnHeader=function(t){var e,o=this;t.definition.headerContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,t.definition.headerContextMenu)),this.tapHold(t,t.definition.headerContextMenu)),t.definition.headerMenu&&(e=document.createElement("span"),e.classList.add("tabulator-header-menu-button"),e.innerHTML="⋮",e.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),o.LoadMenuEvent(t,t.definition.headerMenu,e)}),t.titleElement.insertBefore(e,t.titleElement.firstChild))},N.prototype.LoadMenuEvent=function(t,e,o){e="function"==typeof e?e.call(this.table,t.getComponent(),o):e,this.loadMenu(o,t,e)},N.prototype.tapHold=function(t,e){var o=this,i=t.getElement(),n=null,s=!1;i.addEventListener("touchstart",function(i){clearTimeout(n),s=!1,n=setTimeout(function(){clearTimeout(n),n=null,s=!0,o.LoadMenuEvent(t,e,i)},1e3)},{passive:!0}),i.addEventListener("touchend",function(t){clearTimeout(n),n=null,s&&t.preventDefault()})},N.prototype.initializeCell=function(t){t.column.definition.contextMenu&&(t.getElement(!0).addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,t.column.definition.contextMenu)),this.tapHold(t,t.column.definition.contextMenu)),t.column.definition.clickMenu&&t.getElement(!0).addEventListener("click",this.LoadMenuEvent.bind(this,t,t.column.definition.clickMenu))},N.prototype.initializeRow=function(t){this.table.options.rowContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,this.table.options.rowContextMenu)),this.tapHold(t,this.table.options.rowContextMenu)),this.table.options.rowClickMenu&&t.getElement().addEventListener("click",this.LoadMenuEvent.bind(this,t,this.table.options.rowClickMenu))},N.prototype.initializeGroup=function(t){this.table.options.groupContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,this.table.options.groupContextMenu)),this.tapHold(t,this.table.options.groupContextMenu)),this.table.options.groupClickMenu&&t.getElement().addEventListener("click",this.LoadMenuEvent.bind(this,t,this.table.options.groupClickMenu))},N.prototype.loadMenu=function(t,e,o,i){var n=this,s=!(t instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),s||t.preventDefault(),o&&o.length){if(!i){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout(function(){n.nestedMenuBlock=!1},100);this.hideMenu(),this.menuElements=[]}o.forEach(function(t){var o=document.createElement("div"),i=t.label,s=t.disabled;t.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof i&&(i=i.call(n.table,e.getComponent())),i instanceof Node?o.appendChild(i):o.innerHTML=i,"function"==typeof s&&(s=s.call(n.table,e.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",function(t){t.stopPropagation()})):t.menu&&t.menu.length?o.addEventListener("click",function(i){i.stopPropagation(),n.hideOldSubMenus(a),n.loadMenu(i,e,t.menu,o)}):t.action&&o.addEventListener("click",function(o){t.action(o,e.getComponent())}),t.menu&&t.menu.length&&o.classList.add("tabulator-menu-item-submenu")),a.appendChild(o)}),a.addEventListener("click",function(t){n.hideMenu()}),this.menuElements.push(a),this.positionMenu(a,i,s,t)}},N.prototype.hideOldSubMenus=function(t){var e=this.menuElements.indexOf(t);if(e>-1)for(var o=this.menuElements.length-1;o>e;o--){var i=this.menuElements[o];i.parentNode&&i.parentNode.removeChild(i),this.menuElements.pop()}},N.prototype.positionMenu=function(t,e,o,i){var n,s,a,r=this,l=Math.max(document.body.offsetHeight,window.innerHeight);e?(a=h.prototype.helpers.elOffset(e),n=a.left+e.offsetWidth,s=a.top-1):(n=o?i.touches[0].pageX:i.pageX,s=o?i.touches[0].pageY:i.pageY,this.positionReversedX=!1),t.style.top=s+"px",t.style.left=n+"px",setTimeout(function(){r.table.rowManager.element.addEventListener("scroll",r.blurEvent),document.body.addEventListener("click",r.blurEvent),document.body.addEventListener("contextmenu",r.blurEvent),window.addEventListener("resize",r.blurEvent),document.body.addEventListener("keydown",r.escEvent)},100),document.body.appendChild(t),s+t.offsetHeight>=l&&(t.style.top="",t.style.bottom=e?l-a.top-e.offsetHeight-1+"px":l-s+"px"),(n+t.offsetWidth>=document.body.offsetWidth||this.positionReversedX)&&(t.style.left="",t.style.right=e?document.documentElement.offsetWidth-a.left+"px":document.documentElement.offsetWidth-n+"px",this.positionReversedX=!0)},N.prototype.isOpen=function(){return!!this.menuElements.length},N.prototype.escMenu=function(t){27==t.keyCode&&this.hideMenu()},N.prototype.hideMenu=function(){this.menuElements.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}),document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent)},N.prototype.menus={},h.prototype.registerModule("menu",N);var B=function(t){this.table=t,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};B.prototype.createPlaceholderElement=function(){var t=document.createElement("div") +;return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t},B.prototype.initializeColumn=function(t){var e,o=this,i={};t.modules.frozen||(e=t.getElement(),i.mousemove=function(i){t.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-h.prototype.helpers.elOffset(e).left+o.table.columnManager.element.scrollLeft>t.getWidth()/2?o.toCol===t&&o.toColAfter||(e.parentNode.insertBefore(o.placeholderElement,e.nextSibling),o.moveColumn(t,!0)):(o.toCol!==t||o.toColAfter)&&(e.parentNode.insertBefore(o.placeholderElement,e),o.moveColumn(t,!1)))}.bind(o),e.addEventListener("mousedown",function(e){o.touchMove=!1,1===e.which&&(o.checkTimeout=setTimeout(function(){o.startMove(e,t)},o.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(t)),t.modules.moveColumn=i},B.prototype.bindTouchEvents=function(t){var e,o,i,n,s,a,r,l=this,c=t.getElement(),u=!1;c.addEventListener("touchstart",function(c){l.checkTimeout=setTimeout(function(){l.touchMove=!0,e=t,o=t.nextColumn(),n=o?o.getWidth()/2:0,i=t.prevColumn(),s=i?i.getWidth()/2:0,a=0,r=0,u=!1,l.startMove(c,t)},l.checkPeriod)},{passive:!0}),c.addEventListener("touchmove",function(c){var d,h;l.moving&&(l.moveHover(c),u||(u=c.touches[0].pageX),d=c.touches[0].pageX-u,d>0?o&&d-a>n&&(h=o)!==t&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveColumn(h,!0)):i&&-d-r>s&&(h=i)!==t&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveColumn(h,!1)),h&&(e=h,o=h.nextColumn(),a=n,n=o?o.getWidth()/2:0,i=h.prevColumn(),r=s,s=i?i.getWidth()/2:0))},{passive:!0}),c.addEventListener("touchend",function(t){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&l.endMove(t)})},B.prototype.startMove=function(t,e){var o=e.getElement();this.moving=e,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-h.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t)},B.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})},B.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})},B.prototype.moveColumn=function(t,e){var o=this.moving.getCells();this.toCol=t,this.toColAfter=e,e?t.getCells().forEach(function(t,e){var i=t.getElement(!0);i.parentNode.insertBefore(o[e].getElement(),i.nextSibling)}):t.getCells().forEach(function(t,e){var i=t.getElement(!0);i.parentNode.insertBefore(o[e].getElement(),i)})},B.prototype.endMove=function(t){(1===t.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},B.prototype.moveHover=function(t){var e,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?t.touches[0].pageX:t.pageX)-h.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-nt.getHeight()/2){if(e.toRow!==t||!e.toRowAfter){var i=t.getElement();i.parentNode.insertBefore(e.placeholderElement,i.nextSibling),e.moveRow(t,!0)}}else if(e.toRow!==t||e.toRowAfter){var i=t.getElement();i.previousSibling&&(i.parentNode.insertBefore(e.placeholderElement,i),e.moveRow(t,!1))}}.bind(e),t.modules.moveRow=o},O.prototype.initializeRow=function(t){var e,o=this,i={};i.mouseup=function(e){o.tableRowDrop(e,t)}.bind(o),i.mousemove=function(e){var i=t.getElement();e.pageY-h.prototype.helpers.elOffset(i).top+o.table.rowManager.element.scrollTop>t.getHeight()/2?o.toRow===t&&o.toRowAfter||(i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(t,!0)):(o.toRow!==t||o.toRowAfter)&&(i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(t,!1))}.bind(o),this.hasHandle||(e=t.getElement(),e.addEventListener("mousedown",function(e){1===e.which&&(o.checkTimeout=setTimeout(function(){o.startMove(e,t)},o.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=i},O.prototype.initializeCell=function(t){var e=this,o=t.getElement(!0);o.addEventListener("mousedown",function(o){1===o.which&&(e.checkTimeout=setTimeout(function(){e.startMove(o,t.row)},e.checkPeriod))}),o.addEventListener("mouseup",function(t){1===t.which&&e.checkTimeout&&clearTimeout(e.checkTimeout)}),this.bindTouchEvents(t.row,o)},O.prototype.bindTouchEvents=function(t,e){var o,i,n,s,a,r,l,c=this,u=!1;e.addEventListener("touchstart",function(e){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=t,i=t.nextRow(),s=i?i.getHeight()/2:0,n=t.prevRow(),a=n?n.getHeight()/2:0,r=0,l=0,u=!1,c.startMove(e,t)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,e.addEventListener("touchmove",function(e){var d,h;c.moving&&(e.preventDefault(),c.moveHover(e),u||(u=e.touches[0].pageY),d=e.touches[0].pageY-u,d>0?i&&d-r>s&&(h=i)!==t&&(u=e.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement().nextSibling),c.moveRow(h,!0)):n&&-d-l>a&&(h=n)!==t&&(u=e.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement()),c.moveRow(h,!1)),h&&(o=h,i=h.nextRow(),r=s,s=i?i.getHeight()/2:0,n=h.prevRow(),l=a,a=n?n.getHeight()/2:0))}),e.addEventListener("touchend",function(t){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(t),c.touchMove=!1)})},O.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"!==t.type&&"group"!==t.type||!t.modules.moveRow.mousemove||t.getElement().addEventListener("mousemove",t.modules.moveRow.mousemove)})},O.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"!==t.type&&"group"!==t.type||!t.modules.moveRow.mousemove||t.getElement().removeEventListener("mousemove",t.modules.moveRow.mousemove)})},O.prototype.startMove=function(t,e){var o=e.getElement();this.setStartPosition(t,e),this.moving=e,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(e)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(t)},O.prototype.setStartPosition=function(t,e){var o,i,n=this.touchMove?t.touches[0].pageX:t.pageX,s=this.touchMove?t.touches[0].pageY:t.pageY;o=e.getElement(),this.connection?(i=o.getBoundingClientRect(),this.startX=i.left-n+window.pageXOffset,this.startY=i.top-s+window.pageYOffset):this.startY=s-o.getBoundingClientRect().top},O.prototype.endMove=function(t){t&&1!==t.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},O.prototype.moveRow=function(t,e){this.toRow=t,this.toRowAfter=e},O.prototype.moveHover=function(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)},O.prototype.moveHoverTable=function(t){var e=this.table.rowManager.getElement(),o=e.scrollTop,i=(this.touchMove?t.touches[0].pageY:t.pageY)-e.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},O.prototype.moveHoverConnections=function(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"},O.prototype.elementRowDrop=function(t,e,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(t,e,!!o&&o.getComponent())},O.prototype.connectToTables=function(t){var e,o=this;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:t})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(t){"string"==typeof t?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(t))):o.connectionElements.push(t)}),this.connectionElements.forEach(function(t){var e=function(e){o.elementRowDrop(e,t,o.moving)};t.addEventListener("mouseup",e),t.tabulatorElementDropEvent=e,t.classList.add("tabulator-movingrow-receiving")}))},O.prototype.disconnectFromTables=function(){var t;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(t){t.classList.remove("tabulator-movingrow-receiving"),t.removeEventListener("mouseup",t.tabulatorElementDropEvent),delete t.tabulatorElementDropEvent})},O.prototype.connect=function(t,e){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=e,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().addEventListener("mouseup",t.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,e,t),!0)},O.prototype.disconnect=function(t){var e=this;t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),e.table.element.removeEventListener("mouseup",e.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,t)):console.warn("Move Row Error - trying to disconnect from non connected table")},O.prototype.dropComplete=function(t,e,o){var i=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender}i?i.call(this,this.moving.getComponent(),e?e.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),e?e.getComponent():void 0,t)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),e?e.getComponent():void 0,t);this.endMove()},O.prototype.tableRowDrop=function(t,e){var o=!1,i=!1;switch(t.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?i=o.call(this,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:e,success:i})},O.prototype.receivers={insert:function(t,e,o){return this.table.addRow(t.getData(),void 0,e),!0},add:function(t,e,o){return this.table.addRow(t.getData()),!0},update:function(t,e,o){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,o){return!!e&&(this.table.addRow(t.getData(),void 0,e),e.delete(),!0)}},O.prototype.senders={delete:function(t,e,o){t.delete()}},O.prototype.commsReceived=function(t,e,o){switch(e){case"connect":return this.connect(t,o.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,o.row,o.success)}},h.prototype.registerModule("moveRow",O);var I=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};I.prototype.initializeColumn=function(t){var e=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,a="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[a]&&(s=e.lookupMutator(t.definition[a]))&&(o=!0,i[a]={mutator:s,params:t.definition[a+"Params"]||{}})}),o&&(t.modules.mutate=i)},I.prototype.lookupMutator=function(t){var e=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?e=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e},I.prototype.transformRow=function(t,e,o){var i,n=this,s="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return this.enabled&&n.table.columnManager.traverse(function(n){var a,r,l;n.modules.mutate&&(a=n.modules.mutate[s]||n.modules.mutate.mutator||!1)&&(i=n.getFieldValue(void 0!==o?o:t),"data"!=e&&void 0===i||(l=n.getComponent(),r="function"==typeof a.params?a.params(i,t,e,l):a.params,n.setFieldValue(t,a.mutator(i,t,e,r,l))))}),t},I.prototype.transformCell=function(t,e){var o=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,t.row.getData()),t.column.setFieldValue(i,e),o.mutator(e,i,"edit",o.params,t.getComponent())):e},I.prototype.enable=function(){this.enabled=!0},I.prototype.disable=function(){this.enabled=!1},I.prototype.mutators={},h.prototype.registerModule("mutator",I);var V=function(t){this.table=t,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};V.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),t=document.createElement("button"),t.classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},V.prototype.generatePageSizeSelectList=function(){var t=this,e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(var o=1;o<5;o++)e.push(this.size*o);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach(function(e){var o=document.createElement("option");o.value=e,!0===e?t.table.modules.localize.bind("pagination|all",function(t){o.innerHTML=t}):o.innerHTML=e,t.pageSizeSelect.appendChild(o)}),this.pageSizeSelect.value=this.size}},V.prototype.initialize=function(t){var e,o,i,n=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),n.table.modules.localize.bind("pagination|first",function(t){n.firstBut.innerHTML=t}),n.table.modules.localize.bind("pagination|first_title",function(t){n.firstBut.setAttribute("aria-label",t),n.firstBut.setAttribute("title",t)}),n.table.modules.localize.bind("pagination|prev",function(t){n.prevBut.innerHTML=t}),n.table.modules.localize.bind("pagination|prev_title",function(t){n.prevBut.setAttribute("aria-label",t),n.prevBut.setAttribute("title",t)}),n.table.modules.localize.bind("pagination|next",function(t){n.nextBut.innerHTML=t}),n.table.modules.localize.bind("pagination|next_title",function(t){n.nextBut.setAttribute("aria-label",t),n.nextBut.setAttribute("title",t)}),n.table.modules.localize.bind("pagination|last",function(t){n.lastBut.innerHTML=t}),n.table.modules.localize.bind("pagination|last_title",function(t){n.lastBut.setAttribute("aria-label",t),n.lastBut.setAttribute("title",t)}),n.firstBut.addEventListener("click",function(){n.setPage(1).then(function(){}).catch(function(){})}),n.prevBut.addEventListener("click",function(){n.previousPage().then(function(){}).catch(function(){})}),n.nextBut.addEventListener("click",function(){n.nextPage().then(function(){}).catch(function(){})}),n.lastBut.addEventListener("click",function(){n.setPage(n.max).then(function(){}).catch(function(){})}),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(e=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",function(t){n.pageSizeSelect.setAttribute("aria-label",t),n.pageSizeSelect.setAttribute("title",t),e.innerHTML=t}),n.element.appendChild(e),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",function(t){n.setPageSize("true"==n.pageSizeSelect.value||n.pageSizeSelect.value),n.setPage(1).then(function(){}).catch(function(){})})),n.element.appendChild(n.firstBut),n.element.appendChild(n.prevBut),n.element.appendChild(n.pagesElement),n.element.appendChild(n.nextBut),n.element.appendChild(n.lastBut),n.table.options.paginationElement||t||n.table.footerManager.append(n.element,n),n.mode=n.table.options.pagination,n.table.options.paginationSize?n.size=n.table.options.paginationSize:(o=document.createElement("div"),o.classList.add("tabulator-row"),o.style.visibility=t,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",o.appendChild(i),n.table.rowManager.getTableElement().appendChild(o),n.size=Math.floor(n.table.rowManager.getElement().clientHeight/o.offsetHeight),n.table.rowManager.getTableElement().removeChild(o)),n.count=n.table.options.paginationButtonCount,n.generatePageSizeSelectList()},V.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0},V.prototype.setDisplayIndex=function(t){this.displayIndex=t},V.prototype.getDisplayIndex=function(){return this.displayIndex},V.prototype.setMaxRows=function(t){this.max=t?!0===this.size?1:Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)},V.prototype.reset=function(t,e){return("local"==this.mode||t)&&(this.page=1),e&&(this.initialLoad=!0),!0},V.prototype.setMaxPage=function(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())},V.prototype.setPage=function(t){var e=this,o=this;switch(t){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return new Promise(function(i,n){t=parseInt(t),t>0&&t<=e.max||"local"!==e.mode?(e.page=t,e.trigger().then(function(){i()}).catch(function(){n()}),o.table.options.persistence&&o.table.modExists("persistence",!0)&&o.table.modules.persistence.config.page&&o.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+e.max+":",t),n())})},V.prototype.setPageToRow=function(t){var e=this;return new Promise(function(o,i){var n=e.table.rowManager.getDisplayRows(e.displayIndex-1),s=n.indexOf(t);if(s>-1){var a=!0===e.size?1:Math.ceil((s+1)/e.size);e.setPage(a).then(function(){o()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},V.prototype.setPageSize=function(t){!0!==t&&(t=parseInt(t)),t>0&&(this.size=t),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},V.prototype._setPageButtons=function(){for(var t=this,e=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&s<=t.max&&t.pagesElement.appendChild(t._generatePageButton(s));this.footerRedraw()},V.prototype._generatePageButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("tabulator-page"),t==e.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),e.table.modules.localize.bind("pagination|page_title",function(e){o.setAttribute("aria-label",e+" "+t),o.setAttribute("title",e+" "+t)}),o.setAttribute("data-page",t),o.textContent=t,o.addEventListener("click",function(o){e.setPage(t).then(function(){}).catch(function(){})}),o},V.prototype.previousPage=function(){var t=this;return new Promise(function(e,o){t.page>1?(t.page--,t.trigger().then(function(){e()}).catch(function(){o()}),t.table.options.persistence&&t.table.modExists("persistence",!0)&&t.table.modules.persistence.config.page&&t.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())})},V.prototype.nextPage=function(){var t=this;return new Promise(function(e,o){t.pagen?i.splice(n,0,t):i.push(t))}),i},j.prototype._findColumn=function(t,e){var o=e.columns?"group":e.field?"field":"object";return t.find(function(t){switch(o){case"group":return t.title===e.title&&t.columns.length===e.columns.length;case"field":return t.field===e.field;case"object":return t===e}})},j.prototype.save=function(t){var e={};switch(t){case"columns":e=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":e=this.table.modules.filter.getFilters();break;case"sort":e=this.validateSorters(this.table.modules.sort.getSort());break;case"group":e=this.getGroupConfig();break;case"page":e=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,t,e)},j.prototype.validateSorters=function(t){return t.forEach(function(t){t.column=t.field,delete t.field}),t},j.prototype.getGroupConfig=function(){var t={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(t.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(t.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(t.groupHeader=this.table.options.groupHeader)),t},j.prototype.getPageConfig=function(){var t={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(t.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(t.paginationInitialPage=this.table.modules.page.getPage())),t},j.prototype.parseColumns=function(t){var e=this,o=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return t.forEach(function(t){var n,s={},a=t.getDefinition();t.isGroup?(s.title=a.title,s.columns=e.parseColumns(t.getColumns())):(s.field=t.getField(),!0===e.config.columns||void 0==e.config.columns?(n=Object.keys(a),n.push("width")):n=e.config.columns,n.forEach(function(e){switch(e){case"width":s.width=t.getWidth();break;case"visible":s.visible=t.visible;break;default:"function"!=typeof a[e]&&-1===i.indexOf(e)&&(s[e]=a[e])}})),o.push(s)}),o},j.prototype.readers={local:function(t,e){var o=localStorage.getItem(t+"-"+e);return!!o&&JSON.parse(o)},cookie:function(t,e){var o,i,n=document.cookie,s=t+"-"+e,a=n.indexOf(s+"=");return a>-1&&(n=n.substr(a),o=n.indexOf(";"),o>-1&&(n=n.substr(0,o)),i=n.replace(s+"=","")),!!i&&JSON.parse(i)}},j.prototype.writers={local:function(t,e,o){localStorage.setItem(t+"-"+e,JSON.stringify(o))},cookie:function(t,e,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=t+"-"+e+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},h.prototype.registerModule("persistence",j);var W=function(t){this.table=t,this.element=!1,this.manualBlock=!1};W.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},W.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))},W.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")},W.prototype.printFullscreen=function(t,e,o){var i,n,s=window.scrollX,a=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),c=this.table.modules.export.genereateTable(void 0!==o?o:this.table.options.printConfig,void 0!==e?e:this.table.options.printStyled,t||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),i="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof i?r.innerHTML=i:r.appendChild(i),this.element.appendChild(r)),this.element.appendChild(c),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof n?l.innerHTML=n:l.appendChild(n),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,c),window.print(),this.cleanup(),window.scrollTo(s,a),this.manualBlock=!1},h.prototype.registerModule("print",W);var G=function(t){this.table=t,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};G.prototype.watchData=function(t){var e,o=this;this.currentVersion++,e=this.currentVersion,o.unwatchData(),o.data=t,o.origFuncs.push=t.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||e!==o.currentVersion||i.forEach(function(t){o.table.rowManager.addRowActual(t,!1)}),o.origFuncs.push.apply(t,arguments)}}),o.origFuncs.unshift=t.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||e!==o.currentVersion||i.forEach(function(t){o.table.rowManager.addRowActual(t,!0)}),o.origFuncs.unshift.apply(t,arguments)}}),o.origFuncs.shift=t.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||e!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]))&&i.deleteActual(),o.origFuncs.shift.call(t)}}),o.origFuncs.pop=t.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||e!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]))&&i.deleteActual(),o.origFuncs.pop.call(t)}}),o.origFuncs.splice=t.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?t.length+n[0]:n[0],a=n[1],r=!!n[2]&&n.slice(2);if(!o.blocked&&e===o.currentVersion){if(r&&(i=!!t[s]&&o.table.rowManager.getRowFromDataObject(t[s]),i?r.forEach(function(t){o.table.rowManager.addRowActual(t,!0,i,!0)}):(r=r.slice().reverse(),r.forEach(function(t){o.table.rowManager.addRowActual(t,!0,!1,!0)}))),0!==a){var l=t.slice(s,void 0===n[1]?n[1]:s+a);l.forEach(function(t,e){var i=o.table.rowManager.getRowFromDataObject(t);i&&i.deleteActual(e!==l.length-1)})}(r||0!==a)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(t,arguments)}})},G.prototype.unwatchData=function(){if(!1!==this.data)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},G.prototype.watchRow=function(t){var e=t.getData();this.blocked=!0;for(var o in e)this.watchKey(t,e,o);this.table.options.dataTree&&this.watchTreeChildren(t),this.blocked=!1},G.prototype.watchTreeChildren=function(t){function e(){o.table.modules.dataTree.initializeRow(t),o.table.modules.dataTree.layoutRow(t),o.table.rowManager.refreshActiveData("tree",!1,!0)}var o=this,i=t.getData()[this.table.options.dataTreeChildField],n={};i&&(n.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:function(){var t=n.push.apply(i,arguments);return e(),t}}),n.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:function(){var t=n.unshift.apply(i,arguments);return e(),t}}),n.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:function(){var t=n.shift.call(i);return e(),t}}),n.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:function(){var t=n.pop.call(i);return e(),t}}),n.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:function(){var t=n.splice.apply(i,arguments);return e(),t}}))},G.prototype.watchKey=function(t,e,o){var i=this,n=Object.getOwnPropertyDescriptor(e,o),s=e[o],a=this.currentVersion;Object.defineProperty(e,o,{set:function(e){if(s=e,!i.blocked&&a===i.currentVersion){var r={};r[o]=e,t.updateData(r)}n.set&&n.set(e)},get:function(){return n.get&&n.get(),s}})},G.prototype.unwatchRow=function(t){var e=t.getData();for(var o in e)Object.defineProperty(e,o,{value:e[o]})},G.prototype.block=function(){this.blocked=!0},G.prototype.unblock=function(){this.blocked=!1},h.prototype.registerModule("reactiveData",G);var U=function(t){this.table=t,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};U.prototype.initializeColumn=function(t,e,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===t&&(n="textarea"==e.definition.formatter||e.definition.variableHeight,e.modules.resize={variableHeight:n}),!0===s||s==t){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var r=document.createElement("div");r.className="tabulator-col-resize-handle prev",a.addEventListener("click",function(t){t.stopPropagation()});var l=function(t){var o=e.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=e,i._mouseDown(t,o,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l,{passive:!0}),a.addEventListener("dblclick",function(t){var o=e.getLastColumn();o&&i._checkResizability(o)&&(t.stopPropagation(),o.reinitializeWidth(!0))}),r.addEventListener("click",function(t){t.stopPropagation()});var c=function(t){var o,n,s;(o=e.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=e,i._mouseDown(t,s,r)))};r.addEventListener("mousedown",c),r.addEventListener("touchstart",c,{passive:!0}),r.addEventListener("dblclick",function(t){var o,n,s;(o=e.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(t.stopPropagation(),s.reinitializeWidth(!0)))}),o.appendChild(a),o.appendChild(r)}},U.prototype._checkResizability=function(t){return void 0!==t.definition.resizable?t.definition.resizable:this.table.options.resizableColumns},U.prototype._mouseDown=function(t,e,o){function i(t){s.table.rtl?e.setWidth(s.startWidth-((void 0===t.screenX?t.touches[0].screenX:t.screenX)-s.startX)):e.setWidth(s.startWidth+((void 0===t.screenX?t.touches[0].screenX:t.screenX)-s.startX)),s.table.options.virtualDomHoz&&s.table.vdomHoz.reinitialize(!0),!s.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights()}function n(t){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,e.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===t.screenX?t.touches[0].screenX:t.screenX,s.startWidth=e.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},h.prototype.registerModule("resizeColumns",U);var X=function(t){this.table=t,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};X.prototype.initializeRow=function(t){var e=this,o=t.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",i.addEventListener("click",function(t){t.stopPropagation()});var s=function(o){e.startRow=t,e._mouseDown(o,t,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",function(t){t.stopPropagation()});var a=function(o){var i=e.table.rowManager.prevDisplayRow(t);i&&(e.startRow=i,e._mouseDown(o,i,n))};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.appendChild(i),o.appendChild(n)},X.prototype._mouseDown=function(t,e,o){function i(t){e.setHeight(s.startHeight+((void 0===t.screenY?t.touches[0].screenY:t.screenY)-s.startY))}function n(t){document.body.removeEventListener("mouseup",i),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,e.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),s.startY=void 0===t.screenY?t.touches[0].screenY:t.screenY,s.startHeight=e.getHeight(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},h.prototype.registerModule("resizeRows",X);var q=function(t){this.table=t,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};q.prototype.initialize=function(t){var e,o=this,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver(function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var e=Math.floor(t[0].contentRect.height),n=Math.floor(t[0].contentRect.width);o.tableHeight==e&&o.tableWidth==n||(o.tableHeight=e,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.options.virtualDomHoz&&i.vdomHoz.reinitialize(!0),i.redraw())}}),this.observer.observe(i.element),e=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var e=Math.floor(t[0].contentRect.height),n=Math.floor(t[0].contentRect.width);o.containerHeight==e&&o.containerWidth==n||(o.containerHeight=e,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth),i.options.virtualDomHoz&&i.vdomHoz.reinitialize(!0),i.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&(i.options.virtualDomHoz&&i.vdomHoz.reinitialize(!0),i.redraw())},window.addEventListener("resize",this.binding))},q.prototype.clearBindings=function(t){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},h.prototype.registerModule("resizeTable",q);var Y=function(t){this.table=t,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};Y.prototype.initialize=function(){var t=this,e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,e.push(o),o.visible||"collapse"!==t.mode||t.hiddenColumns.push(o))}),e=e.reverse(),e=e.sort(function(t,e){return e.modules.responsive.order-t.modules.responsive.order||e.modules.responsive.index-t.modules.responsive.index}),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(var o=this.table.columnManager.columnsByIndex,i=Array.isArray(o),n=0,o=i?o:o[Symbol.iterator]();;){var s;if(i){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var a=s;if("responsiveCollapse"==a.definition.formatter){this.collapseHandleColumn=a;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},Y.prototype.initializeColumn=function(t){var e=t.getDefinition();t.modules.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}},Y.prototype.initializeRow=function(t){var e;"calc"!==t.type&&(e=document.createElement("div"),e.classList.add("tabulator-responsive-collapse"),t.modules.responsiveLayout={element:e,open:this.collapseStartOpen},this.collapseStartOpen||(e.style.display="none"))},Y.prototype.layoutRow=function(t){var e=t.getElement();t.modules.responsiveLayout&&(e.appendChild(t.modules.responsiveLayout.element),this.generateCollapsedRowContent(t))},Y.prototype.updateColumnVisibility=function(t,e){t.modules.responsive&&(t.modules.responsive.visible=e,this.initialize())},Y.prototype.hideColumn=function(t){var e=this.hiddenColumns.length;t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent(),this.collapseHandleColumn&&!e&&this.collapseHandleColumn.show())},Y.prototype.showColumn=function(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&(e=this.hiddenColumns.indexOf(t),e>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},Y.prototype.update=function(){for(var t=this,e=!0;e;){var o="fitColumns"==t.table.modules.layout.getMode()?t.table.columnManager.getFlexBaseWidth():t.table.columnManager.getWidth(),i=(t.table.options.headerVisible?t.table.columnManager.element.clientWidth:t.table.element.clientWidth)-o;if(i<0){var n=t.columns[t.index];n?(t.hideColumn(n),t.index++):e=!1}else{var s=t.columns[t.index-1];s&&i>0&&i>=s.getWidth()?(t.showColumn(s),t.index--):e=!1}t.table.rowManager.activeRowsCount||t.table.rowManager.renderEmptyScroll()}},Y.prototype.generateCollapsedContent=function(){var t=this;this.table.rowManager.getDisplayRows().forEach(function(e){t.generateCollapsedRowContent(e)})},Y.prototype.generateCollapsedRowContent=function(t){var e,o;if(t.modules.responsiveLayout){for(e=t.modules.responsiveLayout.element;e.firstChild;)e.removeChild(e.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(t)),o&&e.appendChild(o)}},Y.prototype.generateCollapsedRowData=function(t){var e,o=this,i=t.getData(),n=[];return this.hiddenColumns.forEach(function(s){var a=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(e={value:!1,data:{},getValue:function(){return a},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return s.getComponent()}},n.push({field:s.field,title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,e,s.modules.format.params)})):n.push({field:s.field,title:s.definition.title,value:a}))}),n},Y.prototype.formatCollapsedData=function(t){var e=document.createElement("table");return t.forEach(function(t){var o,i=document.createElement("tr"),n=document.createElement("td"),s=document.createElement("td"),a=document.createElement("strong");n.appendChild(a),this.table.modules.localize.bind("columns|"+t.field,function(e){a.innerText=e||t.title}),t.value instanceof Node?(o=document.createElement("div"),o.appendChild(t.value),s.appendChild(o)):s.innerHTML=t.value,i.appendChild(n),i.appendChild(s),e.appendChild(i)},this),Object.keys(t).length?e:""},h.prototype.registerModule("responsiveLayout",Y);var K=function(t){this.table=t,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};K.prototype.clearSelectionData=function(t){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t||this._rowSelectionChanged()},K.prototype.initializeRow=function(t){var e=this,o=t.getElement(),i=function t(){setTimeout(function(){e.selecting=!1},50),document.body.removeEventListener("mouseup",t)};t.modules.select={selected:!1},e.table.options.selectableCheck.call(this.table,t.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),e.table.options.selectable&&"highlight"!=e.table.options.selectable&&("click"===e.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){e.table._clearSelection(),e.lastClickedRow=e.lastClickedRow||t;var i=e.table.rowManager.getDisplayRowIndex(e.lastClickedRow),n=e.table.rowManager.getDisplayRowIndex(t),s=i<=n?i:n,a=i>=n?i:n,r=e.table.rowManager.getDisplayRows().slice(0),l=r.splice(s,a-s+1);o.ctrlKey||o.metaKey?(l.forEach(function(o){o!==e.lastClickedRow&&(!0===e.table.options.selectable||e.isRowSelected(t)?e.toggleRow(o):e.selectedRows.lengthe.table.options.selectable&&(l=l.slice(0,e.table.options.selectable)),e.selectRows(l)),e.table._clearSelection()}else o.ctrlKey||o.metaKey?(e.toggleRow(t),e.lastClickedRow=t):(e.deselectRows(void 0,!0),e.selectRows(t),e.lastClickedRow=t)}):(o.addEventListener("click",function(o){e.table.modExists("edit")&&e.table.modules.edit.getCurrentCell()||e.table._clearSelection(),e.selecting||e.toggleRow(t)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return e.table._clearSelection(),e.selecting=!0,e.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),e.toggleRow(t),!1}),o.addEventListener("mouseenter",function(o){e.selecting&&(e.table._clearSelection(),e.toggleRow(t),e.selectPrev[1]==t&&e.toggleRow(e.selectPrev[0]))}),o.addEventListener("mouseout",function(o){e.selecting&&(e.table._clearSelection(),e.selectPrev.unshift(t))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},K.prototype.toggleRow=function(t){this.table.options.selectableCheck.call(this.table,t.getComponent())&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))},K.prototype.selectRows=function(t){var e,o=this;switch(void 0===t?"undefined":_typeof(t)){case"undefined":this.table.rowManager.rows.forEach(function(t){o._selectRow(t,!0,!0)}),this._rowSelectionChanged();break;case"string":e=this.table.rowManager.findRow(t),e?this._selectRow(e,!0,!0):this.table.rowManager.getRows(t).forEach(function(t){o._selectRow(t,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(t)?(t.forEach(function(t){o._selectRow(t,!0,!0)}),this._rowSelectionChanged()):this._selectRow(t,!1,!0)}},K.prototype._selectRow=function(t,e,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(t);i?-1==this.selectedRows.indexOf(i)&&(i.getElement().classList.add("tabulator-selected"),i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),e||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(e)):e||console.warn("Selection Error - No such row found, ignoring selection:"+t)},K.prototype.isRowSelected=function(t){return-1!==this.selectedRows.indexOf(t)},K.prototype.deselectRows=function(t,e){var o,i=this;if(void 0===t){o=i.selectedRows.length;for(var n=0;n-1&&(n.getElement().classList.remove("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),e||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(e)):e||console.warn("Deselection Error - No such row found, ignoring selection:"+t)},K.prototype.getSelectedData=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getData())}),t},K.prototype.getSelectedRows=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getComponent())}),t},K.prototype._rowSelectionChanged=function(t){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),t||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},K.prototype.registerRowSelectCheckbox=function(t,e){t._row.modules.select||(t._row.modules.select={}),t._row.modules.select.checkboxEl=e},K.prototype.registerHeaderSelectCheckbox=function(t){this.headerCheckboxElement=t},K.prototype.childRowSelection=function(t,e){var o=this.table.modules.dataTree.getChildren(t,!0);if(e)for(var i=o,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var a;if(n){if(s>=i.length)break;a=i[s++]}else{if(s=i.next(),s.done)break;a=s.value}var r=a;this._selectRow(r,!0)}else for(var l=o,c=Array.isArray(l),u=0,l=c?l:l[Symbol.iterator]();;){var d;if(c){if(u>=l.length)break;d=l[u++]}else{if(u=l.next(),u.done)break;d=u.value}var h=d;this._deselectRow(h,!0)}},h.prototype.registerModule("selectRow",K);var J=function(t){this.table=t,this.sortList=[],this.changed=!1};J.prototype.initializeColumn=function(t,e){var o,i,n=this,s=!1;switch(_typeof(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?s=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":s=t.definition.sorter}t.modules.sort={sorter:s,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:void 0!==t.definition.headerSortTristate?t.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===t.definition.headerSort?!1!==this.table.options.headerSort:!1!==t.definition.headerSort)&&(o=t.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-col-sorter"),"object"==_typeof(this.table.options.headerSortElement)?i.appendChild(this.table.options.headerSortElement):i.innerHTML=this.table.options.headerSortElement,e.appendChild(i),t.modules.sort.element=i,o.addEventListener("click",function(e){var o="",i=[],s=!1;if(t.modules.sort){if(t.modules.sort.tristate)o="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(e){return e.field===t.getField()}),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:t,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(t,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},J.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},J.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},J.prototype.setSort=function(t,e){var o=this,i=[];Array.isArray(t)||(t=[{column:t,dir:e}]), +t.forEach(function(t){var e;e=o.table.columnManager.findColumn(t.column),e?(t.column=e,i.push(t),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),o.sortList=i,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},J.prototype.clear=function(){this.setSort([])},J.prototype.findSorter=function(t){var e,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),t.getField()))switch(e=t.getFieldValue(o),void 0===e?"undefined":_typeof(e)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},J.prototype.sort=function(t){var e=this,o=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,i=[],n=[];e.table.options.dataSorting&&e.table.options.dataSorting.call(e.table,e.getSort()),e.clearColumnHeaders(),e.table.options.ajaxSorting?o.forEach(function(t,o){e.setColumnHeader(t.column,t.dir)}):(o.forEach(function(t,o){var n=t.column.modules.sort;t.column&&n&&(n.sorter||(n.sorter=e.findSorter(t.column)),t.params="function"==typeof n.params?n.params(t.column.getComponent(),t.dir):n.params,i.push(t)),e.setColumnHeader(t.column,t.dir)}),i.length&&e._sortItems(t,i)),e.table.options.dataSorted&&(t.forEach(function(t){n.push(t.getComponent())}),e.table.options.dataSorted.call(e.table,e.getSort(),n))},J.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},J.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},J.prototype._sortItems=function(t,e){var o=this,i=e.length-1;t.sort(function(t,n){for(var s,a=i;a>=0;a--){var r=e[a];if(0!==(s=o._sortRow(t,n,r.column,r.dir,r.params)))break}return s})},J.prototype._sortRow=function(t,e,o,i,n){var s,a,r="asc"==i?t:e,l="asc"==i?e:t;return t=o.getFieldValue(r.getData()),e=o.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",s=r.getComponent(),a=l.getComponent(),o.modules.sort.sorter.call(this,t,e,s,a,o.getComponent(),i,n)},J.prototype.sorters={number:function(t,e,o,i,n,s,a){var r=a.alignEmptyValues,l=a.decimalSeparator,c=a.thousandSeparator,u=0;if(t=String(t),e=String(e),c&&(t=t.split(c).join(""),e=e.split(c).join("")),l&&(t=t.split(l).join("."),e=e.split(l).join(".")),t=parseFloat(t),e=parseFloat(e),isNaN(t))u=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;u=1}return("top"===r&&"desc"===s||"bottom"===r&&"asc"===s)&&(u*=-1),u},string:function(t,e,o,i,n,s,a){var r,l=a.alignEmptyValues,c=0;if(t){if(e){switch(_typeof(a.locale)){case"boolean":a.locale&&(r=this.table.modules.localize.getLocale());break;case"string":r=a.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),r)}c=1}else c=e?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(t,e,o,i,n,s,a){return a.format||(a.format="DD/MM/YYYY"),this.sorters.datetime.call(this,t,e,o,i,n,s,a)},time:function(t,e,o,i,n,s,a){return a.format||(a.format="HH:mm"),this.sorters.datetime.call(this,t,e,o,i,n,s,a)},datetime:function(t,e,o,i,n,s,a){var r=a.format||"DD/MM/YYYY HH:mm:ss",l=a.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(t=moment(t,r),e=moment(e,r),t.isValid()){if(e.isValid())return t-e;c=1}else c=e.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(t,e,o,i,n,s,a){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,o,i,n,s,a){function r(t){switch(u){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}var l=0,c=0,u=a.type||"length",d=a.alignEmptyValues,h=0;if(Array.isArray(t)){if(Array.isArray(e))return l=t?r(t):0,c=e?r(e):0,l-c;d=1}else d=Array.isArray(e)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(h*=-1),h},exists:function(t,e,o,i,n,s,a){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,o,i,n,s,a){var r,l,c,u,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=a.alignEmptyValues,g=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if(r=String(t).toLowerCase(),l=String(e).toLowerCase(),r===l)return 0;if(!m.test(r)||!m.test(l))return r>l?1:-1;for(r=r.match(p),l=l.match(p),d=r.length>l.length?l.length:r.length;hu?1:-1;return r.length>l.length}g=1}else g=e||0===e?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},h.prototype.registerModule("sort",J);var $=function(t){this.table=t,this.invalidCells=[]};return $.prototype.initializeColumn=function(t){var e,o=this,i=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(e=o._extractValidator(t))&&i.push(e)}):(e=this._extractValidator(t.definition.validator))&&i.push(e),t.modules.validate=!!i.length&&i)},$.prototype._extractValidator=function(t){var e,o,i;switch(void 0===t?"undefined":_typeof(t)){case"string":return i=t.indexOf(":"),i>-1?(e=t.substring(0,i),o=t.substring(i+1)):e=t,this._buildValidator(e,o);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},$.prototype._buildValidator=function(t,e){var o="function"==typeof t?t:this.validators[t];return o?{type:"function"==typeof t?"function":t,func:o,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},$.prototype.validate=function(t,e,o){var i=this,n=[],s=this.invalidCells.indexOf(e);return t&&t.forEach(function(t){t.func.call(i,e.getComponent(),o,t.params)||n.push({type:t.type,parameters:t.params})}),n=!n.length||n,e.modules.validate||(e.modules.validate={}),!0===n?(e.modules.validate.invalid=!1,e.getElement().classList.remove("tabulator-validation-fail"),s>-1&&this.invalidCells.splice(s,1)):(e.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&e.getElement().classList.add("tabulator-validation-fail"),-1==s&&this.invalidCells.push(e)),n},$.prototype.getInvalidCells=function(){var t=[];return this.invalidCells.forEach(function(e){t.push(e.getComponent())}),t},$.prototype.clearValidation=function(t){var e;t.modules.validate&&t.modules.validate.invalid&&(t.getElement().classList.remove("tabulator-validation-fail"),t.modules.validate.invalid=!1,(e=this.invalidCells.indexOf(t))>-1&&this.invalidCells.splice(e,1))},$.prototype.validators={integer:function(t,e,o){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&Math.floor(e)===e},float:function(t,e,o){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&e%1!=0},numeric:function(t,e,o){return""===e||null===e||void 0===e||!isNaN(e)},string:function(t,e,o){return""===e||null===e||void 0===e||isNaN(e)},max:function(t,e,o){return""===e||null===e||void 0===e||parseFloat(e)<=o},min:function(t,e,o){return""===e||null===e||void 0===e||parseFloat(e)>=o},starts:function(t,e,o){return""===e||null===e||void 0===e||String(e).toLowerCase().startsWith(String(o).toLowerCase())},ends:function(t,e,o){return""===e||null===e||void 0===e||String(e).toLowerCase().endsWith(String(o).toLowerCase())},minLength:function(t,e,o){return""===e||null===e||void 0===e||String(e).length>=o},maxLength:function(t,e,o){return""===e||null===e||void 0===e||String(e).length<=o},in:function(t,e,o){return""===e||null===e||void 0===e||("string"==typeof o&&(o=o.split("|")),""===e||o.indexOf(e)>-1)},regex:function(t,e,o){return""===e||null===e||void 0===e||new RegExp(o).test(e)},unique:function(t,e,o){if(""===e||null===e||void 0===e)return!0;var i=!0,n=t.getData(),s=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var o=t.getData();o!==n&&e==s.getFieldValue(o)&&(i=!1)}),i},required:function(t,e,o){return""!==e&&null!==e&&void 0!==e}},h.prototype.registerModule("validate",$),h}); \ No newline at end of file