From 9489e09d329a75966cd6882f1c588442838d07ef Mon Sep 17 00:00:00 2001 From: Oli Folkerd Date: Sun, 21 Jun 2020 14:26:59 +0100 Subject: [PATCH] regenerate dist files after merge --- dist/js/modules/edit.js | 28 +++- dist/js/modules/edit.min.js | 2 +- dist/js/modules/group_rows.js | 4 + dist/js/modules/group_rows.min.js | 2 +- dist/js/modules/menu.js | 33 ++++- dist/js/modules/menu.min.js | 2 +- dist/js/tabulator.js | 209 +++++++++++++++++++----------- dist/js/tabulator.min.js | 22 ++-- dist/js/tabulator_core.js | 10 ++ dist/js/tabulator_core.min.js | 6 +- 10 files changed, 214 insertions(+), 104 deletions(-) diff --git a/dist/js/modules/edit.js b/dist/js/modules/edit.js index ea11172be..320fa0dc9 100644 --- a/dist/js/modules/edit.js +++ b/dist/js/modules/edit.js @@ -783,7 +783,7 @@ Edit.prototype.editors = { input.addEventListener("keydown", function (e) { switch (e.keyCode) { case 13: - case 9: + // case 9: onChange(); break; @@ -861,8 +861,10 @@ Edit.prototype.editors = { function processComplexListItem(item) { var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label) : item.label, + label: item.label, value: item.value, + itemParams: item.itemParams, + elementAttributes: item.elementAttributes, element: false }; @@ -894,6 +896,8 @@ Edit.prototype.editors = { item = { label: value.label, group: true, + itemParams: value.itemParams, + elementAttributes: value.elementAttributes, element: false }; @@ -908,7 +912,7 @@ Edit.prototype.editors = { } else { item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value, + label: value, value: value, element: false }; @@ -928,7 +932,7 @@ Edit.prototype.editors = { } else { for (var key in inputValues) { var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], + label: inputValues[key], value: key, element: false }; @@ -956,17 +960,17 @@ Edit.prototype.editors = { while (listEl.firstChild) { listEl.removeChild(listEl.firstChild); }displayItems.forEach(function (item) { + var el = item.element; if (!el) { - + el = document.createElement("div"); + item.label = editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label, cell, el, item.itemParams) : item.label; if (item.group) { - el = document.createElement("div"); el.classList.add("tabulator-edit-select-list-group"); el.tabIndex = 0; el.innerHTML = item.label === "" ? " " : item.label; } else { - el = document.createElement("div"); el.classList.add("tabulator-edit-select-list-item"); el.tabIndex = 0; el.innerHTML = item.label === "" ? " " : item.label; @@ -992,6 +996,16 @@ Edit.prototype.editors = { } } + if (item.elementAttributes && _typeof(item.elementAttributes) == "object") { + for (var key in item.elementAttributes) { + if (key.charAt(0) == "+") { + key = key.slice(1); + el.setAttribute(key, input.getAttribute(key) + item.elementAttributes["+" + key]); + } else { + el.setAttribute(key, item.elementAttributes[key]); + } + } + } el.addEventListener("mousedown", function () { blurable = false; diff --git a/dist/js/modules/edit.min.js b/dist/js/modules/edit.min.js index 074419d0a..121c69dba 100644 --- a/dist/js/modules/edit.min.js +++ b/dist/js/modules/edit.min.js @@ -1,2 +1,2 @@ /* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),e?i.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTop;n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i)}},Edit.prototype.edit=function(e,t,i){function n(t){if(d.currentCell===e){var i=!0;return e.column.modules.validate&&d.table.modExists("validate")&&"manual"!=d.table.options.validationMode&&(i=d.table.modules.validate.validate(e.column.modules.validate,e,t)),!0===i||"highlight"===d.table.options.validationMode?(d.clearEditor(),e.setValue(t,!0),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==d.editedCells.indexOf(e)&&d.editedCells.push(e),d.table.options.dataTree&&d.table.modExists("dataTree")&&d.table.modules.dataTree.checkForRestyle(e),!0===i||(m.classList.add("tabulator-validation-fail"),!1)):(d.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),d.focusCellNoEvent(e,!0),c(),d.table.options.validationFailed.call(d.table,e.getComponent(),t,i),!1)}}function o(){d.currentCell===e&&(d.cancelEdit(),d.table.options.dataTree&&d.table.modExists("dataTree")&&d.table.modules.dataTree.checkForRestyle(e))}function a(e){c=e}var r,l,s,d=this,u=!0,c=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":u=e.column.modules.edit.check(e.getComponent());break;case"boolean":u=e.column.modules.edit.check}if(u||i){if(d.cancelEdit(),d.currentCell=e,this.focusScrollAdjust(e),l=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,l)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,l),d.table.options.cellEditing.call(this.table,l),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(l):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(d,l,a,n,o,s)))return m.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");m.firstChild;)m.removeChild(m.firstChild);m.appendChild(r),c();for(var f=m.children,p=0;p46){if(i>=n.length)return t.preventDefault(),t.stopPropagation(),l=!1,!1;switch(n[i]){case o:if(s.toUpperCase()==s.toLowerCase())return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case a:if(isNaN(s))return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case r:break;default:if(s!==n[i])return t.preventDefault(),t.stopPropagation(),l=!1,!1}l=!0}}),e.addEventListener("keyup",function(n){n.keyCode>46&&t.maskAutoFill&&i(e.value.length)}),e.placeholder||(e.placeholder=n),t.maskAutoFill&&i(e.value.length)},Edit.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach(function(t){e.push(t.getComponent())}),e},Edit.prototype.clearEdited=function(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1))},Edit.prototype.editors={input:function(e,t,i,n,o){function a(e){(null===r||void 0===r)&&""!==l.value||l.value!==r?i(l.value)&&(r=l.value):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type",o.search?"search":"text"),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var s in o.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+o.elementAttributes["+"+s])):l.setAttribute(s,o.elementAttributes[s]);return l.value=void 0!==r?r:"",t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("change",a),l.addEventListener("blur",a),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a(e);break;case 27:n()}}),o.mask&&this.table.modules.edit.maskInput(l,o),l},textarea:function(e,t,i,n,o){function a(t){(null===r||void 0===r)&&""!==d.value||d.value!==r?(i(d.value)&&(r=d.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}var r=e.getValue(),l=o.verticalNavigation||"hybrid",s=String(null!==r&&void 0!==r?r:""),d=(s.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),u=0;if(d.style.display="block",d.style.padding="2px",d.style.height="100%",d.style.width="100%",d.style.boxSizing="border-box",d.style.whiteSpace="pre-wrap",d.style.resize="none",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var c in o.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+o.elementAttributes["+"+c])):d.setAttribute(c,o.elementAttributes[c]);return d.value=s,t(function(){d.focus({preventScroll:!0}),d.style.height="100%"}),d.addEventListener("change",a),d.addEventListener("blur",a),d.addEventListener("keyup",function(){d.style.height="";var t=d.scrollHeight;d.style.height=t+"px",t!=u&&(u=t,e.getRow().normalizeHeight())}),d.addEventListener("keydown",function(e){switch(e.keyCode){case 27:n();break;case 38:("editor"==l||"hybrid"==l&&d.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==l||"hybrid"==l&&d.selectionStart!==d.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),o.mask&&this.table.modules.edit.maskInput(d,o),d},number:function(e,t,i,n,o){function a(){var e=s.value;isNaN(e)||""===e||(e=Number(e)),e!==r?i(e)&&(r=e):n()}var r=e.getValue(),l=o.verticalNavigation||"editor",s=document.createElement("input");if(s.setAttribute("type","number"),void 0!==o.max&&s.setAttribute("max",o.max),void 0!==o.min&&s.setAttribute("min",o.min),void 0!==o.step&&s.setAttribute("step",o.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var d in o.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),s.setAttribute(d,s.getAttribute(d)+o.elementAttributes["+"+d])):s.setAttribute(d,o.elementAttributes[d]);s.value=r;var u=function(e){a()};return t(function(){s.removeEventListener("blur",u),s.focus({preventScroll:!0}),s.style.height="100%",s.addEventListener("blur",u)}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a();break;case 27:n();break;case 38:case 40:"editor"==l&&(e.stopImmediatePropagation(),e.stopPropagation())}}),o.mask&&this.table.modules.edit.maskInput(s,o),s},range:function(e,t,i,n,o){function a(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!=r?i(e)&&(r=e):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type","range"),void 0!==o.max&&l.setAttribute("max",o.max),void 0!==o.min&&l.setAttribute("min",o.min),void 0!==o.step&&l.setAttribute("step",o.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var s in o.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+o.elementAttributes["+"+s])):l.setAttribute(s,o.elementAttributes[s]);return l.value=r,t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("blur",function(e){a()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:a();break;case 27:n()}}),l},select:function(e,t,i,n,o){function a(t){var i,n={},a=y.table.getData();return i=t?y.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),i?(a.forEach(function(e){var t=i.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(n[t]=!0)}),n=o.sortValuesList?"asc"==o.sortValuesList?Object.keys(n).sort():Object.keys(n).sort().reverse():Object.keys(n)):console.warn("unable to find matching column to create select lookup list:",t),n}function r(t,i){function n(e){var e={label:o.listItemFormatter?o.listItemFormatter(e.value,e.label):e.label,value:e.value,element:!1};return i.indexOf(e.value)>-1&&d(e),a.push(e),r.push(e),e}var a=[],r=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,element:!1},r.push(t),e.options.forEach(function(e){n(e)})):n(e):(t={label:o.listItemFormatter?o.listItemFormatter(e,e):e,value:e,element:!1},i.indexOf(t.value)>-1&&d(t),a.push(t),r.push(t))});else for(var s in t){var u={label:o.listItemFormatter?o.listItemFormatter(s,t[s]):t[s],value:s,element:!1};i.indexOf(u.value)>-1&&d(u),a.push(u),r.push(u)}P=a,I=r,l()}function l(){for(;w.firstChild;)w.removeChild(w.firstChild);I.forEach(function(e){var t=e.element;t||(e.group?(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-group"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label):(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-item"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label,t.addEventListener("click",function(){x?(c(e),L.focus()):m(e)}),T.indexOf(e)>-1&&(console.log("current",N),t.classList.add("active"))),t.addEventListener("mousedown",function(){S=!1,setTimeout(function(){S=!0},10)}),e.element=t),w.appendChild(t)})}function s(e,t){!x&&N&&N.element&&N.element.classList.remove("active"),N&&N.element&&N.element.classList.remove("focused"),N=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function d(e){-1==T.indexOf(e)&&(T.push(e),s(e,!0)),p()}function u(e){var t=T[e];e>-1&&(T.splice(e,1),t.element&&t.element.classList.remove("active"))}function c(e){e||(e=N);var t=T.indexOf(e);t>-1?u(t):(!0!==x&&T.length>=x&&u(0),d(e)),p()}function m(e){h(),e||(e=N),e&&i(e.value)}function f(){h();var e=[];T.forEach(function(t){e.push(t.value)}),i(e)}function p(){var e=[];T.forEach(function(t){e.push(t.label)}),L.value=e.join(", ")}function v(){h(),n()}function b(){if(!w.parentNode){!0===o.values?r(a(),C):"string"==typeof o.values?r(a(o.values),C):r(o.values||[],C);var e=Tabulator.prototype.helpers.elOffset(E);w.style.minWidth=E.offsetWidth+"px",w.style.top=e.top+E.offsetHeight+"px",w.style.left=e.left+"px",w.addEventListener("mousedown",function(e){S=!1,setTimeout(function(){S=!0},10)}),document.body.appendChild(w)}}function h(){w.parentNode&&w.parentNode.removeChild(w),g()}function g(){y.table.rowManager.element.removeEventListener("scroll",v)}var y=this,E=e.getElement(),k=e.getValue(),A=o.verticalNavigation||"editor",C=void 0!==k||null===k?k:void 0!==o.defaultValue?o.defaultValue:[],L=document.createElement("input"),w=document.createElement("div"),x=o.multiselect,P=[],N={},I=[],T=[],S=!0;if(this.table.rowManager.element.addEventListener("scroll",v),(Array.isArray(o)||!Array.isArray(o)&&"object"===(void 0===o?"undefined":_typeof(o))&&!o.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),o={values:o}),L.setAttribute("type","text"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",L.style.cursor="default",L.readOnly=0!=this.currentCell,o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var O in o.elementAttributes)"+"==O.charAt(0)?(O=O.slice(1),L.setAttribute(O,L.getAttribute(O)+o.elementAttributes["+"+O])):L.setAttribute(O,o.elementAttributes[O]);return L.value=void 0!==k||null===k?k:"",L.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=P.indexOf(N),("editor"==A||"hybrid"==A&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&s(P[t-1],!x));break;case 40:t=P.indexOf(N),("editor"==A||"hybrid"==A&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&a.push(t)}),c(a,t))}function s(e){var t=document.createElement("div");u(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,w.appendChild(t))}function d(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var i={};"object"===(void 0===e?"undefined":_typeof(e))?(i.title=o.listItemFormatter?o.listItemFormatter(e.value,e.label):e.label,i.value=e.value):(i.title=o.listItemFormatter?o.listItemFormatter(e,e):e,i.value=e),t.push(i)});else for(var i in e){var n={title:o.listItemFormatter?o.listItemFormatter(i,e[i]):e[i],value:i};t.push(n)}return t}function u(){for(;w.firstChild;)w.removeChild(w.firstChild)}function c(e,t){e.length?m(e,t):o.emptyPlaceholder&&s(o.emptyPlaceholder)}function m(e,t){var i=!1;u(),x=e,x.forEach(function(e){var n=e.element;n||(n=document.createElement("div"),n.classList.add("tabulator-edit-select-list-item"),n.tabIndex=0,n.innerHTML=e.title,n.addEventListener("click",function(t){v(e),f()}),n.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),e.element=n,t&&e.value==k&&(L.value=e.title,e.element.classList.add("active"),i=!0),e===P&&(e.element.classList.add("active"),i=!0)),w.appendChild(n)}),i||v(!1)}function f(){b(),P?k!==P.value?(k=P.value,L.value=P.title,i(P.value)):n():o.freetext?(k=L.value,i(L.value)):o.allowEmpty&&""===L.value?(k=L.value,i(L.value)):n()}function p(){if(!w.parentNode){for(;w.firstChild;)w.removeChild(w.firstChild);var e=Tabulator.prototype.helpers.elOffset(E);w.style.minWidth=E.offsetWidth+"px",w.style.top=e.top+E.offsetHeight+"px",w.style.left=e.left+"px",document.body.appendChild(w)}}function v(e,t){P&&P.element&&P.element.classList.remove("active"),P=e,e&&e.element&&e.element.classList.add("active")}function b(){w.parentNode&&w.parentNode.removeChild(w),g()}function h(){b(),n()}function g(){y.table.rowManager.element.removeEventListener("scroll",h)}var y=this,E=e.getElement(),k=e.getValue(),A=o.verticalNavigation||"editor",C=void 0!==k||null===k?k:void 0!==o.defaultValue?o.defaultValue:"",L=document.createElement("input"),w=document.createElement("div"),x=[],P=!1,N=!0,I=!1;if(this.table.rowManager.element.addEventListener("scroll",h),L.setAttribute("type","search"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var T in o.elementAttributes)"+"==T.charAt(0)?(T=T.slice(1),L.setAttribute(T,L.getAttribute(T)+o.elementAttributes["+"+T])):L.setAttribute(T,o.elementAttributes[T]);return w.classList.add("tabulator-edit-select-list"),w.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),L.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=x.indexOf(P),("editor"==A||"hybrid"==A&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),v(t>0?x[t-1]:!1));break;case 40:t=x.indexOf(P),("editor"==A||"hybrid"==A&&t'):("ie"==l.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){d=e,a(e)}var l=this,s=e.getElement(),d=e.getValue(),u=s.getElementsByTagName("svg").length||5,c=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",p.setAttribute("width",c),p.setAttribute("height",c),p.setAttribute("viewBox","0 0 512 512"),p.setAttribute("xml:space","preserve"),p.style.padding="0 1px",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var v in o.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),f.setAttribute(v,f.getAttribute(v)+o.elementAttributes["+"+v])):f.setAttribute(v,o.elementAttributes[v]);for(var b=1;b<=u;b++)!function(e){var t=document.createElement("span"),n=p.cloneNode(!0);m.push(n),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),a(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e)}),t.appendChild(n),f.appendChild(t)}(b);return d=Math.min(parseInt(d),u),a(d),f.addEventListener("mousemove",function(e){a(0)}),f.addEventListener("click",function(e){i(0)}),s.addEventListener("blur",function(e){n()}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(d+1);break;case 37:r(d-1);break;case 13:i(d);break;case 27:n()}}),f},progress:function(e,t,i,n,o){function a(){var e=c*Math.round(p.offsetWidth/(s.clientWidth/100))+u;i(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",m)}var r,l,s=e.getElement(),d=void 0===o.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,u=void 0===o.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,c=(d-u)/100,m=e.getValue()||0,f=document.createElement("div"),p=document.createElement("div");if(f.style.position="absolute",f.style.right="0",f.style.top="0",f.style.bottom="0",f.style.width="5px",f.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var v in o.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),p.setAttribute(v,p.getAttribute(v)+o.elementAttributes["+"+v])):p.setAttribute(v,o.elementAttributes[v]);return s.style.padding="4px 4px",m=Math.min(parseFloat(m),d),m=Math.max(parseFloat(m),u),m=Math.round((m-u)/c),p.style.width=m+"%",s.setAttribute("aria-valuemin",u),s.setAttribute("aria-valuemax",d),p.appendChild(f),f.addEventListener("mousedown",function(e){r=e.screenX,l=p.offsetWidth}),f.addEventListener("mouseover",function(){f.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(e){r&&(p.style.width=l+e.screenX-r+"px")}),s.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,l=!1,a())}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+s.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-s.clientWidth/100+"px";break;case 9:case 13:a();break;case 27:n()}}),s.addEventListener("blur",function(){n()}),p},tickCross:function(e,t,i,n,o){function a(e){return s?e?u?d:l.checked:l.checked&&!u?(l.checked=!1,l.indeterminate=!0,u=!0,d):(u=!1,l.checked):l.checked}var r=e.getValue(),l=document.createElement("input"),s=o.tristate,d=void 0===o.indeterminateValue?null:o.indeterminateValue,u=!1;if(l.setAttribute("type","checkbox"),l.style.marginTop="5px",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var c in o.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+o.elementAttributes["+"+c])):l.setAttribute(c,o.elementAttributes[c]);return l.value=r,!s||void 0!==r&&r!==d&&""!==r||(u=!0,l.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){l.focus({preventScroll:!0})}),l.checked=!0===r||"true"===r||"True"===r||1===r,l.addEventListener("change",function(e){i(a())}),l.addEventListener("blur",function(e){i(a(!0))}),l.addEventListener("keydown",function(e){13==e.keyCode&&i(a()),27==e.keyCode&&n()}),l}},Tabulator.prototype.registerModule("edit",Edit); \ No newline at end of file +var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),e?i.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTop;n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i)}},Edit.prototype.edit=function(e,t,i){function n(t){if(u.currentCell===e){var i=!0;return e.column.modules.validate&&u.table.modExists("validate")&&"manual"!=u.table.options.validationMode&&(i=u.table.modules.validate.validate(e.column.modules.validate,e,t)),!0===i||"highlight"===u.table.options.validationMode?(u.clearEditor(),e.setValue(t,!0),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==u.editedCells.indexOf(e)&&u.editedCells.push(e),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e),!0===i||(m.classList.add("tabulator-validation-fail"),!1)):(u.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),u.focusCellNoEvent(e,!0),c(),u.table.options.validationFailed.call(u.table,e.getComponent(),t,i),!1)}}function o(){u.currentCell===e&&(u.cancelEdit(),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e))}function a(e){c=e}var r,l,s,u=this,d=!0,c=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":d=e.column.modules.edit.check(e.getComponent());break;case"boolean":d=e.column.modules.edit.check}if(d||i){if(u.cancelEdit(),u.currentCell=e,this.focusScrollAdjust(e),l=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,l)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,l),u.table.options.cellEditing.call(this.table,l),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(l):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(u,l,a,n,o,s)))return m.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");m.firstChild;)m.removeChild(m.firstChild);m.appendChild(r),c();for(var f=m.children,p=0;p46){if(i>=n.length)return t.preventDefault(),t.stopPropagation(),l=!1,!1;switch(n[i]){case o:if(s.toUpperCase()==s.toLowerCase())return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case a:if(isNaN(s))return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case r:break;default:if(s!==n[i])return t.preventDefault(),t.stopPropagation(),l=!1,!1}l=!0}}),e.addEventListener("keyup",function(n){n.keyCode>46&&t.maskAutoFill&&i(e.value.length)}),e.placeholder||(e.placeholder=n),t.maskAutoFill&&i(e.value.length)},Edit.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach(function(t){e.push(t.getComponent())}),e},Edit.prototype.clearEdited=function(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1))},Edit.prototype.editors={input:function(e,t,i,n,o){function a(e){(null===r||void 0===r)&&""!==l.value||l.value!==r?i(l.value)&&(r=l.value):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type",o.search?"search":"text"),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var s in o.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+o.elementAttributes["+"+s])):l.setAttribute(s,o.elementAttributes[s]);return l.value=void 0!==r?r:"",t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("change",a),l.addEventListener("blur",a),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a(e);break;case 27:n()}}),o.mask&&this.table.modules.edit.maskInput(l,o),l},textarea:function(e,t,i,n,o){function a(t){(null===r||void 0===r)&&""!==u.value||u.value!==r?(i(u.value)&&(r=u.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}var r=e.getValue(),l=o.verticalNavigation||"hybrid",s=String(null!==r&&void 0!==r?r:""),u=(s.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),d=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var c in o.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),u.setAttribute(c,u.getAttribute(c)+o.elementAttributes["+"+c])):u.setAttribute(c,o.elementAttributes[c]);return u.value=s,t(function(){u.focus({preventScroll:!0}),u.style.height="100%"}),u.addEventListener("change",a),u.addEventListener("blur",a),u.addEventListener("keyup",function(){u.style.height="";var t=u.scrollHeight;u.style.height=t+"px",t!=d&&(d=t,e.getRow().normalizeHeight())}),u.addEventListener("keydown",function(e){switch(e.keyCode){case 27:n();break;case 38:("editor"==l||"hybrid"==l&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==l||"hybrid"==l&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),o.mask&&this.table.modules.edit.maskInput(u,o),u},number:function(e,t,i,n,o){function a(){var e=s.value;isNaN(e)||""===e||(e=Number(e)),e!==r?i(e)&&(r=e):n()}var r=e.getValue(),l=o.verticalNavigation||"editor",s=document.createElement("input");if(s.setAttribute("type","number"),void 0!==o.max&&s.setAttribute("max",o.max),void 0!==o.min&&s.setAttribute("min",o.min),void 0!==o.step&&s.setAttribute("step",o.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var u in o.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),s.setAttribute(u,s.getAttribute(u)+o.elementAttributes["+"+u])):s.setAttribute(u,o.elementAttributes[u]);s.value=r;var d=function(e){a()};return t(function(){s.removeEventListener("blur",d),s.focus({preventScroll:!0}),s.style.height="100%",s.addEventListener("blur",d)}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a();break;case 27:n();break;case 38:case 40:"editor"==l&&(e.stopImmediatePropagation(),e.stopPropagation())}}),o.mask&&this.table.modules.edit.maskInput(s,o),s},range:function(e,t,i,n,o){function a(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!=r?i(e)&&(r=e):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type","range"),void 0!==o.max&&l.setAttribute("max",o.max),void 0!==o.min&&l.setAttribute("min",o.min),void 0!==o.step&&l.setAttribute("step",o.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var s in o.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+o.elementAttributes["+"+s])):l.setAttribute(s,o.elementAttributes[s]);return l.value=r,t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("blur",function(e){a()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a();break;case 27:n()}}),l},select:function(e,t,i,n,o){function a(t){var i,n={},a=y.table.getData();return i=t?y.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),i?(a.forEach(function(e){var t=i.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(n[t]=!0)}),n=o.sortValuesList?"asc"==o.sortValuesList?Object.keys(n).sort():Object.keys(n).sort().reverse():Object.keys(n)):console.warn("unable to find matching column to create select lookup list:",t),n}function r(t,i){function n(e){var e={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1};return i.indexOf(e.value)>-1&&u(e),o.push(e),a.push(e),e}var o=[],a=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1},a.push(t),e.options.forEach(function(e){n(e)})):n(e):(t={label:e,value:e,element:!1},i.indexOf(t.value)>-1&&u(t),o.push(t),a.push(t))});else for(var r in t){var s={label:t[r],value:r,element:!1};i.indexOf(s.value)>-1&&u(s),o.push(s),a.push(s)}P=o,T=a,l()}function l(){for(;w.firstChild;)w.removeChild(w.firstChild);T.forEach(function(t){var i=t.element;if(!i){if(i=document.createElement("div"),t.label=o.listItemFormatter?o.listItemFormatter(t.value,t.label,e,i,t.itemParams):t.label,t.group?(i.classList.add("tabulator-edit-select-list-group"),i.tabIndex=0,i.innerHTML=""===t.label?" ":t.label):(i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=""===t.label?" ":t.label,i.addEventListener("click",function(){x?(c(t),L.focus()):m(t)}),I.indexOf(t)>-1&&(console.log("current",N),i.classList.add("active"))),t.elementAttributes&&"object"==_typeof(t.elementAttributes))for(var n in t.elementAttributes)"+"==n.charAt(0)?(n=n.slice(1),i.setAttribute(n,L.getAttribute(n)+t.elementAttributes["+"+n])):i.setAttribute(n,t.elementAttributes[n]);i.addEventListener("mousedown",function(){S=!1,setTimeout(function(){S=!0},10)}),t.element=i}w.appendChild(i)})}function s(e,t){!x&&N&&N.element&&N.element.classList.remove("active"),N&&N.element&&N.element.classList.remove("focused"),N=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function u(e){-1==I.indexOf(e)&&(I.push(e),s(e,!0)),p()}function d(e){var t=I[e];e>-1&&(I.splice(e,1),t.element&&t.element.classList.remove("active"))}function c(e){e||(e=N);var t=I.indexOf(e);t>-1?d(t):(!0!==x&&I.length>=x&&d(0),u(e)),p()}function m(e){h(),e||(e=N),e&&i(e.value)}function f(){h();var e=[];I.forEach(function(t){e.push(t.value)}),i(e)}function p(){var e=[];I.forEach(function(t){e.push(t.label)}),L.value=e.join(", ")}function v(){h(),n()}function b(){if(!w.parentNode){!0===o.values?r(a(),C):"string"==typeof o.values?r(a(o.values),C):r(o.values||[],C);var e=Tabulator.prototype.helpers.elOffset(E);w.style.minWidth=E.offsetWidth+"px",w.style.top=e.top+E.offsetHeight+"px",w.style.left=e.left+"px",w.addEventListener("mousedown",function(e){S=!1,setTimeout(function(){S=!0},10)}),document.body.appendChild(w)}}function h(){w.parentNode&&w.parentNode.removeChild(w),g()}function g(){y.table.rowManager.element.removeEventListener("scroll",v)}var y=this,E=e.getElement(),A=e.getValue(),k=o.verticalNavigation||"editor",C=void 0!==A||null===A?A:void 0!==o.defaultValue?o.defaultValue:[],L=document.createElement("input"),w=document.createElement("div"),x=o.multiselect,P=[],N={},T=[],I=[],S=!0;if(this.table.rowManager.element.addEventListener("scroll",v),(Array.isArray(o)||!Array.isArray(o)&&"object"===(void 0===o?"undefined":_typeof(o))&&!o.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),o={values:o}),L.setAttribute("type","text"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",L.style.cursor="default",L.readOnly=0!=this.currentCell,o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var O in o.elementAttributes)"+"==O.charAt(0)?(O=O.slice(1),L.setAttribute(O,L.getAttribute(O)+o.elementAttributes["+"+O])):L.setAttribute(O,o.elementAttributes[O]);return L.value=void 0!==A||null===A?A:"",L.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=P.indexOf(N),("editor"==k||"hybrid"==k&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&s(P[t-1],!x));break;case 40:t=P.indexOf(N),("editor"==k||"hybrid"==k&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&a.push(t)}),c(a,t))}function s(e){var t=document.createElement("div");d(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,w.appendChild(t))}function u(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var i={};"object"===(void 0===e?"undefined":_typeof(e))?(i.title=o.listItemFormatter?o.listItemFormatter(e.value,e.label):e.label,i.value=e.value):(i.title=o.listItemFormatter?o.listItemFormatter(e,e):e,i.value=e),t.push(i)});else for(var i in e){var n={title:o.listItemFormatter?o.listItemFormatter(i,e[i]):e[i],value:i};t.push(n)}return t}function d(){for(;w.firstChild;)w.removeChild(w.firstChild)}function c(e,t){e.length?m(e,t):o.emptyPlaceholder&&s(o.emptyPlaceholder)}function m(e,t){var i=!1;d(),x=e,x.forEach(function(e){var n=e.element;n||(n=document.createElement("div"),n.classList.add("tabulator-edit-select-list-item"),n.tabIndex=0,n.innerHTML=e.title,n.addEventListener("click",function(t){v(e),f()}),n.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),e.element=n,t&&e.value==A&&(L.value=e.title,e.element.classList.add("active"),i=!0),e===P&&(e.element.classList.add("active"),i=!0)),w.appendChild(n)}),i||v(!1)}function f(){b(),P?A!==P.value?(A=P.value,L.value=P.title,i(P.value)):n():o.freetext?(A=L.value,i(L.value)):o.allowEmpty&&""===L.value?(A=L.value,i(L.value)):n()}function p(){if(!w.parentNode){for(;w.firstChild;)w.removeChild(w.firstChild);var e=Tabulator.prototype.helpers.elOffset(E);w.style.minWidth=E.offsetWidth+"px",w.style.top=e.top+E.offsetHeight+"px",w.style.left=e.left+"px",document.body.appendChild(w)}}function v(e,t){P&&P.element&&P.element.classList.remove("active"),P=e,e&&e.element&&e.element.classList.add("active")}function b(){w.parentNode&&w.parentNode.removeChild(w),g()}function h(){b(),n()}function g(){y.table.rowManager.element.removeEventListener("scroll",h)}var y=this,E=e.getElement(),A=e.getValue(),k=o.verticalNavigation||"editor",C=void 0!==A||null===A?A:void 0!==o.defaultValue?o.defaultValue:"",L=document.createElement("input"),w=document.createElement("div"),x=[],P=!1,N=!0,T=!1;if(this.table.rowManager.element.addEventListener("scroll",h),L.setAttribute("type","search"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var I in o.elementAttributes)"+"==I.charAt(0)?(I=I.slice(1),L.setAttribute(I,L.getAttribute(I)+o.elementAttributes["+"+I])):L.setAttribute(I,o.elementAttributes[I]);return w.classList.add("tabulator-edit-select-list"),w.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),L.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=x.indexOf(P),("editor"==k||"hybrid"==k&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),v(t>0?x[t-1]:!1));break;case 40:t=x.indexOf(P),("editor"==k||"hybrid"==k&&t'):("ie"==l.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){u=e,a(e)}var l=this,s=e.getElement(),u=e.getValue(),d=s.getElementsByTagName("svg").length||5,c=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",p.setAttribute("width",c),p.setAttribute("height",c),p.setAttribute("viewBox","0 0 512 512"),p.setAttribute("xml:space","preserve"),p.style.padding="0 1px",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var v in o.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),f.setAttribute(v,f.getAttribute(v)+o.elementAttributes["+"+v])):f.setAttribute(v,o.elementAttributes[v]);for(var b=1;b<=d;b++)!function(e){var t=document.createElement("span"),n=p.cloneNode(!0);m.push(n),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),a(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e)}),t.appendChild(n),f.appendChild(t)}(b);return u=Math.min(parseInt(u),d),a(u),f.addEventListener("mousemove",function(e){a(0)}),f.addEventListener("click",function(e){i(0)}),s.addEventListener("blur",function(e){n()}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(u+1);break;case 37:r(u-1);break;case 13:i(u);break;case 27:n()}}),f},progress:function(e,t,i,n,o){function a(){var e=c*Math.round(p.offsetWidth/(s.clientWidth/100))+d;i(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",m)}var r,l,s=e.getElement(),u=void 0===o.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,d=void 0===o.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,c=(u-d)/100,m=e.getValue()||0,f=document.createElement("div"),p=document.createElement("div");if(f.style.position="absolute",f.style.right="0",f.style.top="0",f.style.bottom="0",f.style.width="5px",f.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var v in o.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),p.setAttribute(v,p.getAttribute(v)+o.elementAttributes["+"+v])):p.setAttribute(v,o.elementAttributes[v]);return s.style.padding="4px 4px",m=Math.min(parseFloat(m),u),m=Math.max(parseFloat(m),d),m=Math.round((m-d)/c),p.style.width=m+"%",s.setAttribute("aria-valuemin",d),s.setAttribute("aria-valuemax",u),p.appendChild(f),f.addEventListener("mousedown",function(e){r=e.screenX,l=p.offsetWidth}),f.addEventListener("mouseover",function(){f.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(e){r&&(p.style.width=l+e.screenX-r+"px")}),s.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,l=!1,a())}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+s.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-s.clientWidth/100+"px";break;case 9:case 13:a();break;case 27:n()}}),s.addEventListener("blur",function(){n()}),p},tickCross:function(e,t,i,n,o){function a(e){return s?e?d?u:l.checked:l.checked&&!d?(l.checked=!1,l.indeterminate=!0,d=!0,u):(d=!1,l.checked):l.checked}var r=e.getValue(),l=document.createElement("input"),s=o.tristate,u=void 0===o.indeterminateValue?null:o.indeterminateValue,d=!1;if(l.setAttribute("type","checkbox"),l.style.marginTop="5px",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var c in o.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+o.elementAttributes["+"+c])):l.setAttribute(c,o.elementAttributes[c]);return l.value=r,!s||void 0!==r&&r!==u&&""!==r||(d=!0,l.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){l.focus({preventScroll:!0})}),l.checked=!0===r||"true"===r||"True"===r||1===r,l.addEventListener("change",function(e){i(a())}),l.addEventListener("blur",function(e){i(a(!0))}),l.addEventListener("keydown",function(e){13==e.keyCode&&i(a()),27==e.keyCode&&n()}),l}},Tabulator.prototype.registerModule("edit",Edit); \ No newline at end of file diff --git a/dist/js/modules/group_rows.js b/dist/js/modules/group_rows.js index 49c000576..39af082d6 100644 --- a/dist/js/modules/group_rows.js +++ b/dist/js/modules/group_rows.js @@ -166,6 +166,10 @@ Group.prototype.addBindings = function () { }); } + if (self.groupManager.table.options.groupContextMenu && self.groupManager.table.modExists("menu")) { + self.groupManager.table.modules.menu.initializeGroup.call(self.groupManager.table.modules.menu, self); + } + if (self.groupManager.table.options.groupTap) { tap = false; diff --git a/dist/js/modules/group_rows.min.js b/dist/js/modules/group_rows.min.js index 87bae5e19..6f36d0bee 100644 --- a/dist/js/modules/group_rows.min.js +++ b/dist/js/modules/group_rows.min.js @@ -1,2 +1,2 @@ /* Tabulator v4.6.3 (c) Oliver Folkerd */ -var GroupComponent=function(t){this._group=t,this.type="GroupComponent"};GroupComponent.prototype.getKey=function(){return this._group.key},GroupComponent.prototype.getField=function(){return this._group.field},GroupComponent.prototype.getElement=function(){return this._group.element},GroupComponent.prototype.getRows=function(){return this._group.getRows(!0)},GroupComponent.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},GroupComponent.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},GroupComponent.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},GroupComponent.prototype.isVisible=function(){return this._group.visible},GroupComponent.prototype.show=function(){this._group.show()},GroupComponent.prototype.hide=function(){this._group.hide()},GroupComponent.prototype.toggle=function(){this._group.toggleVisibility()},GroupComponent.prototype._getSelf=function(){return this._group},GroupComponent.prototype.getTable=function(){return this._group.groupManager.table};var Group=function(t,o,e,r,i,s,n){this.groupManager=t,this.parent=o,this.key=r,this.level=e,this.field=i,this.hasSubGroups=e-1?e?this.rows.splice(i+1,0,t):this.rows.splice(i,0,t):e?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)},Group.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(o){o.scrollHeader(t)})},Group.prototype.getRowIndex=function(t){},Group.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},Group.prototype.removeRow=function(t){var o=this.rows.indexOf(t),e=t.getElement();o>-1&&this.rows.splice(o,1),this.groupManager.table.options.groupValues||this.rows.length?(e.parentNode&&e.parentNode.removeChild(e),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))},Group.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],o=this.groupList.indexOf(t),o>-1&&this.groupList.splice(o,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},Group.prototype.getHeadersAndRows=function(t){var o=[];return o.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(e){o=o.concat(e.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),o.push(this.calcs.top)),o=o.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),o.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),o.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),o.push(this.calcs.bottom)))),o},Group.prototype.getData=function(t,o){var e=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){e.push(t.getData(o||"data"))}),e},Group.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t},Group.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},Group.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 o=t.getElement();o.parentNode.removeChild(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(),!1)},Group.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 o=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e})}):t.rows.forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=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(),!0)},Group.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},Group.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}):this.rows.find(function(o){return o===t})&&(o=this),o},Group.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.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)},Group.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;tr.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(o,e){t.headerGenerator[0]=function(t,r,i){return(void 0===t?"":t)+"("+r+" "+(1===r?o:e.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(o)||o)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 i=this.table.columnManager.getRealColumns();i.forEach(function(o){o.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),o.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(o,e){var r,i;"function"==typeof o?r=o:(i=t.table.columnManager.getColumnByField(o),r=i?function(t){return i.getFieldValue(t)}:function(t){return t[o]}),t.groupIDLookups.push({field:"function"!=typeof o&&o,func:r,values:!!t.allowedValues&&t.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=e),r&&(t.headerGenerator=Array.isArray(r)?r:[r]),this.initialized=!0},GroupRows.prototype.setDisplayIndex=function(t){this.displayIndex=t},GroupRows.prototype.getDisplayIndex=function(){return this.displayIndex},GroupRows.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)},GroupRows.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},GroupRows.prototype.getChildGroups=function(t){var o=this,e=[];return t||(t=this),t.groupList.forEach(function(t){t.groupList.length?e=e.concat(o.getChildGroups(t)):e.push(t)}),e},GroupRows.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})},GroupRows.prototype.pullGroupListData=function(t){var o=this,e=[];return t.forEach(function(t){var r={};r.level=0,r.rowCount=0,r.headerContent="";var i=[];t.hasSubGroups?(i=o.pullGroupListData(t.groupList),r.level=t.level,r.rowCount=i.length-t.groupList.length,r.headerContent=t.generator(t.key,r.rowCount,t.rows,t),e.push(r),e=e.concat(i)):(r.level=t.level,r.headerContent=t.generator(t.key,t.rows.length,t.rows,t),r.rowCount=t.getRows().length,e.push(r),t.getRows().forEach(function(t){e.push(t.getData("data"))}))}),e},GroupRows.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},GroupRows.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}),o},GroupRows.prototype.countGroups=function(){return this.groupList.length},GroupRows.prototype.generateGroups=function(t){var o=this,e=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){o.createGroup(t,0,e)}),t.forEach(function(t){o.assignRowToExistingGroup(t,e)})):t.forEach(function(t){o.assignRowToGroup(t,e)})},GroupRows.prototype.createGroup=function(t,o,e){var r,i=o+"_"+t;e=e||[],r=new Group(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],e[i]),this.groups[i]=r,this.groupList.push(r)},GroupRows.prototype.assignRowToExistingGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r="0_"+e;this.groups[r]&&this.groups[r].addRow(t)},GroupRows.prototype.assignRowToGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r=!this.groups["0_"+e];return r&&this.createGroup(e,0,o),this.groups["0_"+e].addRow(t),!r},GroupRows.prototype.updateGroupRows=function(t){var o=this,e=[];if(o.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}),t){var r=o.table.rowManager.setDisplayRows(e,this.getDisplayIndex());!0!==r&&this.setDisplayIndex(r),o.table.rowManager.refreshActiveData("group",!0,!0)}return e},GroupRows.prototype.scrollHeaders=function(t){t+="px",this.groupList.forEach(function(o){o.scrollHeader(t)})},GroupRows.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],(o=this.groupList.indexOf(t))>-1&&this.groupList.splice(o,1))},Tabulator.prototype.registerModule("groupRows",GroupRows); \ No newline at end of file +var GroupComponent=function(t){this._group=t,this.type="GroupComponent"};GroupComponent.prototype.getKey=function(){return this._group.key},GroupComponent.prototype.getField=function(){return this._group.field},GroupComponent.prototype.getElement=function(){return this._group.element},GroupComponent.prototype.getRows=function(){return this._group.getRows(!0)},GroupComponent.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},GroupComponent.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},GroupComponent.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},GroupComponent.prototype.isVisible=function(){return this._group.visible},GroupComponent.prototype.show=function(){this._group.show()},GroupComponent.prototype.hide=function(){this._group.hide()},GroupComponent.prototype.toggle=function(){this._group.toggleVisibility()},GroupComponent.prototype._getSelf=function(){return this._group},GroupComponent.prototype.getTable=function(){return this._group.groupManager.table};var Group=function(t,o,e,r,i,s,n){this.groupManager=t,this.parent=o,this.key=r,this.level=e,this.field=i,this.hasSubGroups=e-1?e?this.rows.splice(i+1,0,t):this.rows.splice(i,0,t):e?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)},Group.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(o){o.scrollHeader(t)})},Group.prototype.getRowIndex=function(t){},Group.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},Group.prototype.removeRow=function(t){var o=this.rows.indexOf(t),e=t.getElement();o>-1&&this.rows.splice(o,1),this.groupManager.table.options.groupValues||this.rows.length?(e.parentNode&&e.parentNode.removeChild(e),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))},Group.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],o=this.groupList.indexOf(t),o>-1&&this.groupList.splice(o,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},Group.prototype.getHeadersAndRows=function(t){var o=[];return o.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(e){o=o.concat(e.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),o.push(this.calcs.top)),o=o.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),o.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),o.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),o.push(this.calcs.bottom)))),o},Group.prototype.getData=function(t,o){var e=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){e.push(t.getData(o||"data"))}),e},Group.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t},Group.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},Group.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 o=t.getElement();o.parentNode.removeChild(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(),!1)},Group.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 o=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e})}):t.rows.forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=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(),!0)},Group.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},Group.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}):this.rows.find(function(o){return o===t})&&(o=this),o},Group.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.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)},Group.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;tr.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(o,e){t.headerGenerator[0]=function(t,r,i){return(void 0===t?"":t)+"("+r+" "+(1===r?o:e.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(o)||o)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 i=this.table.columnManager.getRealColumns();i.forEach(function(o){o.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),o.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(o,e){var r,i;"function"==typeof o?r=o:(i=t.table.columnManager.getColumnByField(o),r=i?function(t){return i.getFieldValue(t)}:function(t){return t[o]}),t.groupIDLookups.push({field:"function"!=typeof o&&o,func:r,values:!!t.allowedValues&&t.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=e),r&&(t.headerGenerator=Array.isArray(r)?r:[r]),this.initialized=!0},GroupRows.prototype.setDisplayIndex=function(t){this.displayIndex=t},GroupRows.prototype.getDisplayIndex=function(){return this.displayIndex},GroupRows.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)},GroupRows.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},GroupRows.prototype.getChildGroups=function(t){var o=this,e=[];return t||(t=this),t.groupList.forEach(function(t){t.groupList.length?e=e.concat(o.getChildGroups(t)):e.push(t)}),e},GroupRows.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})},GroupRows.prototype.pullGroupListData=function(t){var o=this,e=[];return t.forEach(function(t){var r={};r.level=0,r.rowCount=0,r.headerContent="";var i=[];t.hasSubGroups?(i=o.pullGroupListData(t.groupList),r.level=t.level,r.rowCount=i.length-t.groupList.length,r.headerContent=t.generator(t.key,r.rowCount,t.rows,t),e.push(r),e=e.concat(i)):(r.level=t.level,r.headerContent=t.generator(t.key,t.rows.length,t.rows,t),r.rowCount=t.getRows().length,e.push(r),t.getRows().forEach(function(t){e.push(t.getData("data"))}))}),e},GroupRows.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},GroupRows.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}),o},GroupRows.prototype.countGroups=function(){return this.groupList.length},GroupRows.prototype.generateGroups=function(t){var o=this,e=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){o.createGroup(t,0,e)}),t.forEach(function(t){o.assignRowToExistingGroup(t,e)})):t.forEach(function(t){o.assignRowToGroup(t,e)})},GroupRows.prototype.createGroup=function(t,o,e){var r,i=o+"_"+t;e=e||[],r=new Group(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],e[i]),this.groups[i]=r,this.groupList.push(r)},GroupRows.prototype.assignRowToExistingGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r="0_"+e;this.groups[r]&&this.groups[r].addRow(t)},GroupRows.prototype.assignRowToGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r=!this.groups["0_"+e];return r&&this.createGroup(e,0,o),this.groups["0_"+e].addRow(t),!r},GroupRows.prototype.updateGroupRows=function(t){var o=this,e=[];if(o.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}),t){var r=o.table.rowManager.setDisplayRows(e,this.getDisplayIndex());!0!==r&&this.setDisplayIndex(r),o.table.rowManager.refreshActiveData("group",!0,!0)}return e},GroupRows.prototype.scrollHeaders=function(t){t+="px",this.groupList.forEach(function(o){o.scrollHeader(t)})},GroupRows.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],(o=this.groupList.indexOf(t))>-1&&this.groupList.splice(o,1))},Tabulator.prototype.registerModule("groupRows",GroupRows); \ No newline at end of file diff --git a/dist/js/modules/menu.js b/dist/js/modules/menu.js index 7c33edcaa..284857440 100644 --- a/dist/js/modules/menu.js +++ b/dist/js/modules/menu.js @@ -4,6 +4,7 @@ var Menu = function Menu(table) { this.table = table; //hold Tabulator object this.menuEl = false; this.blurEvent = this.hideMenu.bind(this); + this.escEvent = this.escMenu.bind(this); }; Menu.prototype.initializeColumnHeader = function (column) { @@ -63,9 +64,21 @@ Menu.prototype.initializeRow = function (row) { }); }; -Menu.prototype.loadMenu = function (e, component, menu) { +Menu.prototype.initializeGroup = function (group) { var _this4 = this; + group.getElement().addEventListener("contextmenu", function (e) { + var menu = typeof _this4.table.options.groupContextMenu == "function" ? _this4.table.options.groupContextMenu(group.getComponent()) : _this4.table.options.groupContextMenu; + + e.preventDefault(); + + _this4.loadMenu(e, group, menu); + }); +}; + +Menu.prototype.loadMenu = function (e, component, menu) { + var _this5 = this; + var docHeight = Math.max(document.body.offsetHeight, window.innerHeight); //abort if no menu set @@ -109,13 +122,13 @@ Menu.prototype.loadMenu = function (e, component, menu) { }); } else { itemEl.addEventListener("click", function (e) { - _this4.hideMenu(); + _this5.hideMenu(); item.action(e, component.getComponent()); }); } } - _this4.menuEl.appendChild(itemEl); + _this5.menuEl.appendChild(itemEl); }); this.menuEl.style.top = e.pageY + "px"; @@ -125,9 +138,11 @@ Menu.prototype.loadMenu = function (e, component, menu) { this.table.rowManager.element.addEventListener("scroll", this.blurEvent); setTimeout(function () { - document.body.addEventListener("contextmenu", _this4.blurEvent); + document.body.addEventListener("contextmenu", _this5.blurEvent); }, 100); + document.body.addEventListener("keydown", this.escEvent); + document.body.appendChild(this.menuEl); //move menu to start on right edge if it is too close to the edge of the screen @@ -143,11 +158,21 @@ Menu.prototype.loadMenu = function (e, component, menu) { } }; +Menu.prototype.escMenu = function (e) { + if (e.keyCode == 27) { + this.hideMenu(); + } +}; + Menu.prototype.hideMenu = function () { if (this.menuEl.parentNode) { this.menuEl.parentNode.removeChild(this.menuEl); } + if (this.escEvent) { + document.body.removeEventListener("keydown", this.escEvent); + } + if (this.blurEvent) { document.body.removeEventListener("click", this.blurEvent); document.body.removeEventListener("contextmenu", this.blurEvent); diff --git a/dist/js/modules/menu.min.js b/dist/js/modules/menu.min.js index dbb2bc15f..676f22741 100644 --- a/dist/js/modules/menu.min.js +++ b/dist/js/modules/menu.min.js @@ -1,2 +1,2 @@ /* Tabulator v4.6.3 (c) Oliver Folkerd */ -var Menu=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this)};Menu.prototype.initializeColumnHeader=function(e){var t,n=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),n.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),n.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},Menu.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;n.preventDefault(),t.loadMenu(n,e,i)})},Menu.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;n.preventDefault(),t.loadMenu(n,e,i)})},Menu.prototype.loadMenu=function(e,t,n){var i=this,o=Math.max(document.body.offsetHeight,window.innerHeight);n&&n.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),n.forEach(function(e){var n=document.createElement("div"),o=e.label,u=e.disabled;e.separator?n.classList.add("tabulator-menu-separator"):(n.classList.add("tabulator-menu-item"),"function"==typeof o&&(o=o(t.getComponent())),o instanceof Node?n.appendChild(o):n.innerHTML=o,"function"==typeof u&&(u=u(t.getComponent())),u?(n.classList.add("tabulator-menu-item-disabled"),n.addEventListener("click",function(e){e.stopPropagation()})):n.addEventListener("click",function(n){i.hideMenu(),e.action(n,t.getComponent())})),i.menuEl.appendChild(n)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=o&&(this.menuEl.style.top="",this.menuEl.style.bottom=o-e.pageY+"px"))},Menu.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},Menu.prototype.menus={},Tabulator.prototype.registerModule("menu",Menu); \ No newline at end of file +var Menu=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this)};Menu.prototype.initializeColumnHeader=function(e){var t,n=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var o="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),n.loadMenu(t,e,o)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var o="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),n.loadMenu(t,e,o)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},Menu.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var o="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;n.preventDefault(),t.loadMenu(n,e,o)})},Menu.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var o="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;n.preventDefault(),t.loadMenu(n,e,o)})},Menu.prototype.initializeGroup=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var o="function"==typeof t.table.options.groupContextMenu?t.table.options.groupContextMenu(e.getComponent()):t.table.options.groupContextMenu;n.preventDefault(),t.loadMenu(n,e,o)})},Menu.prototype.loadMenu=function(e,t,n){var o=this,i=Math.max(document.body.offsetHeight,window.innerHeight);n&&n.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),n.forEach(function(e){var n=document.createElement("div"),i=e.label,u=e.disabled;e.separator?n.classList.add("tabulator-menu-separator"):(n.classList.add("tabulator-menu-item"),"function"==typeof i&&(i=i(t.getComponent())),i instanceof Node?n.appendChild(i):n.innerHTML=i,"function"==typeof u&&(u=u(t.getComponent())),u?(n.classList.add("tabulator-menu-item-disabled"),n.addEventListener("click",function(e){e.stopPropagation()})):n.addEventListener("click",function(n){o.hideMenu(),e.action(n,t.getComponent())})),o.menuEl.appendChild(n)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",o.blurEvent)},100),document.body.addEventListener("keydown",this.escEvent),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=i&&(this.menuEl.style.top="",this.menuEl.style.bottom=i-e.pageY+"px"))},Menu.prototype.escMenu=function(e){27==e.keyCode&&this.hideMenu()},Menu.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.escEvent&&document.body.removeEventListener("keydown",this.escEvent),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},Menu.prototype.menus={},Tabulator.prototype.registerModule("menu",Menu); \ No newline at end of file diff --git a/dist/js/tabulator.js b/dist/js/tabulator.js index 52c26ffdd..29c1fee2f 100644 --- a/dist/js/tabulator.js +++ b/dist/js/tabulator.js @@ -5580,6 +5580,18 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } }; + RowComponent.prototype.isFrozen = function () { + + if (this._row.table.modExists("frozenRows", true)) { + + var index = this._row.table.modules.frozenRows.rows.indexOf(this._row); + + return index > -1; + } + + return false; + }; + RowComponent.prototype.treeCollapse = function () { if (this._row.table.modExists("dataTree", true)) { @@ -8269,6 +8281,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol groupContext: false, + groupContextMenu: false, + groupTap: false, groupDblTap: false, @@ -14625,7 +14639,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol input.addEventListener("keydown", function (e) { switch (e.keyCode) { case 13: - case 9: + // case 9: onChange(); break; @@ -14703,8 +14717,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol function processComplexListItem(item) { var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label) : item.label, + label: item.label, value: item.value, + itemParams: item.itemParams, + elementAttributes: item.elementAttributes, element: false }; @@ -14736,6 +14752,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol item = { label: value.label, group: true, + itemParams: value.itemParams, + elementAttributes: value.elementAttributes, element: false }; @@ -14750,7 +14768,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } else { item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value, + label: value, value: value, element: false }; @@ -14770,7 +14788,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } else { for (var key in inputValues) { var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], + label: inputValues[key], value: key, element: false }; @@ -14798,17 +14816,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol while (listEl.firstChild) { listEl.removeChild(listEl.firstChild); }displayItems.forEach(function (item) { + var el = item.element; if (!el) { - + el = document.createElement("div"); + item.label = editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label, cell, el, item.itemParams) : item.label; if (item.group) { - el = document.createElement("div"); el.classList.add("tabulator-edit-select-list-group"); el.tabIndex = 0; el.innerHTML = item.label === "" ? " " : item.label; } else { - el = document.createElement("div"); el.classList.add("tabulator-edit-select-list-item"); el.tabIndex = 0; el.innerHTML = item.label === "" ? " " : item.label; @@ -14834,6 +14852,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } } + if (item.elementAttributes && _typeof(item.elementAttributes) == "object") { + for (var key in item.elementAttributes) { + if (key.charAt(0) == "+") { + key = key.slice(1); + el.setAttribute(key, input.getAttribute(key) + item.elementAttributes["+" + key]); + } else { + el.setAttribute(key, item.elementAttributes[key]); + } + } + } el.addEventListener("mousedown", function () { blurable = false; @@ -18611,6 +18639,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); } + if (self.groupManager.table.options.groupContextMenu && self.groupManager.table.modExists("menu")) { + self.groupManager.table.modules.menu.initializeGroup.call(self.groupManager.table.modules.menu, self); + } + if (self.groupManager.table.options.groupTap) { tap = false; @@ -20244,6 +20276,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol this.table = table; //hold Tabulator object this.menuEl = false; this.blurEvent = this.hideMenu.bind(this); + this.escEvent = this.escMenu.bind(this); }; Menu.prototype.initializeColumnHeader = function (column) { @@ -20303,9 +20336,21 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); }; - Menu.prototype.loadMenu = function (e, component, menu) { + Menu.prototype.initializeGroup = function (group) { var _this64 = this; + group.getElement().addEventListener("contextmenu", function (e) { + var menu = typeof _this64.table.options.groupContextMenu == "function" ? _this64.table.options.groupContextMenu(group.getComponent()) : _this64.table.options.groupContextMenu; + + e.preventDefault(); + + _this64.loadMenu(e, group, menu); + }); + }; + + Menu.prototype.loadMenu = function (e, component, menu) { + var _this65 = this; + var docHeight = Math.max(document.body.offsetHeight, window.innerHeight); //abort if no menu set @@ -20349,13 +20394,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); } else { itemEl.addEventListener("click", function (e) { - _this64.hideMenu(); + _this65.hideMenu(); item.action(e, component.getComponent()); }); } } - _this64.menuEl.appendChild(itemEl); + _this65.menuEl.appendChild(itemEl); }); this.menuEl.style.top = e.pageY + "px"; @@ -20365,9 +20410,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol this.table.rowManager.element.addEventListener("scroll", this.blurEvent); setTimeout(function () { - document.body.addEventListener("contextmenu", _this64.blurEvent); + document.body.addEventListener("contextmenu", _this65.blurEvent); }, 100); + document.body.addEventListener("keydown", this.escEvent); + document.body.appendChild(this.menuEl); //move menu to start on right edge if it is too close to the edge of the screen @@ -20383,11 +20430,21 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } }; + Menu.prototype.escMenu = function (e) { + if (e.keyCode == 27) { + this.hideMenu(); + } + }; + Menu.prototype.hideMenu = function () { if (this.menuEl.parentNode) { this.menuEl.parentNode.removeChild(this.menuEl); } + if (this.escEvent) { + document.body.removeEventListener("keydown", this.escEvent); + } + if (this.blurEvent) { document.body.removeEventListener("click", this.blurEvent); document.body.removeEventListener("contextmenu", this.blurEvent); @@ -21085,7 +21142,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol //establish connection with other tables MoveRows.prototype.connectToTables = function (row) { - var _this65 = this; + var _this66 = this; var connectionTables; @@ -21109,15 +21166,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol this.connectionSelectorsElements.forEach(function (query) { if (typeof query === "string") { - _this65.connectionElements = _this65.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query))); + _this66.connectionElements = _this66.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query))); } else { - _this65.connectionElements.push(query); + _this66.connectionElements.push(query); } }); this.connectionElements.forEach(function (element) { var dropEvent = function dropEvent(e) { - _this65.elementRowDrop(e, element, _this65.moving); + _this66.elementRowDrop(e, element, _this66.moving); }; element.addEventListener("mouseup", dropEvent); @@ -21491,7 +21548,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; Page.prototype.generatePageSizeSelectList = function () { - var _this66 = this; + var _this67 = this; var pageSizes = []; @@ -21526,14 +21583,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol itemEl.value = item; if (item === true) { - _this66.table.modules.localize.bind("pagination|all", function (value) { + _this67.table.modules.localize.bind("pagination|all", function (value) { itemEl.innerHTML = value; }); } else { itemEl.innerHTML = item; } - _this66.pageSizeSelect.appendChild(itemEl); + _this67.pageSizeSelect.appendChild(itemEl); }); this.pageSizeSelect.value = this.size; @@ -21727,7 +21784,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol //set current page number Page.prototype.setPage = function (page) { - var _this67 = this; + var _this68 = this; var self = this; @@ -21753,9 +21810,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol page = parseInt(page); - if (page > 0 && page <= _this67.max) { - _this67.page = page; - _this67.trigger().then(function () { + if (page > 0 && page <= _this68.max) { + _this68.page = page; + _this68.trigger().then(function () { resolve(); }).catch(function () { reject(); @@ -21765,24 +21822,24 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol self.table.modules.persistence.save("page"); } } else { - console.warn("Pagination Error - Requested page is out of range of 1 - " + _this67.max + ":", page); + console.warn("Pagination Error - Requested page is out of range of 1 - " + _this68.max + ":", page); reject(); } }); }; Page.prototype.setPageToRow = function (row) { - var _this68 = this; + var _this69 = this; return new Promise(function (resolve, reject) { - var rows = _this68.table.rowManager.getDisplayRows(_this68.displayIndex - 1); + var rows = _this69.table.rowManager.getDisplayRows(_this69.displayIndex - 1); var index = rows.indexOf(row); if (index > -1) { - var page = _this68.size === true ? 1 : Math.ceil((index + 1) / _this68.size); + var page = _this69.size === true ? 1 : Math.ceil((index + 1) / _this69.size); - _this68.setPage(page).then(function () { + _this69.setPage(page).then(function () { resolve(); }).catch(function () { reject(); @@ -21878,19 +21935,19 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol //previous page Page.prototype.previousPage = function () { - var _this69 = this; + var _this70 = this; return new Promise(function (resolve, reject) { - if (_this69.page > 1) { - _this69.page--; - _this69.trigger().then(function () { + if (_this70.page > 1) { + _this70.page--; + _this70.trigger().then(function () { resolve(); }).catch(function () { reject(); }); - if (_this69.table.options.persistence && _this69.table.modExists("persistence", true) && _this69.table.modules.persistence.config.page) { - _this69.table.modules.persistence.save("page"); + if (_this70.table.options.persistence && _this70.table.modExists("persistence", true) && _this70.table.modules.persistence.config.page) { + _this70.table.modules.persistence.save("page"); } } else { console.warn("Pagination Error - Previous page would be less than page 1:", 0); @@ -21901,23 +21958,23 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol //next page Page.prototype.nextPage = function () { - var _this70 = this; + var _this71 = this; return new Promise(function (resolve, reject) { - if (_this70.page < _this70.max) { - _this70.page++; - _this70.trigger().then(function () { + if (_this71.page < _this71.max) { + _this71.page++; + _this71.trigger().then(function () { resolve(); }).catch(function () { reject(); }); - if (_this70.table.options.persistence && _this70.table.modExists("persistence", true) && _this70.table.modules.persistence.config.page) { - _this70.table.modules.persistence.save("page"); + if (_this71.table.options.persistence && _this71.table.modExists("persistence", true) && _this71.table.modules.persistence.config.page) { + _this71.table.modules.persistence.save("page"); } } else { - if (!_this70.progressiveLoad) { - console.warn("Pagination Error - Next page would be greater than maximum page of " + _this70.max + ":", _this70.max + 1); + if (!_this71.progressiveLoad) { + console.warn("Pagination Error - Next page would be greater than maximum page of " + _this71.max + ":", _this71.max + 1); } reject(); } @@ -21975,28 +22032,28 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; Page.prototype.trigger = function () { - var _this71 = this; + var _this72 = this; var left; return new Promise(function (resolve, reject) { - switch (_this71.mode) { + switch (_this72.mode) { case "local": - left = _this71.table.rowManager.scrollLeft; + left = _this72.table.rowManager.scrollLeft; - _this71.table.rowManager.refreshActiveData("page"); - _this71.table.rowManager.scrollHorizontal(left); + _this72.table.rowManager.refreshActiveData("page"); + _this72.table.rowManager.scrollHorizontal(left); - _this71.table.options.pageLoaded.call(_this71.table, _this71.getPage()); + _this72.table.options.pageLoaded.call(_this72.table, _this72.getPage()); resolve(); break; case "remote": case "progressive_load": case "progressive_scroll": - _this71.table.modules.ajax.blockActiveRequest(); - _this71._getRemotePage().then(function () { + _this72.table.modules.ajax.blockActiveRequest(); + _this72._getRemotePage().then(function () { resolve(); }).catch(function () { reject(); @@ -22004,14 +22061,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol break; default: - console.warn("Pagination Error - no such pagination mode:", _this71.mode); + console.warn("Pagination Error - no such pagination mode:", _this72.mode); reject(); } }); }; Page.prototype._getRemotePage = function () { - var _this72 = this; + var _this73 = this; var self = this, oldParams, @@ -22028,33 +22085,33 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol pageParams = self.table.modules.ajax.getParams(); //configure request params - pageParams[_this72.dataSentNames.page] = self.page; + pageParams[_this73.dataSentNames.page] = self.page; //set page size if defined - if (_this72.size) { - pageParams[_this72.dataSentNames.size] = _this72.size; + if (_this73.size) { + pageParams[_this73.dataSentNames.size] = _this73.size; } //set sort data if defined - if (_this72.table.options.ajaxSorting && _this72.table.modExists("sort")) { + if (_this73.table.options.ajaxSorting && _this73.table.modExists("sort")) { var sorters = self.table.modules.sort.getSort(); sorters.forEach(function (item) { delete item.column; }); - pageParams[_this72.dataSentNames.sorters] = sorters; + pageParams[_this73.dataSentNames.sorters] = sorters; } //set filter data if defined - if (_this72.table.options.ajaxFiltering && _this72.table.modExists("filter")) { + if (_this73.table.options.ajaxFiltering && _this73.table.modExists("filter")) { var filters = self.table.modules.filter.getFilters(true, true); - pageParams[_this72.dataSentNames.filters] = filters; + pageParams[_this73.dataSentNames.filters] = filters; } self.table.modules.ajax.setParams(pageParams); - self.table.modules.ajax.sendRequest(_this72.progressiveLoad).then(function (data) { + self.table.modules.ajax.sendRequest(_this73.progressiveLoad).then(function (data) { self._parseRemoteData(data); resolve(); }).catch(function (e) { @@ -23170,7 +23227,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; ResizeTable.prototype.initialize = function (row) { - var _this73 = this; + var _this74 = this; var table = this.table, tableStyle; @@ -23193,13 +23250,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var nodeHeight = Math.floor(entry[0].contentRect.height); var nodeWidth = Math.floor(entry[0].contentRect.width); - if (_this73.tableHeight != nodeHeight || _this73.tableWidth != nodeWidth) { - _this73.tableHeight = nodeHeight; - _this73.tableWidth = nodeWidth; + if (_this74.tableHeight != nodeHeight || _this74.tableWidth != nodeWidth) { + _this74.tableHeight = nodeHeight; + _this74.tableWidth = nodeWidth; if (table.element.parentNode) { - _this73.containerHeight = table.element.parentNode.clientHeight; - _this73.containerWidth = table.element.parentNode.clientWidth; + _this74.containerHeight = table.element.parentNode.clientHeight; + _this74.containerWidth = table.element.parentNode.clientWidth; } table.redraw(); @@ -23219,11 +23276,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var nodeHeight = Math.floor(entry[0].contentRect.height); var nodeWidth = Math.floor(entry[0].contentRect.width); - if (_this73.containerHeight != nodeHeight || _this73.containerWidth != nodeWidth) { - _this73.containerHeight = nodeHeight; - _this73.containerWidth = nodeWidth; - _this73.tableHeight = table.element.clientHeight; - _this73.tableWidth = table.element.clientWidth; + if (_this74.containerHeight != nodeHeight || _this74.containerWidth != nodeWidth) { + _this74.containerHeight = nodeHeight; + _this74.containerWidth = nodeWidth; + _this74.tableHeight = table.element.clientHeight; + _this74.tableWidth = table.element.clientWidth; table.redraw(); } @@ -23718,14 +23775,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol //select a number of rows SelectRow.prototype.selectRows = function (rows) { - var _this74 = this; + var _this75 = this; var rowMatch; switch (typeof rows === 'undefined' ? 'undefined' : _typeof(rows)) { case "undefined": this.table.rowManager.rows.forEach(function (row) { - _this74._selectRow(row, true, true); + _this75._selectRow(row, true, true); }); this._rowSelectionChanged(); @@ -23739,7 +23796,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol this._selectRow(rowMatch, true, true); } else { this.table.rowManager.getRows(rows).forEach(function (row) { - _this74._selectRow(row, true, true); + _this75._selectRow(row, true, true); }); } @@ -23749,7 +23806,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol default: if (Array.isArray(rows)) { rows.forEach(function (row) { - _this74._selectRow(row, true, true); + _this75._selectRow(row, true, true); }); this._rowSelectionChanged(); @@ -24253,7 +24310,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol //sort each item in sort list Sort.prototype._sortItems = function (data, sortList) { - var _this75 = this; + var _this76 = this; var sorterCount = sortList.length - 1; @@ -24263,7 +24320,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol for (var i = sorterCount; i >= 0; i--) { var sortItem = sortList[i]; - result = _this75._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params); + result = _this76._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params); if (result !== 0) { break; diff --git a/dist/js/tabulator.min.js b/dist/js/tabulator.min.js index dd857ab4a..269ed3a1f 100644 --- a/dist/js/tabulator.min.js +++ b/dist/js/tabulator.min.js @@ -1,12 +1,12 @@ /* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tabulator=t()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof e)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|t,s=Math.max(n>=0?n:i-Math.abs(n),0);so?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){t=e[0];for(var n in t){var s={field:n,title:n},a=t[n];switch(void 0===a?"undefined":_typeof(a)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(a)?"array":"string";break;default:o=isNaN(a)||""===a?a.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){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(),e.forEach(function(e,t){o._addColumn(e)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var i=new n(e,this),s=i.getElement(),a=o?this.findColumnIndex(o):o;if(o&&a>-1){var r=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(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 t?(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(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach(function(e){var o;e.clearVerticalAlign(),(o=e.getHeight())>t&&(t=o)}),e.columns.forEach(function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)}),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e)))return this.columnsByField[e]||!1;if(e instanceof n)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.columns.find(function(t){return t.element===e})||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===e&&o.push(t.columnsByField[i])}),o},t.prototype.getColumnByIndex=function(e){return this.columnsByIndex[e]},t.prototype.getFirstVisibileColumn=function(e){var e=this.columnsByIndex.findIndex(function(e){return e.visible});return e>-1&&this.columnsByIndex[e]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(e){return this.columnsByIndex.findIndex(function(t){return e===t})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(e){this.columnsByIndex.forEach(function(t,o){e(t,o)})},t.prototype.getDefinitions=function(e){var t=this,o=[];return t.columnsByIndex.forEach(function(t){(!e||e&&t.visible)&&o.push(t.getDefinition())}),o},t.prototype.getDefinitionTree=function(){var e=this,t=[];return e.columns.forEach(function(e){t.push(e.getDefinition(!0))}),t},t.prototype.getComponents=function(e){var t=this,o=[];return(e?t.columns:t.columnsByIndex).forEach(function(e){o.push(e.getComponent())}),o},t.prototype.getWidth=function(){var e=0;return this.columnsByIndex.forEach(function(t){t.visible&&(e+=t.getWidth())}),e},t.prototype.moveColumn=function(e,t,o){this.moveColumnActual(e,t,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),t.element.parentNode.insertBefore(e.element,t.element),o&&t.element.parentNode.insertBefore(t.element,e.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(e,t,o){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,o):this._moveColumnInArray(this.columns,e,t,o),this._moveColumnInArray(this.columnsByIndex,e,t,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,e.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(e,t,o,i,n){var s,a=e.indexOf(t);a>-1&&(e.splice(a,1),s=e.indexOf(o),s>-1?i&&(s+=1):s=a,e.splice(s,0,t),n&&this.table.rowManager.rows.forEach(function(e){if(e.cells.length){var t=e.cells.splice(a,1)[0];e.cells.splice(s,0,t)}}))},t.prototype.scrollToColumn=function(e,t,o){var i=this,n=0,s=0,a=0,r=e.getElement();return new Promise(function(l,c){if(void 0===t&&(t=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),e.visible){switch(t){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.offsetWidthe.rowManager.element.clientHeight&&(t-=e.rowManager.element.offsetWidth-e.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,a;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?e.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,o+=a>s?a:s)}),o},t.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var a=i._addColumn(e,t,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(),"fitColumns"!=i.table.modules.layout.getMode()&&a.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(a)})},t.prototype.deregisterColumn=function(e){var t,o=e.getField();o&&delete this.columnsByField[o],t=this.columnsByIndex.indexOf(e),t>-1&&this.columnsByIndex.splice(t,1),t=this.columns.indexOf(e),t>-1&&this.columns.splice(t,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(e){e&&(d.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():e?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),e&&(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(e){this._column=e,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 e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e},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(e){e.show()}):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(e){e.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 e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e},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(e){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,e)},o.prototype.move=function(e,t){var o=this._column.table.columnManager.findColumn(e);o?this._column.table.columnManager.moveColumn(this._column,o,t):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var e=this._column.nextColumn();return!!e&&e.getComponent()},o.prototype.getPrevColumn=function(){var e=this._column.prevColumn();return!!e&&e.getComponent()},o.prototype.updateDefinition=function(e){return this._column.updateDefinition(e)},o.prototype.getWidth=function(){return this._column.getWidth()},o.prototype.setWidth=function(e){return!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e)},o.prototype.validate=function(){return this._column.validate()};var n=function e(t,o){var i=this;this.table=o.table,this.definition=t,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!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.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),t.columns?(this.isGroup=!0,t.columns.forEach(function(t,o){var n=new e(t,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),t.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 e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e},n.prototype.createGroupElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e},n.prototype.checkDefinition=function(){var e=this;Object.keys(this.definition).forEach(function(t){-1===e.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)})},n.prototype.setField=function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},n.prototype.registerColumnPosition=function(e){this.parent.registerColumnPosition(e)},n.prototype.registerColumnField=function(e){this.parent.registerColumnField(e)},n.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(e){e.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 e=this,t=e.definition,o=t.headerTooltip||!1===t.tooltip?t.headerTooltip:e.table.options.tooltipsHeader;o?!0===o?t.field?e.table.modules.localize.bind("columns|"+t.field,function(o){e.element.setAttribute("title",o||t.title)}):e.element.setAttribute("title",t.title):("function"==typeof o&&!1===(o=o(e.getComponent()))&&(o=""),e.element.setAttribute("title",o)):e.element.setAttribute("title","")},n.prototype._buildHeader=function(){for(var e=this,t=e.definition;e.element.firstChild;)e.element.removeChild(e.element.firstChild);t.headerVertical&&(e.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&e.element.classList.add("tabulator-col-vertical-flip")),e.contentElement=e._bindEvents(),e.contentElement=e._buildColumnHeaderContent(),e.element.appendChild(e.contentElement),e.isGroup?e._buildGroupHeader():e._buildColumnHeader(),e.setTooltip(),e.table.options.resizableColumns&&e.table.modExists("resizeColumns")&&e.table.modules.resizeColumns.initializeColumn("header",e,e.element),t.headerFilter&&e.table.modExists("filter")&&e.table.modExists("edit")&&(void 0!==t.headerFilterPlaceholder&&t.field&&e.table.modules.localize.setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),e.table.modules.filter.initializeColumn(e)),e.table.modExists("frozenColumns")&&e.table.modules.frozenColumns.initializeColumn(e),e.table.options.movableColumns&&!e.isGroup&&e.table.modExists("moveColumn")&&e.table.modules.moveColumn.initializeColumn(e),(t.topCalc||t.bottomCalc)&&e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.initializeColumn(e),e.table.modExists("persistence")&&e.table.modules.persistence.config.columns&&e.table.modules.persistence.initializeColumn(e),e.element.addEventListener("mouseenter",function(t){e.setTooltip()})},n.prototype._bindEvents=function(){var e,t,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(e){n.headerClick(e,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(e){n.headerDblClick(e,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(e){n.headerContext(e,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&n.headerTap(e,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,n.headerDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),"function"==typeof n.headerTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,n.headerTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=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 e=this,t=e.definition,o=e.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(e,e.contentElement),(t.headerContextMenu||t.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(e),o.modExists("format")&&o.modules.format.initializeColumn(e),void 0!==t.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(e),void 0!==t.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(e),o.modExists("mutator")&&o.modules.mutator.initializeColumn(e),o.modExists("accessor")&&o.modules.accessor.initializeColumn(e),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(e),void 0!==t.visible&&(t.visible?e.show(!0):e.hide(!0)),t.cssClass){t.cssClass.split(" ").forEach(function(t){e.element.classList.add(t)})}t.field&&this.element.setAttribute("tabulator-field",t.field),e.setMinWidth(void 0===t.minWidth?e.table.options.columnMinWidth:parseInt(t.minWidth)),e.reinitializeWidth(),e.tooltip=e.definition.tooltip||!1===e.definition.tooltip?e.definition.tooltip:e.table.options.tooltips,e.hozAlign=void 0===e.definition.hozAlign?e.table.options.cellHozAlign:e.definition.hozAlign,e.vertAlign=void 0===e.definition.vertAlign?e.table.options.cellVertAlign:e.definition.vertAlign},n.prototype._buildColumnHeaderContent=function(){var e=(this.definition,this.table,document.createElement("div"));return e.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),e.appendChild(this.titleElement),e},n.prototype._buildColumnHeaderTitle=function(){var e=this,t=e.definition,o=e.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(e){e.stopPropagation(),n.focus()}),n.addEventListener("change",function(){t.title=n.value,o.options.columnTitleChanged.call(e.table,e.getComponent())}),i.appendChild(n),t.field?o.modules.localize.bind("columns|"+t.field,function(e){n.value=e||t.title||" "}):n.value=t.title||" "}else t.field?o.modules.localize.bind("columns|"+t.field,function(o){e._formatColumnHeaderTitle(i,o||t.title||" ")}):e._formatColumnHeaderTitle(i,t.title||" ");return i},n.prototype._formatColumnHeaderTitle=function(e,t){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(e){r.titleFormatterRendered=e},s={getValue:function(){return t},getElement:function(){return e}},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?e.appendChild(i):(e.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":e.innerHTML="";break;default:e.innerHTML=i}else e.innerHTML=t},n.prototype._buildGroupHeader=function(){var e=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(t){e.element.classList.add(t)})}this.element.appendChild(this.groupElement)},n.prototype._getFlatData=function(e){return e[this.field]},n.prototype._getNestedData=function(e){for(var t,o=e,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(e+1)},n.prototype._nextVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)},n.prototype.prevColumn=function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)},n.prototype._prevVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)},n.prototype.reinitializeWidth=function(e){this.widthFixed=!1,void 0===this.definition.width||e||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 e=this;this.widthFixed||(this.element.style.width="",e.cells.forEach(function(e){e.clearWidth()}));var t=this.element.offsetWidth;e.width&&this.widthFixed||(e.cells.forEach(function(e){var o=e.getWidth();o>t&&(t=o)}),t&&e.setWidthActual(t+1))},n.prototype.updateDefinition=function(e){var t=this;return new Promise(function(o,i){var n;t.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},t.getDefinition()),n=Object.assign(n,e),t.table.columnManager.addColumn(n,!1,t).then(function(e){n.field==t.field&&(t.field=!1),t.delete().then(function(){o(e.getComponent())}).catch(function(e){i(e)})}).catch(function(e){i(e)}))})},n.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},n.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","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","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","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(e){this.table=e,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 e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},s.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},s.prototype.getElement=function(){return this.element},s.prototype.getTableElement=function(){return this.tableElement},s.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},s.prototype.setColumnManager=function(e){this.columnManager=e},s.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t}),"virtual"===this.renderMode&&e.element.addEventListener("scroll",function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t})},s.prototype.findRow=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e))){if(void 0===e||null===e)return!1;return t.rows.find(function(o){return o.data[t.table.options.index]==e})||!1}if(e instanceof r)return e;if(e instanceof a)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.rows.find(function(t){return t.element===e})||!1}return!1},s.prototype.getRowFromDataObject=function(e){return this.rows.find(function(t){return t.data===e})||!1},s.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},s.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),a=e.getElement(),r=0;return new Promise(function(e,l){if(s>-1){if(void 0===t&&(t=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=d.prototype.helpers.elOffset(a).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":t=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&d.prototype.helpers.elVisible(a)&&(r=d.prototype.helpers.elOffset(a).top-d.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(t){var o=t.indexOf(e);o>-1&&t.splice(o,1)}),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,e.getComponent()),this.table.options.dataEdited.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(e,t,o,i){var n=this.addRowActual(e,t,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:e,pos:t,index:o}),n},s.prototype.addRows=function(e,t,o){var i=this,n=this,s=0,a=[];return new Promise(function(r,l){t=i.findAddRowPos(t),Array.isArray(e)||(e=[e]),s=e.length-1,(void 0===o&&t||void 0!==o&&!t)&&e.reverse(),e.forEach(function(e,i){var s=n.addRow(e,t,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(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e},s.prototype.addRowActual=function(e,t,o,i){var n,s,a=e instanceof r?e:new r(e||{},this),l=this.findAddRowPos(t),c=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),l?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],l=!1):s.length&&(o=s[s.length-1],l=!(s.length1&&(!o||o&&-1==u.indexOf(o)?l?u[0]!==a&&(o=u[0],this._moveRowInArray(a.getGroup().rows,a,o,!l)):u[u.length-1]!==a&&(o=u[u.length-1],this._moveRowInArray(a.getGroup().rows,a,o,!l)):this._moveRowInArray(a.getGroup().rows,a,o,!l))}return o&&(c=this.rows.indexOf(o)),o&&c>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(e){var t=e.indexOf(o);t>-1&&e.splice(l?t:t+1,0,a)}),n>-1&&this.activeRows.splice(l?n:n+1,0,a),this.rows.splice(l?c:c+1,0,a)):l?(this.displayRowIterator(function(e){e.unshift(a)}),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator(function(e){e.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.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),a},s.prototype.moveRow=function(e,t,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",e,{posFrom:this.getRowPosition(e),posTo:this.getRowPosition(t),to:t,after:o}),this.moveRowActual(e,t,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,e.getComponent())},s.prototype.moveRowActual=function(e,t,o){var i=this;if(this._moveRowInArray(this.rows,e,t,o),this._moveRowInArray(this.activeRows,e,t,o),this.displayRowIterator(function(n){i._moveRowInArray(n,e,t,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&t instanceof S&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t.getGroup(),s=e.getGroup();n===s?this._moveRowInArray(n.rows,e,t,o):(s&&s.removeRow(e),n.insertRow(e,t,o))}},s.prototype._moveRowInArray=function(e,t,o,i){var n,s,a,r;if(t!==o&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),s=e.indexOf(o),s>-1?i?e.splice(s+1,0,t):e.splice(s,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){a=nn?s:n+1;for(var l=a;l<=r;l++)e[l]&&this.styleRow(e[l],l)}},s.prototype.clearData=function(){this.setData([])},s.prototype.getRowIndex=function(e){return this.findRowIndex(e,this.rows)},s.prototype.getDisplayRowIndex=function(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t},s.prototype.nextDisplayRow=function(e,t){var o=this.getDisplayRowIndex(e),i=!1;return!1!==o&&o-1)&&o},s.prototype.getData=function(e,t){var o=[];return this.getRows(e).forEach(function(e){"row"==e.type&&o.push(e.getData(t||"data"))}),o},s.prototype.getComponents=function(e){var t=[];return this.getRows(e).forEach(function(e){t.push(e.getComponent())}),t},s.prototype.getDataCount=function(e){return this.getRows(e).length},s.prototype._genRemoteRequest=function(){var e=this,t=this.table,o=t.options,i={};if(t.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(e){delete e.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)}t.modules.ajax.sendRequest().then(function(t){e._setDataActual(t,!0)}).catch(function(e){})},s.prototype.filterRefresh=function(){var e=this.table,t=e.options,o=this.scrollLeft;t.ajaxFiltering?"remote"==t.pagination&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):t.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},s.prototype.sorterRefresh=function(e){var t=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(e?"filter":"sort"),this.scrollHorizontal(i)},s.prototype.scrollHorizontal=function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(e),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(e)},s.prototype.refreshActiveData=function(e,t,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(e)=0))break;s=r}else if(t-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(e){this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},s.prototype.getRows=function(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!0);break;default:t=this.rows}return t},s.prototype.reRenderInPosition=function(e){if("virtual"==this.getRenderMode())if(this.redrawBlock)e?e():this.redrawBlockRederInPosition=!0;else{for(var t=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=t-s[a].getElement().offsetTop;if(!(!1===i||Math.abs(r)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(u=!1),i.vDomBottom++,c++}e?(i.vDomTopPad=t?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",t&&(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&&t&&(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(e){var t=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-t>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else e?(t<0&&this._addTopRow(-t),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(t>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(t):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},s.prototype._addTopRow=function(e){var t=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;e>=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--),e=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(e,t+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},s.prototype._removeTopRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,t.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,e=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(e)}},s.prototype._addBottomRow=function(e){var t=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++),e=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(e,t+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},s.prototype._removeBottomRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),t.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,e=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(e)}},s.prototype._quickNormalizeRowHeight=function(e){e.forEach(function(e){e.calcHeight()}),e.forEach(function(e){e.setCellHeight()}),e.length=0},s.prototype.normalizeHeight=function(){this.activeRows.forEach(function(e){e.normalizeHeight()})},s.prototype.adjustTableSize=function(){var e,t=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight: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||t==this.element.clientHeight||((e=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!e)&&this.redraw()}},s.prototype.reinitialize=function(){this.rows.forEach(function(e){e.reinitialize()})},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(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(t)),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 e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))};var a=function(e){this._row=e};a.prototype.getData=function(e){return this._row.getData(e)},a.prototype.getElement=function(){return this._row.getElement()},a.prototype.getCells=function(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e},a.prototype.getCell=function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()},a.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},a.prototype.getPosition=function(e){return this._row.table.rowManager.getRowPosition(this._row,e)},a.prototype.delete=function(){return this._row.delete()},a.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},a.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},a.prototype.move=function(e,t){this._row.moveToRow(e,t)},a.prototype.update=function(e){return this._row.updateData(e)},a.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},a.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)}, -a.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},a.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},a.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},a.prototype._getSelf=function(){return this._row},a.prototype.validate=function(){return this._row.validate()},a.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},a.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},a.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},a.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},a.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},a.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},a.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},a.prototype.addTreeChild=function(e,t,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,e,t,o)},a.prototype.reformat=function(){return this._row.reinitialize()},a.prototype.getGroup=function(){return this._row.getGroup().getComponent()},a.prototype.getTable=function(){return this._row.table},a.prototype.getNextRow=function(){var e=this._row.nextRow();return e?e.getComponent():e},a.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var r=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),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.setData(e),this.generateElement()};r.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},r.prototype.getElement=function(){return this.element},r.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},r.prototype.generateElement=function(){var e,t,o,i=this;!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&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(e){i.table.options.rowClick(e,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(e){i.table.options.rowDblClick(e,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(e){i.table.options.rowContext(e,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(e){i.table.options.rowMouseEnter(e,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(e){i.table.options.rowMouseLeave(e,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(e){i.table.options.rowMouseOver(e,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(e){i.table.options.rowMouseOut(e,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(e){i.table.options.rowMouseMove(e,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null}))},r.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},r.prototype.initialize=function(e){var t=this;if(!t.initialized||e){for(t.deleteCells();t.element.firstChild;)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach(function(e){t.element.appendChild(e.getElement()),e.cellRendered()}),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},r.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},r.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},r.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(e){var o=e.getHeight();o>t&&(t=o)}),this.height=e?Math.max(t,o):this.manualHeight?this.height:Math.max(t,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},r.prototype.setCellHeight=function(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0},r.prototype.clearCellHeight=function(){this.cells.forEach(function(e){e.clearHeight()})},r.prototype.normalizeHeight=function(e){e&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()},r.prototype.setHeight=function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},r.prototype.getHeight=function(){return this.outerHeight},r.prototype.getWidth=function(){return this.element.offsetWidth},r.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},r.prototype.setData=function(e){this.table.modExists("mutator")&&(e=this.table.modules.mutator.transformRow(e,"data")),this.data=e,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},r.prototype.updateData=function(e){var t,o=this,i=d.prototype.helpers.elVisible(this.element),n={};return new Promise(function(s,a){"string"==typeof e&&(e=JSON.parse(e)),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,e),t=o.table.modules.mutator.transformRow(n,"data",e)):t=e;for(var r in t)o.data[r]=t[r];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var r in e){o.table.columnManager.getColumnsByFieldRoot(r).forEach(function(e){var n=o.getCell(e.getField());if(n){var s=e.getFieldValue(t);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}})}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(e)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()})},r.prototype.getData=function(e){var t=this;return e?t.table.modExists("accessor")?t.table.modules.accessor.transformRow(t.data,e):void 0:this.data},r.prototype.getCell=function(e){return e=this.table.columnManager.findColumn(e),this.cells.find(function(t){return t.column===e})},r.prototype.getCellIndex=function(e){return this.cells.findIndex(function(t){return t===e})},r.prototype.findNextEditableCell=function(e){var t=!1;if(e0)for(var o=e-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&d.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){t=i;break}}return t},r.prototype.getCells=function(){return this.cells},r.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},r.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},r.prototype.moveToRow=function(e,t){var o=this.table.rowManager.findRow(e);o?(this.table.rowManager.moveRowActual(this,o,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)},r.prototype.validate=function(){var e=[];return this.cells.forEach(function(t){t.validate()||e.push(t.getComponent())}),!e.length||e},r.prototype.delete=function(){var e=this;return new Promise(function(t,o){var i,n;e.table.options.history&&e.table.modExists("history")&&(e.table.options.groupBy&&e.table.modExists("groupRows")?(n=e.getGroup().rows,(i=n.indexOf(e))&&(i=n[i-1])):(i=e.table.rowManager.getRowIndex(e))&&(i=e.table.rowManager.rows[i-1]),e.table.modules.history.action("rowDelete",e,{data:e.getData(),pos:!i,index:i})),e.deleteActual(),t()})},r.prototype.deleteActual=function(e){this.table.rowManager.getRowIndex(this);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.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!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))},r.prototype.deleteCells=function(){for(var e=this.cells.length,t=0;t-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.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(e)||/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(e.substr(0,4))},d.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},d.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},d.prototype.setDataFromLocalFile=function(e){var t=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=e||".json,application/json",n.addEventListener("change",function(e){var s,a=n.files[0],r=new FileReader;r.readAsText(a),r.onload=function(e){try{s=JSON.parse(r.result)}catch(e){return console.warn("File Load Error - File contents is invalid JSON",e),void i(e)}t._setData(s).then(function(e){o(e)}).catch(function(e){o(e)})},r.onerror=function(e){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},d.prototype.setData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!1,!0)},d.prototype._setData=function(e,t,o,i,n){var s=this;return"string"!=typeof e?e?s.rowManager.setData(e,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==e.indexOf("{")||0==e.indexOf("[")?s.rowManager.setData(JSON.parse(e),i,n):s.modExists("ajax",!0)?(t&&s.modules.ajax.setParams(t),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(e),"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},d.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},d.prototype.getData=function(e){return!0===e&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getData(e)},d.prototype.getDataCount=function(e){return!0===e&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getDataCount(e)},d.prototype.searchRows=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",e,t,o)},d.prototype.searchData=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",e,t,o)},d.prototype.getHtml=function(e,t,o){if(this.modExists("export",!0))return this.modules.export.getHtml(e,t,o)},d.prototype.print=function(e,t,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(e,t,o)},d.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},d.prototype.replaceData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!0)},d.prototype.updateData=function(e){var t=this,o=this,i=0;return new Promise(function(n,s){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);t&&(i++,t.updateData(e).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},d.prototype.addData=function(e,t,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?i.rowManager.addRows(e,t,o).then(function(e){var t=[];e.forEach(function(e){t.push(e.getComponent())}),n(t)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},d.prototype.updateOrAddData=function(e){var t=this,o=this,i=[],n=0;return new Promise(function(s,a){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);n++,t?t.updateData(e).then(function(){n--,i.push(t.getComponent()),n||s(i)}):o.rowManager.addRows(e).then(function(e){n--,i.push(e[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))})},d.prototype.getRow=function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},d.prototype.getRowFromPosition=function(e,t){var o=this.rowManager.getRowFromPosition(e,t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},d.prototype.deleteRow=function(e){var t=this;return new Promise(function(o,i){function n(){++a==e.length&&r&&(s.rowManager.reRenderInPosition(),o())}var s=t,a=0,r=0,l=[];Array.isArray(e)||(e=[e]),e.forEach(function(e){var o=t.rowManager.findRow(e,!0);o?l.push(o):(console.warn("Delete Error - No matching row found:",e),i("Delete Error - No matching row found"),n())}),l.sort(function(e,o){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(o)?1:-1}),l.forEach(function(e){e.delete().then(function(){r++,n()}).catch(function(e){n(),i(e)})})})},d.prototype.addRow=function(e,t,o){var i=this;return new Promise(function(n,s){"string"==typeof e&&(e=JSON.parse(e)),i.rowManager.addRows(e,t,o).then(function(e){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(e[0].getComponent())})})},d.prototype.updateOrAddRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(e){n(e)}):s=o.rowManager.addRows(t).then(function(e){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(e[0].getComponent())}).catch(function(e){n(e)})})},d.prototype.updateRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){i(s.getComponent())}).catch(function(e){n(e)}):(console.warn("Update Error - No matching row found:",e),n("Update Error - No matching row found"))})},d.prototype.scrollToRow=function(e,t,o){var i=this;return new Promise(function(n,s){var a=i.rowManager.findRow(e);a?i.rowManager.scrollToRow(a,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching row found:",e),s("Scroll Error - No matching row found"))})},d.prototype.moveRow=function(e,t,o){var i=this.rowManager.findRow(e);i?i.moveToRow(t,o):console.warn("Move Error - No matching row found:",e)},d.prototype.getRows=function(e){return!0===e&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getComponents(e)},d.prototype.getRowPosition=function(e,t){var o=this.rowManager.findRow(e);return o?this.rowManager.getRowPosition(o,t):(console.warn("Position Error - No matching row found:",e),!1)},d.prototype.copyToClipboard=function(e){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(e)},d.prototype.setColumns=function(e){this.columnManager.setColumns(e)},d.prototype.getColumns=function(e){return this.columnManager.getComponents(e)},d.prototype.getColumn=function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)},d.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},d.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},d.prototype.setColumnLayout=function(e){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,e)),!0)},d.prototype.showColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},d.prototype.hideColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},d.prototype.toggleColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()},d.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var a=i.columnManager.findColumn(o);i.columnManager.addColumn(e,t,a).then(function(e){n(e.getComponent())}).catch(function(e){s(e)})})},d.prototype.deleteColumn=function(e){var t=this;return new Promise(function(o,i){var n=t.columnManager.findColumn(e);n?n.delete().then(function(){o()}).catch(function(e){i(e)}):(console.warn("Column Delete Error - No matching column found:",e),i())})},d.prototype.updateColumnDefinition=function(e,t){var o=this;return new Promise(function(i,n){var s=o.columnManager.findColumn(e);s?s.updateDefinition(t).then(function(e){i(e)}).catch(function(e){n(e)}):(console.warn("Column Update Error - No matching column found:",e),n())})},d.prototype.moveColumn=function(e,t,o){var i=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);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:",e)},d.prototype.scrollToColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var a=i.columnManager.findColumn(e);a?i.columnManager.scrollToColumn(a,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching column found:",e),s("Scroll Error - No matching column found"))})},d.prototype.setLocale=function(e){this.modules.localize.setLocale(e)},d.prototype.getLocale=function(){return this.modules.localize.getLocale()},d.prototype.getLang=function(e){return this.modules.localize.getLang(e)},d.prototype.redraw=function(e){this.columnManager.redraw(e),this.rowManager.redraw(e)},d.prototype.setHeight=function(e){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(e)?e:e+"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")},d.prototype.setSort=function(e,t){this.modExists("sort",!0)&&(this.modules.sort.setSort(e,t),this.rowManager.sorterRefresh())},d.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},d.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},d.prototype.setFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(e,t,o,i),this.rowManager.filterRefresh())},d.prototype.addFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(e,t,o,i),this.rowManager.filterRefresh())},d.prototype.getFilters=function(e){if(this.modExists("filter",!0))return this.modules.filter.getFilters(e)},d.prototype.setHeaderFilterFocus=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterFocus(t)}},d.prototype.getHeaderFilterValue=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(t)return this.modules.filter.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},d.prototype.setHeaderFilterValue=function(e,t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(e);if(!o)return console.warn("Column Filter Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterValue(o,t)}},d.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},d.prototype.removeFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(e,t,o),this.rowManager.filterRefresh())},d.prototype.clearFilter=function(e){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(e),this.rowManager.filterRefresh())},d.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},d.prototype.selectRow=function(e){this.modExists("selectRow",!0)&&(!0===e&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),e="active"),this.modules.selectRow.selectRows(e))},d.prototype.deselectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(e)},d.prototype.toggleSelectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(e)},d.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},d.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},d.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},d.prototype.clearCellValidation=function(e){var t=this;this.modExists("validate",!0)&&(e||(e=this.modules.validate.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach(function(e){t.modules.validate.clearValidation(e._getSelf())}))},d.prototype.validate=function(e){var t=[];return this.rowManager.rows.forEach(function(e){var o=e.validate();!0!==o&&(t=t.concat(o))}),!t.length||t},d.prototype.setMaxPage=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(e)},d.prototype.setPage=function(e){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(e):new Promise(function(e,t){t()})},d.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){t.options.pagination&&t.modExists("page")?(e=t.rowManager.findRow(e),e?t.modules.page.setPageToRow(e).then(function(){o()}).catch(function(){i()}):i()):i()})},d.prototype.setPageSize=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(e),this.modules.page.setPage(1).then(function(){}).catch(function(){})},d.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},d.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},d.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},d.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},d.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},d.prototype.setGroupBy=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=e,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")},d.prototype.setGroupStartOpen=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=e,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")},d.prototype.setGroupHeader=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=e,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")},d.prototype.getGroups=function(e){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},d.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},d.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},d.prototype.clearCellEdited=function(e){var t=this;this.modExists("edit",!0)&&(e||(e=this.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach(function(e){t.modules.edit.clearEdited(e._getSelf())}))},d.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},d.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},d.prototype.navigatePrev=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().prev()},d.prototype.navigateNext=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().next()},d.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},d.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},d.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},d.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},d.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},d.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},d.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},d.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},d.prototype.download=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i)},d.prototype.downloadToTab=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i,!0)},d.prototype.tableComms=function(e,t,o,i){this.modules.comms.receive(e,t,o,i)},d.prototype.moduleBindings={},d.prototype.extendModule=function(e,t,o){if(d.prototype.moduleBindings[e]){var i=d.prototype.moduleBindings[e].prototype[t];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:",t)}else console.warn("Module Error - module does not exist:",e)},d.prototype.registerModule=function(e,t){d.prototype.moduleBindings[e]=t},d.prototype.bindModules=function(){this.modules={};for(var e in d.prototype.moduleBindings)this.modules[e]=new d.prototype.moduleBindings[e](this)},d.prototype.modExists=function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)},d.prototype.helpers={elVisible:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)},elOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(e){var t=Array.isArray(e)?[]:{};for(var o in e)null!=e[o]&&"object"===_typeof(e[o])?e[o]instanceof Date?t[o]=new Date(e[o]):t[o]=this.deepClone(e[o]):t[o]=e[o];return t}},d.prototype.comms={tables:[],register:function(e){d.prototype.comms.tables.push(e)},deregister:function(e){var t=d.prototype.comms.tables.indexOf(e);t>-1&&d.prototype.comms.tables.splice(t,1)},lookupTable:function(e,t){var o,i,n=[];if("string"==typeof e){if(o=document.querySelectorAll(e),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(e){function t(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function o(e,i,n,s){function a(e){return n*(e.column.definition.widthGrow||1)}function r(e){return t(e.width)-n*(e.column.definition.widthShrink||0)}var l=[],c=0,u=0,d=0,h=0,p=0,m=[];return e.forEach(function(e,t){var o=s?r(e):a(e);e.column.minWidth>=o?l.push(e):(m.push(e),p+=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)}),l.length?(l.forEach(function(e){c+=s?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth}),u=i-c,d=p?Math.floor(u/p):u,h=u-d*p,h+=o(m,u,d,s)):(h=p?i-Math.floor(i/p)*p:i,m.forEach(function(e){e.width=s?r(e):a(e)})),h}var i=this,n=i.table.element.clientWidth,s=0,a=0,r=0,l=0,c=[],u=[],d=0,h=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach(function(e){var o,i,n;e.visible&&(o=e.definition.width,i=parseInt(e.minWidth),o?(n=t(o),s+=n>i?n:i,e.definition.widthShrink&&(u.push({column:e,width:n>i?n:i}),d+=e.definition.widthShrink)):(c.push({column:e,width:0}),r+=e.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(e){a-=e.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(e){e.column.setWidth(e.width)}),u.forEach(function(e){e.column.setWidth(e.width)})}},d.prototype.registerModule("layout",h);var p=function(e){this.table=e,this.locale="default",this.lang=!1,this.bindings={}};p.prototype.setHeaderFilterPlaceholder=function(e){this.langs.default.headerFilters.default=e},p.prototype.setHeaderFilterColumnPlaceholder=function(e,t){this.langs.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)},p.prototype.installLang=function(e,t){this.langs[e]?this._setLangProp(this.langs[e],t):this.langs[e]=t},p.prototype._setLangProp=function(e,t){for(var o in t)e[o]&&"object"==_typeof(e[o])?this._setLangProp(e[o],t[o]):e[o]=t[o]},p.prototype.setLocale=function(e){function t(e,o){for(var i in e)"object"==_typeof(e[i])?(o[i]||(o[i]={}),t(e[i],o[i])):o[i]=e[i]}var o=this;if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!o.langs[e]){var i=e.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}o.locale=e,o.lang=d.prototype.helpers.deepClone(o.langs.default||{}),"default"!=e&&t(o.langs[e],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},p.prototype.getLocale=function(e){return self.locale},p.prototype.getLang=function(e){return e?this.langs[e]:this.lang},p.prototype.getText=function(e,t){var e=t?e+"|"+t:e,o=e.split("|");return this._getLangElement(o,this.locale)||""},p.prototype._getLangElement=function(e,t){var o=this,i=o.lang;return e.forEach(function(e){var t;i&&(t=i[e],i=void 0!==t&&t)}),i},p.prototype.bind=function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)},p.prototype._executeBindings=function(){var e=this;for(var t in e.bindings)!function(t){e.bindings[t].forEach(function(o){o(e.getText(t),e.lang)})}(t)},p.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:{}}}},d.prototype.registerModule("localize",p);var m=function(e){this.table=e};m.prototype.getConnections=function(e){var t,o=this,i=[];return t=d.prototype.comms.lookupTable(e),t.forEach(function(e){o.table!==e&&i.push(e)}),i},m.prototype.send=function(e,t,o,i){var n=this,s=this.getConnections(e);s.forEach(function(e){e.tableComms(n.table.element,t,o,i)}),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)},m.prototype.receive=function(e,t,o,i){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,o,i);console.warn("Inter-table Comms Error - no such module:",t)},d.prototype.registerModule("comms",m);var f=function(e){this.table=e,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};f.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,a="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[a]&&(s=t.lookupAccessor(e.definition[a]))&&(o=!0,i[a]={accessor:s,params:e.definition[a+"Params"]||{}})}),o&&(e.modules.accessor=i)},f.prototype.lookupAccessor=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.accessors[e]?t=this.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t},f.prototype.transformRow=function(e,t){var o=this,i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=d.prototype.helpers.deepClone(e||{});return o.table.columnManager.traverse(function(e){var o,s,a,r;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(o=e.getFieldValue(n))&&(r=e.getComponent(),a="function"==typeof s.params?s.params(o,n,t,r):s.params,e.setFieldValue(n,s.accessor(o,n,t,a,r)))}),n},f.prototype.accessors={},d.prototype.registerModule("accessor",f);var g=function(e){this.table=e,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};g.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.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?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.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"))},g.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},g.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},g.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},g.prototype.getParams=function(){return this.params||{}},g.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},g.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},g.prototype.setUrl=function(e){this.url=e},g.prototype.getUrl=function(){return this.url},g.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},g.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ei||null===i)&&(i=e)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(e,t,o){var i=null,n=void 0!==o.precision&&o.precision;return e.forEach(function(e){((e=Number(e))"),o.dataTreeExpandElement?"string"==typeof o.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=o.dataTreeExpandElement,this.expandEl=e.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(e,t){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return o.dataTreeStartExpanded[t]}}},y.prototype.initializeRow=function(e){var t=e.getData()[this.field],o=Array.isArray(t),i=o||!o&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!i&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!i&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!i&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:i}},y.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],o=t.getElement(),i=e.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(e,o),e.element.classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},y.prototype.generateControlElement=function(e,t){var o=this,i=e.modules.dataTree,t=t||e.getCells()[0].getElement(),n=i.controlEl;!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.expandRow(e)})),i.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))},y.prototype.setDisplayIndex=function(e){this.displayIndex=e},y.prototype.getDisplayIndex=function(){return this.displayIndex},y.prototype.getRows=function(e){var t=this,o=[];return e.forEach(function(e,i){var n,s;o.push(e),e instanceof r&&(n=e.modules.dataTree.children,n.index||!1===n.children||(s=t.getChildren(e),s.forEach(function(e){o.push(e)})))}),o},y.prototype.getChildren=function(e){var t=this,o=e.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach(function(e){n.push(e),t.getChildren(e).forEach(function(e){n.push(e)})})),n},y.prototype.generateChildren=function(e){var t=this,o=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var n=new r(i||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)}),o},y.prototype.expandRow=function(e,t){var o=e.modules.dataTree -;!1!==o.children&&(o.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},y.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},y.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},y.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},y.prototype.getFilteredTreeChildren=function(e){var t,o=e.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,t.forEach(function(e){e instanceof r&&i.push(e)})),i},y.prototype.rowDelete=function(e){var t,o=e.modules.dataTree.parent;o&&(t=this.findChildIndex(e,o),!1!==t&&o.data[this.field].splice(t,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)},y.prototype.addTreeChildRow=function(e,t,o,i){var n=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==i&&!1!==(n=this.findChildIndex(i,e))&&e.data[this.field].splice(o?n:n+1,0,t),!1===n&&(o?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)},y.prototype.findChildIndex=function(e,t){var o=this,i=!1;return"object"==(void 0===e?"undefined":_typeof(e))?e instanceof r?i=e.data:e instanceof a?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find(function(t){return t instanceof r&&t.element===e}))&&(i=i.data):i=void 0!==e&&null!==e&&t.data[this.field].find(function(t){return t.data[o.table.options.index]==e}),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i},y.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,o=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof r&&o.push(e.getComponent())})),o},y.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},y.prototype.getChildField=function(){return this.field},y.prototype.redrawNeeded=function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]},d.prototype.registerModule("dataTree",y);var w=function(e){this.table=e};w.prototype.download=function(e,t,o,i,n){function s(o,i){n?!0===n?a.triggerDownload(o,i,e,t,!0):n(o):a.triggerDownload(o,i,e,t)}var a=this,r=!1;if("function"==typeof e?r=e:a.downloaders[e]?r=a.downloaders[e]:console.warn("Download Error - No such download type found: ",e),r){var l=this.generateExportList(i);r.call(this.table,l,o||{},s)}},w.prototype.generateExportList=function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),o=this.table.options.groupHeaderDownload;return o&&!Array.isArray(o)&&(o=[o]),t.forEach(function(e){var t;"group"===e.type&&(t=e.columns[0],o&&o[e.indent]&&(t.value=o[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))}),t},w.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),a=new Blob([e],{type:t}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(a=this.table.options.downloadReady.call(this.table,e,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())},w.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept)}},w.prototype.downloaders={csv:function(e,t,o){var i=t&&t.delimiter?t.delimiter:",",n=[],s=[];e.forEach(function(e){var t=[];switch(e.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":e.columns.forEach(function(e,t){e&&1===e.depth&&(s[t]=void 0===e.value||"null"==typeof e.value?"":e.value)});break;case"row":e.columns.forEach(function(e){if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}}),n.push(t.join(i))}}),s.length&&(n=[s].concat(n)),n=n.join("\n"),t.bom&&(n="\ufeff"+n),o(n,"text/csv")},json:function(e,t,o){var i=[];e.forEach(function(e){var t={};switch(e.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":e.columns.forEach(function(e){e&&(t[e.component.getField()]=e.value)}),i.push(t)}}),i=JSON.stringify(i,null,"\t"),o(i,"application/json")},pdf:function(e,t,o){function i(e,t){var o=[];return e.columns.forEach(function(e){var i;if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}i={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(i.styles=t),o.push(i)}else o.push("")}),o}var n=[],s=[],a={},r=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=t.jsPDF||{},u=t&&t.title?t.title:"";c.orientation||(c.orientation=t.orientation||"landscape"),c.unit||(c.unit="pt"),e.forEach(function(e){switch(e.type){case"header":n.push(i(e));break;case"group":s.push(i(e,r));break;case"calc":s.push(i(e,l));break;case"row":s.push(i(e))}});var d=new jsPDF(c);t&&t.autoTable&&(a="function"==typeof t.autoTable?t.autoTable(d)||{}:t.autoTable),u&&(a.addPageContent=function(e){d.text(u,40,30)}),a.head=n,a.body=s,d.autoTable(a),t&&t.documentProcessing&&t.documentProcessing(d),o(d.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,o){function i(){var t=[],o=[],i={},n={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce(function(e,t){return e+(t&&t.width?t.width:1)},0):0,r:e.length}};return e.forEach(function(e,i){var n=[];e.columns.forEach(function(e,t){e?(n.push(e.value instanceof Date||"object"!==_typeof(e.value)?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&o.push({s:{r:i,c:t},e:{r:i+e.height-1,c:t+e.width-1}})):n.push("")}),t.push(n)}),XLSX.utils.sheet_add_aoa(i,t),i["!ref"]=XLSX.utils.encode_range(n),o.length&&(i["!merges"]=o),i}var n,s=this,a=t.sheetName||"Sheet1",r=XLSX.utils.book_new();if(r.SheetNames=[],r.Sheets={},t.sheetOnly)return void o(i());if(t.sheets)for(var l in t.sheets)!0===t.sheets[l]?(r.SheetNames.push(l),r.Sheets[l]=i()):(r.SheetNames.push(l),this.table.modules.comms.send(t.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:s.active,intercept:function(e){r.Sheets[l]=e}}));else r.SheetNames.push(a),r.Sheets[a]=i();t.documentProcessing&&(r=t.documentProcessing(r)),n=XLSX.write(r,{bookType:"xlsx",bookSST:!0,type:"binary"}),o(function(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i!=e.length;++i)o[i]=255&e.charCodeAt(i);return t}(n),"application/octet-stream")},html:function(e,t,o){this.modExists("export",!0)&&o(this.modules.export.genereateHTMLTable(e),"text/html")}},d.prototype.registerModule("download",w);var E=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};E.prototype.initializeColumn=function(e){var t=this,o={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?o.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":o.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?o.editor=t.editors[e.definition.formatter]:o.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}o.editor&&(e.modules.edit=o)},E.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},E.prototype.clearEditor=function(e){var t,o=this.currentCell;if(this.invalidEdit=!1,o){for(this.currentCell=!1,t=o.getElement(),e?o.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}},E.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},E.prototype.bindEditor=function(e){var t=this,o=e.getElement();o.setAttribute("tabindex",0),o.addEventListener("click",function(e){o.classList.contains("tabulator-editing")||o.focus({preventScroll:!0})}),o.addEventListener("mousedown",function(e){t.mouseClick=!0}),o.addEventListener("focus",function(o){t.recursionBlock||t.edit(e,o,!1)})},E.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},E.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},E.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,o=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=e.row.getElement();i.offsetTop;i.offsetTopo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o)}},E.prototype.edit=function(e,t,o){function i(t){if(c.currentCell===e){var o=!0;return e.column.modules.validate&&c.table.modExists("validate")&&"manual"!=c.table.options.validationMode&&(o=c.table.modules.validate.validate(e.column.modules.validate,e,t)),!0===o||"highlight"===c.table.options.validationMode?(c.clearEditor(),e.setValue(t,!0),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==c.editedCells.indexOf(e)&&c.editedCells.push(e),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e),!0===o||(h.classList.add("tabulator-validation-fail"),!1)):(c.invalidEdit=!0,h.classList.add("tabulator-validation-fail"),c.focusCellNoEvent(e,!0),d(),c.table.options.validationFailed.call(c.table,e.getComponent(),t,o),!1)}}function n(){c.currentCell===e&&(c.cancelEdit(),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e))}function s(e){d=e}var a,r,l,c=this,u=!0,d=function(){},h=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":u=e.column.modules.edit.check(e.getComponent());break;case"boolean":u=e.column.modules.edit.check}if(u||o){if(c.cancelEdit(),c.currentCell=e,this.focusScrollAdjust(e),r=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,r)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,r),c.table.options.cellEditing.call(this.table,r),l="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(r):e.column.modules.edit.params,!1===(a=e.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"),e.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 t.preventDefault(),t.stopPropagation(),r=!1,!1;switch(i[o]){case n:if(l.toUpperCase()==l.toLowerCase())return t.preventDefault(),t.stopPropagation(),r=!1,!1;break;case s:if(isNaN(l))return t.preventDefault(),t.stopPropagation(),r=!1,!1;break;case a:break;default:if(l!==i[o])return t.preventDefault(),t.stopPropagation(),r=!1,!1}r=!0}}),e.addEventListener("keyup",function(i){i.keyCode>46&&t.maskAutoFill&&o(e.value.length)}),e.placeholder||(e.placeholder=i),t.maskAutoFill&&o(e.value.length)},E.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach(function(t){e.push(t.getComponent())}),e},E.prototype.clearEdited=function(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1))},E.prototype.editors={input:function(e,t,o,i,n){function s(e){(null===a||void 0===a)&&""!==r.value||r.value!==a?o(r.value)&&(a=r.value):i()}var a=e.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:"",t(function(){r.focus({preventScroll:!0}),r.style.height="100%"}),r.addEventListener("change",s),r.addEventListener("blur",s),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s(e);break;case 27:i()}}),n.mask&&this.table.modules.edit.maskInput(r,n),r},textarea:function(e,t,o,i,n){function s(t){(null===a||void 0===a)&&""!==c.value||c.value!==a?(o(c.value)&&(a=c.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):i()}var a=e.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,t(function(){c.focus({preventScroll:!0}),c.style.height="100%"}),c.addEventListener("change",s),c.addEventListener("blur",s),c.addEventListener("keyup",function(){c.style.height="";var t=c.scrollHeight;c.style.height=t+"px",t!=u&&(u=t,e.getRow().normalizeHeight())}),c.addEventListener("keydown",function(e){switch(e.keyCode){case 27:i();break;case 38:("editor"==r||"hybrid"==r&&c.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&c.selectionStart!==c.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(c,n),c},number:function(e,t,o,i,n){function s(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==a?o(e)&&(a=e):i()}var a=e.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(e){s()};return t(function(){l.removeEventListener("blur",u),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",u)}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s();break;case 27:i();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(l,n),l},range:function(e,t,o,i,n){function s(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=a?o(e)&&(a=e):i()}var a=e.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,t(function(){r.focus({preventScroll:!0}),r.style.height="100%"}),r.addEventListener("blur",function(e){s()}),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:s();break;case 27:i()}}),r},select:function(e,t,o,i,n){function s(t){var o,i={},s=w.table.getData();return o=t?w.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),o?(s.forEach(function(e){var t=o.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(i[t]=!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 select lookup list:",t),i}function a(t,o){function i(e){var e={label:n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,value:e.value,element:!1};return o.indexOf(e.value)>-1&&c(e),s.push(e),a.push(e),e}var s=[],a=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,element:!1},a.push(t),e.options.forEach(function(e){i(e)})):i(e):(t={label:n.listItemFormatter?n.listItemFormatter(e,e):e,value:e,element:!1},o.indexOf(t.value)>-1&&c(t),s.push(t),a.push(t))});else for(var l in t){var u={label:n.listItemFormatter?n.listItemFormatter(l,t[l]):t[l],value:l,element:!1};o.indexOf(u.value)>-1&&c(u),s.push(u),a.push(u)}D=s,S=a,r()}function r(){for(;L.firstChild;)L.removeChild(L.firstChild);S.forEach(function(e){var t=e.element;t||(e.group?(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-group"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label):(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-item"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label,t.addEventListener("click",function(){T?(h(e),M.focus()):p(e)}),H.indexOf(e)>-1&&(console.log("current",k),t.classList.add("active"))),t.addEventListener("mousedown",function(){z=!1,setTimeout(function(){z=!0},10)}),e.element=t),L.appendChild(t)})}function l(e,t){!T&&k&&k.element&&k.element.classList.remove("active"),k&&k.element&&k.element.classList.remove("focused"),k=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function c(e){-1==H.indexOf(e)&&(H.push(e),l(e,!0)),f()}function u(e){var t=H[e];e>-1&&(H.splice(e,1),t.element&&t.element.classList.remove("active"))}function h(e){e||(e=k);var t=H.indexOf(e);t>-1?u(t):(!0!==T&&H.length>=T&&u(0),c(e)),f()}function p(e){v(),e||(e=k),e&&o(e.value)}function m(){v();var e=[];H.forEach(function(t){e.push(t.value)}),o(e)}function f(){var e=[];H.forEach(function(t){e.push(t.label)}),M.value=e.join(", ")}function g(){v(),i()}function b(){if(!L.parentNode){!0===n.values?a(s(),R):"string"==typeof n.values?a(s(n.values),R):a(n.values||[],R);var e=d.prototype.helpers.elOffset(E);L.style.minWidth=E.offsetWidth+"px",L.style.top=e.top+E.offsetHeight+"px",L.style.left=e.left+"px",L.addEventListener("mousedown",function(e){z=!1,setTimeout(function(){z=!0},10)}),document.body.appendChild(L)}}function v(){L.parentNode&&L.parentNode.removeChild(L),y()}function y(){w.table.rowManager.element.removeEventListener("scroll",g)}var w=this,E=e.getElement(),C=e.getValue(),x=n.verticalNavigation||"editor",R=void 0!==C||null===C?C:void 0!==n.defaultValue?n.defaultValue:[],M=document.createElement("input"),L=document.createElement("div"),T=n.multiselect,D=[],k={},S=[],H=[],z=!0;if(this.table.rowManager.element.addEventListener("scroll",g),(Array.isArray(n)||!Array.isArray(n)&&"object"===(void 0===n?"undefined":_typeof(n))&&!n.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),n={values:n}),M.setAttribute("type","text"),M.style.padding="4px",M.style.width="100%",M.style.boxSizing="border-box",M.style.cursor="default",M.readOnly=0!=this.currentCell,n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var A in n.elementAttributes)"+"==A.charAt(0)?(A=A.slice(1),M.setAttribute(A,M.getAttribute(A)+n.elementAttributes["+"+A])):M.setAttribute(A,n.elementAttributes[A]);return M.value=void 0!==C||null===C?C:"",M.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=D.indexOf(k),("editor"==x||"hybrid"==x&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&l(D[t-1],!T));break;case 40:t=D.indexOf(k),("editor"==x||"hybrid"==x&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&s.push(t)}),h(s,t))}function l(e){var t=document.createElement("div");u(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,L.appendChild(t))}function c(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var o={};"object"===(void 0===e?"undefined":_typeof(e))?(o.title=n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,o.value=e.value):(o.title=n.listItemFormatter?n.listItemFormatter(e,e):e,o.value=e),t.push(o)});else for(var o in e){var i={title:n.listItemFormatter?n.listItemFormatter(o,e[o]):e[o],value:o};t.push(i)}return t}function u(){for(;L.firstChild;)L.removeChild(L.firstChild)}function h(e,t){e.length?p(e,t):n.emptyPlaceholder&&l(n.emptyPlaceholder)}function p(e,t){var o=!1;u(),T=e,T.forEach(function(e){var i=e.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=e.title,i.addEventListener("click",function(t){g(e),m()}),i.addEventListener("mousedown",function(e){k=!1,setTimeout(function(){k=!0},10)}),e.element=i,t&&e.value==C&&(M.value=e.title,e.element.classList.add("active"),o=!0),e===D&&(e.element.classList.add("active"),o=!0)),L.appendChild(i)}),o||g(!1)}function m(){b(),D?C!==D.value?(C=D.value,M.value=D.title,o(D.value)):i():n.freetext?(C=M.value,o(M.value)):n.allowEmpty&&""===M.value?(C=M.value,o(M.value)):i()}function f(){if(!L.parentNode){for(;L.firstChild;)L.removeChild(L.firstChild);var e=d.prototype.helpers.elOffset(E);L.style.minWidth=E.offsetWidth+"px",L.style.top=e.top+E.offsetHeight+"px",L.style.left=e.left+"px",document.body.appendChild(L)}}function g(e,t){D&&D.element&&D.element.classList.remove("active"),D=e,e&&e.element&&e.element.classList.add("active")}function b(){L.parentNode&&L.parentNode.removeChild(L),y()}function v(){b(),i()}function y(){w.table.rowManager.element.removeEventListener("scroll",v)}var w=this,E=e.getElement(),C=e.getValue(),x=n.verticalNavigation||"editor",R=void 0!==C||null===C?C:void 0!==n.defaultValue?n.defaultValue:"",M=document.createElement("input"),L=document.createElement("div"),T=[],D=!1,k=!0,S=!1;if(this.table.rowManager.element.addEventListener("scroll",v),M.setAttribute("type","search"),M.style.padding="4px",M.style.width="100%",M.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var H in n.elementAttributes)"+"==H.charAt(0)?(H=H.slice(1),M.setAttribute(H,M.getAttribute(H)+n.elementAttributes["+"+H])):M.setAttribute(H,n.elementAttributes[H]);return L.classList.add("tabulator-edit-select-list"),L.addEventListener("mousedown",function(e){k=!1,setTimeout(function(){k=!0},10)}),M.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=T.indexOf(D),("editor"==x||"hybrid"==x&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),g(t>0?T[t-1]:!1));break;case 40:t=T.indexOf(D),("editor"==x||"hybrid"==x&&t'):("ie"==r.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function a(e){c=e,s(e)}var r=this,l=e.getElement(),c=e.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(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),s(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e)}),t.appendChild(i),p.appendChild(t)}(g);return c=Math.min(parseInt(c),u),s(c),p.addEventListener("mousemove",function(e){s(0)}),p.addEventListener("click",function(e){o(0)}),l.addEventListener("blur",function(e){i()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:a(c+1);break;case 37:a(c-1);break;case 13:o(c);break;case 27:i()}}),p},progress:function(e,t,o,i,n){function s(){var e=d*Math.round(m.offsetWidth/(l.clientWidth/100))+u;o(e),l.setAttribute("aria-valuenow",e),l.setAttribute("aria-label",h)}var a,r,l=e.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=e.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(e){a=e.screenX,r=m.offsetWidth}), -p.addEventListener("mouseover",function(){p.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(e){a&&(m.style.width=r+e.screenX-a+"px")}),l.addEventListener("mouseup",function(e){a&&(e.stopPropagation(),e.stopImmediatePropagation(),a=!1,r=!1,s())}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+l.clientWidth/100+"px";break;case 37:e.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(e,t,o,i,n){function s(e){return l?e?u?c:r.checked:r.checked&&!u?(r.checked=!1,r.indeterminate=!0,u=!0,c):(u=!1,r.checked):r.checked}var a=e.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&&t(function(){r.focus({preventScroll:!0})}),r.checked=!0===a||"true"===a||"True"===a||1===a,r.addEventListener("change",function(e){o(s())}),r.addEventListener("blur",function(e){o(s(!0))}),r.addEventListener("keydown",function(e){13==e.keyCode&&o(s()),27==e.keyCode&&i()}),r}},d.prototype.registerModule("edit",E);var C=function(e,t,o,i){this.type=e,this.columns=t,this.component=o||!1,this.indent=i||0},x=function(e,t,o,i,n){this.value=e,this.component=t||!1,this.width=o,this.height=i,this.depth=n},R=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};R.prototype.generateExportList=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],s=this.bodyToExportRows(this.rowLookup(o));return n.concat(s)},R.prototype.genereateTable=function(e,t,o,i){var n=this.generateExportList(e,t,o,i);return this.genereateTableElement(n)},R.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach(function(e){(e=t.table.rowManager.findRow(e))&&o.push(e)});else switch(e){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.rowManager.getDisplayRows()}return Object.assign([],o)},R.prototype.generateColumnGroupHeaders=function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var i=e.processColumnGroup(o);i&&t.push(i)}),t},R.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n=e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,s={title:n,column:e,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach(function(e){var o=t.processColumnGroup(e);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(e))return!1;s.width=1}return s},R.prototype.columnVisCheck=function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])},R.prototype.headersToExportRows=function(e){function t(e,n){var s=i-n;if(void 0===o[n]&&(o[n]=[]),e.height=e.subGroups?1:s-e.depth+1,o[n].push(e),e.height>1)for(var a=1;a1)for(var r=1;ri&&(i=e.depth)}),e.forEach(function(e){t(e,0)}),o.forEach(function(e){var t=[];e.forEach(function(e){e?t.push(new x(e.title,e.column.getComponent(),e.width,e.height,e.depth)):t.push(null)}),n.push(new C("header",t))}),n},R.prototype.bodyToExportRows=function(e){var t=this,o=[],i=[];return this.table.columnManager.columnsByIndex.forEach(function(e){t.columnVisCheck(e)&&o.push(e.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter(function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}),e.forEach(function(e,n){var s=e.getData(t.colVisProp),a=[],r=0;switch(e.type){case"group":r=e.level,a.push(new x(e.key,e.getComponent(),o.length,1));break;case"calc":case"row":o.forEach(function(e){a.push(new x(e._column.getFieldValue(s),e,1,1))}),t.table.options.dataTree&&!1!==t.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new C(e.type,a,e.getComponent(),r))}),i},R.prototype.genereateTableElement=function(e){var t=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"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(function(e,o){switch(e.type){case"header":i.appendChild(t.genereateHeaderElement(e,r,s));break;case"group":n.appendChild(t.genereateGroupElement(e,r,s));break;case"calc":n.appendChild(t.genereateCalcElement(e,r,s));break;case"row":var a=t.genereateRowElement(e,r,s);t.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},R.prototype.lookupTableStyles=function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e},R.prototype.genereateHeaderElement=function(e,t,o){var i=this,n=document.createElement("tr");return e.columns.forEach(function(e){if(e){var t=document.createElement("th"),o=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,i.cloneTableStyle&&(t.style.boxSizing="border-box"),o.forEach(function(e){t.classList.add(e)}),i.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),i.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?i.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&i.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),n.appendChild(t)}}),n},R.prototype.genereateGroupElement=function(e,t,o){var i=document.createElement("tr"),n=document.createElement("td"),s=e.columns[0];return i.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?s.value=t.groupHeader[e.indent](s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?s.value=s.value:s.value=e.component._group.generator(s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),n.colSpan=s.width,n.innerHTML=s.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+e.indent),s.component.getVisibility()&&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},R.prototype.genereateCalcElement=function(e,t,o){var i=this.genereateRowElement(e,t,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},R.prototype.genereateRowElement=function(e,t,o){var n=this,s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.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 rowData},getRow:function(){return e.getComponent()},getComponent:function(){return u},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach(function(e){r.classList.add(e)}),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}if(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&&(t.treeElementField&&t.treeElementField==l.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&r.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),r.firstChild),e.component._row.modules.dataTree.branchEl&&r.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),r.firstChild)),s.appendChild(r),u.modules.format&&u.modules.format.renderedCallback&&u.modules.format.renderedCallback(),t.rowFormatter&&!1!==n.config.formatCells){var d=e.getComponent();d.getElement=function(){return s},t.rowFormatter(d)}}}),s},R.prototype.genereateHTMLTable=function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML},R.prototype.getHtml=function(e,t,o,i){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,t,e,i||"htmlOutput");return this.genereateHTMLTable(n)},R.prototype.mapElementStyles=function(e,t,o){if(this.cloneTableStyle&&e&&t){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(e);o.forEach(function(e){t.style[i[e]]=n.getPropertyValue(e)})}}},d.prototype.registerModule("export",R);var M=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};M.prototype.initializeColumn=function(e,t){function o(t){var o,a="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",l="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete n.headerFilters[s];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":n.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(o){var i=e.definition.headerFilterFuncParams||{},s=e.getFieldValue(o);return i="function"==typeof i?i(t,s,o):i,n.filters[e.definition.headerFilterFunc](t,s,o,i)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":o=function(o){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(o);return i="function"==typeof i?i(t,n,o):i,e.definition.headerFilterFunc(t,n,o,i)},r=o}if(!o)switch(a){case"partial":o=function(o){var i=e.getFieldValue(o);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:o=function(o){return e.getFieldValue(o)==t},r="="}n.headerFilters[s]={value:t,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=e.getField();e.modules.filter={success:o,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},M.prototype.generateHeaderFilterElement=function(e,t,o){function i(){}var n,s,a,r,l,c,u,d=this,h=this,p=e.modules.filter.success,m=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),m){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":h.table.modules.edit.editors[e.definition.headerFilter]?(s=h.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):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":e.modules.edit&&e.modules.edit.editor?s=e.modules.edit.editor:e.definition.formatter&&h.table.modules.edit.editors[e.definition.formatter]?(s=h.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):s=h.table.modules.edit.editors.input}if(s){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.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|"+e.definition.field,function(e){a.setAttribute("placeholder",void 0!==e&&e?e:h.table.modules.localize.getText("headerFilters|default"))}):h.table.modules.localize.bind("headerFilters|default",function(e){a.setAttribute("placeholder",void 0!==h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:e)}),a.addEventListener("click",function(e){e.stopPropagation(),a.focus()}),a.addEventListener("focus",function(e){var t=d.table.columnManager.element.scrollLeft;t!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(t),d.table.columnManager.scrollHorizontal(t))}),l=!1,c=function(e){l&&clearTimeout(l),l=setTimeout(function(){p(a.value)},h.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=a,e.modules.filter.attrType=a.hasAttribute("type")?a.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=a.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(a.addEventListener("keyup",c),a.addEventListener("search",c),"number"==e.modules.filter.attrType&&a.addEventListener("change",function(e){p(a.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&a.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||a.addEventListener("mousedown",function(e){e.stopPropagation()})),n.appendChild(a),e.contentElement.appendChild(n),o||h.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},M.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})},M.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})},M.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},M.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},M.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},M.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},M.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},M.prototype.setFilter=function(e,t,o,i){var n=this;n.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),n.addFilter(e)},M.prototype.addFilter=function(e,t,o,i){var n=this;Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),e.forEach(function(e){(e=n.findFilter(e))&&(n.filterList.push(e),n.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.findFilter=function(e){var t,o=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:o.filters[e.type]?(t=o.table.columnManager.getColumnByField(e.field),i=t?function(i){return o.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return o.filters[e.type](e.value,t[e.field],t,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},M.prototype.findSubFilters=function(e){var t=this,o=[];return e.forEach(function(e){(e=t.findFilter(e))&&o.push(e)}),!!o.length&&o},M.prototype.getFilters=function(e,t){var o=[];return e&&(o=this.getHeaderFilters()),t&&o.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),o=o.concat(this.filtersToArray(this.filterList,t))},M.prototype.filtersToArray=function(e,t){var o=this,i=[];return e.forEach(function(e){var n;Array.isArray(e)?i.push(o.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},M.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},M.prototype.removeFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?i.filterList.findIndex(function(t){return e===t}):i.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.clearFilter=function(e){this.filterList=[],e&&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")},M.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)}),this.changed=!0},M.prototype.search=function(e,t,o,i){var n=this,s=[],a=[];return Array.isArray(t)||(t=[{field:t,type:o,value:i}]),t.forEach(function(e){(e=n.findFilter(e))&&a.push(e)}),this.table.rowManager.rows.forEach(function(t){var o=!0;a.forEach(function(e){n.filterRecurse(e,t.getData())||(o=!1)}),o&&s.push("data"===e?t.getData("data"):t.getComponent())}),s},M.prototype.filter=function(e,t){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=e.slice(0):e.forEach(function(e){o.filterRow(e)&&i.push(e)}),o.table.options.dataFiltered&&(i.forEach(function(e){n.push(e.getComponent())}),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},M.prototype.filterRow=function(e,t){var o=this,i=!0,n=e.getData();o.filterList.forEach(function(e){o.filterRecurse(e,n)||(i=!1)});for(var s in o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},M.prototype.filterRecurse=function(e,t){var o=this,i=!1;return Array.isArray(e)?e.forEach(function(e){o.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i},M.prototype.filters={"=":function(e,t,o,i){return t==e},"<":function(e,t,o,i){return t":function(e,t,o,i){return t>e},">=":function(e,t,o,i){return t>=e},"!=":function(e,t,o,i){return t!=e},regex:function(e,t,o,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,o,i){var n=e.toLowerCase().split(void 0===i.separator?" ":i.separator),s=String(null===t||void 0===t?"":t).toLowerCase(),a=[];return n.forEach(function(e){s.includes(e)&&a.push(!0)}),i.matchAll?a.length===n.length:!!a.length},starts:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,o,i){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},d.prototype.registerModule("filter",M);var L=function(e){this.table=e};L.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},L.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},i=e.definition["formatter"+t];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},L.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},L.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,i,t)},L.prototype.formatExportValue=function(e,t){var o,i=e.column.modules.format[t];if(i){var n=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof i.params?i.params(component):i.params,i.formatter.call(this,e.getComponent(),o,n)}return this.formatValue(e)},L.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},L.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},L.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},L.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var i,n,s,a,r=parseFloat(e.getValue()),l=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,h=void 0!==t.precision?t.precision:2;if(isNaN(r))return this.emptyToSpace(this.sanitizeHTML(e.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(e,t,o){var i,n=e.getValue(),s=t.urlPrefix||"",a=t.download,r=n,l=document.createElement("a");if(t.labelField&&(i=e.getData(),r=i[t.labelField]),t.label)switch(_typeof(t.label)){case"string":r=t.label;break;case"function":r=t.label(e)}if(r){if(t.urlField&&(i=e.getData(),n=i[t.urlField]),t.url)switch(_typeof(t.url)){case"string":n=t.url;break;case"function":n=t.url(e)}return l.setAttribute("href",s+n),t.target&&l.setAttribute("target",t.target),t.download&&(a="function"==typeof a?a(e):!0===a?"":a,l.setAttribute("download",a)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),l}return" "},image:function(e,t,o){var i=document.createElement("img");switch(i.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":i.style.height=t.height+"px";break;case"string":i.style.height=t.height}switch(_typeof(t.width)){case"number":i.style.width=t.width+"px";break;case"string":i.style.width=t.width}return i.addEventListener("load",function(){e.getRow().normalizeHeight()}),i},tickCross:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t.allowEmpty,a=t.allowTruthy,r=void 0!==t.tickElement?t.tickElement:'',l=void 0!==t.crossElement?t.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(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=t.outputFormat||"DD/MM/YYYY hh:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=e.getValue(),r=moment(a,i);return r.isValid()?t.timezone?r.tz(t.timezone).format(n):r.format(n):!0===s?a:"function"==typeof s?s(a):s},datetimediff:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",s=void 0!==t.suffix&&t.suffix,a=void 0!==t.unit?t.unit:void 0,r=void 0!==t.humanize&&t.humanize,l=void 0!==t.date?t.date:moment(),c=e.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(e,t,o){var i=e.getValue();return void 0===t[i]?(console.warn("Missing display value for "+i),i):t[i]},star:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t&&t.stars?t.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(e,t,o){var i,n,s=this.sanitizeHTML(e.getValue())||0,a=document.createElement("span"),r=t&&t.max?t.max:100,l=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(s)&&void 0!==e.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(e,t,o){var i,n,s,a,r,c=this.sanitizeHTML(e.getValue())||0,u=e.getElement(),d=t&&t.max?t.max:100,h=t&&t.min?t.min:0,p=t&&t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(c)<=d?parseFloat(c):d,n=parseFloat(n)>=h?parseFloat(n):h,i=(d-h)/100,n=Math.round((n-h)/i),_typeof(t.color)){case"string":s=t.color;break;case"function":s=t.color(c);break;case"object":if(Array.isArray(t.color)){var m=100/t.color.length,f=Math.floor(n/m);f=Math.min(f,t.color.length-1),f=Math.max(f,0),s=t.color[f];break}default:s="#2DC214"}switch(_typeof(t.legend)){case"string":a=t.legend;break;case"function":a=t.legend(c);break;case"boolean":a=c;break;default:a=!1}switch(_typeof(t.legendColor)){case"string":r=t.legendColor;break;case"function":r=t.legendColor(c);break;case"object":if(Array.isArray(t.legendColor)){var m=100/t.legendColor.length,f=Math.floor(n/m);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),r=t.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(!(e instanceof l)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",u.appendChild(t),u=t}u.appendChild(g),a&&u.appendChild(b)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function i(e){var t=s.element;s.open=e,t&&(s.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}var n=document.createElement("div"),s=e.getRow()._row.modules.responsiveLayout;return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(e){e.stopImmediatePropagation(),i(!s.open)}),i(s.open),n},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",function(e){i.toggleSelect()}),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},d.prototype.registerModule("format",L);var T=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};T.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},T.prototype.initializeColumn=function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")},T.prototype.frozenCheck=function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen},T.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},T.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},T.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))},T.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach(function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach(function(e){t.layoutElement(e.getElement(),i)})}),this.rightColumns.forEach(function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach(function(e){t.layoutElement(e.getElement(),o)})})},T.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},T.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},T.prototype.layoutRow=function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}),this.rightColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)})},T.prototype.layoutElement=function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))},T.prototype._calcSpace=function(e,t){for(var o=0,i=0;i-1&&t.splice(o,1)}),t},D.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},D.prototype.unfreezeRow=function(e){var t=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var o=e.getElement();o.parentNode.removeChild(o),this.table.rowManager.adjustTableSize(),this.rows.splice(t,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},D.prototype.styleRows=function(e){var t=this;this.rows.forEach(function(e,o){t.table.rowManager.styleRow(e,o)})},d.prototype.registerModule("frozenRows",D);var k=function(e){this._group=e,this.type="GroupComponent"};k.prototype.getKey=function(){return this._group.key},k.prototype.getField=function(){return this._group.field},k.prototype.getElement=function(){return this._group.element},k.prototype.getRows=function(){return this._group.getRows(!0)},k.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},k.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},k.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},k.prototype.isVisible=function(){return this._group.visible},k.prototype.show=function(){this._group.show()},k.prototype.hide=function(){this._group.hide()},k.prototype.toggle=function(){this._group.toggleVisibility()},k.prototype._getSelf=function(){return this._group},k.prototype.getTable=function(){return this._group.groupManager.table};var S=function(e,t,o,i,n,s,a){this.groupManager=e,this.parent=t,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):o?this.rows.push(e):this.rows.unshift(e),e.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)},S.prototype.scrollHeader=function(e){this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)})},S.prototype.getRowIndex=function(e){},S.prototype.conformRowData=function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e},S.prototype.removeRow=function(e){var t=this.rows.indexOf(e),o=e.getElement();t>-1&&this.rows.splice(t,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))},S.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},S.prototype.getHeadersAndRows=function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){t=t.concat(o.getHeadersAndRows(e))}):(!e&&"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),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"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),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&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),t.push(this.calcs.top))),!e&&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),t.push(this.calcs.bottom)))),t},S.prototype.getData=function(e,t){var o=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(function(e){o.push(e.getData(t||"data"))}),o},S.prototype.getRowCount=function(){var e=0;return this.groupList.length?this.groupList.forEach(function(t){e+=t.getRowCount()}):e=this.rows.length,e},S.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},S.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(e){e.getHeadersAndRows().forEach(function(e){e.detachElement()})}):this.rows.forEach(function(e){var t=e.getElement();t.parentNode.removeChild(t)}),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)},S.prototype.show=function(){var e=this;if(e.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 t=e.getElement();this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o})}):e.rows.forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=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)},S.prototype._visSet=function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))},S.prototype.getRowGroup=function(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}):this.rows.find(function(t){return t===e})&&(t=this),t},S.prototype.getSubGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},S.prototype.getRows=function(e){var t=[];return this.rows.forEach(function(o){t.push(e?o.getComponent():o)}),t},S.prototype.generateGroupHeaderContents=function(){var e=[];for(this.rows.forEach(function(t){e.push(t.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,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)},S.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 e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),e.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],e.table.modules.localize.bind("groups|item",function(t,o){e.headerGenerator[0]=function(e,i,n){return(void 0===e?"":e)+"("+i+" "+(1===i?t:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(t)||t)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(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(t)||(t=[t]),t.forEach(function(t,o){var i,n;"function"==typeof t?i=t:(n=e.table.columnManager.getColumnByField(t),i=n?function(e){return n.getFieldValue(e)}:function(e){return e[t]}),e.groupIDLookups.push({field:"function"!=typeof t&&t,func:i,values:!!e.allowedValues&&e.allowedValues[o]})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(e){e="function"==typeof e?e:function(){return!0}}),e.startOpen=o),i&&(e.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},H.prototype.setDisplayIndex=function(e){this.displayIndex=e},H.prototype.getDisplayIndex=function(){return this.displayIndex},H.prototype.getRows=function(e){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(e),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):e.slice(0)},H.prototype.getGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},H.prototype.getChildGroups=function(e){var t=this,o=[];return e||(e=this),e.groupList.forEach(function(e){e.groupList.length?o=o.concat(t.getChildGroups(e)):o.push(e)}),o},H.prototype.wipe=function(){this.groupList.forEach(function(e){e.wipe()})},H.prototype.pullGroupListData=function(e){var t=this,o=[];return e.forEach(function(e){var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];e.hasSubGroups?(n=t.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=n.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),o.push(i),o=o.concat(n)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,o.push(i),e.getRows().forEach(function(e){o.push(e.getData("data"))}))}),o},H.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},H.prototype.getRowGroup=function(e){var t=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}),t},H.prototype.countGroups=function(){return this.groupList.length},H.prototype.generateGroups=function(e){var t=this,o=t.groups;t.groups={},t.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(e){t.createGroup(e,0,o)}),e.forEach(function(e){t.assignRowToExistingGroup(e,o)})):e.forEach(function(e){t.assignRowToGroup(e,o)})},H.prototype.createGroup=function(e,t,o){var i,n=t+"_"+e;o=o||[],i=new S(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},H.prototype.assignRowToExistingGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(e)},H.prototype.assignRowToGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,t),this.groups["0_"+o].addRow(e),!i},H.prototype.updateGroupRows=function(e){var t=this,o=[];if(t.groupList.forEach(function(e){o=o.concat(e.getHeadersAndRows())}),e){var i=t.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),t.table.rowManager.refreshActiveData("group",!0,!0)}return o},H.prototype.scrollHeaders=function(e){e+="px",this.groupList.forEach(function(t){t.scrollHeader(e)})},H.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))},d.prototype.registerModule("groupRows",H);var z=function(e){this.table=e,this.history=[],this.index=-1};z.prototype.clear=function(){this.history=[],this.index=-1},z.prototype.action=function(e,t,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:o}),this.index++},z.prototype.getHistoryUndoSize=function(){return this.index+1},z.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},z.prototype.undo=function(){if(this.index>-1){var e=this.history[this.index];return this.undoers[e.type].call(this,e),this.index--,this.table.options.historyUndo.call(this.table,e.type,e.component.getComponent(),e.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 e=this.history[this.index];return this.redoers[e.type].call(this,e),this.table.options.historyRedo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},z.prototype.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue)},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},z.prototype.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue)},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}},z.prototype._rebindRow=function(e,t){this.history.forEach(function(o){if(o.component instanceof r)o.component===e&&(o.component=t);else if(o.component instanceof c&&o.component.row===e){var i=o.component.column.getField();i&&(o.component=t.getCell(i))}})}, -d.prototype.registerModule("history",z);var A=function(e){this.table=e,this.fieldIndex=[],this.hasIndex=!1};A.prototype.parseTable=function(){var e=this,t=e.table.element,o=e.table.options,i=(o.columns,t.getElementsByTagName("th")),n=t.getElementsByTagName("tbody")[0],s=[];e.hasIndex=!1,e.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],e._extractOptions(t,o),i.length?e._extractHeaders(i,n):e._generateBlankHeaders(i,n);for(var a=0;a-1&&e.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(e,t){var o=this,i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach(function(e){-1==o.pressedKeys.indexOf(e)&&(i=!1)}),i&&t.action.call(o,e),!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(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,o=t.scrollTop-t.height;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o>=0?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,o=t.scrollTop+t.height,i=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o<=i?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().prev())},navNext:function(e){var t,o=!1,i=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell)&&(e.preventDefault(),t=o.nav(),t.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(){t.next()})})))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().left())},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().right())},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().up())},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().down())},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},d.prototype.registerModule("keybindings",F);var _=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this)};_.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},_.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},_.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},_.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);o&&o.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach(function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",function(e){e.stopPropagation()})):o.addEventListener("click",function(o){i.hideMenu(),e.action(o,t.getComponent())})),i.menuEl.appendChild(o)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px"))},_.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},_.prototype.menus={},d.prototype.registerModule("menu",_);var P=function(e){this.table=e,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)};P.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},P.prototype.initializeColumn=function(e){var t,o=this,i={};e.modules.frozen||(t=e.getElement(),i.mousemove=function(i){e.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-d.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=i},P.prototype.bindTouchEvents=function(e){var t,o,i,n,s,a,r,l=this,c=e.getElement(),u=!1;c.addEventListener("touchstart",function(c){l.checkTimeout=setTimeout(function(){l.touchMove=!0,t=e,o=e.nextColumn(),n=o?o.getWidth()/2:0,i=e.prevColumn(),s=i?i.getWidth()/2:0,a=0,r=0,u=!1,l.startMove(c,e)},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)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveColumn(h,!0)):i&&-d-r>s&&(h=i)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveColumn(h,!1)),h&&(t=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(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&l.endMove(e)})},P.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-d.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.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(e)},P.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},P.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},P.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i.nextSibling)}):e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i)})},P.prototype.endMove=function(e){(1===e.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)))},P.prototype.moveHover=function(e){var t,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?e.touches[0].pageX:e.pageX)-d.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-ne.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(t.placeholderElement,i.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var i=e.getElement();i.previousSibling&&(i.parentNode.insertBefore(t.placeholderElement,i),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},N.prototype.initializeRow=function(e){var t,o=this,i={};i.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),i.mousemove=function(t){if(t.pageY-d.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i},N.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},N.prototype.bindTouchEvents=function(e,t){var o,i,n,s,a,r,l,c=this,u=!1;t.addEventListener("touchstart",function(t){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=e,i=e.nextRow(),s=i?i.getHeight()/2:0,n=e.prevRow(),a=n?n.getHeight()/2:0,r=0,l=0,u=!1,c.startMove(t,e)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var d,h;c.moving&&(t.preventDefault(),c.moveHover(t),u||(u=t.touches[0].pageY),d=t.touches[0].pageY-u,d>0?i&&d-r>s&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement().nextSibling),c.moveRow(h,!0)):n&&-d-l>a&&(h=n)!==e&&(u=t.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))}),t.addEventListener("touchend",function(e){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(e),c.touchMove=!1)})},N.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},N.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},N.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(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(e)},N.prototype.setStartPosition=function(e,t){var o,i,n=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.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},N.prototype.endMove=function(e){e&&1!==e.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()))},N.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},N.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},N.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,i=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},N.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},N.prototype.elementRowDrop=function(e,t,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(e,t,!!o&&o.getComponent())},N.prototype.connectToTables=function(e){var t,o=this;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(e){"string"==typeof e?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):o.connectionElements.push(e)}),this.connectionElements.forEach(function(e){var t=function(t){o.elementRowDrop(t,e,o.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")}))},N.prototype.disconnectFromTables=function(){var e;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent})},N.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},N.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},N.prototype.dropComplete=function(e,t,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(),t?t.getComponent():void 0,e):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(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},N.prototype.tableRowDrop=function(e,t){var o=!1,i=!1;switch(console.trace("drop"),e.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(),t?t.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(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:i})},N.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},N.prototype.senders={delete:function(e,t,o){e.delete()}},N.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},d.prototype.registerModule("moveRow",N);var B=function(e){this.table=e,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};B.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,a="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[a]&&(s=t.lookupMutator(e.definition[a]))&&(o=!0,i[a]={mutator:s,params:e.definition[a+"Params"]||{}})}),o&&(e.modules.mutate=i)},B.prototype.lookupMutator=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.mutators[e]?t=this.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t},B.prototype.transformRow=function(e,t,o){var i,n=this,s="mutator"+(t.charAt(0).toUpperCase()+t.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:e),"data"!=t&&void 0===i||(l=n.getComponent(),r="function"==typeof a.params?a.params(i,e,t,l):a.params,n.setFieldValue(e,a.mutator(i,e,t,r,l))))}),e},B.prototype.transformCell=function(e,t){var o=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,e.row.getData()),e.column.setFieldValue(i,t),o.mutator(t,i,"edit",o.params,e.getComponent())):t},B.prototype.enable=function(){this.enabled=!0},B.prototype.disable=function(){this.enabled=!1},B.prototype.mutators={},d.prototype.registerModule("mutator",B);var I=function(e){this.table=e,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()};I.prototype.createElements=function(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},I.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var o=1;o<5;o++)t.push(this.size*o);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var o=document.createElement("option");o.value=t,!0===t?e.table.modules.localize.bind("pagination|all",function(e){o.innerHTML=e}):o.innerHTML=t,e.pageSizeSelect.appendChild(o)}),this.pageSizeSelect.value=this.size}},I.prototype.initialize=function(e){var t,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(e){n.firstBut.innerHTML=e}),n.table.modules.localize.bind("pagination|first_title",function(e){n.firstBut.setAttribute("aria-label",e),n.firstBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|prev",function(e){n.prevBut.innerHTML=e}),n.table.modules.localize.bind("pagination|prev_title",function(e){n.prevBut.setAttribute("aria-label",e),n.prevBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|next",function(e){n.nextBut.innerHTML=e}),n.table.modules.localize.bind("pagination|next_title",function(e){n.nextBut.setAttribute("aria-label",e),n.nextBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|last",function(e){n.lastBut.innerHTML=e}),n.table.modules.localize.bind("pagination|last_title",function(e){n.lastBut.setAttribute("aria-label",e),n.lastBut.setAttribute("title",e)}),n.firstBut.addEventListener("click",function(){ -n.setPage(1)}),n.prevBut.addEventListener("click",function(){n.previousPage()}),n.nextBut.addEventListener("click",function(){n.nextPage().then(function(){}).catch(function(){})}),n.lastBut.addEventListener("click",function(){n.setPage(n.max)}),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",function(e){n.pageSizeSelect.setAttribute("aria-label",e),n.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),n.element.appendChild(t),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",function(e){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||e||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=e,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()},I.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},I.prototype.setDisplayIndex=function(e){this.displayIndex=e},I.prototype.getDisplayIndex=function(){return this.displayIndex},I.prototype.setMaxRows=function(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},I.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},I.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},I.prototype.setPage=function(e){var t=this,o=this;switch(e){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){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.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 - "+t.max+":",e),n())})},I.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){var n=t.table.rowManager.getDisplayRows(t.displayIndex-1),s=n.indexOf(e);if(s>-1){var a=!0===t.size?1:Math.ceil((s+1)/t.size);t.setPage(a).then(function(){o()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},I.prototype.setPageSize=function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e),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")},I.prototype._setPageButtons=function(){for(var e=this,t=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&s<=e.max&&e.pagesElement.appendChild(e._generatePageButton(s));this.footerRedraw()},I.prototype._generatePageButton=function(e){var t=this,o=document.createElement("button");return o.classList.add("tabulator-page"),e==t.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),t.table.modules.localize.bind("pagination|page_title",function(t){o.setAttribute("aria-label",t+" "+e),o.setAttribute("title",t+" "+e)}),o.setAttribute("data-page",e),o.textContent=e,o.addEventListener("click",function(o){t.setPage(e)}),o},I.prototype.previousPage=function(){var e=this;return new Promise(function(t,o){e.page>1?(e.page--,e.trigger().then(function(){t()}).catch(function(){o()}),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())})},I.prototype.nextPage=function(){var e=this;return new Promise(function(t,o){e.pagen?i.splice(n,0,e):i.push(e))}),i},O.prototype._findColumn=function(e,t){var o=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(o){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},O.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)},O.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},O.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},O.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},O.prototype.parseColumns=function(e){var t=this,o=[];return e.forEach(function(e){var i,n={},s=e.getDefinition();e.isGroup?(n.title=s.title,n.columns=t.parseColumns(e.getColumns())):(n.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(i=Object.keys(s),i.push("width")):i=t.config.columns,i.forEach(function(t){switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:n[t]=s[t]}})),o.push(n)}),o},O.prototype.readers={local:function(e,t){var o=localStorage.getItem(e+"-"+t);return!!o&&JSON.parse(o)},cookie:function(e,t){var o,i,n=document.cookie,s=e+"-"+t,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)}},O.prototype.writers={local:function(e,t,o){localStorage.setItem(e+"-"+t,JSON.stringify(o))},cookie:function(e,t,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},d.prototype.registerModule("persistence",O);var j=function(e){this.table=e,this.element=!1,this.manualBlock=!1};j.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},j.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))},j.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="")},j.prototype.printFullscreen=function(e,t,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!==t?t:this.table.options.printStyled,e,"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},d.prototype.registerModule("print",j);var V=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};V.prototype.watchData=function(e){var t,o=this;this.currentVersion++,t=this.currentVersion,o.unwatchData(),o.data=e,o.origFuncs.push=e.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!1)}),o.origFuncs.push.apply(e,arguments)}}),o.origFuncs.unshift=e.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!0)}),o.origFuncs.unshift.apply(e,arguments)}}),o.origFuncs.shift=e.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]))&&i.deleteActual(),o.origFuncs.shift.call(e)}}),o.origFuncs.pop=e.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]))&&i.deleteActual(),o.origFuncs.pop.call(e)}}),o.origFuncs.splice=e.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?e.length+n[0]:n[0],a=n[1],r=!!n[2]&&n.slice(2);if(!o.blocked&&t===o.currentVersion){if(r&&(i=!!e[s]&&o.table.rowManager.getRowFromDataObject(e[s]),i?r.forEach(function(e){o.table.rowManager.addRowActual(e,!0,i,!0)}):(r=r.slice().reverse(),r.forEach(function(e){o.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==a){var l=e.slice(s,void 0===n[1]?n[1]:s+a);l.forEach(function(e,t){var i=o.table.rowManager.getRowFromDataObject(e);i&&i.deleteActual(t!==l.length-1)})}(r||0!==a)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(e,arguments)}})},V.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},V.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var o in t)this.watchKey(e,t,o);this.blocked=!1},V.prototype.watchKey=function(e,t,o){var i=this,n=Object.getOwnPropertyDescriptor(t,o),s=t[o],a=this.currentVersion;Object.defineProperty(t,o,{set:function(t){if(s=t,!i.blocked&&a===i.currentVersion){var r={};r[o]=t,e.updateData(r)}n.set&&n.set(t)},get:function(){return n.get&&n.get(),s}})},V.prototype.unwatchRow=function(e){var t=e.getData();for(var o in t)Object.defineProperty(t,o,{value:t[o]})},V.prototype.block=function(){this.blocked=!0},V.prototype.unblock=function(){this.blocked=!1},d.prototype.registerModule("reactiveData",V);var W=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};W.prototype.initializeColumn=function(e,t,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===e&&(n="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:n}),!0===s||s==e){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(e){e.stopPropagation()});var l=function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=t,i._mouseDown(e,o,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l,{passive:!0}),a.addEventListener("dblclick",function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(e.stopPropagation(),o.reinitializeWidth(!0))}),r.addEventListener("click",function(e){e.stopPropagation()});var c=function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=t,i._mouseDown(e,s,r)))};r.addEventListener("mousedown",c),r.addEventListener("touchstart",c,{passive:!0}),r.addEventListener("dblclick",function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),o.appendChild(a),o.appendChild(r)}},W.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},W.prototype._mouseDown=function(e,t,o){function i(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.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,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},d.prototype.registerModule("resizeColumns",W);var G=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};G.prototype.initializeRow=function(e){var t=this,o=e.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(e){e.stopPropagation()});var s=function(o){t.startRow=e,t._mouseDown(o,e,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var a=function(o){var i=t.table.rowManager.prevDisplayRow(e);i&&(t.startRow=i,t._mouseDown(o,i,n))};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.appendChild(i),o.appendChild(n)},G.prototype._mouseDown=function(e,t,o){function i(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){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,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},d.prototype.registerModule("resizeRows",G);var U=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};U.prototype.initialize=function(e){var t,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(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.tableHeight==t&&o.tableWidth==n||(o.tableHeight=t,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.redraw())}}),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.containerHeight==t&&o.containerWidth==n||(o.containerHeight=t,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth,i.redraw()),i.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&i.redraw()},window.addEventListener("resize",this.binding))},U.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},d.prototype.registerModule("resizeTable",U);var Y=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};Y.prototype.initialize=function(){var e=this,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(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"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(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},Y.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},Y.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},Y.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},Y.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},Y.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},Y.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),i=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(i<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var s=e.columns[e.index-1];s&&i>0&&i>=s.getWidth()?(e.showColumn(s),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},Y.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},Y.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},Y.prototype.generateCollapsedRowData=function(e){var t,o=this,i=e.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?(t={value:!1,data:{},getValue:function(){return a},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return s.getComponent()}},n.push({title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,t,s.modules.format.params)})):n.push({title:s.definition.title,value:a}))}),n},Y.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""}),t.innerHTML=o,Object.keys(e).length?t:""},d.prototype.registerModule("responsiveLayout",Y);var q=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[], -this.selectedRows=[],this.headerCheckboxElement=null};q.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},q.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var i=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),n=t.table.rowManager.getDisplayRowIndex(e),s=i<=n?i:n,a=i>=n?i:n,r=t.table.rowManager.getDisplayRows().slice(0),l=r.splice(s,a-s+1);o.ctrlKey||o.metaKey?(l.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.lengtht.table.options.selectable&&(l=l.slice(0,t.table.options.selectable)),t.selectRows(l)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},q.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},q.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},q.prototype._selectRow=function(e,t,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(e);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),t||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},q.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},q.prototype.deselectRows=function(e,t){var o,i=this;if(void 0===e){o=i.selectedRows.length;for(var n=0;n-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),t||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},q.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},q.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},q.prototype._rowSelectionChanged=function(e){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)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},q.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},q.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},q.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t)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)}},d.prototype.registerModule("selectRow",q);var X=function(e){this.table=e,this.sortList=[],this.changed=!1};X.prototype.initializeColumn=function(e,t){var o,i,n=this,s=!1;switch(_typeof(e.definition.sorter)){case"string":n.sorters[e.definition.sorter]?s=n.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:void 0!==e.definition.headerSortTristate?e.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===e.definition.headerSort?!1!==this.table.options.headerSort:!1!==e.definition.headerSort)&&(o=e.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),t.appendChild(i),o.addEventListener("click",function(t){var o="",i=[],s=!1;if(e.modules.sort){if(e.modules.sort.tristate)o="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(t){return t.field===e.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:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},X.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},X.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t},X.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.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")},X.prototype.clear=function(){this.setSort([])},X.prototype.findSorter=function(e){var t,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),e.getField()))switch(t=e.getFieldValue(o),void 0===t?"undefined":_typeof(t)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},X.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table,t.getSort()),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach(function(e,o){t.setColumnHeader(e.column,e.dir)}):(o.forEach(function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"==typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)}),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&t.table.options.dataSorted.call(t.table,t.getSort(),t.table.rowManager.getComponents("active"))},X.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))})},X.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},X.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort(function(e,n){for(var s,a=i;a>=0;a--){var r=t[a];if(0!==(s=o._sortRow(e,n,r.column,r.dir,r.params)))break}return s})},X.prototype._sortRow=function(e,t,o,i,n){var s,a,r="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(r.getData()),t=o.getFieldValue(l.getData()),e=void 0!==e?e:"",t=void 0!==t?t:"",s=r.getComponent(),a=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,a,o.getComponent(),i,n)},X.prototype.sorters={number:function(e,t,o,i,n,s,a){var r=a.alignEmptyValues,l=a.decimalSeparator||".",c=a.thousandSeparator||",",u=0;if(e=parseFloat(String(e).split(c).join("").split(l).join(".")),t=parseFloat(String(t).split(c).join("").split(l).join(".")),isNaN(e))u=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;u=1}return("top"===r&&"desc"===s||"bottom"===r&&"asc"===s)&&(u*=-1),u},string:function(e,t,o,i,n,s,a){var r,l=a.alignEmptyValues,c=0;if(e){if(t){switch(_typeof(a.locale)){case"boolean":a.locale&&(r=this.table.modules.localize.getLocale());break;case"string":r=a.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),r)}c=1}else c=t?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,a){return a.format||(a.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,a)},time:function(e,t,o,i,n,s,a){return a.format||(a.format="HH:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,a)},datetime:function(e,t,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(e=moment(e,r),t=moment(t,r),e.isValid()){if(t.isValid())return e-t;c=1}else c=t.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(e,t,o,i,n,s,a){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,o,i,n,s,a){function r(e){switch(u){case"length":return e.length;case"sum":return e.reduce(function(e,t){return e+t});case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce(function(e,t){return e+t})/e.length}}var l=0,c=0,u=a.type||"length",d=a.alignEmptyValues,h=0;if(Array.isArray(e)){if(Array.isArray(t))return l=e?r(e):0,c=t?r(t):0,l-c;d=1}else d=Array.isArray(t)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(h*=-1),h},exists:function(e,t,o,i,n,s,a){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,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(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if(r=String(e).toLowerCase(),l=String(t).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=t||0===t?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},d.prototype.registerModule("sort",X);var K=function(e){this.table=e,this.invalidCells=[]};return K.prototype.initializeColumn=function(e){var t,o=this,i=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(function(e){(t=o._extractValidator(e))&&i.push(t)}):(t=this._extractValidator(e.definition.validator))&&i.push(t),e.modules.validate=!!i.length&&i)},K.prototype._extractValidator=function(e){var t,o,i;switch(void 0===e?"undefined":_typeof(e)){case"string":return i=e.indexOf(":"),i>-1?(t=e.substring(0,i),o=e.substring(i+1)):t=e,this._buildValidator(t,o);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}},K.prototype._buildValidator=function(e,t){var o="function"==typeof e?e:this.validators[e];return o?{type:"function"==typeof e?"function":e,func:o,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)},K.prototype.validate=function(e,t,o){var i=this,n=[],s=this.invalidCells.indexOf(t);return e&&e.forEach(function(e){e.func.call(i,t.getComponent(),o,e.params)||n.push({type:e.type,parameters:e.params})}),n=!n.length||n,t.modules.validate||(t.modules.validate={}),!0===n?(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),s>-1&&this.invalidCells.splice(s,1)):(t.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==s&&this.invalidCells.push(t)),n},K.prototype.getInvalidCells=function(){var e=[];return this.invalidCells.forEach(function(t){e.push(t.getComponent())}),e},K.prototype.clearValidation=function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.element.classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))},K.prototype.validators={integer:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,o){return""===t||null===t||void 0===t||!isNaN(t)},string:function(e,t,o){return""===t||null===t||void 0===t||isNaN(t)},max:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)<=o},min:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)>=o},starts:function(e,t,o){return""===t||null===t||void 0===t||String(t).toLowerCase().startsWith(String(o).toLowerCase())},ends:function(e,t,o){return""===t||null===t||void 0===t||String(t).toLowerCase().endsWith(String(o).toLowerCase())},minLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length>=o},maxLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length<=o},in:function(e,t,o){return""===t||null===t||void 0===t||("string"==typeof o&&(o=o.split("|")),""===t||o.indexOf(t)>-1)},regex:function(e,t,o){return""===t||null===t||void 0===t||new RegExp(o).test(t)},unique:function(e,t,o){if(""===t||null===t||void 0===t)return!0;var i=!0,n=e.getData(),s=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(e){var o=e.getData();o!==n&&t==s.getFieldValue(o)&&(i=!1)}),i},required:function(e,t,o){return""!==t&&null!==t&&void 0!==t}},d.prototype.registerModule("validate",K),d}); \ No newline at end of file +var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tabulator=t()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof e)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|t,s=Math.max(n>=0?n:i-Math.abs(n),0);so?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){t=e[0];for(var n in t){var s={field:n,title:n},r=t[n];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"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){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(),e.forEach(function(e,t){o._addColumn(e)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var i=new n(e,this),s=i.getElement(),r=o?this.findColumnIndex(o):o;if(o&&r>-1){var a=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(this.columns.splice(a,0,i),l.parentNode.insertBefore(s,l)):(this.columns.splice(a+1,0,i),l.parentNode.insertBefore(s,l.nextSibling))}else t?(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(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach(function(e){var o;e.clearVerticalAlign(),(o=e.getHeight())>t&&(t=o)}),e.columns.forEach(function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)}),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e)))return this.columnsByField[e]||!1;if(e instanceof n)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.columns.find(function(t){return t.element===e})||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===e&&o.push(t.columnsByField[i])}),o},t.prototype.getColumnByIndex=function(e){return this.columnsByIndex[e]},t.prototype.getFirstVisibileColumn=function(e){var e=this.columnsByIndex.findIndex(function(e){return e.visible});return e>-1&&this.columnsByIndex[e]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(e){return this.columnsByIndex.findIndex(function(t){return e===t})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(e){this.columnsByIndex.forEach(function(t,o){e(t,o)})},t.prototype.getDefinitions=function(e){var t=this,o=[];return t.columnsByIndex.forEach(function(t){(!e||e&&t.visible)&&o.push(t.getDefinition())}),o},t.prototype.getDefinitionTree=function(){var e=this,t=[];return e.columns.forEach(function(e){t.push(e.getDefinition(!0))}),t},t.prototype.getComponents=function(e){var t=this,o=[];return(e?t.columns:t.columnsByIndex).forEach(function(e){o.push(e.getComponent())}),o},t.prototype.getWidth=function(){var e=0;return this.columnsByIndex.forEach(function(t){t.visible&&(e+=t.getWidth())}),e},t.prototype.moveColumn=function(e,t,o){this.moveColumnActual(e,t,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),t.element.parentNode.insertBefore(e.element,t.element),o&&t.element.parentNode.insertBefore(t.element,e.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(e,t,o){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,o):this._moveColumnInArray(this.columns,e,t,o),this._moveColumnInArray(this.columnsByIndex,e,t,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,e.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(e,t,o,i,n){var s,r=e.indexOf(t);r>-1&&(e.splice(r,1),s=e.indexOf(o),s>-1?i&&(s+=1):s=r,e.splice(s,0,t),n&&this.table.rowManager.rows.forEach(function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(s,0,t)}}))},t.prototype.scrollToColumn=function(e,t,o){var i=this,n=0,s=0,r=0,a=e.getElement();return new Promise(function(l,c){if(void 0===t&&(t=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-i.element.clientWidth/2;break;case"right":r=a.clientWidth-i.headersElement.clientWidth}if(!o&&(s=a.offsetLeft)>0&&s+a.offsetWidthe.rowManager.element.clientHeight&&(t-=e.rowManager.element.offsetWidth-e.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,r;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?e.table.options.columnMinWidth:parseInt(i.minWidth),r="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,o+=r>s?r:s)}),o},t.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i._addColumn(e,t,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(),"fitColumns"!=i.table.modules.layout.getMode()&&r.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(r)})},t.prototype.deregisterColumn=function(e){var t,o=e.getField();o&&delete this.columnsByField[o],t=this.columnsByIndex.indexOf(e),t>-1&&this.columnsByIndex.splice(t,1),t=this.columns.indexOf(e),t>-1&&this.columns.splice(t,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(e){e&&(d.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():e?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),e&&(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(e){this._column=e,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 e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e},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(e){e.show()}):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(e){e.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 e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e},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(e){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,e)},o.prototype.move=function(e,t){var o=this._column.table.columnManager.findColumn(e);o?this._column.table.columnManager.moveColumn(this._column,o,t):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var e=this._column.nextColumn();return!!e&&e.getComponent()},o.prototype.getPrevColumn=function(){var e=this._column.prevColumn();return!!e&&e.getComponent()},o.prototype.updateDefinition=function(e){return this._column.updateDefinition(e)},o.prototype.getWidth=function(){return this._column.getWidth()},o.prototype.setWidth=function(e){return!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e)},o.prototype.validate=function(){return this._column.validate()};var n=function e(t,o){var i=this;this.table=o.table,this.definition=t,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!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.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),t.columns?(this.isGroup=!0,t.columns.forEach(function(t,o){var n=new e(t,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),t.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 e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e},n.prototype.createGroupElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e},n.prototype.checkDefinition=function(){var e=this;Object.keys(this.definition).forEach(function(t){-1===e.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)})},n.prototype.setField=function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},n.prototype.registerColumnPosition=function(e){this.parent.registerColumnPosition(e)},n.prototype.registerColumnField=function(e){this.parent.registerColumnField(e)},n.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(e){e.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 e=this,t=e.definition,o=t.headerTooltip||!1===t.tooltip?t.headerTooltip:e.table.options.tooltipsHeader;o?!0===o?t.field?e.table.modules.localize.bind("columns|"+t.field,function(o){e.element.setAttribute("title",o||t.title)}):e.element.setAttribute("title",t.title):("function"==typeof o&&!1===(o=o(e.getComponent()))&&(o=""),e.element.setAttribute("title",o)):e.element.setAttribute("title","")},n.prototype._buildHeader=function(){for(var e=this,t=e.definition;e.element.firstChild;)e.element.removeChild(e.element.firstChild);t.headerVertical&&(e.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&e.element.classList.add("tabulator-col-vertical-flip")),e.contentElement=e._bindEvents(),e.contentElement=e._buildColumnHeaderContent(),e.element.appendChild(e.contentElement),e.isGroup?e._buildGroupHeader():e._buildColumnHeader(),e.setTooltip(),e.table.options.resizableColumns&&e.table.modExists("resizeColumns")&&e.table.modules.resizeColumns.initializeColumn("header",e,e.element),t.headerFilter&&e.table.modExists("filter")&&e.table.modExists("edit")&&(void 0!==t.headerFilterPlaceholder&&t.field&&e.table.modules.localize.setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),e.table.modules.filter.initializeColumn(e)),e.table.modExists("frozenColumns")&&e.table.modules.frozenColumns.initializeColumn(e),e.table.options.movableColumns&&!e.isGroup&&e.table.modExists("moveColumn")&&e.table.modules.moveColumn.initializeColumn(e),(t.topCalc||t.bottomCalc)&&e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.initializeColumn(e),e.table.modExists("persistence")&&e.table.modules.persistence.config.columns&&e.table.modules.persistence.initializeColumn(e),e.element.addEventListener("mouseenter",function(t){e.setTooltip()})},n.prototype._bindEvents=function(){var e,t,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(e){n.headerClick(e,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(e){n.headerDblClick(e,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(e){n.headerContext(e,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&n.headerTap(e,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,n.headerDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),"function"==typeof n.headerTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,n.headerTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=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 e=this,t=e.definition,o=e.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(e,e.contentElement),(t.headerContextMenu||t.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(e),o.modExists("format")&&o.modules.format.initializeColumn(e),void 0!==t.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(e),void 0!==t.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(e),o.modExists("mutator")&&o.modules.mutator.initializeColumn(e),o.modExists("accessor")&&o.modules.accessor.initializeColumn(e),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(e),void 0!==t.visible&&(t.visible?e.show(!0):e.hide(!0)),t.cssClass){t.cssClass.split(" ").forEach(function(t){e.element.classList.add(t)})}t.field&&this.element.setAttribute("tabulator-field",t.field),e.setMinWidth(void 0===t.minWidth?e.table.options.columnMinWidth:parseInt(t.minWidth)),e.reinitializeWidth(),e.tooltip=e.definition.tooltip||!1===e.definition.tooltip?e.definition.tooltip:e.table.options.tooltips,e.hozAlign=void 0===e.definition.hozAlign?e.table.options.cellHozAlign:e.definition.hozAlign,e.vertAlign=void 0===e.definition.vertAlign?e.table.options.cellVertAlign:e.definition.vertAlign},n.prototype._buildColumnHeaderContent=function(){var e=(this.definition,this.table,document.createElement("div"));return e.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),e.appendChild(this.titleElement),e},n.prototype._buildColumnHeaderTitle=function(){var e=this,t=e.definition,o=e.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(e){e.stopPropagation(),n.focus()}),n.addEventListener("change",function(){t.title=n.value,o.options.columnTitleChanged.call(e.table,e.getComponent())}),i.appendChild(n),t.field?o.modules.localize.bind("columns|"+t.field,function(e){n.value=e||t.title||" "}):n.value=t.title||" "}else t.field?o.modules.localize.bind("columns|"+t.field,function(o){e._formatColumnHeaderTitle(i,o||t.title||" ")}):e._formatColumnHeaderTitle(i,t.title||" ");return i},n.prototype._formatColumnHeaderTitle=function(e,t){var o,i,n,s,r,a=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),r=function(e){a.titleFormatterRendered=e},s={getValue:function(){return t},getElement:function(){return e}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,s,n,r),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?e.appendChild(i):(e.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":e.innerHTML="";break;default:e.innerHTML=i}else e.innerHTML=t},n.prototype._buildGroupHeader=function(){var e=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(t){e.element.classList.add(t)})}this.element.appendChild(this.groupElement)},n.prototype._getFlatData=function(e){return e[this.field]},n.prototype._getNestedData=function(e){for(var t,o=e,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(e+1)},n.prototype._nextVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)},n.prototype.prevColumn=function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)},n.prototype._prevVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)},n.prototype.reinitializeWidth=function(e){this.widthFixed=!1,void 0===this.definition.width||e||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 e=this;this.widthFixed||(this.element.style.width="",e.cells.forEach(function(e){e.clearWidth()}));var t=this.element.offsetWidth;e.width&&this.widthFixed||(e.cells.forEach(function(e){var o=e.getWidth();o>t&&(t=o)}),t&&e.setWidthActual(t+1))},n.prototype.updateDefinition=function(e){var t=this;return new Promise(function(o,i){var n;t.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},t.getDefinition()),n=Object.assign(n,e),t.table.columnManager.addColumn(n,!1,t).then(function(e){n.field==t.field&&(t.field=!1),t.delete().then(function(){o(e.getComponent())}).catch(function(e){i(e)})}).catch(function(e){i(e)}))})},n.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},n.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","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","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","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(e){this.table=e,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 e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},s.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},s.prototype.getElement=function(){return this.element},s.prototype.getTableElement=function(){return this.tableElement},s.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},s.prototype.setColumnManager=function(e){this.columnManager=e},s.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t}),"virtual"===this.renderMode&&e.element.addEventListener("scroll",function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t})},s.prototype.findRow=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e))){if(void 0===e||null===e)return!1;return t.rows.find(function(o){return o.data[t.table.options.index]==e})||!1}if(e instanceof a)return e;if(e instanceof r)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.rows.find(function(t){return t.element===e})||!1}return!1},s.prototype.getRowFromDataObject=function(e){return this.rows.find(function(t){return t.data===e})||!1},s.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},s.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),r=e.getElement(),a=0;return new Promise(function(e,l){if(s>-1){if(void 0===t&&(t=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=d.prototype.helpers.elOffset(r).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":t=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&d.prototype.helpers.elVisible(r)&&(a=d.prototype.helpers.elOffset(r).top-d.prototype.helpers.elOffset(n.element).top)>0&&a-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(t){var o=t.indexOf(e);o>-1&&t.splice(o,1)}),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,e.getComponent()),this.table.options.dataEdited.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(e,t,o,i){var n=this.addRowActual(e,t,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:e,pos:t,index:o}),n},s.prototype.addRows=function(e,t,o){var i=this,n=this,s=0,r=[];return new Promise(function(a,l){t=i.findAddRowPos(t),Array.isArray(e)||(e=[e]),s=e.length-1,(void 0===o&&t||void 0!==o&&!t)&&e.reverse(),e.forEach(function(e,i){var s=n.addRow(e,t,o,!0);r.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(),a(r)})},s.prototype.findAddRowPos=function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e},s.prototype.addRowActual=function(e,t,o,i){var n,s,r=e instanceof a?e:new a(e||{},this),l=this.findAddRowPos(t),c=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),l?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],l=!1):s.length&&(o=s[s.length-1],l=!(s.length1&&(!o||o&&-1==u.indexOf(o)?l?u[0]!==r&&(o=u[0],this._moveRowInArray(r.getGroup().rows,r,o,!l)):u[u.length-1]!==r&&(o=u[u.length-1],this._moveRowInArray(r.getGroup().rows,r,o,!l)):this._moveRowInArray(r.getGroup().rows,r,o,!l))}return o&&(c=this.rows.indexOf(o)),o&&c>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(e){var t=e.indexOf(o);t>-1&&e.splice(l?t:t+1,0,r)}),n>-1&&this.activeRows.splice(l?n:n+1,0,r),this.rows.splice(l?c:c+1,0,r)):l?(this.displayRowIterator(function(e){e.unshift(r)}),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator(function(e){e.push(r)}),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,r.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),r},s.prototype.moveRow=function(e,t,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",e,{posFrom:this.getRowPosition(e),posTo:this.getRowPosition(t),to:t,after:o}),this.moveRowActual(e,t,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,e.getComponent())},s.prototype.moveRowActual=function(e,t,o){var i=this;if(this._moveRowInArray(this.rows,e,t,o),this._moveRowInArray(this.activeRows,e,t,o),this.displayRowIterator(function(n){i._moveRowInArray(n,e,t,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&t instanceof S&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t.getGroup(),s=e.getGroup();n===s?this._moveRowInArray(n.rows,e,t,o):(s&&s.removeRow(e),n.insertRow(e,t,o))}},s.prototype._moveRowInArray=function(e,t,o,i){var n,s,r,a;if(t!==o&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),s=e.indexOf(o),s>-1?i?e.splice(s+1,0,t):e.splice(s,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){r=nn?s:n+1;for(var l=r;l<=a;l++)e[l]&&this.styleRow(e[l],l)}},s.prototype.clearData=function(){this.setData([])},s.prototype.getRowIndex=function(e){return this.findRowIndex(e,this.rows)},s.prototype.getDisplayRowIndex=function(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t},s.prototype.nextDisplayRow=function(e,t){var o=this.getDisplayRowIndex(e),i=!1;return!1!==o&&o-1)&&o},s.prototype.getData=function(e,t){var o=[];return this.getRows(e).forEach(function(e){"row"==e.type&&o.push(e.getData(t||"data"))}),o},s.prototype.getComponents=function(e){var t=[];return this.getRows(e).forEach(function(e){t.push(e.getComponent())}),t},s.prototype.getDataCount=function(e){return this.getRows(e).length},s.prototype._genRemoteRequest=function(){var e=this,t=this.table,o=t.options,i={};if(t.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(e){delete e.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)}t.modules.ajax.sendRequest().then(function(t){e._setDataActual(t,!0)}).catch(function(e){})},s.prototype.filterRefresh=function(){var e=this.table,t=e.options,o=this.scrollLeft;t.ajaxFiltering?"remote"==t.pagination&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):t.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},s.prototype.sorterRefresh=function(e){var t=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(e?"filter":"sort"),this.scrollHorizontal(i)},s.prototype.scrollHorizontal=function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(e),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(e)},s.prototype.refreshActiveData=function(e,t,o){var i,n=this,s=this.table,r=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||r.indexOf(e)=0))break;s=a}else if(t-r[a].getElement().offsetTop>=0)n=a;else{if(i=!0,!(o-r[a].getElement().offsetTop>=0))break;s=a}}else n=this.vDomTop,s=this.vDomBottom;return r.slice(n,s+1)},s.prototype.displayRowIterator=function(e){this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},s.prototype.getRows=function(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!0);break;default:t=this.rows}return t},s.prototype.reRenderInPosition=function(e){if("virtual"==this.getRenderMode())if(this.redrawBlock)e?e():this.redrawBlockRederInPosition=!0;else{for(var t=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(s[r]){var a=t-s[r].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(u=!1),i.vDomBottom++,c++}e?(i.vDomTopPad=t?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+l)/c),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",t&&(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&&t&&(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(e){var t=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-t>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else e?(t<0&&this._addTopRow(-t),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(t>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(t):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},s.prototype._addTopRow=function(e){var t=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],r=s.getHeight()||this.vDomRowHeight;e>=r&&(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-=r,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=r,this.vDomTop--),e=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(e,t+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},s.prototype._removeTopRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,t.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,e=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(e)}},s.prototype._addBottomRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=r&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=r,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=r,this.vDomBottom++),e=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(e,t+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},s.prototype._removeBottomRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),t.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,e=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(e)}},s.prototype._quickNormalizeRowHeight=function(e){e.forEach(function(e){e.calcHeight()}),e.forEach(function(e){e.setCellHeight()}),e.length=0},s.prototype.normalizeHeight=function(){this.activeRows.forEach(function(e){e.normalizeHeight()})},s.prototype.adjustTableSize=function(){var e,t=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight: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||t==this.element.clientHeight||((e=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!e)&&this.redraw()}},s.prototype.reinitialize=function(){this.rows.forEach(function(e){e.reinitialize()})},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(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(t)),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 e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))};var r=function(e){this._row=e};r.prototype.getData=function(e){return this._row.getData(e)},r.prototype.getElement=function(){return this._row.getElement()},r.prototype.getCells=function(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e},r.prototype.getCell=function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()},r.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},r.prototype.getPosition=function(e){return this._row.table.rowManager.getRowPosition(this._row,e)},r.prototype.delete=function(){return this._row.delete()},r.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},r.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},r.prototype.move=function(e,t){this._row.moveToRow(e,t)},r.prototype.update=function(e){return this._row.updateData(e)},r.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},r.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)}, +r.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},r.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},r.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},r.prototype._getSelf=function(){return this._row},r.prototype.validate=function(){return this._row.validate()},r.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},r.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},r.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){return this._row.table.modules.frozenRows.rows.indexOf(this._row)>-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)},r.prototype.addTreeChild=function(e,t,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,e,t,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 e=this._row.nextRow();return e?e.getComponent():e},r.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var a=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),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.setData(e),this.generateElement()};a.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},a.prototype.getElement=function(){return this.element},a.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},a.prototype.generateElement=function(){var e,t,o,i=this;!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&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(e){i.table.options.rowClick(e,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(e){i.table.options.rowDblClick(e,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(e){i.table.options.rowContext(e,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(e){i.table.options.rowMouseEnter(e,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(e){i.table.options.rowMouseLeave(e,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(e){i.table.options.rowMouseOver(e,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(e){i.table.options.rowMouseOut(e,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(e){i.table.options.rowMouseMove(e,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null}))},a.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},a.prototype.initialize=function(e){var t=this;if(!t.initialized||e){for(t.deleteCells();t.element.firstChild;)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach(function(e){t.element.appendChild(e.getElement()),e.cellRendered()}),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},a.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},a.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},a.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(e){var o=e.getHeight();o>t&&(t=o)}),this.height=e?Math.max(t,o):this.manualHeight?this.height:Math.max(t,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},a.prototype.setCellHeight=function(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0},a.prototype.clearCellHeight=function(){this.cells.forEach(function(e){e.clearHeight()})},a.prototype.normalizeHeight=function(e){e&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()},a.prototype.setHeight=function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},a.prototype.getHeight=function(){return this.outerHeight},a.prototype.getWidth=function(){return this.element.offsetWidth},a.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},a.prototype.setData=function(e){this.table.modExists("mutator")&&(e=this.table.modules.mutator.transformRow(e,"data")),this.data=e,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},a.prototype.updateData=function(e){var t,o=this,i=d.prototype.helpers.elVisible(this.element),n={};return new Promise(function(s,r){"string"==typeof e&&(e=JSON.parse(e)),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,e),t=o.table.modules.mutator.transformRow(n,"data",e)):t=e;for(var a in t)o.data[a]=t[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in e){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(e){var n=o.getCell(e.getField());if(n){var s=e.getFieldValue(t);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}})}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(e)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()})},a.prototype.getData=function(e){var t=this;return e?t.table.modExists("accessor")?t.table.modules.accessor.transformRow(t.data,e):void 0:this.data},a.prototype.getCell=function(e){return e=this.table.columnManager.findColumn(e),this.cells.find(function(t){return t.column===e})},a.prototype.getCellIndex=function(e){return this.cells.findIndex(function(t){return t===e})},a.prototype.findNextEditableCell=function(e){var t=!1;if(e0)for(var o=e-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&d.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){t=i;break}}return t},a.prototype.getCells=function(){return this.cells},a.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},a.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},a.prototype.moveToRow=function(e,t){var o=this.table.rowManager.findRow(e);o?(this.table.rowManager.moveRowActual(this,o,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)},a.prototype.validate=function(){var e=[];return this.cells.forEach(function(t){t.validate()||e.push(t.getComponent())}),!e.length||e},a.prototype.delete=function(){var e=this;return new Promise(function(t,o){var i,n;e.table.options.history&&e.table.modExists("history")&&(e.table.options.groupBy&&e.table.modExists("groupRows")?(n=e.getGroup().rows,(i=n.indexOf(e))&&(i=n[i-1])):(i=e.table.rowManager.getRowIndex(e))&&(i=e.table.rowManager.rows[i-1]),e.table.modules.history.action("rowDelete",e,{data:e.getData(),pos:!i,index:i})),e.deleteActual(),t()})},a.prototype.deleteActual=function(e){this.table.rowManager.getRowIndex(this);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.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!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))},a.prototype.deleteCells=function(){for(var e=this.cells.length,t=0;t-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.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(e)||/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(e.substr(0,4))},d.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},d.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},d.prototype.setDataFromLocalFile=function(e){var t=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=e||".json,application/json",n.addEventListener("change",function(e){var s,r=n.files[0],a=new FileReader;a.readAsText(r),a.onload=function(e){try{s=JSON.parse(a.result)}catch(e){return console.warn("File Load Error - File contents is invalid JSON",e),void i(e)}t._setData(s).then(function(e){o(e)}).catch(function(e){o(e)})},a.onerror=function(e){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},d.prototype.setData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!1,!0)},d.prototype._setData=function(e,t,o,i,n){var s=this;return"string"!=typeof e?e?s.rowManager.setData(e,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==e.indexOf("{")||0==e.indexOf("[")?s.rowManager.setData(JSON.parse(e),i,n):s.modExists("ajax",!0)?(t&&s.modules.ajax.setParams(t),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(e),"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},d.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},d.prototype.getData=function(e){return!0===e&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getData(e)},d.prototype.getDataCount=function(e){return!0===e&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getDataCount(e)},d.prototype.searchRows=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",e,t,o)},d.prototype.searchData=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",e,t,o)},d.prototype.getHtml=function(e,t,o){if(this.modExists("export",!0))return this.modules.export.getHtml(e,t,o)},d.prototype.print=function(e,t,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(e,t,o)},d.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},d.prototype.replaceData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!0)},d.prototype.updateData=function(e){var t=this,o=this,i=0;return new Promise(function(n,s){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);t&&(i++,t.updateData(e).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},d.prototype.addData=function(e,t,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?i.rowManager.addRows(e,t,o).then(function(e){var t=[];e.forEach(function(e){t.push(e.getComponent())}),n(t)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},d.prototype.updateOrAddData=function(e){var t=this,o=this,i=[],n=0;return new Promise(function(s,r){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);n++,t?t.updateData(e).then(function(){n--,i.push(t.getComponent()),n||s(i)}):o.rowManager.addRows(e).then(function(e){n--,i.push(e[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})},d.prototype.getRow=function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},d.prototype.getRowFromPosition=function(e,t){var o=this.rowManager.getRowFromPosition(e,t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},d.prototype.deleteRow=function(e){var t=this;return new Promise(function(o,i){function n(){++r==e.length&&a&&(s.rowManager.reRenderInPosition(),o())}var s=t,r=0,a=0,l=[];Array.isArray(e)||(e=[e]),e.forEach(function(e){var o=t.rowManager.findRow(e,!0);o?l.push(o):(console.warn("Delete Error - No matching row found:",e),i("Delete Error - No matching row found"),n())}),l.sort(function(e,o){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(o)?1:-1}),l.forEach(function(e){e.delete().then(function(){a++,n()}).catch(function(e){n(),i(e)})})})},d.prototype.addRow=function(e,t,o){var i=this;return new Promise(function(n,s){"string"==typeof e&&(e=JSON.parse(e)),i.rowManager.addRows(e,t,o).then(function(e){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(e[0].getComponent())})})},d.prototype.updateOrAddRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(e){n(e)}):s=o.rowManager.addRows(t).then(function(e){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(e[0].getComponent())}).catch(function(e){n(e)})})},d.prototype.updateRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){i(s.getComponent())}).catch(function(e){n(e)}):(console.warn("Update Error - No matching row found:",e),n("Update Error - No matching row found"))})},d.prototype.scrollToRow=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.rowManager.findRow(e);r?i.rowManager.scrollToRow(r,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching row found:",e),s("Scroll Error - No matching row found"))})},d.prototype.moveRow=function(e,t,o){var i=this.rowManager.findRow(e);i?i.moveToRow(t,o):console.warn("Move Error - No matching row found:",e)},d.prototype.getRows=function(e){return!0===e&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getComponents(e)},d.prototype.getRowPosition=function(e,t){var o=this.rowManager.findRow(e);return o?this.rowManager.getRowPosition(o,t):(console.warn("Position Error - No matching row found:",e),!1)},d.prototype.copyToClipboard=function(e){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(e)},d.prototype.setColumns=function(e){this.columnManager.setColumns(e)},d.prototype.getColumns=function(e){return this.columnManager.getComponents(e)},d.prototype.getColumn=function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)},d.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},d.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},d.prototype.setColumnLayout=function(e){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,e)),!0)},d.prototype.showColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},d.prototype.hideColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},d.prototype.toggleColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()},d.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(o);i.columnManager.addColumn(e,t,r).then(function(e){n(e.getComponent())}).catch(function(e){s(e)})})},d.prototype.deleteColumn=function(e){var t=this;return new Promise(function(o,i){var n=t.columnManager.findColumn(e);n?n.delete().then(function(){o()}).catch(function(e){i(e)}):(console.warn("Column Delete Error - No matching column found:",e),i())})},d.prototype.updateColumnDefinition=function(e,t){var o=this;return new Promise(function(i,n){var s=o.columnManager.findColumn(e);s?s.updateDefinition(t).then(function(e){i(e)}).catch(function(e){n(e)}):(console.warn("Column Update Error - No matching column found:",e),n())})},d.prototype.moveColumn=function(e,t,o){var i=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);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:",e)},d.prototype.scrollToColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(e);r?i.columnManager.scrollToColumn(r,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching column found:",e),s("Scroll Error - No matching column found"))})},d.prototype.setLocale=function(e){this.modules.localize.setLocale(e)},d.prototype.getLocale=function(){return this.modules.localize.getLocale()},d.prototype.getLang=function(e){return this.modules.localize.getLang(e)},d.prototype.redraw=function(e){this.columnManager.redraw(e),this.rowManager.redraw(e)},d.prototype.setHeight=function(e){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(e)?e:e+"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")},d.prototype.setSort=function(e,t){this.modExists("sort",!0)&&(this.modules.sort.setSort(e,t),this.rowManager.sorterRefresh())},d.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},d.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},d.prototype.setFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(e,t,o,i),this.rowManager.filterRefresh())},d.prototype.addFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(e,t,o,i),this.rowManager.filterRefresh())},d.prototype.getFilters=function(e){if(this.modExists("filter",!0))return this.modules.filter.getFilters(e)},d.prototype.setHeaderFilterFocus=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterFocus(t)}},d.prototype.getHeaderFilterValue=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(t)return this.modules.filter.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},d.prototype.setHeaderFilterValue=function(e,t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(e);if(!o)return console.warn("Column Filter Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterValue(o,t)}},d.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},d.prototype.removeFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(e,t,o),this.rowManager.filterRefresh())},d.prototype.clearFilter=function(e){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(e),this.rowManager.filterRefresh())},d.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},d.prototype.selectRow=function(e){this.modExists("selectRow",!0)&&(!0===e&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),e="active"),this.modules.selectRow.selectRows(e))},d.prototype.deselectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(e)},d.prototype.toggleSelectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(e)},d.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},d.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},d.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},d.prototype.clearCellValidation=function(e){var t=this;this.modExists("validate",!0)&&(e||(e=this.modules.validate.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach(function(e){t.modules.validate.clearValidation(e._getSelf())}))},d.prototype.validate=function(e){var t=[];return this.rowManager.rows.forEach(function(e){var o=e.validate();!0!==o&&(t=t.concat(o))}),!t.length||t},d.prototype.setMaxPage=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(e)},d.prototype.setPage=function(e){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(e):new Promise(function(e,t){t()})},d.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){t.options.pagination&&t.modExists("page")?(e=t.rowManager.findRow(e),e?t.modules.page.setPageToRow(e).then(function(){o()}).catch(function(){i()}):i()):i()})},d.prototype.setPageSize=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(e),this.modules.page.setPage(1).then(function(){}).catch(function(){})},d.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},d.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},d.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},d.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},d.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},d.prototype.setGroupBy=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=e,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")},d.prototype.setGroupStartOpen=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=e,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")},d.prototype.setGroupHeader=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=e,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")},d.prototype.getGroups=function(e){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},d.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},d.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},d.prototype.clearCellEdited=function(e){var t=this;this.modExists("edit",!0)&&(e||(e=this.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach(function(e){t.modules.edit.clearEdited(e._getSelf())}))},d.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},d.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},d.prototype.navigatePrev=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().prev()},d.prototype.navigateNext=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().next()},d.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},d.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},d.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},d.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},d.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},d.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},d.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},d.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},d.prototype.download=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i)},d.prototype.downloadToTab=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i,!0)},d.prototype.tableComms=function(e,t,o,i){this.modules.comms.receive(e,t,o,i)},d.prototype.moduleBindings={},d.prototype.extendModule=function(e,t,o){if(d.prototype.moduleBindings[e]){var i=d.prototype.moduleBindings[e].prototype[t];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:",t)}else console.warn("Module Error - module does not exist:",e)},d.prototype.registerModule=function(e,t){d.prototype.moduleBindings[e]=t},d.prototype.bindModules=function(){this.modules={};for(var e in d.prototype.moduleBindings)this.modules[e]=new d.prototype.moduleBindings[e](this)},d.prototype.modExists=function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)},d.prototype.helpers={elVisible:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)},elOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(e){var t=Array.isArray(e)?[]:{};for(var o in e)null!=e[o]&&"object"===_typeof(e[o])?e[o]instanceof Date?t[o]=new Date(e[o]):t[o]=this.deepClone(e[o]):t[o]=e[o];return t}},d.prototype.comms={tables:[],register:function(e){d.prototype.comms.tables.push(e)},deregister:function(e){var t=d.prototype.comms.tables.indexOf(e);t>-1&&d.prototype.comms.tables.splice(t,1)},lookupTable:function(e,t){var o,i,n=[];if("string"==typeof e){if(o=document.querySelectorAll(e),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(e){function t(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function o(e,i,n,s){function r(e){return n*(e.column.definition.widthGrow||1)}function a(e){return t(e.width)-n*(e.column.definition.widthShrink||0)}var l=[],c=0,u=0,d=0,h=0,p=0,m=[];return e.forEach(function(e,t){var o=s?a(e):r(e);e.column.minWidth>=o?l.push(e):(m.push(e),p+=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)}),l.length?(l.forEach(function(e){c+=s?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth}),u=i-c,d=p?Math.floor(u/p):u,h=u-d*p,h+=o(m,u,d,s)):(h=p?i-Math.floor(i/p)*p:i,m.forEach(function(e){e.width=s?a(e):r(e)})),h}var i=this,n=i.table.element.clientWidth,s=0,r=0,a=0,l=0,c=[],u=[],d=0,h=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach(function(e){var o,i,n;e.visible&&(o=e.definition.width,i=parseInt(e.minWidth),o?(n=t(o),s+=n>i?n:i,e.definition.widthShrink&&(u.push({column:e,width:n>i?n:i}),d+=e.definition.widthShrink)):(c.push({column:e,width:0}),a+=e.definition.widthGrow||1))}),r=n-s,l=Math.floor(r/a);var p=o(c,r,l,!1);c.length&&p>0&&(c[c.length-1].width+=+p),c.forEach(function(e){r-=e.width}),h=Math.abs(p)+r,h>0&&d&&(p=o(u,h,Math.floor(h/d),!0)),u.length&&(u[u.length-1].width-=p),c.forEach(function(e){e.column.setWidth(e.width)}),u.forEach(function(e){e.column.setWidth(e.width)})}},d.prototype.registerModule("layout",h);var p=function(e){this.table=e,this.locale="default",this.lang=!1,this.bindings={}};p.prototype.setHeaderFilterPlaceholder=function(e){this.langs.default.headerFilters.default=e},p.prototype.setHeaderFilterColumnPlaceholder=function(e,t){this.langs.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)},p.prototype.installLang=function(e,t){this.langs[e]?this._setLangProp(this.langs[e],t):this.langs[e]=t},p.prototype._setLangProp=function(e,t){for(var o in t)e[o]&&"object"==_typeof(e[o])?this._setLangProp(e[o],t[o]):e[o]=t[o]},p.prototype.setLocale=function(e){function t(e,o){for(var i in e)"object"==_typeof(e[i])?(o[i]||(o[i]={}),t(e[i],o[i])):o[i]=e[i]}var o=this;if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!o.langs[e]){var i=e.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}o.locale=e,o.lang=d.prototype.helpers.deepClone(o.langs.default||{}),"default"!=e&&t(o.langs[e],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},p.prototype.getLocale=function(e){return self.locale},p.prototype.getLang=function(e){return e?this.langs[e]:this.lang},p.prototype.getText=function(e,t){var e=t?e+"|"+t:e,o=e.split("|");return this._getLangElement(o,this.locale)||""},p.prototype._getLangElement=function(e,t){var o=this,i=o.lang;return e.forEach(function(e){var t;i&&(t=i[e],i=void 0!==t&&t)}),i},p.prototype.bind=function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)},p.prototype._executeBindings=function(){var e=this;for(var t in e.bindings)!function(t){e.bindings[t].forEach(function(o){o(e.getText(t),e.lang)})}(t)},p.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:{}}}},d.prototype.registerModule("localize",p);var m=function(e){this.table=e};m.prototype.getConnections=function(e){var t,o=this,i=[];return t=d.prototype.comms.lookupTable(e),t.forEach(function(e){o.table!==e&&i.push(e)}),i},m.prototype.send=function(e,t,o,i){var n=this,s=this.getConnections(e);s.forEach(function(e){e.tableComms(n.table.element,t,o,i)}),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)},m.prototype.receive=function(e,t,o,i){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,o,i);console.warn("Inter-table Comms Error - no such module:",t)},d.prototype.registerModule("comms",m);var f=function(e){this.table=e,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};f.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[r]&&(s=t.lookupAccessor(e.definition[r]))&&(o=!0,i[r]={accessor:s,params:e.definition[r+"Params"]||{}})}),o&&(e.modules.accessor=i)},f.prototype.lookupAccessor=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.accessors[e]?t=this.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t},f.prototype.transformRow=function(e,t){var o=this,i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=d.prototype.helpers.deepClone(e||{});return o.table.columnManager.traverse(function(e){var o,s,r,a;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(o=e.getFieldValue(n))&&(a=e.getComponent(),r="function"==typeof s.params?s.params(o,n,t,a):s.params,e.setFieldValue(n,s.accessor(o,n,t,r,a)))}),n},f.prototype.accessors={},d.prototype.registerModule("accessor",f);var g=function(e){this.table=e,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};g.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.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?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.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"))},g.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},g.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},g.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},g.prototype.getParams=function(){return this.params||{}},g.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},g.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},g.prototype.setUrl=function(e){this.url=e},g.prototype.getUrl=function(){return this.url},g.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},g.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ei||null===i)&&(i=e)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(e,t,o){var i=null,n=void 0!==o.precision&&o.precision;return e.forEach(function(e){((e=Number(e))"),o.dataTreeExpandElement?"string"==typeof o.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=o.dataTreeExpandElement,this.expandEl=e.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(e,t){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return o.dataTreeStartExpanded[t]}}},y.prototype.initializeRow=function(e){var t=e.getData()[this.field],o=Array.isArray(t),i=o||!o&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!i&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!i&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!i&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:i}},y.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],o=t.getElement(),i=e.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(e,o),e.element.classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},y.prototype.generateControlElement=function(e,t){var o=this,i=e.modules.dataTree,t=t||e.getCells()[0].getElement(),n=i.controlEl;!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.expandRow(e)})),i.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))},y.prototype.setDisplayIndex=function(e){this.displayIndex=e},y.prototype.getDisplayIndex=function(){return this.displayIndex},y.prototype.getRows=function(e){var t=this,o=[];return e.forEach(function(e,i){var n,s;o.push(e),e instanceof a&&(n=e.modules.dataTree.children,n.index||!1===n.children||(s=t.getChildren(e),s.forEach(function(e){o.push(e)})))}),o},y.prototype.getChildren=function(e){var t=this,o=e.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach(function(e){n.push(e),t.getChildren(e).forEach(function(e){n.push(e)})})),n},y.prototype.generateChildren=function(e){var t=this,o=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var n=new a(i||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e, +n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)}),o},y.prototype.expandRow=function(e,t){var o=e.modules.dataTree;!1!==o.children&&(o.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},y.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},y.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},y.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},y.prototype.getFilteredTreeChildren=function(e){var t,o=e.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,t.forEach(function(e){e instanceof a&&i.push(e)})),i},y.prototype.rowDelete=function(e){var t,o=e.modules.dataTree.parent;o&&(t=this.findChildIndex(e,o),!1!==t&&o.data[this.field].splice(t,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)},y.prototype.addTreeChildRow=function(e,t,o,i){var n=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==i&&!1!==(n=this.findChildIndex(i,e))&&e.data[this.field].splice(o?n:n+1,0,t),!1===n&&(o?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)},y.prototype.findChildIndex=function(e,t){var o=this,i=!1;return"object"==(void 0===e?"undefined":_typeof(e))?e instanceof a?i=e.data:e instanceof r?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find(function(t){return t instanceof a&&t.element===e}))&&(i=i.data):i=void 0!==e&&null!==e&&t.data[this.field].find(function(t){return t.data[o.table.options.index]==e}),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i},y.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,o=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof a&&o.push(e.getComponent())})),o},y.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},y.prototype.getChildField=function(){return this.field},y.prototype.redrawNeeded=function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]},d.prototype.registerModule("dataTree",y);var w=function(e){this.table=e};w.prototype.download=function(e,t,o,i,n){function s(o,i){n?!0===n?r.triggerDownload(o,i,e,t,!0):n(o):r.triggerDownload(o,i,e,t)}var r=this,a=!1;if("function"==typeof e?a=e:r.downloaders[e]?a=r.downloaders[e]:console.warn("Download Error - No such download type found: ",e),a){var l=this.generateExportList(i);a.call(this.table,l,o||{},s)}},w.prototype.generateExportList=function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),o=this.table.options.groupHeaderDownload;return o&&!Array.isArray(o)&&(o=[o]),t.forEach(function(e){var t;"group"===e.type&&(t=e.columns[0],o&&o[e.indent]&&(t.value=o[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))}),t},w.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),r=new Blob([e],{type:t}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(r=this.table.options.downloadReady.call(this.table,e,r))&&(n?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,i):(s.setAttribute("href",window.URL.createObjectURL(r)),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())},w.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept)}},w.prototype.downloaders={csv:function(e,t,o){var i=t&&t.delimiter?t.delimiter:",",n=[],s=[];e.forEach(function(e){var t=[];switch(e.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":e.columns.forEach(function(e,t){e&&1===e.depth&&(s[t]=void 0===e.value||"null"==typeof e.value?"":e.value)});break;case"row":e.columns.forEach(function(e){if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}}),n.push(t.join(i))}}),s.length&&(n=[s].concat(n)),n=n.join("\n"),t.bom&&(n="\ufeff"+n),o(n,"text/csv")},json:function(e,t,o){var i=[];e.forEach(function(e){var t={};switch(e.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":e.columns.forEach(function(e){e&&(t[e.component.getField()]=e.value)}),i.push(t)}}),i=JSON.stringify(i,null,"\t"),o(i,"application/json")},pdf:function(e,t,o){function i(e,t){var o=[];return e.columns.forEach(function(e){var i;if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}i={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(i.styles=t),o.push(i)}else o.push("")}),o}var n=[],s=[],r={},a=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=t.jsPDF||{},u=t&&t.title?t.title:"";c.orientation||(c.orientation=t.orientation||"landscape"),c.unit||(c.unit="pt"),e.forEach(function(e){switch(e.type){case"header":n.push(i(e));break;case"group":s.push(i(e,a));break;case"calc":s.push(i(e,l));break;case"row":s.push(i(e))}});var d=new jsPDF(c);t&&t.autoTable&&(r="function"==typeof t.autoTable?t.autoTable(d)||{}:t.autoTable),u&&(r.addPageContent=function(e){d.text(u,40,30)}),r.head=n,r.body=s,d.autoTable(r),t&&t.documentProcessing&&t.documentProcessing(d),o(d.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,o){function i(){var t=[],o=[],i={},n={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce(function(e,t){return e+(t&&t.width?t.width:1)},0):0,r:e.length}};return e.forEach(function(e,i){var n=[];e.columns.forEach(function(e,t){e?(n.push(e.value instanceof Date||"object"!==_typeof(e.value)?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&o.push({s:{r:i,c:t},e:{r:i+e.height-1,c:t+e.width-1}})):n.push("")}),t.push(n)}),XLSX.utils.sheet_add_aoa(i,t),i["!ref"]=XLSX.utils.encode_range(n),o.length&&(i["!merges"]=o),i}var n,s=this,r=t.sheetName||"Sheet1",a=XLSX.utils.book_new();if(a.SheetNames=[],a.Sheets={},t.sheetOnly)return void o(i());if(t.sheets)for(var l in t.sheets)!0===t.sheets[l]?(a.SheetNames.push(l),a.Sheets[l]=i()):(a.SheetNames.push(l),this.table.modules.comms.send(t.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:s.active,intercept:function(e){a.Sheets[l]=e}}));else a.SheetNames.push(r),a.Sheets[r]=i();t.documentProcessing&&(a=t.documentProcessing(a)),n=XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"}),o(function(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i!=e.length;++i)o[i]=255&e.charCodeAt(i);return t}(n),"application/octet-stream")},html:function(e,t,o){this.modExists("export",!0)&&o(this.modules.export.genereateHTMLTable(e),"text/html")}},d.prototype.registerModule("download",w);var E=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};E.prototype.initializeColumn=function(e){var t=this,o={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?o.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":o.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?o.editor=t.editors[e.definition.formatter]:o.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}o.editor&&(e.modules.edit=o)},E.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},E.prototype.clearEditor=function(e){var t,o=this.currentCell;if(this.invalidEdit=!1,o){for(this.currentCell=!1,t=o.getElement(),e?o.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}},E.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},E.prototype.bindEditor=function(e){var t=this,o=e.getElement();o.setAttribute("tabindex",0),o.addEventListener("click",function(e){o.classList.contains("tabulator-editing")||o.focus({preventScroll:!0})}),o.addEventListener("mousedown",function(e){t.mouseClick=!0}),o.addEventListener("focus",function(o){t.recursionBlock||t.edit(e,o,!1)})},E.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},E.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},E.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,o=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=e.row.getElement();i.offsetTop;i.offsetTopo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o)}},E.prototype.edit=function(e,t,o){function i(t){if(c.currentCell===e){var o=!0;return e.column.modules.validate&&c.table.modExists("validate")&&"manual"!=c.table.options.validationMode&&(o=c.table.modules.validate.validate(e.column.modules.validate,e,t)),!0===o||"highlight"===c.table.options.validationMode?(c.clearEditor(),e.setValue(t,!0),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==c.editedCells.indexOf(e)&&c.editedCells.push(e),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e),!0===o||(h.classList.add("tabulator-validation-fail"),!1)):(c.invalidEdit=!0,h.classList.add("tabulator-validation-fail"),c.focusCellNoEvent(e,!0),d(),c.table.options.validationFailed.call(c.table,e.getComponent(),t,o),!1)}}function n(){c.currentCell===e&&(c.cancelEdit(),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e))}function s(e){d=e}var r,a,l,c=this,u=!0,d=function(){},h=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":u=e.column.modules.edit.check(e.getComponent());break;case"boolean":u=e.column.modules.edit.check}if(u||o){if(c.cancelEdit(),c.currentCell=e,this.focusScrollAdjust(e),a=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,a)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,a),c.table.options.cellEditing.call(this.table,a),l="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(a):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(c,a,s,i,n,l)))return h.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),h.blur(),!1;for(h.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");h.firstChild;)h.removeChild(h.firstChild);h.appendChild(r),d();for(var p=h.children,m=0;m46){if(o>=i.length)return t.preventDefault(),t.stopPropagation(),a=!1,!1;switch(i[o]){case n:if(l.toUpperCase()==l.toLowerCase())return t.preventDefault(),t.stopPropagation(),a=!1,!1;break;case s:if(isNaN(l))return t.preventDefault(),t.stopPropagation(),a=!1,!1;break;case r:break;default:if(l!==i[o])return t.preventDefault(),t.stopPropagation(),a=!1,!1}a=!0}}),e.addEventListener("keyup",function(i){i.keyCode>46&&t.maskAutoFill&&o(e.value.length)}),e.placeholder||(e.placeholder=i),t.maskAutoFill&&o(e.value.length)},E.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach(function(t){e.push(t.getComponent())}),e},E.prototype.clearEdited=function(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1))},E.prototype.editors={input:function(e,t,o,i,n){function s(e){(null===r||void 0===r)&&""!==a.value||a.value!==r?o(a.value)&&(r=a.value):i()}var r=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",n.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),a.setAttribute(l,a.getAttribute(l)+n.elementAttributes["+"+l])):a.setAttribute(l,n.elementAttributes[l]);return a.value=void 0!==r?r:"",t(function(){a.focus({preventScroll:!0}),a.style.height="100%"}),a.addEventListener("change",s),a.addEventListener("blur",s),a.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s(e);break;case 27:i()}}),n.mask&&this.table.modules.edit.maskInput(a,n),a},textarea:function(e,t,o,i,n){function s(t){(null===r||void 0===r)&&""!==c.value||c.value!==r?(o(c.value)&&(r=c.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):i()}var r=e.getValue(),a=n.verticalNavigation||"hybrid",l=String(null!==r&&void 0!==r?r:""),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,t(function(){c.focus({preventScroll:!0}),c.style.height="100%"}),c.addEventListener("change",s),c.addEventListener("blur",s),c.addEventListener("keyup",function(){c.style.height="";var t=c.scrollHeight;c.style.height=t+"px",t!=u&&(u=t,e.getRow().normalizeHeight())}),c.addEventListener("keydown",function(e){switch(e.keyCode){case 27:i();break;case 38:("editor"==a||"hybrid"==a&&c.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==a||"hybrid"==a&&c.selectionStart!==c.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(c,n),c},number:function(e,t,o,i,n){function s(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==r?o(e)&&(r=e):i()}var r=e.getValue(),a=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=r;var u=function(e){s()};return t(function(){l.removeEventListener("blur",u),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",u)}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s();break;case 27:i();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(l,n),l},range:function(e,t,o,i,n){function s(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!=r?o(e)&&(r=e):i()}var r=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),void 0!==n.max&&a.setAttribute("max",n.max),void 0!==n.min&&a.setAttribute("min",n.min),void 0!==n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),a.setAttribute(l,a.getAttribute(l)+n.elementAttributes["+"+l])):a.setAttribute(l,n.elementAttributes[l]);return a.value=r,t(function(){a.focus({preventScroll:!0}),a.style.height="100%"}),a.addEventListener("blur",function(e){s()}),a.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s();break;case 27:i()}}),a},select:function(e,t,o,i,n){function s(t){var o,i={},s=w.table.getData();return o=t?w.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),o?(s.forEach(function(e){var t=o.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(i[t]=!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 select lookup list:",t),i}function r(t,o){function i(e){var e={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1};return o.indexOf(e.value)>-1&&c(e),n.push(e),s.push(e),e}var n=[],s=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1},s.push(t),e.options.forEach(function(e){i(e)})):i(e):(t={label:e,value:e,element:!1},o.indexOf(t.value)>-1&&c(t),n.push(t),s.push(t))});else for(var r in t){var l={label:t[r],value:r,element:!1};o.indexOf(l.value)>-1&&c(l),n.push(l),s.push(l)}D=n,S=s,a()}function a(){for(;L.firstChild;)L.removeChild(L.firstChild);S.forEach(function(t){var o=t.element;if(!o){if(o=document.createElement("div"),t.label=n.listItemFormatter?n.listItemFormatter(t.value,t.label,e,o,t.itemParams):t.label,t.group?(o.classList.add("tabulator-edit-select-list-group"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label):(o.classList.add("tabulator-edit-select-list-item"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label,o.addEventListener("click",function(){T?(h(t),M.focus()):p(t)}),H.indexOf(t)>-1&&(console.log("current",k),o.classList.add("active"))),t.elementAttributes&&"object"==_typeof(t.elementAttributes))for(var i in t.elementAttributes)"+"==i.charAt(0)?(i=i.slice(1),o.setAttribute(i,M.getAttribute(i)+t.elementAttributes["+"+i])):o.setAttribute(i,t.elementAttributes[i]);o.addEventListener("mousedown",function(){z=!1,setTimeout(function(){z=!0},10)}),t.element=o}L.appendChild(o)})}function l(e,t){!T&&k&&k.element&&k.element.classList.remove("active"),k&&k.element&&k.element.classList.remove("focused"),k=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function c(e){-1==H.indexOf(e)&&(H.push(e),l(e,!0)),f()}function u(e){var t=H[e];e>-1&&(H.splice(e,1),t.element&&t.element.classList.remove("active"))}function h(e){e||(e=k);var t=H.indexOf(e);t>-1?u(t):(!0!==T&&H.length>=T&&u(0),c(e)),f()}function p(e){v(),e||(e=k),e&&o(e.value)}function m(){v();var e=[];H.forEach(function(t){e.push(t.value)}),o(e)}function f(){var e=[];H.forEach(function(t){e.push(t.label)}),M.value=e.join(", ")}function g(){v(),i()}function b(){if(!L.parentNode){!0===n.values?r(s(),R):"string"==typeof n.values?r(s(n.values),R):r(n.values||[],R);var e=d.prototype.helpers.elOffset(E);L.style.minWidth=E.offsetWidth+"px",L.style.top=e.top+E.offsetHeight+"px",L.style.left=e.left+"px",L.addEventListener("mousedown",function(e){z=!1,setTimeout(function(){z=!0},10)}),document.body.appendChild(L)}}function v(){L.parentNode&&L.parentNode.removeChild(L),y()}function y(){w.table.rowManager.element.removeEventListener("scroll",g)}var w=this,E=e.getElement(),C=e.getValue(),x=n.verticalNavigation||"editor",R=void 0!==C||null===C?C:void 0!==n.defaultValue?n.defaultValue:[],M=document.createElement("input"),L=document.createElement("div"),T=n.multiselect,D=[],k={},S=[],H=[],z=!0;if(this.table.rowManager.element.addEventListener("scroll",g),(Array.isArray(n)||!Array.isArray(n)&&"object"===(void 0===n?"undefined":_typeof(n))&&!n.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),n={values:n}),M.setAttribute("type","text"),M.style.padding="4px",M.style.width="100%",M.style.boxSizing="border-box",M.style.cursor="default",M.readOnly=0!=this.currentCell,n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var A in n.elementAttributes)"+"==A.charAt(0)?(A=A.slice(1),M.setAttribute(A,M.getAttribute(A)+n.elementAttributes["+"+A])):M.setAttribute(A,n.elementAttributes[A]);return M.value=void 0!==C||null===C?C:"",M.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=D.indexOf(k),("editor"==x||"hybrid"==x&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&l(D[t-1],!T));break;case 40:t=D.indexOf(k),("editor"==x||"hybrid"==x&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&s.push(t)}),h(s,t))}function l(e){var t=document.createElement("div");u(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,L.appendChild(t))}function c(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var o={};"object"===(void 0===e?"undefined":_typeof(e))?(o.title=n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,o.value=e.value):(o.title=n.listItemFormatter?n.listItemFormatter(e,e):e,o.value=e),t.push(o)});else for(var o in e){var i={title:n.listItemFormatter?n.listItemFormatter(o,e[o]):e[o],value:o};t.push(i)}return t}function u(){for(;L.firstChild;)L.removeChild(L.firstChild)}function h(e,t){e.length?p(e,t):n.emptyPlaceholder&&l(n.emptyPlaceholder)}function p(e,t){var o=!1;u(),T=e,T.forEach(function(e){var i=e.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=e.title,i.addEventListener("click",function(t){g(e),m()}),i.addEventListener("mousedown",function(e){k=!1,setTimeout(function(){k=!0},10)}),e.element=i,t&&e.value==C&&(M.value=e.title,e.element.classList.add("active"),o=!0),e===D&&(e.element.classList.add("active"),o=!0)),L.appendChild(i)}),o||g(!1)}function m(){b(),D?C!==D.value?(C=D.value,M.value=D.title,o(D.value)):i():n.freetext?(C=M.value,o(M.value)):n.allowEmpty&&""===M.value?(C=M.value,o(M.value)):i()}function f(){if(!L.parentNode){for(;L.firstChild;)L.removeChild(L.firstChild);var e=d.prototype.helpers.elOffset(E);L.style.minWidth=E.offsetWidth+"px",L.style.top=e.top+E.offsetHeight+"px",L.style.left=e.left+"px",document.body.appendChild(L)}}function g(e,t){D&&D.element&&D.element.classList.remove("active"),D=e,e&&e.element&&e.element.classList.add("active")}function b(){L.parentNode&&L.parentNode.removeChild(L),y()}function v(){b(),i()}function y(){w.table.rowManager.element.removeEventListener("scroll",v)}var w=this,E=e.getElement(),C=e.getValue(),x=n.verticalNavigation||"editor",R=void 0!==C||null===C?C:void 0!==n.defaultValue?n.defaultValue:"",M=document.createElement("input"),L=document.createElement("div"),T=[],D=!1,k=!0,S=!1;if(this.table.rowManager.element.addEventListener("scroll",v),M.setAttribute("type","search"),M.style.padding="4px",M.style.width="100%",M.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var H in n.elementAttributes)"+"==H.charAt(0)?(H=H.slice(1),M.setAttribute(H,M.getAttribute(H)+n.elementAttributes["+"+H])):M.setAttribute(H,n.elementAttributes[H]);return L.classList.add("tabulator-edit-select-list"),L.addEventListener("mousedown",function(e){k=!1,setTimeout(function(){k=!0},10)}),M.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=T.indexOf(D),("editor"==x||"hybrid"==x&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),g(t>0?T[t-1]:!1));break;case 40:t=T.indexOf(D),("editor"==x||"hybrid"==x&&t'):("ie"==a.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){c=e,s(e)}var a=this,l=e.getElement(),c=e.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(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),s(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e)}),t.appendChild(i),p.appendChild(t)}(g);return c=Math.min(parseInt(c),u),s(c),p.addEventListener("mousemove",function(e){s(0)}),p.addEventListener("click",function(e){o(0)}),l.addEventListener("blur",function(e){i()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(c+1);break;case 37:r(c-1);break;case 13:o(c);break;case 27:i()}}),p},progress:function(e,t,o,i,n){function s(){var e=d*Math.round(m.offsetWidth/(l.clientWidth/100))+u;o(e),l.setAttribute("aria-valuenow",e),l.setAttribute("aria-label",h)}var r,a,l=e.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=e.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(e){r=e.screenX,a=m.offsetWidth}),p.addEventListener("mouseover",function(){p.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(e){r&&(m.style.width=a+e.screenX-r+"px")}),l.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,a=!1,s())}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+l.clientWidth/100+"px";break;case 37:e.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(e,t,o,i,n){function s(e){return l?e?u?c:a.checked:a.checked&&!u?(a.checked=!1,a.indeterminate=!0,u=!0,c):(u=!1,a.checked):a.checked}var r=e.getValue(),a=document.createElement("input"),l=n.tristate,c=void 0===n.indeterminateValue?null:n.indeterminateValue,u=!1;if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),a.setAttribute(d,a.getAttribute(d)+n.elementAttributes["+"+d])):a.setAttribute(d,n.elementAttributes[d]);return a.value=r,!l||void 0!==r&&r!==c&&""!==r||(u=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){a.focus({preventScroll:!0})}),a.checked=!0===r||"true"===r||"True"===r||1===r,a.addEventListener("change",function(e){o(s())}),a.addEventListener("blur",function(e){o(s(!0))}),a.addEventListener("keydown",function(e){13==e.keyCode&&o(s()),27==e.keyCode&&i()}),a}},d.prototype.registerModule("edit",E);var C=function(e,t,o,i){this.type=e,this.columns=t,this.component=o||!1,this.indent=i||0},x=function(e,t,o,i,n){this.value=e,this.component=t||!1,this.width=o,this.height=i,this.depth=n},R=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};R.prototype.generateExportList=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],s=this.bodyToExportRows(this.rowLookup(o));return n.concat(s)},R.prototype.genereateTable=function(e,t,o,i){var n=this.generateExportList(e,t,o,i);return this.genereateTableElement(n)},R.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach(function(e){(e=t.table.rowManager.findRow(e))&&o.push(e)});else switch(e){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.rowManager.getDisplayRows()}return Object.assign([],o)},R.prototype.generateColumnGroupHeaders=function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var i=e.processColumnGroup(o);i&&t.push(i)}),t},R.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n=e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,s={title:n,column:e,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach(function(e){var o=t.processColumnGroup(e);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(e))return!1;s.width=1}return s},R.prototype.columnVisCheck=function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])},R.prototype.headersToExportRows=function(e){function t(e,n){var s=i-n;if(void 0===o[n]&&(o[n]=[]),e.height=e.subGroups?1:s-e.depth+1,o[n].push(e),e.height>1)for(var r=1;r1)for(var a=1;ai&&(i=e.depth)}),e.forEach(function(e){t(e,0)}),o.forEach(function(e){var t=[];e.forEach(function(e){e?t.push(new x(e.title,e.column.getComponent(),e.width,e.height,e.depth)):t.push(null)}),n.push(new C("header",t))}),n},R.prototype.bodyToExportRows=function(e){var t=this,o=[],i=[];return this.table.columnManager.columnsByIndex.forEach(function(e){t.columnVisCheck(e)&&o.push(e.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter(function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}),e.forEach(function(e,n){var s=e.getData(t.colVisProp),r=[],a=0;switch(e.type){case"group":a=e.level,r.push(new x(e.key,e.getComponent(),o.length,1));break;case"calc":case"row":o.forEach(function(e){r.push(new x(e._column.getFieldValue(s),e,1,1))}),t.table.options.dataTree&&!1!==t.config.dataTree&&(a=e.modules.dataTree.index)}i.push(new C(e.type,r,e.getComponent(),a))}),i},R.prototype.genereateTableElement=function(e){var t=this,o=document.createElement("table"),i=document.createElement("thead"),n=document.createElement("tbody"),s=this.lookupTableStyles(),r=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],a={};return a.rowFormatter=null!==r?r:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(a.treeElementField=this.table.modules.dataTree.elementField),a.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],a.groupHeader&&!Array.isArray(a.groupHeader)&&(a.groupHeader=[a.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"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(function(e,o){switch(e.type){case"header":i.appendChild(t.genereateHeaderElement(e,a,s));break;case"group":n.appendChild(t.genereateGroupElement(e,a,s));break;case"calc":n.appendChild(t.genereateCalcElement(e,a,s));break;case"row":var r=t.genereateRowElement(e,a,s);t.mapElementStyles(o%2&&s.evenRow?s.evenRow:s.oddRow,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(r)}}),i.innerHTML&&o.appendChild(i),o.appendChild(n),this.mapElementStyles(this.table.element,o,["border-top","border-left","border-right","border-bottom"]),o},R.prototype.lookupTableStyles=function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e},R.prototype.genereateHeaderElement=function(e,t,o){var i=this,n=document.createElement("tr");return e.columns.forEach(function(e){if(e){var t=document.createElement("th"),o=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,i.cloneTableStyle&&(t.style.boxSizing="border-box"),o.forEach(function(e){t.classList.add(e)}),i.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),i.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?i.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&i.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),n.appendChild(t)}}),n},R.prototype.genereateGroupElement=function(e,t,o){var i=document.createElement("tr"),n=document.createElement("td"),s=e.columns[0];return i.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?s.value=t.groupHeader[e.indent](s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?s.value=s.value:s.value=e.component._group.generator(s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),n.colSpan=s.width,n.innerHTML=s.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+e.indent),s.component.getVisibility()&&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},R.prototype.genereateCalcElement=function(e,t,o){var i=this.genereateRowElement(e,t,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},R.prototype.genereateRowElement=function(e,t,o){var n=this,s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach(function(r){if(r){var a=document.createElement("td"),l=r.component._column,c=r.value,u={modules:{},getValue:function(){return c},getField:function(){return l.definition.field},getElement:function(){return a},getColumn:function(){return l.getComponent()},getData:function(){return rowData},getRow:function(){return e.getComponent()},getComponent:function(){return u},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach(function(e){a.classList.add(e)}),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}if(c instanceof Node?a.appendChild(c):a.innerHTML=c,o.firstCell&&(n.mapElementStyles(o.firstCell,a,["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&&(a.style.textAlign=l.definition.align)),n.table.options.dataTree&&!1!==n.config.dataTree&&(t.treeElementField&&t.treeElementField==l.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&a.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),a.firstChild),e.component._row.modules.dataTree.branchEl&&a.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),a.firstChild)),s.appendChild(a),u.modules.format&&u.modules.format.renderedCallback&&u.modules.format.renderedCallback(),t.rowFormatter&&!1!==n.config.formatCells){var d=e.getComponent();d.getElement=function(){return s},t.rowFormatter(d)}}}),s},R.prototype.genereateHTMLTable=function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML},R.prototype.getHtml=function(e,t,o,i){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,t,e,i||"htmlOutput");return this.genereateHTMLTable(n)},R.prototype.mapElementStyles=function(e,t,o){if(this.cloneTableStyle&&e&&t){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(e);o.forEach(function(e){t.style[i[e]]=n.getPropertyValue(e)})}}},d.prototype.registerModule("export",R);var M=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};M.prototype.initializeColumn=function(e,t){function o(t){var o,r="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",a="",l="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete n.headerFilters[s];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":n.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,o=function(o){var i=e.definition.headerFilterFuncParams||{},s=e.getFieldValue(o);return i="function"==typeof i?i(t,s,o):i,n.filters[e.definition.headerFilterFunc](t,s,o,i)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":o=function(o){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(o);return i="function"==typeof i?i(t,n,o):i,e.definition.headerFilterFunc(t,n,o,i)},a=o}if(!o)switch(r){case"partial":o=function(o){var i=e.getFieldValue(o);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},a="like";break;default:o=function(o){return e.getFieldValue(o)==t},a="="}n.headerFilters[s]={value:t,func:o,type:a,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=e.getField();e.modules.filter={success:o,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},M.prototype.generateHeaderFilterElement=function(e,t,o){function i(){}var n,s,r,a,l,c,u,d=this,h=this,p=e.modules.filter.success,m=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),m){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":h.table.modules.edit.editors[e.definition.headerFilter]?(s=h.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):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":e.modules.edit&&e.modules.edit.editor?s=e.modules.edit.editor:e.definition.formatter&&h.table.modules.edit.editors[e.definition.formatter]?(s=h.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):s=h.table.modules.edit.editors.input}if(s){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.definition.headerFilterParams||{},u="function"==typeof u?u.call(h.table):u,!(r=s.call(this.table.modules.edit,a,function(){},p,i,u)))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(r instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",r);m?h.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){r.setAttribute("placeholder",void 0!==e&&e?e:h.table.modules.localize.getText("headerFilters|default"))}):h.table.modules.localize.bind("headerFilters|default",function(e){r.setAttribute("placeholder",void 0!==h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:e)}),r.addEventListener("click",function(e){e.stopPropagation(),r.focus()}),r.addEventListener("focus",function(e){var t=d.table.columnManager.element.scrollLeft;t!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(t),d.table.columnManager.scrollHorizontal(t))}),l=!1,c=function(e){l&&clearTimeout(l),l=setTimeout(function(){p(r.value)},h.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=r,e.modules.filter.attrType=r.hasAttribute("type")?r.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=r.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(r.addEventListener("keyup",c),r.addEventListener("search",c),"number"==e.modules.filter.attrType&&r.addEventListener("change",function(e){p(r.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&r.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||r.addEventListener("mousedown",function(e){e.stopPropagation()})),n.appendChild(r),e.contentElement.appendChild(n),o||h.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},M.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})},M.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})},M.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},M.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},M.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},M.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},M.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},M.prototype.setFilter=function(e,t,o,i){var n=this;n.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),n.addFilter(e)},M.prototype.addFilter=function(e,t,o,i){var n=this;Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),e.forEach(function(e){(e=n.findFilter(e))&&(n.filterList.push(e),n.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.findFilter=function(e){var t,o=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:o.filters[e.type]?(t=o.table.columnManager.getColumnByField(e.field),i=t?function(i){return o.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return o.filters[e.type](e.value,t[e.field],t,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},M.prototype.findSubFilters=function(e){var t=this,o=[];return e.forEach(function(e){(e=t.findFilter(e))&&o.push(e)}),!!o.length&&o},M.prototype.getFilters=function(e,t){var o=[];return e&&(o=this.getHeaderFilters()),t&&o.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),o=o.concat(this.filtersToArray(this.filterList,t))},M.prototype.filtersToArray=function(e,t){var o=this,i=[];return e.forEach(function(e){var n;Array.isArray(e)?i.push(o.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},M.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},M.prototype.removeFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?i.filterList.findIndex(function(t){return e===t}):i.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.clearFilter=function(e){this.filterList=[],e&&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")},M.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)}),this.changed=!0},M.prototype.search=function(e,t,o,i){var n=this,s=[],r=[];return Array.isArray(t)||(t=[{field:t,type:o,value:i}]),t.forEach(function(e){(e=n.findFilter(e))&&r.push(e)}),this.table.rowManager.rows.forEach(function(t){var o=!0;r.forEach(function(e){n.filterRecurse(e,t.getData())||(o=!1)}),o&&s.push("data"===e?t.getData("data"):t.getComponent())}),s},M.prototype.filter=function(e,t){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=e.slice(0):e.forEach(function(e){o.filterRow(e)&&i.push(e)}),o.table.options.dataFiltered&&(i.forEach(function(e){n.push(e.getComponent())}),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},M.prototype.filterRow=function(e,t){var o=this,i=!0,n=e.getData();o.filterList.forEach(function(e){o.filterRecurse(e,n)||(i=!1)});for(var s in o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},M.prototype.filterRecurse=function(e,t){var o=this,i=!1;return Array.isArray(e)?e.forEach(function(e){o.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i},M.prototype.filters={"=":function(e,t,o,i){return t==e},"<":function(e,t,o,i){return t":function(e,t,o,i){return t>e},">=":function(e,t,o,i){return t>=e},"!=":function(e,t,o,i){return t!=e},regex:function(e,t,o,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,o,i){var n=e.toLowerCase().split(void 0===i.separator?" ":i.separator),s=String(null===t||void 0===t?"":t).toLowerCase(),r=[];return n.forEach(function(e){s.includes(e)&&r.push(!0)}),i.matchAll?r.length===n.length:!!r.length},starts:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,o,i){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},d.prototype.registerModule("filter",M);var L=function(e){this.table=e};L.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},L.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},i=e.definition["formatter"+t];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},L.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},L.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,i,t)},L.prototype.formatExportValue=function(e,t){var o,i=e.column.modules.format[t];if(i){var n=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof i.params?i.params(component):i.params,i.formatter.call(this,e.getComponent(),o,n)}return this.formatValue(e)},L.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},L.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},L.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},L.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var i,n,s,r,a=parseFloat(e.getValue()),l=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,h=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(i=!1!==h?a.toFixed(h):a,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",r=/(\d+)(\d{3})/;r.test(n);)n=n.replace(r,"$1"+c+"$2");return d?n+s+u:u+n+s},link:function(e,t,o){var i,n=e.getValue(),s=t.urlPrefix||"",r=t.download,a=n,l=document.createElement("a");if(t.labelField&&(i=e.getData(),a=i[t.labelField]),t.label)switch(_typeof(t.label)){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(i=e.getData(),n=i[t.urlField]),t.url)switch(_typeof(t.url)){case"string":n=t.url;break;case"function":n=t.url(e)}return l.setAttribute("href",s+n),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,o){var i=document.createElement("img");switch(i.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":i.style.height=t.height+"px";break;case"string":i.style.height=t.height}switch(_typeof(t.width)){case"number":i.style.width=t.width+"px";break;case"string":i.style.width=t.width}return i.addEventListener("load",function(){e.getRow().normalizeHeight()}),i},tickCross:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t.allowEmpty,r=t.allowTruthy,a=void 0!==t.tickElement?t.tickElement:'',l=void 0!==t.crossElement?t.crossElement:'';return r&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),a||""):!s||"null"!==i&&""!==i&&null!==i&&void 0!==i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=t.outputFormat||"DD/MM/YYYY hh:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",r=e.getValue(),a=moment(r,i);return a.isValid()?t.timezone?a.tz(t.timezone).format(n):a.format(n):!0===s?r:"function"==typeof s?s(r):s},datetimediff:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",s=void 0!==t.suffix&&t.suffix,r=void 0!==t.unit?t.unit:void 0,a=void 0!==t.humanize&&t.humanize,l=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,i) +;return u.isValid()?a?moment.duration(u.diff(l)).humanize(s):u.diff(l,r)+(s?" "+s:""):!0===n?c:"function"==typeof n?n(c):n},lookup:function(e,t,o){var i=e.getValue();return void 0===t[i]?(console.warn("Missing display value for "+i),i):t[i]},star:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.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=a.cloneNode(!0);c.innerHTML=l<=i?'':'',r.appendChild(c)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),r},traffic:function(e,t,o){var i,n,s=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(s)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=a?parseFloat(s):a,n=parseFloat(n)>=l?parseFloat(n):l,i=(a-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 r.style.backgroundColor=u,r}},progress:function(e,t,o){var i,n,s,r,a,c=this.sanitizeHTML(e.getValue())||0,u=e.getElement(),d=t&&t.max?t.max:100,h=t&&t.min?t.min:0,p=t&&t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(c)<=d?parseFloat(c):d,n=parseFloat(n)>=h?parseFloat(n):h,i=(d-h)/100,n=Math.round((n-h)/i),_typeof(t.color)){case"string":s=t.color;break;case"function":s=t.color(c);break;case"object":if(Array.isArray(t.color)){var m=100/t.color.length,f=Math.floor(n/m);f=Math.min(f,t.color.length-1),f=Math.max(f,0),s=t.color[f];break}default:s="#2DC214"}switch(_typeof(t.legend)){case"string":r=t.legend;break;case"function":r=t.legend(c);break;case"boolean":r=c;break;default:r=!1}switch(_typeof(t.legendColor)){case"string":a=t.legendColor;break;case"function":a=t.legendColor(c);break;case"object":if(Array.isArray(t.legendColor)){var m=100/t.legendColor.length,f=Math.floor(n/m);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),a=t.legendColor[f]}break;default:a="#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),r){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=a,b.innerHTML=r}return o(function(){if(!(e instanceof l)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",u.appendChild(t),u=t}u.appendChild(g),r&&u.appendChild(b)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function i(e){var t=s.element;s.open=e,t&&(s.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}var n=document.createElement("div"),s=e.getRow()._row.modules.responsiveLayout;return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(e){e.stopImmediatePropagation(),i(!s.open)}),i(s.open),n},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",function(e){i.toggleSelect()}),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},d.prototype.registerModule("format",L);var T=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};T.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},T.prototype.initializeColumn=function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")},T.prototype.frozenCheck=function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen},T.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},T.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},T.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))},T.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach(function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach(function(e){t.layoutElement(e.getElement(),i)})}),this.rightColumns.forEach(function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach(function(e){t.layoutElement(e.getElement(),o)})})},T.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},T.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},T.prototype.layoutRow=function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}),this.rightColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)})},T.prototype.layoutElement=function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))},T.prototype._calcSpace=function(e,t){for(var o=0,i=0;i-1&&t.splice(o,1)}),t},D.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},D.prototype.unfreezeRow=function(e){var t=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var o=e.getElement();o.parentNode.removeChild(o),this.table.rowManager.adjustTableSize(),this.rows.splice(t,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},D.prototype.styleRows=function(e){var t=this;this.rows.forEach(function(e,o){t.table.rowManager.styleRow(e,o)})},d.prototype.registerModule("frozenRows",D);var k=function(e){this._group=e,this.type="GroupComponent"};k.prototype.getKey=function(){return this._group.key},k.prototype.getField=function(){return this._group.field},k.prototype.getElement=function(){return this._group.element},k.prototype.getRows=function(){return this._group.getRows(!0)},k.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},k.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},k.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},k.prototype.isVisible=function(){return this._group.visible},k.prototype.show=function(){this._group.show()},k.prototype.hide=function(){this._group.hide()},k.prototype.toggle=function(){this._group.toggleVisibility()},k.prototype._getSelf=function(){return this._group},k.prototype.getTable=function(){return this._group.groupManager.table};var S=function(e,t,o,i,n,s,r){this.groupManager=e,this.parent=t,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):o?this.rows.push(e):this.rows.unshift(e),e.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)},S.prototype.scrollHeader=function(e){this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)})},S.prototype.getRowIndex=function(e){},S.prototype.conformRowData=function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e},S.prototype.removeRow=function(e){var t=this.rows.indexOf(e),o=e.getElement();t>-1&&this.rows.splice(t,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))},S.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},S.prototype.getHeadersAndRows=function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){t=t.concat(o.getHeadersAndRows(e))}):(!e&&"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),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"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),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&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),t.push(this.calcs.top))),!e&&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),t.push(this.calcs.bottom)))),t},S.prototype.getData=function(e,t){var o=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(function(e){o.push(e.getData(t||"data"))}),o},S.prototype.getRowCount=function(){var e=0;return this.groupList.length?this.groupList.forEach(function(t){e+=t.getRowCount()}):e=this.rows.length,e},S.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},S.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(e){e.getHeadersAndRows().forEach(function(e){e.detachElement()})}):this.rows.forEach(function(e){var t=e.getElement();t.parentNode.removeChild(t)}),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)},S.prototype.show=function(){var e=this;if(e.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 t=e.getElement();this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o})}):e.rows.forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=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)},S.prototype._visSet=function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))},S.prototype.getRowGroup=function(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}):this.rows.find(function(t){return t===e})&&(t=this),t},S.prototype.getSubGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},S.prototype.getRows=function(e){var t=[];return this.rows.forEach(function(o){t.push(e?o.getComponent():o)}),t},S.prototype.generateGroupHeaderContents=function(){var e=[];for(this.rows.forEach(function(t){e.push(t.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,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)},S.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 e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),e.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],e.table.modules.localize.bind("groups|item",function(t,o){e.headerGenerator[0]=function(e,i,n){return(void 0===e?"":e)+"("+i+" "+(1===i?t:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(t)||t)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(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(t)||(t=[t]),t.forEach(function(t,o){var i,n;"function"==typeof t?i=t:(n=e.table.columnManager.getColumnByField(t),i=n?function(e){return n.getFieldValue(e)}:function(e){return e[t]}),e.groupIDLookups.push({field:"function"!=typeof t&&t,func:i,values:!!e.allowedValues&&e.allowedValues[o]})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(e){e="function"==typeof e?e:function(){return!0}}),e.startOpen=o),i&&(e.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},H.prototype.setDisplayIndex=function(e){this.displayIndex=e},H.prototype.getDisplayIndex=function(){return this.displayIndex},H.prototype.getRows=function(e){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(e),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):e.slice(0)},H.prototype.getGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},H.prototype.getChildGroups=function(e){var t=this,o=[];return e||(e=this),e.groupList.forEach(function(e){e.groupList.length?o=o.concat(t.getChildGroups(e)):o.push(e)}),o},H.prototype.wipe=function(){this.groupList.forEach(function(e){e.wipe()})},H.prototype.pullGroupListData=function(e){var t=this,o=[];return e.forEach(function(e){var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];e.hasSubGroups?(n=t.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=n.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),o.push(i),o=o.concat(n)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,o.push(i),e.getRows().forEach(function(e){o.push(e.getData("data"))}))}),o},H.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},H.prototype.getRowGroup=function(e){var t=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}),t},H.prototype.countGroups=function(){return this.groupList.length},H.prototype.generateGroups=function(e){var t=this,o=t.groups;t.groups={},t.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(e){t.createGroup(e,0,o)}),e.forEach(function(e){t.assignRowToExistingGroup(e,o)})):e.forEach(function(e){t.assignRowToGroup(e,o)})},H.prototype.createGroup=function(e,t,o){var i,n=t+"_"+e;o=o||[],i=new S(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},H.prototype.assignRowToExistingGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(e)},H.prototype.assignRowToGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,t),this.groups["0_"+o].addRow(e),!i},H.prototype.updateGroupRows=function(e){var t=this,o=[];if(t.groupList.forEach(function(e){o=o.concat(e.getHeadersAndRows())}),e){var i=t.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),t.table.rowManager.refreshActiveData("group",!0,!0)}return o},H.prototype.scrollHeaders=function(e){e+="px",this.groupList.forEach(function(t){t.scrollHeader(e)})},H.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))},d.prototype.registerModule("groupRows",H);var z=function(e){this.table=e,this.history=[],this.index=-1};z.prototype.clear=function(){this.history=[],this.index=-1},z.prototype.action=function(e,t,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:o}),this.index++},z.prototype.getHistoryUndoSize=function(){return this.index+1},z.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},z.prototype.undo=function(){if(this.index>-1){var e=this.history[this.index];return this.undoers[e.type].call(this,e),this.index--,this.table.options.historyUndo.call(this.table,e.type,e.component.getComponent(),e.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 e=this.history[this.index];return this.redoers[e.type].call(this,e),this.table.options.historyRedo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},z.prototype.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue)},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},z.prototype.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue)},rowAdd:function(e){ +var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}},z.prototype._rebindRow=function(e,t){this.history.forEach(function(o){if(o.component instanceof a)o.component===e&&(o.component=t);else if(o.component instanceof c&&o.component.row===e){var i=o.component.column.getField();i&&(o.component=t.getCell(i))}})},d.prototype.registerModule("history",z);var A=function(e){this.table=e,this.fieldIndex=[],this.hasIndex=!1};A.prototype.parseTable=function(){var e=this,t=e.table.element,o=e.table.options,i=(o.columns,t.getElementsByTagName("th")),n=t.getElementsByTagName("tbody")[0],s=[];e.hasIndex=!1,e.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],e._extractOptions(t,o),i.length?e._extractHeaders(i,n):e._generateBlankHeaders(i,n);for(var r=0;r-1&&e.pressedKeys.splice(i,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},_.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},_.prototype.checkBinding=function(e,t){var o=this,i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach(function(e){-1==o.pressedKeys.indexOf(e)&&(i=!1)}),i&&t.action.call(o,e),!0)},_.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"},_.prototype.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,o=t.scrollTop-t.height;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o>=0?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,o=t.scrollTop+t.height,i=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o<=i?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().prev())},navNext:function(e){var t,o=!1,i=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell)&&(e.preventDefault(),t=o.nav(),t.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(){t.next()})})))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().left())},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().right())},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().up())},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().down())},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},d.prototype.registerModule("keybindings",_);var P=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this)};P.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},P.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},P.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},P.prototype.initializeGroup=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.groupContextMenu?t.table.options.groupContextMenu(e.getComponent()):t.table.options.groupContextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},P.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);o&&o.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach(function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",function(e){e.stopPropagation()})):o.addEventListener("click",function(o){i.hideMenu(),e.action(o,t.getComponent())})),i.menuEl.appendChild(o)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.addEventListener("keydown",this.escEvent),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px"))},P.prototype.escMenu=function(e){27==e.keyCode&&this.hideMenu()},P.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.escEvent&&document.body.removeEventListener("keydown",this.escEvent),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},P.prototype.menus={},d.prototype.registerModule("menu",P);var F=function(e){this.table=e,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)};F.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},F.prototype.initializeColumn=function(e){var t,o=this,i={};e.modules.frozen||(t=e.getElement(),i.mousemove=function(i){e.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-d.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=i},F.prototype.bindTouchEvents=function(e){var t,o,i,n,s,r,a,l=this,c=e.getElement(),u=!1;c.addEventListener("touchstart",function(c){l.checkTimeout=setTimeout(function(){l.touchMove=!0,t=e,o=e.nextColumn(),n=o?o.getWidth()/2:0,i=e.prevColumn(),s=i?i.getWidth()/2:0,r=0,a=0,u=!1,l.startMove(c,e)},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-r>n&&(h=o)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveColumn(h,!0)):i&&-d-a>s&&(h=i)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveColumn(h,!1)),h&&(t=h,o=h.nextColumn(),r=n,n=o?o.getWidth()/2:0,i=h.prevColumn(),a=s,s=i?i.getWidth()/2:0))},{passive:!0}),c.addEventListener("touchend",function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&l.endMove(e)})},F.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-d.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.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(e)},F.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},F.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},F.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i.nextSibling)}):e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i)})},F.prototype.endMove=function(e){(1===e.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)))},F.prototype.moveHover=function(e){var t,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?e.touches[0].pageX:e.pageX)-d.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-ne.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(t.placeholderElement,i.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var i=e.getElement();i.previousSibling&&(i.parentNode.insertBefore(t.placeholderElement,i),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},N.prototype.initializeRow=function(e){var t,o=this,i={};i.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),i.mousemove=function(t){if(t.pageY-d.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i},N.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},N.prototype.bindTouchEvents=function(e,t){var o,i,n,s,r,a,l,c=this,u=!1;t.addEventListener("touchstart",function(t){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=e,i=e.nextRow(),s=i?i.getHeight()/2:0,n=e.prevRow(),r=n?n.getHeight()/2:0,a=0,l=0,u=!1,c.startMove(t,e)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var d,h;c.moving&&(t.preventDefault(),c.moveHover(t),u||(u=t.touches[0].pageY),d=t.touches[0].pageY-u,d>0?i&&d-a>s&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement().nextSibling),c.moveRow(h,!0)):n&&-d-l>r&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement()),c.moveRow(h,!1)),h&&(o=h,i=h.nextRow(),a=s,s=i?i.getHeight()/2:0,n=h.prevRow(),l=r,r=n?n.getHeight()/2:0))}),t.addEventListener("touchend",function(e){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(e),c.touchMove=!1)})},N.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},N.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},N.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(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(e)},N.prototype.setStartPosition=function(e,t){var o,i,n=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.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},N.prototype.endMove=function(e){e&&1!==e.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()))},N.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},N.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},N.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,i=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},N.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},N.prototype.elementRowDrop=function(e,t,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(e,t,!!o&&o.getComponent())},N.prototype.connectToTables=function(e){var t,o=this;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(e){"string"==typeof e?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):o.connectionElements.push(e)}),this.connectionElements.forEach(function(e){var t=function(t){o.elementRowDrop(t,e,o.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")}))},N.prototype.disconnectFromTables=function(){var e;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent})},N.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},N.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},N.prototype.dropComplete=function(e,t,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(),t?t.getComponent():void 0,e):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(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},N.prototype.tableRowDrop=function(e,t){var o=!1,i=!1;switch(console.trace("drop"),e.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(),t?t.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(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:i})},N.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},N.prototype.senders={delete:function(e,t,o){e.delete()}},N.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},d.prototype.registerModule("moveRow",N);var B=function(e){this.table=e,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};B.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[r]&&(s=t.lookupMutator(e.definition[r]))&&(o=!0,i[r]={mutator:s,params:e.definition[r+"Params"]||{}})}),o&&(e.modules.mutate=i)},B.prototype.lookupMutator=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.mutators[e]?t=this.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t},B.prototype.transformRow=function(e,t,o){var i,n=this,s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&n.table.columnManager.traverse(function(n){var r,a,l;n.modules.mutate&&(r=n.modules.mutate[s]||n.modules.mutate.mutator||!1)&&(i=n.getFieldValue(void 0!==o?o:e),"data"!=t&&void 0===i||(l=n.getComponent(),a="function"==typeof r.params?r.params(i,e,t,l):r.params,n.setFieldValue(e,r.mutator(i,e,t,a,l))))}),e},B.prototype.transformCell=function(e,t){var o=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,e.row.getData()),e.column.setFieldValue(i,t),o.mutator(t,i,"edit",o.params,e.getComponent())):t},B.prototype.enable=function(){this.enabled=!0},B.prototype.disable=function(){this.enabled=!1},B.prototype.mutators={},d.prototype.registerModule("mutator",B);var O=function(e){this.table=e,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()};O.prototype.createElements=function(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},O.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var o=1;o<5;o++)t.push(this.size*o);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var o=document.createElement("option");o.value=t,!0===t?e.table.modules.localize.bind("pagination|all",function(e){o.innerHTML=e}):o.innerHTML=t,e.pageSizeSelect.appendChild(o)}),this.pageSizeSelect.value=this.size}},O.prototype.initialize=function(e){var t,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(e){n.firstBut.innerHTML=e}),n.table.modules.localize.bind("pagination|first_title",function(e){n.firstBut.setAttribute("aria-label",e),n.firstBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|prev",function(e){n.prevBut.innerHTML=e}),n.table.modules.localize.bind("pagination|prev_title",function(e){n.prevBut.setAttribute("aria-label",e),n.prevBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|next",function(e){n.nextBut.innerHTML=e}),n.table.modules.localize.bind("pagination|next_title",function(e){n.nextBut.setAttribute("aria-label",e),n.nextBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|last",function(e){n.lastBut.innerHTML=e}),n.table.modules.localize.bind("pagination|last_title",function(e){n.lastBut.setAttribute("aria-label",e),n.lastBut.setAttribute("title",e)}),n.firstBut.addEventListener("click",function(){n.setPage(1)}),n.prevBut.addEventListener("click",function(){n.previousPage()}),n.nextBut.addEventListener("click",function(){n.nextPage().then(function(){}).catch(function(){})}),n.lastBut.addEventListener("click",function(){n.setPage(n.max)}),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",function(e){n.pageSizeSelect.setAttribute("aria-label",e),n.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),n.element.appendChild(t),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",function(e){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||e||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=e,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()},O.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},O.prototype.setDisplayIndex=function(e){this.displayIndex=e},O.prototype.getDisplayIndex=function(){return this.displayIndex},O.prototype.setMaxRows=function(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},O.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},O.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},O.prototype.setPage=function(e){var t=this,o=this;switch(e){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){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.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 - "+t.max+":",e),n())})},O.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){var n=t.table.rowManager.getDisplayRows(t.displayIndex-1),s=n.indexOf(e);if(s>-1){var r=!0===t.size?1:Math.ceil((s+1)/t.size);t.setPage(r).then(function(){o()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},O.prototype.setPageSize=function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e),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")},O.prototype._setPageButtons=function(){for(var e=this,t=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&s<=e.max&&e.pagesElement.appendChild(e._generatePageButton(s));this.footerRedraw()},O.prototype._generatePageButton=function(e){var t=this,o=document.createElement("button");return o.classList.add("tabulator-page"),e==t.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),t.table.modules.localize.bind("pagination|page_title",function(t){o.setAttribute("aria-label",t+" "+e),o.setAttribute("title",t+" "+e)}),o.setAttribute("data-page",e),o.textContent=e,o.addEventListener("click",function(o){t.setPage(e)}),o},O.prototype.previousPage=function(){var e=this;return new Promise(function(t,o){e.page>1?(e.page--,e.trigger().then(function(){t()}).catch(function(){o()}),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())})},O.prototype.nextPage=function(){var e=this;return new Promise(function(t,o){e.pagen?i.splice(n,0,e):i.push(e))}),i},I.prototype._findColumn=function(e,t){var o=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(o){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},I.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)},I.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},I.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},I.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},I.prototype.parseColumns=function(e){var t=this,o=[];return e.forEach(function(e){var i,n={},s=e.getDefinition();e.isGroup?(n.title=s.title,n.columns=t.parseColumns(e.getColumns())):(n.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(i=Object.keys(s),i.push("width")):i=t.config.columns,i.forEach(function(t){switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:n[t]=s[t]}})),o.push(n)}),o},I.prototype.readers={local:function(e,t){var o=localStorage.getItem(e+"-"+t);return!!o&&JSON.parse(o)},cookie:function(e,t){var o,i,n=document.cookie,s=e+"-"+t,r=n.indexOf(s+"=");return r>-1&&(n=n.substr(r),o=n.indexOf(";"),o>-1&&(n=n.substr(0,o)),i=n.replace(s+"=","")),!!i&&JSON.parse(i)}},I.prototype.writers={local:function(e,t,o){localStorage.setItem(e+"-"+t,JSON.stringify(o))},cookie:function(e,t,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},d.prototype.registerModule("persistence",I);var j=function(e){this.table=e,this.element=!1,this.manualBlock=!1};j.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},j.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))},j.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="")},j.prototype.printFullscreen=function(e,t,o){var i,n,s=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),c=this.table.modules.export.genereateTable(void 0!==o?o:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.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?a.innerHTML=i:a.appendChild(i),this.element.appendChild(a)),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,r),this.manualBlock=!1},d.prototype.registerModule("print",j);var V=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};V.prototype.watchData=function(e){var t,o=this;this.currentVersion++,t=this.currentVersion,o.unwatchData(),o.data=e,o.origFuncs.push=e.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!1)}),o.origFuncs.push.apply(e,arguments)}}),o.origFuncs.unshift=e.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!0)}),o.origFuncs.unshift.apply(e,arguments)}}),o.origFuncs.shift=e.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]))&&i.deleteActual(),o.origFuncs.shift.call(e)}}),o.origFuncs.pop=e.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]))&&i.deleteActual(),o.origFuncs.pop.call(e)}}),o.origFuncs.splice=e.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?e.length+n[0]:n[0],r=n[1],a=!!n[2]&&n.slice(2);if(!o.blocked&&t===o.currentVersion){if(a&&(i=!!e[s]&&o.table.rowManager.getRowFromDataObject(e[s]),i?a.forEach(function(e){o.table.rowManager.addRowActual(e,!0,i,!0)}):(a=a.slice().reverse(),a.forEach(function(e){o.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(s,void 0===n[1]?n[1]:s+r);l.forEach(function(e,t){var i=o.table.rowManager.getRowFromDataObject(e);i&&i.deleteActual(t!==l.length-1)})}(a||0!==r)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(e,arguments)}})},V.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},V.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var o in t)this.watchKey(e,t,o);this.blocked=!1},V.prototype.watchKey=function(e,t,o){var i=this,n=Object.getOwnPropertyDescriptor(t,o),s=t[o],r=this.currentVersion;Object.defineProperty(t,o,{set:function(t){if(s=t,!i.blocked&&r===i.currentVersion){var a={};a[o]=t,e.updateData(a)}n.set&&n.set(t)},get:function(){return n.get&&n.get(),s}})},V.prototype.unwatchRow=function(e){var t=e.getData();for(var o in t)Object.defineProperty(t,o,{value:t[o]})},V.prototype.block=function(){this.blocked=!0},V.prototype.unblock=function(){this.blocked=!1},d.prototype.registerModule("reactiveData",V);var W=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};W.prototype.initializeColumn=function(e,t,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===e&&(n="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:n}),!0===s||s==e){var r=document.createElement("div");r.className="tabulator-col-resize-handle";var a=document.createElement("div");a.className="tabulator-col-resize-handle prev",r.addEventListener("click",function(e){e.stopPropagation()});var l=function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=t,i._mouseDown(e,o,r))};r.addEventListener("mousedown",l),r.addEventListener("touchstart",l,{passive:!0}),r.addEventListener("dblclick",function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(e.stopPropagation(),o.reinitializeWidth(!0))}),a.addEventListener("click",function(e){e.stopPropagation()});var c=function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=t,i._mouseDown(e,s,a)))};a.addEventListener("mousedown",c),a.addEventListener("touchstart",c,{passive:!0}),a.addEventListener("dblclick",function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),o.appendChild(r),o.appendChild(a)}},W.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},W.prototype._mouseDown=function(e,t,o){function i(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.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,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},d.prototype.registerModule("resizeColumns",W);var G=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};G.prototype.initializeRow=function(e){var t=this,o=e.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(e){e.stopPropagation()});var s=function(o){t.startRow=e,t._mouseDown(o,e,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var r=function(o){var i=t.table.rowManager.prevDisplayRow(e);i&&(t.startRow=i,t._mouseDown(o,i,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),o.appendChild(i),o.appendChild(n)},G.prototype._mouseDown=function(e,t,o){function i(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){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,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},d.prototype.registerModule("resizeRows",G);var U=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};U.prototype.initialize=function(e){var t,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(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.tableHeight==t&&o.tableWidth==n||(o.tableHeight=t,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.redraw())}}),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.containerHeight==t&&o.containerWidth==n||(o.containerHeight=t,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth,i.redraw()),i.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&i.redraw()},window.addEventListener("resize",this.binding))},U.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},d.prototype.registerModule("resizeTable",U);var Y=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};Y.prototype.initialize=function(){var e=this,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(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"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 r=s;if("responsiveCollapse"==r.definition.formatter){this.collapseHandleColumn=r;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},Y.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},Y.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},Y.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},Y.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},Y.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},Y.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},Y.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),i=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(i<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var s=e.columns[e.index-1];s&&i>0&&i>=s.getWidth()?(e.showColumn(s),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},Y.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},Y.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild) +;o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},Y.prototype.generateCollapsedRowData=function(e){var t,o=this,i=e.getData(),n=[];return this.hiddenColumns.forEach(function(s){var r=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return r},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return s.getComponent()}},n.push({title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,t,s.modules.format.params)})):n.push({title:s.definition.title,value:r}))}),n},Y.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""}),t.innerHTML=o,Object.keys(e).length?t:""},d.prototype.registerModule("responsiveLayout",Y);var q=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};q.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},q.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var i=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),n=t.table.rowManager.getDisplayRowIndex(e),s=i<=n?i:n,r=i>=n?i:n,a=t.table.rowManager.getDisplayRows().slice(0),l=a.splice(s,r-s+1);o.ctrlKey||o.metaKey?(l.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.lengtht.table.options.selectable&&(l=l.slice(0,t.table.options.selectable)),t.selectRows(l)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},q.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},q.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},q.prototype._selectRow=function(e,t,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(e);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),t||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},q.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},q.prototype.deselectRows=function(e,t){var o,i=this;if(void 0===e){o=i.selectedRows.length;for(var n=0;n-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),t||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},q.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},q.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},q.prototype._rowSelectionChanged=function(e){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)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},q.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},q.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},q.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t)for(var i=o,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var r;if(n){if(s>=i.length)break;r=i[s++]}else{if(s=i.next(),s.done)break;r=s.value}var a=r;this._selectRow(a,!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)}},d.prototype.registerModule("selectRow",q);var X=function(e){this.table=e,this.sortList=[],this.changed=!1};X.prototype.initializeColumn=function(e,t){var o,i,n=this,s=!1;switch(_typeof(e.definition.sorter)){case"string":n.sorters[e.definition.sorter]?s=n.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:void 0!==e.definition.headerSortTristate?e.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===e.definition.headerSort?!1!==this.table.options.headerSort:!1!==e.definition.headerSort)&&(o=e.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),t.appendChild(i),o.addEventListener("click",function(t){var o="",i=[],s=!1;if(e.modules.sort){if(e.modules.sort.tristate)o="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(t){return t.field===e.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:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},X.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},X.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t},X.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.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")},X.prototype.clear=function(){this.setSort([])},X.prototype.findSorter=function(e){var t,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),e.getField()))switch(t=e.getFieldValue(o),void 0===t?"undefined":_typeof(t)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},X.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table,t.getSort()),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach(function(e,o){t.setColumnHeader(e.column,e.dir)}):(o.forEach(function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"==typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)}),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&t.table.options.dataSorted.call(t.table,t.getSort(),t.table.rowManager.getComponents("active"))},X.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))})},X.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},X.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort(function(e,n){for(var s,r=i;r>=0;r--){var a=t[r];if(0!==(s=o._sortRow(e,n,a.column,a.dir,a.params)))break}return s})},X.prototype._sortRow=function(e,t,o,i,n){var s,r,a="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(a.getData()),t=o.getFieldValue(l.getData()),e=void 0!==e?e:"",t=void 0!==t?t:"",s=a.getComponent(),r=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,r,o.getComponent(),i,n)},X.prototype.sorters={number:function(e,t,o,i,n,s,r){var a=r.alignEmptyValues,l=r.decimalSeparator||".",c=r.thousandSeparator||",",u=0;if(e=parseFloat(String(e).split(c).join("").split(l).join(".")),t=parseFloat(String(t).split(c).join("").split(l).join(".")),isNaN(e))u=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;u=1}return("top"===a&&"desc"===s||"bottom"===a&&"asc"===s)&&(u*=-1),u},string:function(e,t,o,i,n,s,r){var a,l=r.alignEmptyValues,c=0;if(e){if(t){switch(_typeof(r.locale)){case"boolean":r.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}c=1}else c=t?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,r){return r.format||(r.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},time:function(e,t,o,i,n,s,r){return r.format||(r.format="HH:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},datetime:function(e,t,o,i,n,s,r){var a=r.format||"DD/MM/YYYY HH:mm:ss",l=r.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(e=moment(e,a),t=moment(t,a),e.isValid()){if(t.isValid())return e-t;c=1}else c=t.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(e,t,o,i,n,s,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,o,i,n,s,r){function a(e){switch(u){case"length":return e.length;case"sum":return e.reduce(function(e,t){return e+t});case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce(function(e,t){return e+t})/e.length}}var l=0,c=0,u=r.type||"length",d=r.alignEmptyValues,h=0;if(Array.isArray(e)){if(Array.isArray(t))return l=e?a(e):0,c=t?a(t):0,l-c;d=1}else d=Array.isArray(t)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(h*=-1),h},exists:function(e,t,o,i,n,s,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,o,i,n,s,r){var a,l,c,u,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=r.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if(a=String(e).toLowerCase(),l=String(t).toLowerCase(),a===l)return 0;if(!m.test(a)||!m.test(l))return a>l?1:-1;for(a=a.match(p),l=l.match(p),d=a.length>l.length?l.length:a.length;hu?1:-1;return a.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},d.prototype.registerModule("sort",X);var K=function(e){this.table=e,this.invalidCells=[]};return K.prototype.initializeColumn=function(e){var t,o=this,i=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(function(e){(t=o._extractValidator(e))&&i.push(t)}):(t=this._extractValidator(e.definition.validator))&&i.push(t),e.modules.validate=!!i.length&&i)},K.prototype._extractValidator=function(e){var t,o,i;switch(void 0===e?"undefined":_typeof(e)){case"string":return i=e.indexOf(":"),i>-1?(t=e.substring(0,i),o=e.substring(i+1)):t=e,this._buildValidator(t,o);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}},K.prototype._buildValidator=function(e,t){var o="function"==typeof e?e:this.validators[e];return o?{type:"function"==typeof e?"function":e,func:o,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)},K.prototype.validate=function(e,t,o){var i=this,n=[],s=this.invalidCells.indexOf(t);return e&&e.forEach(function(e){e.func.call(i,t.getComponent(),o,e.params)||n.push({type:e.type,parameters:e.params})}),n=!n.length||n,t.modules.validate||(t.modules.validate={}),!0===n?(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),s>-1&&this.invalidCells.splice(s,1)):(t.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==s&&this.invalidCells.push(t)),n},K.prototype.getInvalidCells=function(){var e=[];return this.invalidCells.forEach(function(t){e.push(t.getComponent())}),e},K.prototype.clearValidation=function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.element.classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))},K.prototype.validators={integer:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,o){return""===t||null===t||void 0===t||!isNaN(t)},string:function(e,t,o){return""===t||null===t||void 0===t||isNaN(t)},max:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)<=o},min:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)>=o},starts:function(e,t,o){return""===t||null===t||void 0===t||String(t).toLowerCase().startsWith(String(o).toLowerCase())},ends:function(e,t,o){return""===t||null===t||void 0===t||String(t).toLowerCase().endsWith(String(o).toLowerCase())},minLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length>=o},maxLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length<=o},in:function(e,t,o){return""===t||null===t||void 0===t||("string"==typeof o&&(o=o.split("|")),""===t||o.indexOf(t)>-1)},regex:function(e,t,o){return""===t||null===t||void 0===t||new RegExp(o).test(t)},unique:function(e,t,o){if(""===t||null===t||void 0===t)return!0;var i=!0,n=e.getData(),s=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(e){var o=e.getData();o!==n&&t==s.getFieldValue(o)&&(i=!1)}),i},required:function(e,t,o){return""!==t&&null!==t&&void 0!==t}},d.prototype.registerModule("validate",K),d}); \ No newline at end of file diff --git a/dist/js/tabulator_core.js b/dist/js/tabulator_core.js index 13d0ae7eb..4f821d4df 100644 --- a/dist/js/tabulator_core.js +++ b/dist/js/tabulator_core.js @@ -4440,6 +4440,15 @@ RowComponent.prototype.unfreeze = function () { } }; +RowComponent.prototype.isFrozen = function () { + if (this._row.table.modExists("frozenRows", true)) { + var index = this._row.table.modules.frozenRows.rows.indexOf(this._row); + return index > -1; + } + + return false; +}; + RowComponent.prototype.treeCollapse = function () { if (this._row.table.modExists("dataTree", true)) { this._row.table.modules.dataTree.collapseRow(this._row); @@ -6396,6 +6405,7 @@ Tabulator.prototype.defaultOptions = { groupClick: false, groupDblClick: false, groupContext: false, + groupContextMenu: false, groupTap: false, groupDblTap: false, groupTapHold: false, diff --git a/dist/js/tabulator_core.min.js b/dist/js/tabulator_core.min.js index ee548d3e7..3d349c3c0 100644 --- a/dist/js/tabulator_core.min.js +++ b/dist/js/tabulator_core.min.js @@ -1,6 +1,6 @@ /* Tabulator v4.6.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};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,l=Math.max(n>=0?n:i-Math.abs(n),0);lo?(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()},ColumnManager.prototype.generateColumnsFromRowData=function(t){var e,o,i=[];if(t&&t.length){e=t[0];for(var n in e){var l={field:n,title:n},s=e[n];switch(void 0===s?"undefined":_typeof(s)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(s)?"array":"string";break;default:o=isNaN(s)||""===s?s.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}l.sorter=o,i.push(l)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},ColumnManager.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(),o.redraw(!0)},ColumnManager.prototype._addColumn=function(t,e,o){var i=new Column(t,this),n=i.getElement(),l=o?this.findColumnIndex(o):o;if(o&&l>-1){var s=this.columns.indexOf(o.getTopColumn()),a=o.getElement();e?(this.columns.splice(s,0,i),a.parentNode.insertBefore(n,a)):(this.columns.splice(s+1,0,i),a.parentNode.insertBefore(n,a.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},ColumnManager.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},ColumnManager.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},ColumnManager.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},ColumnManager.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()},ColumnManager.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof Column)return t;if(t instanceof ColumnComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.columns.find(function(e){return e.element===t})||!1}return!1},ColumnManager.prototype.getColumnByField=function(t){return this.columnsByField[t]},ColumnManager.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},ColumnManager.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},ColumnManager.prototype.getFirstVisibileColumn=function(t){var t=this.columnsByIndex.findIndex(function(t){return t.visible});return t>-1&&this.columnsByIndex[t]},ColumnManager.prototype.getColumns=function(){return this.columns},ColumnManager.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},ColumnManager.prototype.getRealColumns=function(){return this.columnsByIndex},ColumnManager.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},ColumnManager.prototype.getDefinitions=function(t){var e=this,o=[];return e.columnsByIndex.forEach(function(e){(!t||t&&e.visible)&&o.push(e.getDefinition())}),o},ColumnManager.prototype.getDefinitionTree=function(){var t=this,e=[];return t.columns.forEach(function(t){e.push(t.getDefinition(!0))}),e},ColumnManager.prototype.getComponents=function(t){var e=this,o=[];return(t?e.columns:e.columnsByIndex).forEach(function(t){o.push(t.getComponent())}),o},ColumnManager.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},ColumnManager.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()},ColumnManager.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.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")},ColumnManager.prototype._moveColumnInArray=function(t,e,o,i,n){var l,s=t.indexOf(e);s>-1&&(t.splice(s,1),l=t.indexOf(o),l>-1?i&&(l+=1):l=s,t.splice(l,0,e),n&&this.table.rowManager.rows.forEach(function(t){if(t.cells.length){var e=t.cells.splice(s,1)[0];t.cells.splice(l,0,e)}}))},ColumnManager.prototype.scrollToColumn=function(t,e,o){var i=this,n=0,l=0,s=0,a=t.getElement();return new Promise(function(r,u){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":s=-i.element.clientWidth/2;break;case"right":s=a.clientWidth-i.headersElement.clientWidth}if(!o&&(l=a.offsetLeft)>0&&l+a.offsetWidtht.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,l,s;i.visible&&(n=i.definition.width||0,l=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),s="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=s>l?s:l)}),o},ColumnManager.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=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(),"fitColumns"!=i.table.modules.layout.getMode()&&s.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(s)})},ColumnManager.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.redraw()},ColumnManager.prototype.redraw=function(t){t&&(Tabulator.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 ColumnComponent=function(t){this._column=t,this.type="ColumnComponent"};ColumnComponent.prototype.getElement=function(){return this._column.getElement()},ColumnComponent.prototype.getDefinition=function(){return this._column.getDefinition()},ColumnComponent.prototype.getField=function(){return this._column.getField()},ColumnComponent.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t},ColumnComponent.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},ColumnComponent.prototype.isVisible=function(){return this._column.visible},ColumnComponent.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()},ColumnComponent.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()},ColumnComponent.prototype.toggle=function(){this._column.visible?this.hide():this.show()},ColumnComponent.prototype.delete=function(){return this._column.delete()},ColumnComponent.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t},ColumnComponent.prototype.getParentColumn=function(){return this._column.parent instanceof Column&&this._column.parent.getComponent()},ColumnComponent.prototype._getSelf=function(){return this._column},ColumnComponent.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},ColumnComponent.prototype.getTable=function(){return this._column.table},ColumnComponent.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},ColumnComponent.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},ColumnComponent.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},ColumnComponent.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},ColumnComponent.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)},ColumnComponent.prototype.getNextColumn=function(){var t=this._column.nextColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)},ColumnComponent.prototype.getWidth=function(){return this._column.getWidth()},ColumnComponent.prototype.setWidth=function(t){return!0===t?this._column.reinitializeWidth(!0):this._column.setWidth(t)},ColumnComponent.prototype.validate=function(){return this._column.validate()};var Column=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.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.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()};Column.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},Column.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},Column.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)})},Column.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},Column.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},Column.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},Column.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},Column.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"))},Column.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","")},Column.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()})},Column.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)},Column.prototype._buildColumnHeader=function(){var t=this,e=t.definition,o=t.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(t,t.contentElement),(e.headerContextMenu||e.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(t),o.modExists("format")&&o.modules.format.initializeColumn(t),void 0!==e.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(t),void 0!==e.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(t),o.modExists("mutator")&&o.modules.mutator.initializeColumn(t),o.modExists("accessor")&&o.modules.accessor.initializeColumn(t),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(t),void 0!==e.visible&&(e.visible?t.show(!0):t.hide(!0)),e.cssClass){e.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}e.field&&this.element.setAttribute("tabulator-field",e.field),t.setMinWidth(void 0===e.minWidth?t.table.options.columnMinWidth:parseInt(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.hozAlign?t.table.options.cellHozAlign:t.definition.hozAlign,t.vertAlign=void 0===t.definition.vertAlign?t.table.options.cellVertAlign:t.definition.vertAlign},Column.prototype._buildColumnHeaderContent=function(){var t=(this.definition,this.table,document.createElement("div"));return t.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),t.appendChild(this.titleElement),t},Column.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},Column.prototype._formatColumnHeaderTitle=function(t,e){var o,i,n,l,s,a=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),s=function(t){a.titleFormatterRendered=t},l={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,l,n,s),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},Column.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.element.appendChild(this.groupElement)},Column.prototype._getFlatData=function(t){return t[this.field]},Column.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,l=0;l-1&&this._nextVisibleColumn(t+1)},Column.prototype._nextVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)},Column.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)},Column.prototype._prevVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)},Column.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()},Column.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))},Column.prototype.updateDefinition=function(t){var e=this;return new Promise(function(o,i){var n;e.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion 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)}))})},Column.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Column.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","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","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],Column.prototype.getComponent=function(){return this.component||(this.component=new ColumnComponent(this)),this.component};var RowManager=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};RowManager.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},RowManager.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},RowManager.prototype.getElement=function(){return this.element},RowManager.prototype.getTableElement=function(){return this.tableElement},RowManager.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},RowManager.prototype.setColumnManager=function(t){this.columnManager=t},RowManager.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})},RowManager.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 Row)return t;if(t instanceof RowComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.rows.find(function(e){return e.element===t})||!1}return!1},RowManager.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},RowManager.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},RowManager.prototype.scrollToRow=function(t,e,o){var i,n=this,l=this.getDisplayRows().indexOf(t),s=t.getElement(),a=0;return new Promise(function(t,r){if(l>-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=Tabulator.prototype.helpers.elOffset(s).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-l)>Math.abs(n.vDomBottom-l)?"bottom":"top"}if(!o&&Tabulator.prototype.helpers.elVisible(s)&&(a=Tabulator.prototype.helpers.elOffset(s).top-Tabulator.prototype.helpers.elOffset(n.element).top)>0&&a-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.dataEdited.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")},RowManager.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},RowManager.prototype.addRows=function(t,e,o){var i=this,n=this,l=0,s=[];return new Promise(function(a,r){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),l=t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach(function(t,i){var l=n.addRow(t,e,o,!0);s.push(l)}),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(),a(s)})},RowManager.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},RowManager.prototype.addRowActual=function(t,e,o,i){var n,l,s=t instanceof Row?t:new Row(t||{},this),a=this.findAddRowPos(e),r=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(l=this.getDisplayRows(),a?l.length?o=l[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],a=!1):l.length&&(o=l[l.length-1],a=!(l.length1&&(!o||o&&-1==u.indexOf(o)?a?u[0]!==s&&(o=u[0],this._moveRowInArray(s.getGroup().rows,s,o,!a)):u[u.length-1]!==s&&(o=u[u.length-1],this._moveRowInArray(s.getGroup().rows,s,o,!a)):this._moveRowInArray(s.getGroup().rows,s,o,!a))}return o&&(r=this.rows.indexOf(o)),o&&r>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(t){var e=t.indexOf(o);e>-1&&t.splice(a?e:e+1,0,s)}),n>-1&&this.activeRows.splice(a?n:n+1,0,s),this.rows.splice(a?r:r+1,0,s)):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)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,s.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),s},RowManager.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())},RowManager.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 Group&&(e=this.table.rowManager.prevDisplayRow(t)||e);var n=e.getGroup(),l=t.getGroup();n===l?this._moveRowInArray(n.rows,t,e,o):(l&&l.removeRow(t),n.insertRow(t,e,o))}},RowManager.prototype._moveRowInArray=function(t,e,o,i){var n,l,s,a;if(e!==o&&(n=t.indexOf(e),n>-1&&(t.splice(n,1),l=t.indexOf(o),l>-1?i?t.splice(l+1,0,e):t.splice(l,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){s=nn?l:n+1;for(var r=s;r<=a;r++)t[r]&&this.styleRow(t[r],r)}},RowManager.prototype.clearData=function(){this.setData([])},RowManager.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},RowManager.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},RowManager.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o-1)&&o},RowManager.prototype.getData=function(t,e){var o=[];return this.getRows(t).forEach(function(t){"row"==t.type&&o.push(t.getData(e||"data"))}),o},RowManager.prototype.getComponents=function(t){var e=[];return this.getRows(t).forEach(function(t){e.push(t.getComponent())}),e},RowManager.prototype.getDataCount=function(t){return this.getRows(t).length},RowManager.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 l=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=l}this.table.modules.ajax.setParams(i,!0)}e.modules.ajax.sendRequest().then(function(e){t._setDataActual(e,!0)}).catch(function(t){})},RowManager.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)},RowManager.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)},RowManager.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)},RowManager.prototype.refreshActiveData=function(t,e,o){var i,n=this,l=this.table,s=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||s.indexOf(t)=0))break;l=a}else if(e-s[a].getElement().offsetTop>=0)n=a;else{if(i=!0,!(o-s[a].getElement().offsetTop>=0))break;l=a}}else n=this.vDomTop,l=this.vDomBottom;return s.slice(n,l+1)},RowManager.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},RowManager.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;default:e=this.rows}return e},RowManager.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,l=this.getDisplayRows(),s=this.vDomTop;s<=this.vDomBottom;s++)if(l[s]){var a=e-l[s].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*f),"group"!==m.type&&(c=!1),i.vDomBottom++,u++}t?(i.vDomTopPad=e?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-r,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-r,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+r)/u),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=r+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",e&&(this.scrollTop=i.vDomTopPad+r+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,l.scrollTop=this.scrollTop,n.style.minWidth=c?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()},RowManager.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))},RowManager.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,l=i[n],s=l.getHeight()||this.vDomRowHeight;t>=s&&(this.styleRow(l,n),o.insertBefore(l.getElement(),o.firstChild),l.initialized&&l.heightInitialized||(this.vDomTopNewRows.push(l),l.heightInitialized||l.clearCellHeight()),l.initialize(),this.vDomTopPad-=s,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=s,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),l.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l.getHeight()),e=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},RowManager.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)}},RowManager.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=s&&(this.styleRow(l,n),o.appendChild(l.getElement()),l.initialized&&l.heightInitialized||(this.vDomBottomNewRows.push(l),l.heightInitialized||l.clearCellHeight()),l.initialize(),this.vDomBottomPad-=s,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=s,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,l.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l.getHeight()),e=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},RowManager.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)}},RowManager.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},RowManager.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},RowManager.prototype.adjustTableSize=function(){var t,e=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight: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()}},RowManager.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize()})},RowManager.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},RowManager.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},RowManager.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))},RowManager.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 RowComponent=function(t){this._row=t};RowComponent.prototype.getData=function(t){return this._row.getData(t)},RowComponent.prototype.getElement=function(){return this._row.getElement()},RowComponent.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t},RowComponent.prototype.getCell=function(t){var e=this._row.getCell(t);return!!e&&e.getComponent()},RowComponent.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},RowComponent.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)},RowComponent.prototype.delete=function(){return this._row.delete()},RowComponent.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},RowComponent.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},RowComponent.prototype.move=function(t,e){this._row.moveToRow(t,e)},RowComponent.prototype.update=function(t){return this._row.updateData(t)},RowComponent.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},RowComponent.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},RowComponent.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},RowComponent.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},RowComponent.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},RowComponent.prototype._getSelf=function(){return this._row},RowComponent.prototype.validate=function(){return this._row.validate()},RowComponent.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},RowComponent.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},RowComponent.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},RowComponent.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},RowComponent.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},RowComponent.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},RowComponent.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},RowComponent.prototype.addTreeChild=function(t,e,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,t,e,o)},RowComponent.prototype.reformat=function(){return this._row.reinitialize()},RowComponent.prototype.getGroup=function(){return this._row.getGroup().getComponent()},RowComponent.prototype.getTable=function(){return this._row.table},RowComponent.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},RowComponent.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var Row=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=this.createElement(),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.setData(t),this.generateElement()};Row.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},Row.prototype.getElement=function(){return this.element},Row.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},Row.prototype.generateElement=function(){var t,e,o,i=this;!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&&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}))},Row.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},Row.prototype.initialize=function(t){var e=this;if(!e.initialized||t){for(e.deleteCells();e.element.firstChild;)e.element.removeChild(e.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&e.normalizeHeight(),e.table.options.dataTree&&e.table.modExists("dataTree")&&e.table.modules.dataTree.layoutRow(this),"collapse"===e.table.options.responsiveLayout&&e.table.modExists("responsiveLayout")&&e.table.modules.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.modExists("resizeRows")&&e.table.modules.resizeRows.initializeRow(e),e.initialized=!0}},Row.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},Row.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},Row.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},Row.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},Row.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},Row.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},Row.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)},Row.prototype.getHeight=function(){return this.outerHeight},Row.prototype.getWidth=function(){return this.element.offsetWidth},Row.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Row.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)},Row.prototype.updateData=function(t){var e,o=this,i=Tabulator.prototype.helpers.elVisible(this.element),n={};return new Promise(function(l,s){"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 a in e)o.data[a]=e[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in t){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(t){var n=o.getCell(t.getField());if(n){var l=t.getFieldValue(e);n.getValue()!=l&&(n.setValueProcessData(l),i&&n.cellRendered())}})}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),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),l()})},Row.prototype.getData=function(t){var e=this;return t?e.table.modExists("accessor")?e.table.modules.accessor.transformRow(e.data,t):void 0:this.data},Row.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},Row.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},Row.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&&Tabulator.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},Row.prototype.getCells=function(){return this.cells},Row.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},Row.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},Row.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)},Row.prototype.validate=function(){var t=[];return this.cells.forEach(function(e){e.validate()||t.push(e.getComponent())}),!t.length||t},Row.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()})},Row.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);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.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.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))},Row.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e-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))},Tabulator.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},Tabulator.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},Tabulator.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 l,s=n.files[0],a=new FileReader;a.readAsText(s),a.onload=function(t){try{l=JSON.parse(a.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e._setData(l).then(function(t){o(t)}).catch(function(t){o(t)})},a.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},Tabulator.prototype.setData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!1,!0)},Tabulator.prototype._setData=function(t,e,o,i,n){var l=this;return"string"!=typeof t?t?l.rowManager.setData(t,i,n):l.modExists("ajax")&&(l.modules.ajax.getUrl||l.options.ajaxURLGenerator)?"remote"==l.options.pagination&&l.modExists("page",!0)?(l.modules.page.reset(!0,!0),l.modules.page.setPage(1)):l.modules.ajax.loadData(i,n):l.rowManager.setData([],i,n):0==t.indexOf("{")||0==t.indexOf("[")?l.rowManager.setData(JSON.parse(t),i,n):l.modExists("ajax",!0)?(e&&l.modules.ajax.setParams(e),o&&l.modules.ajax.setConfig(o),l.modules.ajax.setUrl(t),"remote"==l.options.pagination&&l.modExists("page",!0)?(l.modules.page.reset(!0,!0),l.modules.page.setPage(1)):l.modules.ajax.loadData(i,n)):void 0},Tabulator.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},Tabulator.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)},Tabulator.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)},Tabulator.prototype.searchRows=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,o)},Tabulator.prototype.searchData=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,o)},Tabulator.prototype.getHtml=function(t,e,o){if(this.modExists("export",!0))return this.modules.export.getHtml(t,e,o)},Tabulator.prototype.print=function(t,e,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,e,o)},Tabulator.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},Tabulator.prototype.replaceData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},Tabulator.prototype.updateData=function(t){var e=this,o=this,i=0;return new Promise(function(n,l){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"),l("Update Error - No data provided"))})},Tabulator.prototype.addData=function(t,e,o){var i=this;return new Promise(function(n,l){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"),l("Update Error - No data provided"))})},Tabulator.prototype.updateOrAddData=function(t){var e=this,o=this,i=[],n=0;return new Promise(function(l,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]);n++,e?e.updateData(t).then(function(){n--,i.push(e.getComponent()),n||l(i)}):o.rowManager.addRows(t).then(function(t){n--,i.push(t[0].getComponent()),n||l(i)})}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},Tabulator.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},Tabulator.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)},Tabulator.prototype.deleteRow=function(t){var e=this;return new Promise(function(o,i){function n(){++s==t.length&&a&&(l.rowManager.reRenderInPosition(),o())}var l=e,s=0,a=0,r=[];Array.isArray(t)||(t=[t]),t.forEach(function(t){var o=e.rowManager.findRow(t,!0);o?r.push(o):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"),n())}),r.sort(function(t,o){return e.rowManager.rows.indexOf(t)>e.rowManager.rows.indexOf(o)?1:-1}),r.forEach(function(t){t.delete().then(function(){a++,n()}).catch(function(t){n(),i(t)})})})},Tabulator.prototype.addRow=function(t,e,o){var i=this;return new Promise(function(n,l){"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())})})},Tabulator.prototype.updateOrAddRow=function(t,e){var o=this;return new Promise(function(i,n){var l=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),l?l.updateData(e).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(l.getComponent())}).catch(function(t){n(t)}):l=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)})})},Tabulator.prototype.updateRow=function(t,e){var o=this;return new Promise(function(i,n){var l=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),l?l.updateData(e).then(function(){i(l.getComponent())}).catch(function(t){n(t)}):(console.warn("Update Error - No matching row found:",t),n("Update Error - No matching row found"))})},Tabulator.prototype.scrollToRow=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.rowManager.findRow(t);s?i.rowManager.scrollToRow(s,e,o).then(function(){n()}).catch(function(t){l(t)}):(console.warn("Scroll Error - No matching row found:",t),l("Scroll Error - No matching row found"))})},Tabulator.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)},Tabulator.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)},Tabulator.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)},Tabulator.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)},Tabulator.prototype.setColumns=function(t){this.columnManager.setColumns(t)},Tabulator.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},Tabulator.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},Tabulator.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},Tabulator.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},Tabulator.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},Tabulator.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()},Tabulator.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()},Tabulator.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()},Tabulator.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.columnManager.findColumn(o);i.columnManager.addColumn(t,e,s).then(function(t){n(t.getComponent())}).catch(function(t){l(t)})})},Tabulator.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())})},Tabulator.prototype.updateColumnDefinition=function(t,e){var o=this;return new Promise(function(i,n){var l=o.columnManager.findColumn(t);l?l.updateDefinition(e).then(function(t){i(t)}).catch(function(t){n(t)}):(console.warn("Column Update Error - No matching column found:",t),n())})},Tabulator.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)},Tabulator.prototype.scrollToColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.columnManager.findColumn(t);s?i.columnManager.scrollToColumn(s,e,o).then(function(){n()}).catch(function(t){l(t)}):(console.warn("Scroll Error - No matching column found:",t),l("Scroll Error - No matching column found"))})},Tabulator.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},Tabulator.prototype.getLocale=function(){return this.modules.localize.getLocale()},Tabulator.prototype.getLang=function(t){return this.modules.localize.getLang(t)},Tabulator.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},Tabulator.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")},Tabulator.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},Tabulator.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},Tabulator.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},Tabulator.prototype.setFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,o,i),this.rowManager.filterRefresh())},Tabulator.prototype.addFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,o,i),this.rowManager.filterRefresh())},Tabulator.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},Tabulator.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)}},Tabulator.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)}},Tabulator.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)}},Tabulator.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},Tabulator.prototype.removeFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},Tabulator.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},Tabulator.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},Tabulator.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))},Tabulator.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},Tabulator.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},Tabulator.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},Tabulator.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},Tabulator.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},Tabulator.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())}))},Tabulator.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},Tabulator.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},Tabulator.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},Tabulator.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()})},Tabulator.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(){})},Tabulator.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},Tabulator.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},Tabulator.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},Tabulator.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},Tabulator.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},Tabulator.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")},Tabulator.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")},Tabulator.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")},Tabulator.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},Tabulator.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},Tabulator.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},Tabulator.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())}))},Tabulator.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},Tabulator.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},Tabulator.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},Tabulator.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},Tabulator.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},Tabulator.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},Tabulator.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},Tabulator.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},Tabulator.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},Tabulator.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},Tabulator.prototype.getHistoryUndoSize=function(){ -return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},Tabulator.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},Tabulator.prototype.download=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i)},Tabulator.prototype.downloadToTab=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i,!0)},Tabulator.prototype.tableComms=function(t,e,o,i){this.modules.comms.receive(t,e,o,i)},Tabulator.prototype.moduleBindings={},Tabulator.prototype.extendModule=function(t,e,o){if(Tabulator.prototype.moduleBindings[t]){var i=Tabulator.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)},Tabulator.prototype.registerModule=function(t,e){Tabulator.prototype.moduleBindings[t]=e},Tabulator.prototype.bindModules=function(){this.modules={};for(var t in Tabulator.prototype.moduleBindings)this.modules[t]=new Tabulator.prototype.moduleBindings[t](this)},Tabulator.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},Tabulator.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=Array.isArray(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]):e[o]=t[o];return e}},Tabulator.prototype.comms={tables:[],register:function(t){Tabulator.prototype.comms.tables.push(t)},deregister:function(t){var e=Tabulator.prototype.comms.tables.indexOf(t);e>-1&&Tabulator.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 l=0;l0?l.setWidth(n):l.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,l){function s(t){return n*(t.column.definition.widthGrow||1)}function a(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var r=[],u=0,c=0,h=0,d=0,p=0,m=[];return t.forEach(function(t,e){var o=l?a(t):s(t);t.column.minWidth>=o?r.push(t):(m.push(t),p+=l?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),r.length?(r.forEach(function(t){u+=l?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),c=i-u,h=p?Math.floor(c/p):c,d=c-h*p,d+=o(m,c,h,l)):(d=p?i-Math.floor(i/p)*p:i,m.forEach(function(t){t.width=l?a(t):s(t)})),d}var i=this,n=i.table.element.clientWidth,l=0,s=0,a=0,r=0,u=[],c=[],h=0,d=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.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),l+=n>i?n:i,t.definition.widthShrink&&(c.push({column:t,width:n>i?n:i}),h+=t.definition.widthShrink)):(u.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),s=n-l,r=Math.floor(s/a);var p=o(u,s,r,!1);u.length&&p>0&&(u[u.length-1].width+=+p),u.forEach(function(t){s-=t.width}),d=Math.abs(p)+s,d>0&&h&&(p=o(c,d,Math.floor(d/h),!0)),c.length&&(c[c.length-1].width-=p),u.forEach(function(t){t.column.setWidth(t.width)}),c.forEach(function(t){t.column.setWidth(t.width)})}},Tabulator.prototype.registerModule("layout",Layout);var Localize=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};Localize.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},Localize.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)},Localize.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},Localize.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]},Localize.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.langs[t]){var i=t.split("-")[0];o.langs[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=Tabulator.prototype.helpers.deepClone(o.langs.default||{}),"default"!=t&&e(o.langs[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},Localize.prototype.getLocale=function(t){return self.locale},Localize.prototype.getLang=function(t){return t?this.langs[t]:this.lang},Localize.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},Localize.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},Localize.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},Localize.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)},Localize.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:{}}}},Tabulator.prototype.registerModule("localize",Localize);var Comms=function(t){this.table=t};Comms.prototype.getConnections=function(t){var e,o=this,i=[];return e=Tabulator.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},Comms.prototype.send=function(t,e,o,i){var n=this,l=this.getConnections(t);l.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!l.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},Comms.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)},Tabulator.prototype.registerModule("comms",Comms); \ No newline at end of file +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))},RowManager.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 RowComponent=function(t){this._row=t};RowComponent.prototype.getData=function(t){return this._row.getData(t)},RowComponent.prototype.getElement=function(){return this._row.getElement()},RowComponent.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t},RowComponent.prototype.getCell=function(t){var e=this._row.getCell(t);return!!e&&e.getComponent()},RowComponent.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},RowComponent.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)},RowComponent.prototype.delete=function(){return this._row.delete()},RowComponent.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},RowComponent.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},RowComponent.prototype.move=function(t,e){this._row.moveToRow(t,e)},RowComponent.prototype.update=function(t){return this._row.updateData(t)},RowComponent.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},RowComponent.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},RowComponent.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},RowComponent.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},RowComponent.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},RowComponent.prototype._getSelf=function(){return this._row},RowComponent.prototype.validate=function(){return this._row.validate()},RowComponent.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},RowComponent.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},RowComponent.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){return this._row.table.modules.frozenRows.rows.indexOf(this._row)>-1}return!1},RowComponent.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},RowComponent.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},RowComponent.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},RowComponent.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},RowComponent.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},RowComponent.prototype.addTreeChild=function(t,e,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,t,e,o)},RowComponent.prototype.reformat=function(){return this._row.reinitialize()},RowComponent.prototype.getGroup=function(){return this._row.getGroup().getComponent()},RowComponent.prototype.getTable=function(){return this._row.table},RowComponent.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},RowComponent.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var Row=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=this.createElement(),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.setData(t),this.generateElement()};Row.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},Row.prototype.getElement=function(){return this.element},Row.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},Row.prototype.generateElement=function(){var t,e,o,i=this;!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&&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}))},Row.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},Row.prototype.initialize=function(t){var e=this;if(!e.initialized||t){for(e.deleteCells();e.element.firstChild;)e.element.removeChild(e.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&e.normalizeHeight(),e.table.options.dataTree&&e.table.modExists("dataTree")&&e.table.modules.dataTree.layoutRow(this),"collapse"===e.table.options.responsiveLayout&&e.table.modExists("responsiveLayout")&&e.table.modules.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.modExists("resizeRows")&&e.table.modules.resizeRows.initializeRow(e),e.initialized=!0}},Row.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},Row.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},Row.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},Row.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},Row.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},Row.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},Row.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)},Row.prototype.getHeight=function(){return this.outerHeight},Row.prototype.getWidth=function(){return this.element.offsetWidth},Row.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Row.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)},Row.prototype.updateData=function(t){var e,o=this,i=Tabulator.prototype.helpers.elVisible(this.element),n={};return new Promise(function(l,s){"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 a in e)o.data[a]=e[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in t){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(t){var n=o.getCell(t.getField());if(n){var l=t.getFieldValue(e);n.getValue()!=l&&(n.setValueProcessData(l),i&&n.cellRendered())}})}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),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),l()})},Row.prototype.getData=function(t){var e=this;return t?e.table.modExists("accessor")?e.table.modules.accessor.transformRow(e.data,t):void 0:this.data},Row.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},Row.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},Row.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&&Tabulator.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},Row.prototype.getCells=function(){return this.cells},Row.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},Row.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},Row.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)},Row.prototype.validate=function(){var t=[];return this.cells.forEach(function(e){e.validate()||t.push(e.getComponent())}),!t.length||t},Row.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()})},Row.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);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.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.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))},Row.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e-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))},Tabulator.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},Tabulator.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},Tabulator.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 l,s=n.files[0],a=new FileReader;a.readAsText(s),a.onload=function(t){try{l=JSON.parse(a.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e._setData(l).then(function(t){o(t)}).catch(function(t){o(t)})},a.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},Tabulator.prototype.setData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!1,!0)},Tabulator.prototype._setData=function(t,e,o,i,n){var l=this;return"string"!=typeof t?t?l.rowManager.setData(t,i,n):l.modExists("ajax")&&(l.modules.ajax.getUrl||l.options.ajaxURLGenerator)?"remote"==l.options.pagination&&l.modExists("page",!0)?(l.modules.page.reset(!0,!0),l.modules.page.setPage(1)):l.modules.ajax.loadData(i,n):l.rowManager.setData([],i,n):0==t.indexOf("{")||0==t.indexOf("[")?l.rowManager.setData(JSON.parse(t),i,n):l.modExists("ajax",!0)?(e&&l.modules.ajax.setParams(e),o&&l.modules.ajax.setConfig(o),l.modules.ajax.setUrl(t),"remote"==l.options.pagination&&l.modExists("page",!0)?(l.modules.page.reset(!0,!0),l.modules.page.setPage(1)):l.modules.ajax.loadData(i,n)):void 0},Tabulator.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},Tabulator.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)},Tabulator.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)},Tabulator.prototype.searchRows=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,o)},Tabulator.prototype.searchData=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,o)},Tabulator.prototype.getHtml=function(t,e,o){if(this.modExists("export",!0))return this.modules.export.getHtml(t,e,o)},Tabulator.prototype.print=function(t,e,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,e,o)},Tabulator.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},Tabulator.prototype.replaceData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},Tabulator.prototype.updateData=function(t){var e=this,o=this,i=0;return new Promise(function(n,l){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"),l("Update Error - No data provided"))})},Tabulator.prototype.addData=function(t,e,o){var i=this;return new Promise(function(n,l){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"),l("Update Error - No data provided"))})},Tabulator.prototype.updateOrAddData=function(t){var e=this,o=this,i=[],n=0;return new Promise(function(l,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]);n++,e?e.updateData(t).then(function(){n--,i.push(e.getComponent()),n||l(i)}):o.rowManager.addRows(t).then(function(t){n--,i.push(t[0].getComponent()),n||l(i)})}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},Tabulator.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},Tabulator.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)},Tabulator.prototype.deleteRow=function(t){var e=this;return new Promise(function(o,i){function n(){++s==t.length&&a&&(l.rowManager.reRenderInPosition(),o())}var l=e,s=0,a=0,r=[];Array.isArray(t)||(t=[t]),t.forEach(function(t){var o=e.rowManager.findRow(t,!0);o?r.push(o):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"),n())}),r.sort(function(t,o){return e.rowManager.rows.indexOf(t)>e.rowManager.rows.indexOf(o)?1:-1}),r.forEach(function(t){t.delete().then(function(){a++,n()}).catch(function(t){n(),i(t)})})})},Tabulator.prototype.addRow=function(t,e,o){var i=this;return new Promise(function(n,l){"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())})})},Tabulator.prototype.updateOrAddRow=function(t,e){var o=this;return new Promise(function(i,n){var l=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),l?l.updateData(e).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(l.getComponent())}).catch(function(t){n(t)}):l=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)})})},Tabulator.prototype.updateRow=function(t,e){var o=this;return new Promise(function(i,n){var l=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),l?l.updateData(e).then(function(){i(l.getComponent())}).catch(function(t){n(t)}):(console.warn("Update Error - No matching row found:",t),n("Update Error - No matching row found"))})},Tabulator.prototype.scrollToRow=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.rowManager.findRow(t);s?i.rowManager.scrollToRow(s,e,o).then(function(){n()}).catch(function(t){l(t)}):(console.warn("Scroll Error - No matching row found:",t),l("Scroll Error - No matching row found"))})},Tabulator.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)},Tabulator.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)},Tabulator.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)},Tabulator.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)},Tabulator.prototype.setColumns=function(t){this.columnManager.setColumns(t)},Tabulator.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},Tabulator.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},Tabulator.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},Tabulator.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},Tabulator.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},Tabulator.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()},Tabulator.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()},Tabulator.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()},Tabulator.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.columnManager.findColumn(o);i.columnManager.addColumn(t,e,s).then(function(t){n(t.getComponent())}).catch(function(t){l(t)})})},Tabulator.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())})},Tabulator.prototype.updateColumnDefinition=function(t,e){var o=this;return new Promise(function(i,n){var l=o.columnManager.findColumn(t);l?l.updateDefinition(e).then(function(t){i(t)}).catch(function(t){n(t)}):(console.warn("Column Update Error - No matching column found:",t),n())})},Tabulator.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)},Tabulator.prototype.scrollToColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.columnManager.findColumn(t);s?i.columnManager.scrollToColumn(s,e,o).then(function(){n()}).catch(function(t){l(t)}):(console.warn("Scroll Error - No matching column found:",t),l("Scroll Error - No matching column found"))})},Tabulator.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},Tabulator.prototype.getLocale=function(){return this.modules.localize.getLocale()},Tabulator.prototype.getLang=function(t){return this.modules.localize.getLang(t)},Tabulator.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},Tabulator.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")},Tabulator.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},Tabulator.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},Tabulator.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},Tabulator.prototype.setFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,o,i),this.rowManager.filterRefresh())},Tabulator.prototype.addFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,o,i),this.rowManager.filterRefresh())},Tabulator.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},Tabulator.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)}},Tabulator.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)}},Tabulator.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)}},Tabulator.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},Tabulator.prototype.removeFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},Tabulator.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},Tabulator.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},Tabulator.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))},Tabulator.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},Tabulator.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},Tabulator.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},Tabulator.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},Tabulator.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},Tabulator.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())}))},Tabulator.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},Tabulator.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},Tabulator.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},Tabulator.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()})},Tabulator.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(){})},Tabulator.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},Tabulator.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},Tabulator.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},Tabulator.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},Tabulator.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},Tabulator.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")},Tabulator.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")},Tabulator.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")},Tabulator.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},Tabulator.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},Tabulator.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},Tabulator.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())}))},Tabulator.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},Tabulator.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},Tabulator.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},Tabulator.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},Tabulator.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},Tabulator.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},Tabulator.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},Tabulator.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},Tabulator.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},Tabulator.prototype.redo=function(){ +return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},Tabulator.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},Tabulator.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},Tabulator.prototype.download=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i)},Tabulator.prototype.downloadToTab=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i,!0)},Tabulator.prototype.tableComms=function(t,e,o,i){this.modules.comms.receive(t,e,o,i)},Tabulator.prototype.moduleBindings={},Tabulator.prototype.extendModule=function(t,e,o){if(Tabulator.prototype.moduleBindings[t]){var i=Tabulator.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)},Tabulator.prototype.registerModule=function(t,e){Tabulator.prototype.moduleBindings[t]=e},Tabulator.prototype.bindModules=function(){this.modules={};for(var t in Tabulator.prototype.moduleBindings)this.modules[t]=new Tabulator.prototype.moduleBindings[t](this)},Tabulator.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},Tabulator.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=Array.isArray(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]):e[o]=t[o];return e}},Tabulator.prototype.comms={tables:[],register:function(t){Tabulator.prototype.comms.tables.push(t)},deregister:function(t){var e=Tabulator.prototype.comms.tables.indexOf(t);e>-1&&Tabulator.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 l=0;l0?l.setWidth(n):l.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,l){function s(t){return n*(t.column.definition.widthGrow||1)}function a(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var r=[],u=0,c=0,h=0,d=0,p=0,m=[];return t.forEach(function(t,e){var o=l?a(t):s(t);t.column.minWidth>=o?r.push(t):(m.push(t),p+=l?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),r.length?(r.forEach(function(t){u+=l?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),c=i-u,h=p?Math.floor(c/p):c,d=c-h*p,d+=o(m,c,h,l)):(d=p?i-Math.floor(i/p)*p:i,m.forEach(function(t){t.width=l?a(t):s(t)})),d}var i=this,n=i.table.element.clientWidth,l=0,s=0,a=0,r=0,u=[],c=[],h=0,d=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.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),l+=n>i?n:i,t.definition.widthShrink&&(c.push({column:t,width:n>i?n:i}),h+=t.definition.widthShrink)):(u.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),s=n-l,r=Math.floor(s/a);var p=o(u,s,r,!1);u.length&&p>0&&(u[u.length-1].width+=+p),u.forEach(function(t){s-=t.width}),d=Math.abs(p)+s,d>0&&h&&(p=o(c,d,Math.floor(d/h),!0)),c.length&&(c[c.length-1].width-=p),u.forEach(function(t){t.column.setWidth(t.width)}),c.forEach(function(t){t.column.setWidth(t.width)})}},Tabulator.prototype.registerModule("layout",Layout);var Localize=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};Localize.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},Localize.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)},Localize.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},Localize.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]},Localize.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.langs[t]){var i=t.split("-")[0];o.langs[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=Tabulator.prototype.helpers.deepClone(o.langs.default||{}),"default"!=t&&e(o.langs[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},Localize.prototype.getLocale=function(t){return self.locale},Localize.prototype.getLang=function(t){return t?this.langs[t]:this.lang},Localize.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},Localize.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},Localize.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},Localize.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)},Localize.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:{}}}},Tabulator.prototype.registerModule("localize",Localize);var Comms=function(t){this.table=t};Comms.prototype.getConnections=function(t){var e,o=this,i=[];return e=Tabulator.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},Comms.prototype.send=function(t,e,o,i){var n=this,l=this.getConnections(t);l.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!l.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},Comms.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)},Tabulator.prototype.registerModule("comms",Comms); \ No newline at end of file