{"version":3,"sources":["WPTB_ExtraStyles.js","WPTB_Logger.js","WPTB_CutGlueTable.js","WPTB_GetDirectionAfterReconstruction.js","WPTB_SortableTable.js","WPTB_RecalculateIndexes.js","WPTB_ResponsiveFrontend.js","WPTB_StylePass.js","WPTB_LazyLoad.js","WPTB_ScrollManager.js","wp-table-builder-frontend.js"],"names":["key","context","factory","module","exports","_typeof","self","global","_tableQueries","_this","this","prefixStyleRules","prefix","extraStyles","splitStyles","replaceAll","split","prefixedStylesArray","map","matches","RegExp","exec","push","replace","concat","join","applyGeneralStyles","generalStyles","baseElement","arguments","length","undefined","generalStylesheet","document","createElement","type","id","insertAdjacentElement","currentMode","modes","block","baseDocument","querySelector","appendChild","prefixedStyleRules","parentPrefix","styles","createTextNode","applyExtraStyle","tableElement","styleId","head","uniqueClass","prefixedStyles","extraStylesRaw","dataset","wptbExtraStyles","atob","tableId","_slicedToArray","getAttribute","match","styleElement","disableThemeStyles","frontEnd","innerHTML","builder","tableQueries","_defineProperty","applyStyles","mode","allTables","Array","from","querySelectorAll","bgColors","normal","prepareMessage","message","prepareMessageStyle","messageType","log","console","WPTB_CutGlueTable","cutTableHorizontally","rowBefore","table","rows","i","tableRowsIChildren","children","j","rowSpan","newTdRowspan","sameCellBeforeDivision","td","hasOwnProperty","wptbCell","mark","getDOMElement","tdTopStyle","setAttribute","colSpan","dataXIndex","xIndex","dataXIndexNext","parseInt","beforeTd","maxCols","insertBefore","WPTB_RecalculateIndexes","glueTableHorizontally","tds","_toConsumableArray","getElementsByTagName","hasAttribute","dataSameCellBeforeDivision","tdsSameBeforeDivision","parentNode","classList","contains","yIndex","tdsSameBeforeDivisionJPlusChildren","k","removeChild","cutTableVertically","col","rowSpanNewTd","colSpanOld","colSpanNewTd","rowChildren","rowChildrenLength","afterTd","tdLeftStyle","tdAnalogThisX","style","width","tdAnalogThisY","height","glueTableVertically","jFirstTdGlue","WPTB_GetDirectionAfterReconstruction","typeFirst","typeSecond","verticalProp","responsiveFront","itemsPerHeader","tableMaxCols","switchMode","getDirective","e","directives","sizeRangeId","detail","responsiveMode","modeOptions","topRowAsHeader","cellStackDirection","cellsPerRow","newTable","options","thisObject","sortingCellMouseMov","element","x","y","xMatch","target","tagName","offsetX","layerX","offsetY","layerY","clientWidth","clientHeight","add","remove","sortingCellMouseMoveVertical","sortingCellMouseMoveHorizontal","tdMouseLeave","sortableTable","currentTarget","tableWasSorted","tableRowsBefore","tableRowsAfter","tableRowsArr","tableLastCont","rowspan","rowNum","rowsTdFirst","rowsValuesArr","tdYCoordsRowSpanPrevious","tableRowsPushed","tdsChanged","changeSortingTdsCollection","tdRowspan","textElementsValues","textElementsValuesGet","rowsTd","value","orderBy","setSortedAscDataAttr","sort","prev","next","sortOrder","unshift","indexOf","trRef","tBody","rowsValObj","row","tr","colspan","colNum","columnsTdFirst","columnsValuesArr","tdXCoordsColSpanPrevious","tdColspan","columnsTd","tdsColumn","difference","columnsValObj","tdsAll","removeAttribute","removeCellsAttrAfterDivision","tableSM","tableStateSet","reassignElementsStyles","dataAttr","prevValue","nextValue","cell","textElements","innerText","tdIndexSpanPrev","collectionTdsJSpan","collectionTdsJSpanProperty","indexName","indexNameCamelCase","indexNamePerpendicularCamelCase","tableGroupCount","tdsCollectionChanged","tdSpanProperty","collectionTds","splice","tdSpan","cellsStylesScheme","rowsStylesScheme","sortModeSwitcher","active","removeEventListener","sortableTableVerticalStart","sortingCellMouseMoveSwitcher","addEventListener","wptbSortableTableVertical","createTableElementsStylesScheme","sortableTableHorizontalStart","wptbSortableTableHorizontal","tableObjectChange","start","elemSelector","elements","elem","backgroundColor","window","getComputedStyle","getPropertyValue","objectKey","String","elementsStylesScheme","elemStyles","sortableTableInitialization","sortModeSwitcherRun","switchModeObj","tableOld","call","s","sCMM","dataAttrSortChange","rowsLength","dataYIndexStart","trs","maxColsFull","tdsArr","jMainIter","z","columns","logToConsole","process","env","NODE_ENV","Error","CellObject","cellElement","reference","referenceObject","mergedRenderStatus","mergedCells","column","getMergedRenderStatus","setMergedRenderStatus","status","addToMergedCells","mergeType","cellObj","isReference","cloneNode","modifications","spans","remainingSpans","cacheSpanValues","Object","keys","defaultVal","prototype","getSpan","spanType","spanVal","getElement","getRemainingSpans","setRemainingSpans","createCellElement","attributeKey","attributeValue","append","glue","currentVal","default","setSpan","valueToApply","mc","remainingVal","remainingParentSpans","startIndex","endIndex","resetAttribute","resetAllAttributes","el","TableObject","tableEl","_this2","parsedTable","rowCache","originals","rowColors","header","even","odd","addToParsed","r","c","cellObject","parseTable","ri","cells","currentIndex","ci","currentCellObject","spanRow","spanTypes","spanCol","sr","referenceCell","sc","parseRowColors","headerDatasetColor","wptbHeaderBackgroundColor","evenRowDatasetColor","wptbEvenRowBackgroundColor","oddRowDatasetColor","wptbOddRowBackgroundColor","rowsNeeded","rn","tempRow","addRow","fromOriginals","originalIndex","isArray","tableBody","range","createRange","setStart","createContextualFragment","childNodes","clearTable","getRow","maxRows","maxColumns","mergedHeader","reduce","p","getCell","returnObject","getCellsAtRow","rowId","returnObj","tempCell","appendToRow","cellRowId","cellColumnId","cachedRow","appendElementToRow","appendObjectToRow","getParsedTable","responsiveClassDefaultOptions","query","defaultClasses","bindToResize","_this3","isBackgroundTransparent","regexp","scrollOperations","revertToOriginal","matrixContainer","wptbHorizontalScrollStatus","storedMaxWidth","wptbTableContainerMaxWidth","_objectSpread","elementObjects","tableObject","bindRebuildToResize","rebuildTables","directiveString","wptbResponsiveDirectives","JSON","parse","addDefaultClasses","removeDefaultClasses","autoBuild","sizeRange","autoOption","tableObj","direction","staticTopRow","repeatMergedHeader","buildDefault","autoDirectionBuild","isRowStacked","headerBuild","baseCells","allCellsByRow","rowStartIndex","filter","b","bgColor","rowObj","forEach","cellCount","pR","currentTableColor","allCellsByCol","t","tCell","cR","headerCells","h","stackedAsColumn","rowBorderStyle","headerCount","Math","ceil","currentOriginalRow","addBorder","borderTop","cellClone","addHeaderCells","cc","currentRowSpan","cellAddStatus","currentCell","remainingItems","min","hc","headerCellObject","clonedHeaderCell","rS","cS","colorIndex","calculateRangeId","val","stops","sortedStops","a","rangeId","rebuildTable","size","directive","responsiveEnabled","buildCallable","getBoundingClientRect","breakpoints","disabled","tabEvent","CustomEvent","dispatchEvent","breakpointId","wptbBreakpoint","o","innerSize","innerWidth","relativeWidth","stylesheets","insertShadowRoot","shadowRootContainer","tableContainer","mainParent","parentChildren","tableIndex","upSibling","downSibling","prepareAllStylesheets","shadowRoot","borrowFromTheme","fontFamily","init","tableContainers","setupStylePass","checkTableEligibility","settings","disableThemeStylesForAll","container","maxWidth","scrollStatus","mainTable","attachShadow","stylesheetsObj","root","action","prepareStylesheet","copyStylesheet","styleSheet","handler","url","linkElement","LazyLoadAnimation","instanceOptions","name","speed","step","hooks","perspective","flashColor","getOptions","calculateDuration","max","abs","calculateAnimationDirection","names","indexConstant","includes","calculateDirectionConstant","callHook","hookName","userHook","getHook","_len","args","_key","apply","getBufferElement","imgElement","removeBufferElement","bufferElement","addStylesheet","content","contentRoot","lazyloadStyleSheet","styleRules","beforeAnimation","animate","afterAnimation","LazyLoadAnimationFactory","getAnimation","animationName","extraOptions","factoryOptions","none","imageElement","slideIn","overflow","transform","transition","growSling","flash","flashElement","flashStyle","ownerDocument","flip","parentWrapper","_parentWrapper$parent","animationDirection","rotationAmount","propertyName","wptbCardFlip","isElementVisible","currentYPos","top","_imgElement$parentNod","bottom","visibilityPercentage","visibilityRangeTop","visibilityRangeBottom","visibilityVariable","scrollY","cachedScrollData","lastYPosition","imageElementLoadCallback","animation","processIndividualImageElement","forceMode","wptbLazyLoadStatus","delay","setTimeout","src","wptbLazyLoadTarget","processImageElements","imgElements","position","firstTimeProcess","forceLoad","img","svgIcon","iconWrapper","iconSvg","iconSize","wptbLazyLoadIconAnimation","iconAnimation","fill","iconColor","windowCurrentYPosition","innerHeight","assignLazyLoadToElements","tables","shadowTables","carry","allImages","images","passive","defaultOptions","animationFactory","forceLoadImages","initOptions","enabled","imageLoadAnimation","imageLoadAnimationSpeed","imageLoadAnimationDirection","imageLoadAnimationPerspective","scrollOptions","prepareTableForScroll","mainContainer","frontendCalculationStatus","tableElements","getElementsByClassName","wptb_tableReconstraction","createNewTableIndic","previewTable","tableContainerMatrix","display","wptbTableAlignment","offsetWidth","reconstraction","wptbAdaptiveTable","tableContainerWidth","previewTableWidth","tableColumns","previewTableRows","tableReconstructed","wptbPreviewTableMobile","tdWidth","wholeColumnsInContainer","floor","dataWholeColumnInContainer","newTableTbody","infArr","className","tableRows","newTableLastSectionFilledColumns","valuesIsSaved","tableRowsWithoutHeader","newTableColumnsWithoutLeftHeader","countRows","tdStyles","sectionNumber","tdLeftHeader","rowFirstStyles","borderTopColor","borderColor","borderBottomColor","borderTopWidth","rowKStyles","borderWidth","background","newTableColumns","increaseRatioRows","newTableRows","jMax","jStart","rowStyles","newTd","minWidth","bubbles","wptb_tdDefaultWidth","wptbTableContainers","wptbTableContainer","wptbTableHorizontalScrollStatus","mergingСellsHorizontally","tableWidthLogic","wptbTableContainerWidth","wptbTableTdsSumMaxWidth","wptbCellsWidthAutoCount","tableTdWidthAuto","wptbFixedWidthSize","tdPaddingCommon","tableTdBorderCommonWidth","styleElementCreate","wptbTdWidthAuto","elementVisibilityStatus","parentObserver","tdStyleObj","tdBorderLeftWidth","tdBorderRightWidth","tdPaddingLeftWidth","tdPaddingRightWidth","parseFloat","_getComputedStyle","visibility","culpritParent","findParentWithNoDisplay","currentElement","currentParent","parentDisplayStatus","parentType","nodeName","toLowerCase","MutationObserver","mutationRecord","mutation","currentVisibility","containerWidth","disconnect","observe","attributes","childList","subtree","cssForTdsWidthAuto","cssForTdsWidthAutoOld","_loop","wptbElementHoverBgColor","wptbElementHoverTextColor","color","wptbElementHoverScale","wptbElementBgColor","wptbElementColor","wptbSize","wptbSizeNew","wptbButtonWrapper","WPTB_ResponsiveFrontend","WPTB_SortableTable","sortingTable","responsiveFrontReady","WPTB_ScrollManager","WptbFrontendData","scrollManager","WPTB_ExtraStyles","WPTB_LazyLoad","lazyLoad","WPTB_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I,UAGpCC,eAAe5P,KAAKuP,iBAAiBM","file":"wp-table-builder-frontend.js","sourcesContent":["/**\n * Extra styles module to add custom css rules defined for individual tables.\n */\n(function UMD(key, context, factory) {\n\tif (typeof module !== 'undefined' && typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tcontext[key] = factory();\n\t}\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_ExtraStyles', self || global, () => {\n\t/**\n\t * Extra styles frontend manager.\n\t *\n\t * This component will be responsible for adding and maintaining extra styles defined for tables.\n\t *\n\t * @class\n\t */\n\t// eslint-disable-next-line camelcase\n\tfunction WPTB_ExtraStyles() {\n\t\t/**\n\t\t * Extra styles operation modes\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.modes = {\n\t\t\tbuilder: 'builder',\n\t\t\tfrontEnd: 'frontEnd',\n\t\t\tblock: 'block',\n\t\t};\n\n\t\t/**\n\t\t * Base document for DOM operations.\n\t\t *\n\t\t * @type {Document}\n\t\t */\n\t\tthis.baseDocument = document;\n\n\t\t/**\n\t\t * Current mode extra styles are operating on.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.currentMode = this.modes.builder;\n\n\t\t/**\n\t\t * General table styles.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.generalStyles = '';\n\n\t\t/**\n\t\t * HTML queries for table element in different plugin modes\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tconst tableQueries = {\n\t\t\t[this.modes.builder]: '.wptb-table-setup .wptb-preview-table',\n\t\t\t[this.modes.block]: '.wptb-block-table-setup .wptb-preview-table',\n\t\t\t[this.modes.frontEnd]: '.wptb-table-container .wptb-preview-table',\n\t\t};\n\n\t\t/**\n\t\t * Format styles.\n\t\t *\n\t\t * @param {string} styles styles\n\t\t * @return {string} formatted styles\n\t\t */\n\t\tconst formatStyles = (styles) => {\n\t\t\t// remove all newlines, comments and '!important' from style string to make it a one liner\n\t\t\tconst cleaned = styles.replaceAll(/(\\r?\\n)|(\\/\\*.+?\\*\\/)|(\\s*!important)/g, '');\n\n\t\t\t// add '!important' to all rules to override default style rules\n\t\t\treturn cleaned.replaceAll(';', ' !important;');\n\t\t};\n\n\t\t/**\n\t\t * Reform style rules so they will only affect given table id.\n\t\t *\n\t\t * @param {number} prefix prefix string that will be added to all rules\n\t\t * @param {string} extraStyles extra styles\n\t\t * @return {string} new style properties prefixed with table id class\n\t\t */\n\t\tconst prefixStyleRules = (prefix, extraStyles) => {\n\t\t\t// reformat styles into a suitable form for our regexp operations\n\t\t\tconst formattedStyles = formatStyles(extraStyles);\n\n\t\t\tconst splitStyles = formattedStyles.split('}');\n\t\t\tconst prefixedStylesArray = [];\n\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\tsplitStyles.map((split) => {\n\t\t\t\tconst regExp = new RegExp(/(.+?)\\{/g);\n\t\t\t\tconst matches = regExp.exec(split);\n\n\t\t\t\tif (matches) {\n\t\t\t\t\tprefixedStylesArray.push(split.replace(matches[1], `${prefix} ${matches[1]}`));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn `${prefixedStylesArray.join('}')}}`;\n\t\t};\n\n\t\t/**\n\t\t * Apply general styles to document.\n\t\t *\n\t\t * @param {string} generalStyles general style rules\n\t\t * @param {Node} baseElement element to use as base\n\t\t */\n\t\tconst applyGeneralStyles = (generalStyles, baseElement = null) => {\n\t\t\tconst generalStylesheet = document.createElement('style');\n\t\t\tgeneralStylesheet.type = 'text/css';\n\t\t\tgeneralStylesheet.id = 'wptb-general-styles';\n\n\t\t\tif (!baseElement) {\n\t\t\t\tconst head =\n\t\t\t\t\tthis.currentMode === this.modes.block ? this.baseDocument : this.baseDocument.querySelector('head');\n\n\t\t\t\thead.appendChild(generalStylesheet);\n\t\t\t} else {\n\t\t\t\tbaseElement.insertAdjacentElement('beforebegin', generalStylesheet);\n\t\t\t}\n\t\t\tconst prefixedStyleRules = prefixStyleRules(generalStyles.parentPrefix, generalStyles.styles);\n\t\t\tgeneralStylesheet.appendChild(document.createTextNode(prefixedStyleRules));\n\t\t};\n\n\t\t/**\n\t\t * Apply defined extra styles for given table element.\n\t\t *\n\t\t * @param {Element} tableElement table element\n\t\t */\n\t\tconst applyExtraStyle = (tableElement) => {\n\t\t\tconst extraStylesRaw = tableElement.dataset.wptbExtraStyles;\n\t\t\tconst styleIdPrefix = 'wptb-extra-styles-';\n\n\t\t\tif (extraStylesRaw) {\n\t\t\t\tconst extraStyles = atob(extraStylesRaw);\n\n\t\t\t\tconst [, tableId] = tableElement\n\t\t\t\t\t.getAttribute('class')\n\t\t\t\t\t.match(/wptb-element-main-table_setting-(?:startedid-)?(\\d+)/);\n\n\t\t\t\tconst styleId = styleIdPrefix + tableId;\n\n\t\t\t\tconst head = this.baseDocument.querySelector('head');\n\n\t\t\t\t// since stylesheets are created for frontend only once at startup, checking document head for any created style object will work even with theme disabled tables which at builder, they are not inside a shadow-root\n\t\t\t\tlet styleElement = head?.querySelector(`#${styleId}`);\n\n\t\t\t\t// if no style element is found, create one\n\t\t\t\tif (!styleElement) {\n\t\t\t\t\tstyleElement = document.createElement('style');\n\t\t\t\t\tstyleElement.type = 'text/css';\n\t\t\t\t\tstyleElement.id = styleId;\n\n\t\t\t\t\tconst isThemeStylesDisabled = tableElement.dataset.disableThemeStyles;\n\n\t\t\t\t\t// if theme styles are disabled, it means our table is residing inside a shadow-root, place style element inside shadow-root instead of document head\n\t\t\t\t\tif (\n\t\t\t\t\t\t(isThemeStylesDisabled && this.currentMode === this.modes.frontEnd) ||\n\t\t\t\t\t\tthis.currentMode === this.modes.block\n\t\t\t\t\t) {\n\t\t\t\t\t\ttableElement.insertAdjacentElement('beforebegin', styleElement);\n\t\t\t\t\t\tif (this.currentMode === this.modes.frontEnd && this.generalStyles) {\n\t\t\t\t\t\t\tapplyGeneralStyles(this.generalStyles, tableElement);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\thead.appendChild(styleElement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst uniqueClass = `.wptb-element-main-table_setting-${tableId}`;\n\t\t\t\t// reform style rules so they will only affect the table they are assigned to\n\t\t\t\tconst prefixedStyles = prefixStyleRules(uniqueClass, extraStyles);\n\n\t\t\t\t// remove previous styles with updated ones\n\t\t\t\tstyleElement.innerHTML = '';\n\t\t\t\tstyleElement.appendChild(document.createTextNode(prefixedStyles));\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Apply extra styles to all available tables on DOM.\n\t\t *\n\t\t * @param {string} mode operation mode to apply styles\n\t\t * @param {string} generalStyles general style rules\n\t\t * @param {Object} baseDocument base document for DOM operations\n\t\t */\n\t\tthis.applyStyles = (mode = this.modes.frontEnd, generalStyles = null, baseDocument = document) => {\n\t\t\tthis.baseDocument = baseDocument;\n\t\t\tthis.currentMode = mode;\n\t\t\tthis.generalStyles = generalStyles;\n\n\t\t\tconst allTables = Array.from(this.baseDocument.querySelectorAll(tableQueries[mode]));\n\n\t\t\tif (allTables) {\n\t\t\t\tallTables.map(applyExtraStyle);\n\t\t\t}\n\n\t\t\t// only apply general styles on client frontend if any general styles are defined\n\t\t\tif ((mode === this.modes.frontEnd || mode === this.modes.block) && generalStyles) {\n\t\t\t\tapplyGeneralStyles(generalStyles);\n\t\t\t}\n\t\t};\n\t}\n\n\t// send a singleton instance of manager\n\treturn new WPTB_ExtraStyles();\n});\n","(function UMD(key, context, factory) {\n\tif (typeof module !== 'undefined' && typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tcontext[key] = factory();\n\t}\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_Logger', self || global, () => {\n\tconst format = '%c WP Table Builder %c {message} ';\n\tconst brandStyle =\n\t\t'border-radius:5px 0 0 5px; background-color: #3299D1; padding: 3px; color: #FFF; font-weight: bold;';\n\tconst messageStyle = 'background-color: {bgColor} ; padding: 3px; color: #FFF; border-radius: 0 5px 5px 0;';\n\n\t/**\n\t * Background colors for message.\n\t *\n\t * Add color property keys keeping in mind that internal function to use that colors will select them based on type of message, ie 'normal' color property for normal messages and 'error' color property for error message types.\n\t *\n\t * @type {Object}\n\t */\n\tconst bgColors = {\n\t\tnormal: '#48BB78',\n\t};\n\n\treturn {\n\t\t/**\n\t\t * Prepare format for incoming message.\n\t\t *\n\t\t * @param {string} message message to be used\n\t\t * @return {string} prepared message\n\t\t */\n\t\tprepareMessage(message) {\n\t\t\treturn format.replace('{message}', message);\n\t\t},\n\t\t/**\n\t\t * Prepare style of message.\n\t\t *\n\t\t * @param {string} messageType message type\n\t\t * @return {string} prepared style\n\t\t */\n\t\tprepareMessageStyle(messageType = 'normal') {\n\t\t\tlet keyName = 'normal';\n\n\t\t\tif (bgColors[messageType]) {\n\t\t\t\tkeyName = messageType;\n\t\t\t}\n\n\t\t\treturn messageStyle.replace('{bgColor}', bgColors[keyName]);\n\t\t},\n\t\t/**\n\t\t * Normal log function.\n\t\t *\n\t\t * @param {string} message message string\n\t\t */\n\t\tlog(message) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.log(this.prepareMessage(message), brandStyle, this.prepareMessageStyle('normal'));\n\t\t},\n\t};\n});\n","let WPTB_CutGlueTable = {\n cutTableHorizontally: function (rowBefore, table) {\n if( table && table.rows[rowBefore] ) {\n for( let i = 0; i < rowBefore; i++ ) {\n let tableRowsIChildren = table.rows[i].children;\n\n for( let j = 0; j < tableRowsIChildren.length; j++ ) {\n if ( tableRowsIChildren[j].rowSpan > 1 && tableRowsIChildren[j].rowSpan > rowBefore - i ) {\n let newTdRowspan = tableRowsIChildren[j].rowSpan - rowBefore + i;\n tableRowsIChildren[j].rowSpan = rowBefore - i;\n if( ! tableRowsIChildren[j].dataset.sameCellBeforeDivision ) {\n tableRowsIChildren[j].dataset.sameCellBeforeDivision = 'r' + i + 'c' + j;\n }\n\n let td;\n if(table.hasOwnProperty('wptbCell')) {\n td = new table.wptbCell( table.mark );\n td = td.getDOMElement();\n } else {\n td = document.createElement('td');\n }\n\n let tdTopStyle = tableRowsIChildren[j].getAttribute( 'style' );\n td.setAttribute( 'style', tdTopStyle );\n td.colSpan = tableRowsIChildren[j].colSpan;\n td.rowSpan = newTdRowspan;\n td.dataset.sameCellBeforeDivision = tableRowsIChildren[j].dataset.sameCellBeforeDivision;\n\n let dataXIndex = tableRowsIChildren[j].dataset.xIndex;\n let dataXIndexNext = parseInt( dataXIndex ) + parseInt( tableRowsIChildren[j].colSpan );\n let beforeTd;\n while( ! beforeTd && dataXIndexNext < table.maxCols ) {\n beforeTd = table.rows[rowBefore].querySelector( '[data-x-index=\"' + dataXIndexNext + '\"]' );\n dataXIndexNext++;\n }\n table.rows[rowBefore].insertBefore( td, beforeTd );\n\n WPTB_RecalculateIndexes(table);\n }\n }\n }\n }\n },\n glueTableHorizontally: function (table) {\n if(table) {\n let tds = [...table.getElementsByTagName( 'td' )];\n for( let i = 0; i < tds.length; i++ ) {\n if( tds[i].hasAttribute( 'data-same-cell-before-division' ) ) {\n let dataSameCellBeforeDivision = tds[i].dataset.sameCellBeforeDivision;\n let tdsSameBeforeDivision = table.querySelectorAll( '[data-same-cell-before-division=\"' + dataSameCellBeforeDivision + '\"]' );\n for( let j = 0; j < tdsSameBeforeDivision.length; j++ ) {\n if( tdsSameBeforeDivision[j] && tdsSameBeforeDivision[j + 1] ) {\n if( tdsSameBeforeDivision[j].parentNode && tdsSameBeforeDivision[j + 1].parentNode &&\n ! tdsSameBeforeDivision[j].parentNode.classList.contains( 'wptb-row-moving' ) &&\n ! tdsSameBeforeDivision[j + 1].parentNode.classList.contains( 'wptb-row-moving' ) ) {\n if( ( tdsSameBeforeDivision[j + 1].dataset.yIndex == parseInt( tdsSameBeforeDivision[j].dataset.yIndex ) +\n parseInt( tdsSameBeforeDivision[j].rowSpan ) ) ) {\n tdsSameBeforeDivision[j].rowSpan += tdsSameBeforeDivision[j + 1].rowSpan;\n\n let tdsSameBeforeDivisionJPlusChildren = [...tdsSameBeforeDivision[j + 1].children];\n\n for( let k = 0; k < tdsSameBeforeDivisionJPlusChildren.length; k++ ) {\n tdsSameBeforeDivision[j].appendChild( tdsSameBeforeDivisionJPlusChildren[k] );\n }\n\n let nextRow = tdsSameBeforeDivision[j + 1].parentNode;\n nextRow.removeChild( tdsSameBeforeDivision[j + 1] );\n }\n }\n }\n }\n }\n }\n\n WPTB_RecalculateIndexes(table);\n }\n },\n cutTableVertically: function (col, table) {\n for ( let i = 0; i < table.rows.length; i++ ) {\n if( col < table.maxCols ) {\n if( col != 0 && ( ! table.rows[i].querySelector( '[data-x-index=\"' + col + '\"]' ) ) ) {\n let rowChildren = table.rows[i].children;\n\n let td,\n rowChildrenLength = rowChildren.length,\n afterTd,\n rowSpanNewTd,\n colSpanOld,\n colSpanNewTd;\n for( let j = 0; j < rowChildrenLength; j++ ) {\n if( rowChildren[j].colSpan > 1 && parseInt( rowChildren[j].dataset.xIndex ) < col &&\n parseInt( rowChildren[j].dataset.xIndex ) + parseInt( rowChildren[j].colSpan ) > col ) {\n if(table.hasOwnProperty('wptbCell')) {\n td = new table.wptbCell( table.mark );\n td = td.getDOMElement();\n } else {\n td = document.createElement('td');\n }\n\n rowSpanNewTd = rowChildren[j].rowSpan;\n colSpanOld = rowChildren[j].colSpan;\n rowChildren[j].colSpan = col - rowChildren[j].dataset.xIndex;\n colSpanNewTd = colSpanOld - rowChildren[j].colSpan;\n\n if( ! rowChildren[j].dataset.sameCellBeforeDivision ) {\n rowChildren[j].dataset.sameCellBeforeDivision = 'r' + i + 'c' + j;\n }\n\n let tdLeftStyle = rowChildren[j].getAttribute( 'style' );\n td.setAttribute( 'style', tdLeftStyle );\n\n let tdAnalogThisX = table.querySelector( '[data-x-index=\"' + col + '\"]' );\n if( tdAnalogThisX ) {\n td.style.width = tdAnalogThisX.style.width;\n }\n\n let tdAnalogThisY = table.querySelector( '[data-y-index=\"' + i + '\"]' );\n if( tdAnalogThisY ) {\n td.style.height = tdAnalogThisY.style.height;\n }\n if( rowChildren[j + 1] ) {\n afterTd = rowChildren[j + 1];\n } else {\n afterTd = null;\n }\n\n table.rows[i].insertBefore( td, afterTd );\n td.colSpan = colSpanNewTd;\n td.rowSpan = rowSpanNewTd;\n td.dataset.sameCellBeforeDivision = rowChildren[j].dataset.sameCellBeforeDivision;\n i += rowSpanNewTd - 1;\n break\n }\n }\n }\n }\n WPTB_RecalculateIndexes(table);\n }\n },\n glueTableVertically: function (table) {\n if( table ) {\n let tds = [...table.getElementsByTagName( 'td' )];\n for( let i = 0; i < tds.length; i++ ) {\n if( tds[i].hasAttribute( 'data-same-cell-before-division' ) ) {\n let dataSameCellBeforeDivision = tds[i].dataset.sameCellBeforeDivision;\n let tdsSameBeforeDivision = [...table.querySelectorAll( '[data-same-cell-before-division=\"' + dataSameCellBeforeDivision + '\"]' )];\n\n let jFirstTdGlue = null;\n for( let j = 0; j < tdsSameBeforeDivision.length; j++ ) {\n if( tdsSameBeforeDivision[j] && tdsSameBeforeDivision[j + 1] &&\n ! tdsSameBeforeDivision[j].classList.contains( 'wptb-column-moving' ) &&\n ! tdsSameBeforeDivision[j + 1].classList.contains( 'wptb-column-moving' ) ) {\n if( ( tdsSameBeforeDivision[j + 1].dataset.xIndex == parseInt( tdsSameBeforeDivision[j].dataset.xIndex ) +\n parseInt( tdsSameBeforeDivision[j].colSpan ) ) ) {\n if( jFirstTdGlue == null ) {\n jFirstTdGlue = j;\n }\n tdsSameBeforeDivision[jFirstTdGlue].colSpan += tdsSameBeforeDivision[j + 1].colSpan;\n\n let tdsSameBeforeDivisionJPlusChildren = [...tdsSameBeforeDivision[j + 1].children];\n\n for( let k = 0; k < tdsSameBeforeDivisionJPlusChildren.length; k++ ) {\n tdsSameBeforeDivision[jFirstTdGlue].appendChild( tdsSameBeforeDivisionJPlusChildren[k] );\n }\n\n let thisRow = tdsSameBeforeDivision[j + 1].parentNode;\n thisRow.removeChild( tdsSameBeforeDivision[j + 1] );\n }\n }\n }\n }\n }\n\n WPTB_RecalculateIndexes(table);\n }\n }\n}\n","/**\n *\n * @param {HTMLElement} table\n * @param {string} typeFirst\n * @param {strinig} typeSecond\n * @param {func} workFunction\n * @param {object} responsiveFront\n */\nvar WPTB_GetDirectionAfterReconstruction = function (table, typeFirst, typeSecond,verticalProp, responsiveFront) {\n\n let itemsPerHeader = 0;\n let tableMaxCols = table.maxCols;\n const switchMode = {};\n let type = [];\n if (responsiveFront && responsiveFront.getDirective(table)) {\n switchMode.switch = function (e) {\n const directives = responsiveFront.getDirective(table)\n\n let sizeRangeId = 'desktop';\n if (e && e.detail) {\n sizeRangeId = e.detail.sizeRangeId;\n }\n type = [typeFirst, 1];\n if (sizeRangeId !== 'desktop') {\n if (directives.hasOwnProperty('modeOptions')) {\n const mode = directives.responsiveMode;\n const modeOptions = directives.modeOptions[mode];\n\n if (\n modeOptions.hasOwnProperty('topRowAsHeader') &&\n modeOptions.topRowAsHeader.hasOwnProperty(sizeRangeId) &&\n modeOptions.topRowAsHeader[sizeRangeId]\n ) {\n if (\n modeOptions.hasOwnProperty('cellStackDirection') &&\n modeOptions.cellStackDirection.hasOwnProperty(sizeRangeId)\n ) {\n if (modeOptions.cellStackDirection[sizeRangeId] === 'row') {\n type = [typeSecond, 2];\n itemsPerHeader = tableMaxCols - 1;\n } else if (modeOptions.cellStackDirection[sizeRangeId] === 'column') {\n if (modeOptions.hasOwnProperty('cellsPerRow')) {\n itemsPerHeader = modeOptions.cellsPerRow[sizeRangeId];\n }\n }\n }\n } else {\n itemsPerHeader = 0;\n }\n }\n } else {\n itemsPerHeader = 0;\n }\n return {type, itemsPerHeader}\n };\n } else {\n switchMode.switch = function (e) {\n type = [typeFirst, 1];\n if (table.classList.contains('wptb-mobile-view-active')) {\n if (table.classList.contains('wptb-table-preview-head')) {\n type = [typeSecond, 2];\n if(type === verticalProp) {\n itemsPerHeader = tableMaxCols - 1;\n }\n }\n let newTable = table.parentNode.parentNode.querySelector('.wptb-preview-table-mobile');\n return {type, itemsPerHeader, newTable};\n }\n\n return {type, itemsPerHeader}\n };\n }\n\n return switchMode;\n}\n","/**\n * Responsive class assignment for frontend operations.\n *\n * This file can be used as an UMD.\n */\n(function assignToGlobal(key, context, factory) {\n\tif (typeof exports === 'object' && typeof module !== 'undefined') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tcontext[key] = factory();\n\t}\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_SortableTable', self || global, () => {\n\tfunction WPTB_SortTable(options = {}) {\n\t\tconst table = (this.table = options.table);\n\t\tWPTB_RecalculateIndexes(table);\n\t\tconst thisObject = this;\n\t\tthis.itemsPerHeader = 0;\n\t\tthis.tableMaxCols = table.maxCols;\n\t\tthis.cellsStylesScheme = {};\n\t\tthis.rowsStylesScheme = {};\n\n\t\t/**\n\t\t * sets the table to sort mode\n\t\t *\n\t\t * @param {string} type\n\t\t * @param {boolean} active\n\t\t * @param {number} number\n\t\t */\n\t\tthis.sortModeSwitcher = function (type, active) {\n\t\t\tif(active) {\n\t\t\t\tthis.sortModeSwitcher('horizontal', false);\n\t\t\t\tthis.sortModeSwitcher('vertical', false);\n\t\t\t}\n\n\t\t\tif (type === 'vertical') {\n\t\t\t\tthis.table.removeEventListener('click', this.sortableTableVerticalStart, false);\n\n\t\t\t\tif (active) {\n\t\t\t\t\tthis.sortingCellMouseMoveSwitcher('vertical', true);\n\t\t\t\t\tthis.table.addEventListener('click', this.sortableTableVerticalStart, false);\n\t\t\t\t\tthis.table.dataset.wptbSortableTableVertical = '1';\n\t\t\t\t\tthis.createTableElementsStylesScheme('td');\n\t\t\t\t\tthis.createTableElementsStylesScheme('tr');\n\t\t\t\t} else {\n\t\t\t\t\tthis.sortingCellMouseMoveSwitcher('vertical', false);\n\t\t\t\t\tdelete this.table.dataset.wptbSortableTableVertical;\n\t\t\t\t}\n\t\t\t} else if (type === 'horizontal') {\n\t\t\t\tthis.table.removeEventListener('click', this.sortableTableHorizontalStart, false);\n\n\t\t\t\tif (active) {\n\t\t\t\t\tthis.sortingCellMouseMoveSwitcher('horizontal', true);\n\t\t\t\t\tthis.table.addEventListener('click', this.sortableTableHorizontalStart, false);\n\t\t\t\t\tthis.table.dataset.wptbSortableTableHorizontal = '1';\n\t\t\t\t\tthis.createTableElementsStylesScheme('td');\n\t\t\t\t\tthis.createTableElementsStylesScheme('tr');\n\t\t\t\t} else {\n\t\t\t\t\tthis.sortingCellMouseMoveSwitcher('horizontal', false);\n\t\t\t\t\tdelete this.table.dataset.wptbSortableTableHorizontal;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * changes table object for old reconstruction table type\n\t\t *\n\t\t * @param {boolean}start\n\t\t * @returns {*}\n\t\t */\n\t\tthis.tableObjectChange = function (start = true) {\n\t\t\tif(this.table.classList.contains('wptb-mobile-view-active') && start) {\n\t\t\t\tthis.table = table.parentNode.parentNode.querySelector('.wptb-preview-table-mobile');\n\t\t\t} else if(this.table.classList.contains('wptb-preview-table-mobile') && !start) {\n\t\t\t\tthis.table = table.parentNode.querySelector('.wptb-preview-table');\n\t\t\t}\n\t\t\treturn this.table;\n\t\t}\n\n\t\t/**\n\t\t * fills the object with data about cell styles for all locations (create scheme)\n\t\t *\n\t\t * @param elemSelector\n\t\t */\n\t\tthis.createTableElementsStylesScheme = function (elemSelector) {\n\t\t\tthis.tableObjectChange();\n\t\t\tlet elements = this.table.querySelectorAll(elemSelector);\n\t\t\tif(elements.length) {\n\t\t\t\tfor(let i = 0; i < elements.length; i++) {\n\t\t\t\t\tlet elem = elements[i];\n\t\t\t\t\tlet cellFullStyleObj = window.getComputedStyle(elem, null);\n\t\t\t\t\tlet backgroundColor = cellFullStyleObj.getPropertyValue( 'background-color' );\n\t\t\t\t\tlet objectKey = '';\n\t\t\t\t\tif(elemSelector === 'td') {\n\t\t\t\t\t\tobjectKey = elem.dataset.xIndex + '-' + elem.dataset.yIndex;\n\t\t\t\t\t\tthis.cellsStylesScheme[objectKey] = {backgroundColor};\n\t\t\t\t\t} else if(elemSelector === 'tr') {\n\t\t\t\t\t\tobjectKey = String(i);\n\t\t\t\t\t\tthis.rowsStylesScheme[objectKey] = {backgroundColor};\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.tableObjectChange(false);\n\t\t}\n\n\t\t/**\n\t\t * applies saved cell styles data to all cells\n\t\t *\n\t\t * @param elemSelector\n\t\t */\n\t\tthis.reassignElementsStyles = function (elemSelector) {\n\t\t\tthis.tableObjectChange();\n\t\t\tlet elements = this.table.querySelectorAll(elemSelector);\n\t\t\tlet elementsStylesScheme;\n\t\t\tif(elemSelector === 'td') {\n\t\t\t\telementsStylesScheme = this.cellsStylesScheme;\n\t\t\t} else if(elemSelector === 'tr') {\n\t\t\t\telementsStylesScheme = this.rowsStylesScheme;\n\t\t\t}\n\t\t\tif(elements.length) {\n\t\t\t\tfor(let i = 0; i < elements.length; i++) {\n\t\t\t\t\tlet elem = elements[i];\n\t\t\t\t\tlet objectKey = '';\n\t\t\t\t\tif(elemSelector === 'td') {\n\t\t\t\t\t\tobjectKey = elem.dataset.xIndex + '-' + elem.dataset.yIndex;\n\t\t\t\t\t} else if(elemSelector === 'tr') {\n\t\t\t\t\t\tobjectKey = i;\n\t\t\t\t\t}\n\t\t\t\t\tif(elementsStylesScheme.hasOwnProperty(objectKey)) {\n\t\t\t\t\t\tlet elemStyles = elementsStylesScheme[objectKey];\n\t\t\t\t\t\tfor(let key in elemStyles) {\n\t\t\t\t\t\t\telem.style[key] = elemStyles[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.tableObjectChange(false);\n\t\t}\n\n\t\t/**\n\t\t * checks whether the table should be in the sort state\n\t\t * and connects the necessary handlers\n\t\t *\n\t\t * @param {object} responsiveFront\n\t\t */\n\t\tthis.sortableTableInitialization = function (responsiveFront) {\n\t\t\tlet typeFirst;\n\t\t\tlet typeSecond;\n\t\t\tif (this.table.dataset.wptbSortableTableVertical && this.table.dataset.wptbSortableTableVertical === '1') {\n\t\t\t\ttypeFirst = 'vertical';\n\t\t\t\ttypeSecond = 'horizontal';\n\t\t\t} else if (\n\t\t\t\tthis.table.dataset.wptbSortableTableHorizontal &&\n\t\t\t\tthis.table.dataset.wptbSortableTableHorizontal === '1'\n\t\t\t) {\n\t\t\t\ttypeFirst = 'horizontal';\n\t\t\t\ttypeSecond = 'vertical';\n\t\t\t}\n\n\t\t\tif(!typeFirst || typeof typeFirst !== 'string' || !typeSecond || typeof typeSecond !== 'string') return;\n\n\t\t\tlet switchMode = WPTB_GetDirectionAfterReconstruction(this.table, typeFirst, typeSecond, 'vertical', responsiveFront);\n\n\t\t\tif(typeof switchMode === 'object' && switchMode.hasOwnProperty('switch')) {\n\t\t\t\tfunction sortModeSwitcherRun (e) {\n\t\t\t\t\tlet switchModeObj = switchMode.switch(e);\n\t\t\t\t\tif(typeof switchModeObj === 'object') {\n\t\t\t\t\t\tthis.itemsPerHeader = switchModeObj.itemsPerHeader;\n\t\t\t\t\t\tif(switchModeObj.hasOwnProperty('newTable')) {\n\t\t\t\t\t\t\tlet tableOld = this.table;\n\t\t\t\t\t\t\tthis.table = switchModeObj.newTable;\n\t\t\t\t\t\t\tthis.sortModeSwitcher(switchModeObj.type[0], true);\n\t\t\t\t\t\t\tthis.table = tableOld;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.sortModeSwitcher(switchModeObj.type[0], true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsortModeSwitcherRun.call(thisObject);\n\t\t\t\tthis.table.addEventListener(\n\t\t\t\t\t'table:rebuilt',\n\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\tsortModeSwitcherRun.call(thisObject, e);\n\t\t\t\t\t},\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * adds and deletes mousemove and mouseleave events handlers when happens switch sorting mode\n\t\t * and also can add necessary attributes\n\t\t *\n\t\t * @param {string} type\n\t\t * @param {boolean} active\n\t\t */\n\t\tthis.sortingCellMouseMoveSwitcher = function (type, active) {\n\t\t\t/**\n\t\t\t * removes and adds mousemove and mouseleave events handlers\n\t\t\t *\n\t\t\t * @param {HTMLElement} td\n\t\t\t * @param {func} sCMM\n\t\t\t * @param {boolean} active\n\t\t\t */\n\t\t\tfunction s(td, sCMM, active) {\n\t\t\t\ttd.removeEventListener('mousemove', sCMM, false);\n\t\t\t\ttd.removeEventListener('mouseleave', tdMouseLeave, false);\n\t\t\t\tif (active) {\n\t\t\t\t\ttd.addEventListener('mousemove', sCMM, false);\n\t\t\t\t\ttd.addEventListener('mouseleave', tdMouseLeave, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * removes and adds data sorted attributes\n\t\t\t *\n\t\t\t * @param {HTMLElement} td\n\t\t\t * @param {string} dataAttr\n\t\t\t * @param {boolean} active\n\t\t\t */\n\t\t\tfunction dataAttrSortChange(td, dataAttr, active) {\n\t\t\t\tif (active) {\n\t\t\t\t\tif (!td.dataset[dataAttr] || td.dataset[dataAttr] !== 'desk-disabled') {\n\t\t\t\t\t\ttd.dataset[dataAttr] = 'ask';\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttd.dataset[dataAttr] = 'desk';\n\t\t\t\t\t}\n\t\t\t\t} else if (td.dataset[dataAttr] === 'ask') {\n\t\t\t\t\ttd.dataset[dataAttr] = 'ask-disabled';\n\t\t\t\t} else if (td.dataset[dataAttr] === 'desk') {\n\t\t\t\t\ttd.dataset[dataAttr] = 'desk-disabled';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// removes all mousemove and mouseleave events handlers\n\t\t\t// and also removes all data sorted attributes from all cells\n\t\t\tlet tds = this.table.querySelectorAll('td');\n\t\t\tif (tds.length) {\n\t\t\t\ttds = [...tds];\n\t\t\t\ttds.map((td) => {\n\t\t\t\t\ts(td, sortingCellMouseMoveVertical, false);\n\t\t\t\t\tdataAttrSortChange(td, 'sortedVertical', false);\n\t\t\t\t\ts(td, sortingCellMouseMoveHorizontal, false);\n\t\t\t\t\tdataAttrSortChange(td, 'sortedHorizontal', false);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// if active === true sets sorted events handlers\n\t\t\t// and data sorted attributes for all cells\n\t\t\tif (active) {\n\t\t\t\tif (type === 'vertical') {\n\t\t\t\t\tlet rowsLength = this.table.rows.length;\n\t\t\t\t\tlet dataYIndexStart = 0;\n\t\t\t\t\twhile (rowsLength > 0) {\n\t\t\t\t\t\tlet tds = this.table.querySelectorAll(`[data-y-index=\"${dataYIndexStart}\"]`);\n\t\t\t\t\t\ttds = [...tds];\n\t\t\t\t\t\ttds.map((td) => {\n\t\t\t\t\t\t\ts(td, sortingCellMouseMoveVertical, active);\n\t\t\t\t\t\t\tdataAttrSortChange(td, 'sortedVertical', active);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif (this.itemsPerHeader) {\n\t\t\t\t\t\t\trowsLength -= this.itemsPerHeader + 1;\n\t\t\t\t\t\t\tdataYIndexStart += this.itemsPerHeader + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trowsLength = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (type === 'horizontal') {\n\t\t\t\t\tlet tds = this.table.querySelectorAll('[data-x-index=\"0\"]');\n\t\t\t\t\ttds = [...tds];\n\t\t\t\t\ttds.map((td) => {\n\t\t\t\t\t\tlet tdsPerAfter = this.table.querySelectorAll(`[data-y-index=\"${td.dataset.yIndex}\"]`);\n\t\t\t\t\t\tif(tdsPerAfter.length > 2) {\n\t\t\t\t\t\t\ts(td, sortingCellMouseMoveHorizontal, active);\n\t\t\t\t\t\t\tdataAttrSortChange(td, 'sortedHorizontal', active);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * adds a sortable-hover class for a cell when the cursor is over the sort icon (arrow)\n\t\t *\n\t\t * @param {event} e\n\t\t * @param {string} type\n\t\t * @param {HTMLElement} element td\n\t\t */\n\t\tfunction sortingCellMouseMov(e, type, element) {\n\t\t\tif (e.target.tagName === 'TD') {\n\t\t\t\tconst x = e.offsetX == undefined ? e.layerX : e.offsetX;\n\t\t\t\tconst y = e.offsetY == undefined ? e.layerY : e.offsetY;\n\t\t\t\tlet xMatch = false;\n\t\t\t\tif ((type === 'vertical' && e.target.clientWidth - x <= 35) || (type === 'horizontal' && x <= 35)) {\n\t\t\t\t\txMatch = true;\n\t\t\t\t}\n\t\t\t\tif (xMatch && (e.target.clientHeight - 35) / 2 < y && (e.target.clientHeight + 35) / 2 > y) {\n\t\t\t\t\telement.classList.add('sortable-hover');\n\t\t\t\t} else {\n\t\t\t\t\telement.classList.remove('sortable-hover');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\telement.classList.remove('sortable-hover');\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * calls sortingCellMouseMov with the type parameter set to vertical\n\t\t *\n\t\t * @param {event} e\n\t\t */\n\t\tfunction sortingCellMouseMoveVertical(e) {\n\t\t\tsortingCellMouseMov(e, 'vertical', this);\n\t\t}\n\n\t\t/**\n\t\t * calls sortingCellMouseMov with the type parameter set to horizontal\n\t\t *\n\t\t * @param {event} e\n\t\t */\n\t\tfunction sortingCellMouseMoveHorizontal(e) {\n\t\t\tsortingCellMouseMov(e, 'horizontal', this);\n\t\t}\n\n\t\t/**\n\t\t * remove sortable-hover class from cell when cursor leave cell\n\t\t */\n\t\tfunction tdMouseLeave() {\n\t\t\tthis.classList.remove('sortable-hover');\n\t\t}\n\n\t\t/**\n\t\t * function for sorting the table vertically by the numeric content of cells\n\t\t *\n\t\t * @param {event} e\n\t\t * @param {HTMLElement} table\n\t\t * @param {string} type\n\t\t */\n\t\tfunction sortableTable(e, type) {\n\t\t\tif (\n\t\t\t\te.target &&\n\t\t\t\te.target.tagName === 'TD' &&\n\t\t\t\t!table.parentNode.classList.contains('wptb-preview-table-manage-cells')\n\t\t\t) {\n\t\t\t\tconst table = e.currentTarget;\n\t\t\t\tlet tableWasSorted = false;\n\t\t\t\tif (type === 'vertical' && e.target.dataset.hasOwnProperty('sortedVertical')) {\n\t\t\t\t\t/**\n\t\t\t\t\t * if table have enabled param topRowAsHeader and sellsStackDirection is column\n\t\t\t\t\t * the top and bottom rows that will not be sorted are temporarily removed from the table\n\t\t\t\t\t */\n\t\t\t\t\tconst tableRowsBefore = [];\n\t\t\t\t\tconst tableRowsAfter = [];\n\t\t\t\t\tif (this.itemsPerHeader && this.itemsPerHeader < table.rows.length) {\n\t\t\t\t\t\tWPTB_RecalculateIndexes(table);\n\t\t\t\t\t\tconst tableRowsArr = [...table.rows];\n\t\t\t\t\t\tconst tableLastCont = table.querySelector('tbody') ? table.querySelector('tbody') : table;\n\t\t\t\t\t\tfor (let i = 0; i < tableRowsArr.length; i++) {\n\t\t\t\t\t\t\tif (i < e.target.dataset.yIndex) {\n\t\t\t\t\t\t\t\ttableRowsBefore.push(tableRowsArr[i]);\n\t\t\t\t\t\t\t\ttableLastCont.removeChild(tableRowsArr[i]);\n\t\t\t\t\t\t\t} else if (i > parseInt(e.target.dataset.yIndex, 10) + this.itemsPerHeader) {\n\t\t\t\t\t\t\t\ttableRowsAfter.push(tableRowsArr[i]);\n\t\t\t\t\t\t\t\ttableLastCont.removeChild(tableRowsArr[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWPTB_RecalculateIndexes(table);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet tds = table.querySelectorAll(`[data-x-index=\"${e.target.dataset.xIndex}\"]`);\n\t\t\t\t\ttds = [...tds];\n\n\t\t\t\t\t/**\n\t\t\t\t\t * preparing table for sorting\n\t\t\t\t\t */\n\t\t\t\t\tlet rowspan;\n\t\t\t\t\tlet rowNum;\n\t\t\t\t\ttds.map((td) => {\n\t\t\t\t\t\tif (!(rowspan = parseInt(td.rowSpan, 10))) {\n\t\t\t\t\t\t\trowspan = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trowNum = td.dataset.yIndex;\n\t\t\t\t\t\tWPTB_CutGlueTable.cutTableHorizontally(rowNum, table);\n\t\t\t\t\t\trowNum += rowspan;\n\t\t\t\t\t\tWPTB_CutGlueTable.cutTableHorizontally(rowNum, table);\n\t\t\t\t\t});\n\n\t\t\t\t\tconst rowsValuesArr = [];\n\t\t\t\t\tlet rowsTdFirst;\n\t\t\t\t\tlet tdYCoordsRowSpanPrevious = 0;\n\t\t\t\t\tconst tableRowsPushed = [];\n\t\t\t\t\tfor (let i = 0; i < tds.length; i++) {\n\t\t\t\t\t\tconst tdsChanged = changeSortingTdsCollection(\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\ttable,\n\t\t\t\t\t\t\ttds,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\ttdYCoordsRowSpanPrevious,\n\t\t\t\t\t\t\t'vertical'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (tdsChanged && tdsChanged.hasOwnProperty('i')) {\n\t\t\t\t\t\t\ttds = tdsChanged.tds;\n\t\t\t\t\t\t\ti = tdsChanged.i;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (tdsChanged) {\n\t\t\t\t\t\t\ttds = tdsChanged.tds;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst td = tds[i];\n\n\t\t\t\t\t\tlet tdRowspan = parseInt(td.rowSpan, 10);\n\t\t\t\t\t\tif (!tdRowspan) tdRowspan = 1;\n\n\t\t\t\t\t\ttdYCoordsRowSpanPrevious = parseInt(td.dataset.yIndex, 10) + tdRowspan;\n\n\t\t\t\t\t\tconst textElementsValues = textElementsValuesGet(td);\n\n\t\t\t\t\t\tconst rowsTd = [];\n\t\t\t\t\t\tfor (let j = 0; j < tdRowspan; j++) {\n\t\t\t\t\t\t\trowsTd.push(table.rows[parseInt(td.dataset.yIndex, 10) + j]);\n\t\t\t\t\t\t\ttableRowsPushed.push(parseInt(td.dataset.yIndex, 10) + j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (td.dataset.yIndex > 0) {\n\t\t\t\t\t\t\trowsValuesArr.push({\n\t\t\t\t\t\t\t\trowsTd,\n\t\t\t\t\t\t\t\tvalue: textElementsValues,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trowsTdFirst = rowsTd;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst orderBy = setSortedAscDataAttr(e, 'sortedVertical');\n\t\t\t\t\tif (!orderBy) return;\n\n\t\t\t\t\tif (rowsValuesArr.length) rowsValuesArr.sort((prev, next) => sortOrder(orderBy, prev, next));\n\n\t\t\t\t\trowsValuesArr.unshift({ rowsTd: rowsTdFirst });\n\n\t\t\t\t\tif (rowsValuesArr.length < table.rows.length) {\n\t\t\t\t\t\tfor (let i = 0; i < table.rows.length; i++) {\n\t\t\t\t\t\t\tif (tableRowsPushed.indexOf(i) > -1) continue;\n\t\t\t\t\t\t\tconst rowsTd = [];\n\t\t\t\t\t\t\trowsTd.push(table.rows[i]);\n\n\t\t\t\t\t\t\trowsValuesArr.push({\n\t\t\t\t\t\t\t\trowsTd,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst tBody = table.querySelector('tbody');\n\t\t\t\t\ttBody.innerHTML = '';\n\n\t\t\t\t\trowsValuesArr.map((rowsValObj) => {\n\t\t\t\t\t\trowsValObj.rowsTd.map((row) => {\n\t\t\t\t\t\t\ttBody.appendChild(row);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n\t\t\t\t\t * returning previously deleted rows\n\t\t\t\t\t */\n\t\t\t\t\tif (tableRowsBefore.length) {\n\t\t\t\t\t\tconst tableLastCont = table.querySelector('tbody') ? table.querySelector('tbody') : table;\n\t\t\t\t\t\tif (tableLastCont) {\n\t\t\t\t\t\t\tconst trRef = tableLastCont.querySelector('tr');\n\t\t\t\t\t\t\ttableRowsBefore.map((tr) => {\n\t\t\t\t\t\t\t\ttableLastCont.insertBefore(tr, trRef);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (tableRowsAfter.length) {\n\t\t\t\t\t\tconst tableLastCont = table.querySelector('tbody') ? table.querySelector('tbody') : table;\n\t\t\t\t\t\tif (tBody) {\n\t\t\t\t\t\t\ttableRowsAfter.map((tr) => {\n\t\t\t\t\t\t\t\ttableLastCont.appendChild(tr);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tWPTB_RecalculateIndexes(table);\n\n\t\t\t\t\tWPTB_CutGlueTable.glueTableHorizontally(table);\n\n\t\t\t\t\ttableWasSorted = true;\n\t\t\t\t} else if (type === 'horizontal' && e.target.dataset.xIndex === '0') {\n\t\t\t\t\tlet tds = table.querySelectorAll(`[data-y-index=\"${e.target.dataset.yIndex}\"]`);\n\t\t\t\t\ttds = [...tds];\n\n\t\t\t\t\t// preparing table for sorting\n\t\t\t\t\tlet colspan;\n\t\t\t\t\tlet colNum;\n\t\t\t\t\ttds.map((td) => {\n\t\t\t\t\t\tif (!(colspan = parseInt(td.colSpan, 10))) {\n\t\t\t\t\t\t\tcolspan = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolNum = td.dataset.xIndex;\n\t\t\t\t\t\tWPTB_CutGlueTable.cutTableVertically(colNum, table);\n\t\t\t\t\t\tcolNum += colspan;\n\t\t\t\t\t\tWPTB_CutGlueTable.cutTableVertically(colNum, table);\n\t\t\t\t\t});\n\n\t\t\t\t\tconst columnsValuesArr = [];\n\t\t\t\t\tlet columnsTdFirst;\n\n\t\t\t\t\tlet tdXCoordsColSpanPrevious = 0;\n\t\t\t\t\tfor (let i = 0; i < tds.length; i++) {\n\t\t\t\t\t\tconst tdsChanged = changeSortingTdsCollection(\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\ttable,\n\t\t\t\t\t\t\ttds,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\ttdXCoordsColSpanPrevious,\n\t\t\t\t\t\t\t'horizontal'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (tdsChanged && tdsChanged.hasOwnProperty('i')) {\n\t\t\t\t\t\t\ttds = tdsChanged.tds;\n\t\t\t\t\t\t\ti = tdsChanged.i;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (tdsChanged) {\n\t\t\t\t\t\t\ttds = tdsChanged.tds;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst td = tds[i];\n\t\t\t\t\t\tlet tdColspan = parseInt(td.colSpan, 10);\n\t\t\t\t\t\tif (!tdColspan) tdColspan = 1;\n\n\t\t\t\t\t\ttdXCoordsColSpanPrevious = parseInt(td.dataset.xIndex, 10) + tdColspan;\n\n\t\t\t\t\t\tconst textElementsValues = textElementsValuesGet(td);\n\t\t\t\t\t\tconst columnsTd = [];\n\t\t\t\t\t\tfor (let j = 0; j < tdColspan; j++) {\n\t\t\t\t\t\t\tconst tdsColumn = [\n\t\t\t\t\t\t\t\t...table.querySelectorAll(`[data-x-index=\"${parseInt(td.dataset.xIndex, 10) + j}\"]`),\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tcolumnsTd.push(tdsColumn);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (td.dataset.xIndex > 0) {\n\t\t\t\t\t\t\tcolumnsValuesArr.push({\n\t\t\t\t\t\t\t\tcolumnsTd,\n\t\t\t\t\t\t\t\tvalue: textElementsValues,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcolumnsTdFirst = columnsTd;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst orderBy = setSortedAscDataAttr(e, 'sortedHorizontal');\n\t\t\t\t\tif (!orderBy) return;\n\n\t\t\t\t\tif (columnsValuesArr.length) columnsValuesArr.sort((prev, next) => sortOrder(orderBy, prev, next));\n\n\t\t\t\t\tcolumnsValuesArr.unshift({ columnsTd: columnsTdFirst });\n\n\t\t\t\t\tif (columnsValuesArr.length < table.maxCols) {\n\t\t\t\t\t\tconst difference = table.maxCols - columnsValuesArr.length;\n\t\t\t\t\t\tfor (let i = 0; i < difference; i++) {\n\t\t\t\t\t\t\tconst tdsColumn = [\n\t\t\t\t\t\t\t\t...table.querySelectorAll(\n\t\t\t\t\t\t\t\t\t`[data-x-index=\"${parseInt(table.maxCols, 10) - parseInt(difference, 10) + i}\"]`\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tcolumnsValuesArr.push({\n\t\t\t\t\t\t\t\tcolumnsTd: [tdsColumn],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let i = 0; i < table.rows.length; i++) {\n\t\t\t\t\t\ttable.rows[i].innerHTML = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcolumnsValuesArr.map((columnsValObj) => {\n\t\t\t\t\t\tcolumnsValObj.columnsTd.map((tdsColumn) => {\n\t\t\t\t\t\t\ttdsColumn.map((td) => {\n\t\t\t\t\t\t\t\ttable.rows[td.dataset.yIndex].appendChild(td);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tWPTB_RecalculateIndexes(table);\n\n\t\t\t\t\tWPTB_CutGlueTable.glueTableVertically(table);\n\n\t\t\t\t\ttableWasSorted = true;\n\t\t\t\t}\n\n\t\t\t\tif (tableWasSorted) {\n\t\t\t\t\tremoveCellsAttrAfterDivision(table);\n\n\t\t\t\t\tif (table.hasOwnProperty('tableSM')) {\n\t\t\t\t\t\tconst tableSM = table.tableSM();\n\t\t\t\t\t\tnew tableSM().tableStateSet();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.reassignElementsStyles('td');\n\t\t\t\t\tthis.reassignElementsStyles('tr');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Function that sets the data-attribute with the number of the row or column\n\t\t * that the table was sorted by. Returns the number of a row or column\n\t\t *\n\t\t * @param {event} e\n\t\t * @param {string} dataAttr\n\t\t * @returns {null|boolean}\n\t\t */\n\t\tfunction setSortedAscDataAttr(e, dataAttr) {\n\t\t\tif (\n\t\t\t\te.currentTarget &&\n\t\t\t\t(e.currentTarget.classList.contains('wptb-preview-table') ||\n\t\t\t\t\te.currentTarget.classList.contains('wptb-preview-table-mobile'))\n\t\t\t) {\n\t\t\t\tif (!e.target.dataset[dataAttr] || e.target.dataset[dataAttr] === 'ask') {\n\t\t\t\t\te.target.dataset[dataAttr] = 'desk';\n\t\t\t\t} else {\n\t\t\t\t\te.target.dataset[dataAttr] = 'ask';\n\t\t\t\t}\n\n\t\t\t\treturn e.target.dataset[dataAttr];\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * defines the sorting order\n\t\t *\n\t\t * @param {string} orderBy\n\t\t * @param prev\n\t\t * @param next\n\t\t * @returns {number}\n\t\t */\n\t\tfunction sortOrder(orderBy = 'ask', prev, next) {\n\t\t\tlet prevValue = prev.value;\n\t\t\tlet nextValue = next.value;\n\t\t\tif (parseInt(prevValue) && parseInt(nextValue)) {\n\t\t\t\tprevValue = parseInt(prevValue);\n\t\t\t\tnextValue = parseInt(nextValue);\n\t\t\t}\n\n\t\t\tif (orderBy === 'ask') {\n\t\t\t\tif (prevValue < nextValue) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif (prevValue === nextValue) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (prevValue < nextValue) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (prevValue === nextValue) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t * return cell text elements values\n\t\t *\n\t\t * @param cell {HTMLElement}\n\t\t * @returns {string}\n\t\t */\n\t\tfunction textElementsValuesGet(cell) {\n\t\t\tlet textElements = cell.querySelectorAll('.wptb-text-container');\n\t\t\ttextElements = [...textElements];\n\t\t\tlet value = '';\n\t\t\tfor (let j = 0; j < textElements.length; j++) {\n\t\t\t\tvalue += textElements[j].innerText;\n\t\t\t\tif (j !== textElements.length - 1) value += ' ';\n\t\t\t}\n\n\t\t\treturn value;\n\t\t}\n\n\t\t/**\n\t\t * adds cells to the collection of cells in the row or column that the table is sorted by.\n\t\t * These added cells are not originally were added in the collection,\n\t\t * because they are combined with cells from higher rows or left-side columns\n\t\t *\n\t\t * @param {event} e\n\t\t * @param {HTMLElement} table\n\t\t * @param {array} tds\n\t\t * @param {number} i\n\t\t * @param {number} tdIndexSpanPrev\n\t\t * @param {string} type\n\t\t * @returns {{tds: *}|boolean|{tds: *, i: *}}\n\t\t */\n\t\tfunction changeSortingTdsCollection(e, table, tds, i, tdIndexSpanPrev, type) {\n\t\t\tconst td = tds[i];\n\t\t\tlet tdsCollectionChanged = false;\n\t\t\tlet collectionTds;\n\t\t\tlet collectionTdsJSpan;\n\t\t\tlet collectionTdsJSpanProperty;\n\t\t\tlet indexName;\n\t\t\tlet indexNameCamelCase;\n\t\t\tlet indexNamePerpendicularCamelCase;\n\t\t\tlet tdSpanProperty;\n\t\t\t// max rows or columns column\n\t\t\tlet tableGroupCount;\n\n\t\t\tif (type === 'vertical') {\n\t\t\t\tcollectionTdsJSpanProperty = 'colSpan';\n\t\t\t\tindexName = 'data-y-index';\n\t\t\t\tindexNameCamelCase = 'yIndex';\n\t\t\t\tindexNamePerpendicularCamelCase = 'xIndex';\n\t\t\t\ttdSpanProperty = 'rowSpan';\n\t\t\t\ttableGroupCount = table.rows.length;\n\t\t\t} else if (type === 'horizontal') {\n\t\t\t\tcollectionTdsJSpanProperty = 'rowSpan';\n\t\t\t\tindexName = 'data-x-index';\n\t\t\t\tindexNameCamelCase = 'xIndex';\n\t\t\t\tindexNamePerpendicularCamelCase = 'yIndex';\n\t\t\t\ttdSpanProperty = 'colSpan';\n\t\t\t\ttableGroupCount = table.maxCols;\n\t\t\t}\n\n\t\t\tif (td.dataset[indexNameCamelCase] - tdIndexSpanPrev > 0) {\n\t\t\t\tcollectionTds = table.querySelectorAll(`[${indexName}=\"${tdIndexSpanPrev}\"]`);\n\n\t\t\t\tfor (let j = 0; j < collectionTds.length; j++) {\n\t\t\t\t\tcollectionTdsJSpan = collectionTds[j][collectionTdsJSpanProperty];\n\t\t\t\t\tif (!collectionTdsJSpan) collectionTdsJSpan = 1;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tcollectionTds[j].dataset[indexNamePerpendicularCamelCase] <\n\t\t\t\t\t\t\te.target.dataset[indexNamePerpendicularCamelCase] &&\n\t\t\t\t\t\tparseInt(collectionTds[j].dataset[indexNamePerpendicularCamelCase], 10) +\n\t\t\t\t\t\t\tparseInt(collectionTdsJSpan, 10) >\n\t\t\t\t\t\t\te.target.dataset[indexNamePerpendicularCamelCase]\n\t\t\t\t\t) {\n\t\t\t\t\t\ttds.splice(i, 0, collectionTds[j]);\n\t\t\t\t\t\ttdsCollectionChanged = true;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tdsCollectionChanged) return { tds, i };\n\n\t\t\tlet tdSpan = parseInt(td[tdSpanProperty], 10);\n\t\t\tif (!tdSpan) tdSpan = 1;\n\t\t\tif (i == tds.length - 1 && parseInt(td.dataset[indexNameCamelCase], 10) + tdSpan < tableGroupCount) {\n\t\t\t\tcollectionTds = table.querySelectorAll(\n\t\t\t\t\t`[${indexName}=\"${parseInt(td.dataset[indexNameCamelCase], 10) + tdSpan}\"]`\n\t\t\t\t);\n\t\t\t\tfor (let j = 0; j < collectionTds.length; j++) {\n\t\t\t\t\tcollectionTdsJSpan = collectionTds[j][collectionTdsJSpanProperty];\n\t\t\t\t\tif (!collectionTdsJSpan) collectionTdsJSpan = 1;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tcollectionTds[j].dataset[indexNamePerpendicularCamelCase] <\n\t\t\t\t\t\t\te.target.dataset[indexNamePerpendicularCamelCase] &&\n\t\t\t\t\t\tparseInt(collectionTds[j].dataset[indexNamePerpendicularCamelCase], 10) +\n\t\t\t\t\t\t\tparseInt(collectionTdsJSpan, 10) >\n\t\t\t\t\t\t\te.target.dataset[indexNamePerpendicularCamelCase]\n\t\t\t\t\t) {\n\t\t\t\t\t\ttds.push(collectionTds[j]);\n\t\t\t\t\t\ttdsCollectionChanged = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tdsCollectionChanged) return { tds };\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * remove cells attributes which were used for division table\n\t\t *\n\t\t * @param {HTMLElement} table\n\t\t */\n\t\tfunction removeCellsAttrAfterDivision(table) {\n\t\t\tconst tdsAll = [...table.getElementsByTagName('td')];\n\t\t\tfor (let i = 0; i < tdsAll.length; i++) {\n\t\t\t\tif (tdsAll[i].hasAttribute('data-same-cell-before-division')) {\n\t\t\t\t\ttdsAll[i].removeAttribute('data-same-cell-before-division');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * function for run sorting table vertically\n\t\t *\n\t\t * @param {event} e\n\t\t */\n\t\tthis.sortableTableVerticalStart = function (e) {\n\t\t\tsortableTable.call(thisObject, e, 'vertical');\n\t\t};\n\n\t\t/**\n\t\t * function for run sorting table horizontally\n\t\t *\n\t\t * @param {event} e\n\t\t */\n\t\tthis.sortableTableHorizontalStart = function (e) {\n\t\t\tsortableTable.call(thisObject, e, 'horizontal');\n\t\t};\n\n\t\treturn this;\n\t}\n\n\treturn WPTB_SortTable;\n});\n","const WPTB_RecalculateIndexes = function (table) {\n let trs = table.getElementsByTagName( 'tr' ),\n tds, maxCols = 0, maxColsFull = 0, tdsArr = [];\n\n for ( let i = 0; i < trs.length; i++ ) {\n tds = trs[i].getElementsByTagName( 'td' );\n\n if ( tdsArr[i] == undefined ) {\n tdsArr[i] = [];\n }\n\n let jMainIter = 0;\n for ( let j = 0; j < tds.length; j++ ) {\n if ( tdsArr[i][j] != undefined ) {\n for ( let y = 0; y < 100; y++ ) {\n if ( tdsArr[i][jMainIter] != undefined ) {\n jMainIter++;\n continue;\n }\n tdsArr[i][jMainIter] = tds[j];\n tds[j].dataset.xIndex = jMainIter;\n break;\n }\n } else {\n tdsArr[i][j] = tds[j];\n tds[j].dataset.xIndex = jMainIter;\n }\n tds[j].dataset.yIndex = i;\n\n if ( tds[j].colSpan > 1 ) {\n for ( let k = 1; k < tds[j].colSpan; k++ ) {\n jMainIter++;\n tdsArr[i][jMainIter] = 'tdDummy';\n }\n }\n\n if ( tds[j].rowSpan > 1 ) {\n for ( let x = 1; x < tds[j].rowSpan; x++ ) {\n if ( tdsArr[i + x] == undefined ) {\n tdsArr[i + x] = [];\n }\n for ( let z = 0; z < tds[j].colSpan; z++ ) {\n tdsArr[i + x][jMainIter - tds[j].colSpan + 1 + z ] = 'tdDummy';\n }\n }\n }\n jMainIter++;\n }\n\n if ( tds.length > maxCols ) {\n maxCols = tds.length;\n }\n\n if( i == 0 ) {\n maxColsFull = jMainIter;\n }\n }\n table.columns = maxCols;\n table.maxCols = maxColsFull;\n}\n","/**\n * Responsive class assignment for frontend operations.\n *\n * This file can be used as an UMD.\n */\n(function assignToGlobal(key, context, factory) {\n\tif (typeof exports === 'object' && typeof module !== 'undefined') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tcontext[key] = factory();\n\t}\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_ResponsiveFrontend', self || global, () => {\n\t/**\n\t * Log a message to console.\n\t *\n\t * @param {string} message message to be logged\n\t * @param {string} type console log type (e.g info, warn, error)\n\t * @throws An error will be given for invalid type value\n\t */\n\tfunction logToConsole(message, type = 'log') {\n\t\tif (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tif (console[type]) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole[type](`[WPTB]: ${message}`);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`no logging type found with given type value of [${type}]`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Object implementation for cell element operations.\n\t * If an empty cellElement parameter is given, a fresh cell element will be created.\n\t *\n\t * @param {HTMLElement | null} cellElement cell element\n\t * @param {null | CellObject} reference main cell object if the current cell is a reference to that cell in cases like merged cells\n\t * @class\n\t */\n\tfunction CellObject(cellElement, reference = null) {\n\t\t// cell element\n\t\tthis.element = cellElement;\n\n\t\tthis.referenceObject = reference;\n\n\t\t// variable for deciding part of merged cells to be visible or not\n\t\tthis.mergedRenderStatus = true;\n\n\t\t// connected merged cell references\n\t\tthis.mergedCells = {\n\t\t\trow: [],\n\t\t\tcolumn: [],\n\t\t};\n\n\t\t/**\n\t\t * Get merged render status.\n\t\t *\n\t\t * @return {boolean} render status\n\t\t */\n\t\tthis.getMergedRenderStatus = () => {\n\t\t\treturn this.mergedRenderStatus;\n\t\t};\n\n\t\t/**\n\t\t * Set merged render status.\n\t\t *\n\t\t * @param {boolean} status render status\n\t\t */\n\t\tthis.setMergedRenderStatus = (status) => {\n\t\t\tthis.mergedRenderStatus = status;\n\t\t};\n\n\t\t/**\n\t\t * Add merged cells.\n\t\t *\n\t\t * @param {string} mergeType merge type\n\t\t * @param {CellObject} cellObj cell object instance\n\t\t */\n\t\tthis.addToMergedCells = (mergeType, cellObj) => {\n\t\t\tthis.mergedCells[mergeType].push(cellObj);\n\t\t};\n\n\t\t/**\n\t\t * Determine if current cell is a reference to a main cell.\n\t\t *\n\t\t * @return {boolean} a reference or not\n\t\t */\n\t\tthis.isReference = () => {\n\t\t\treturn this.referenceObject !== null;\n\t\t};\n\n\t\tif (this.isReference()) {\n\t\t\tthis.element = cellElement.cloneNode(true);\n\t\t}\n\n\t\t// modifications object\n\t\t// this object will keep track of the modifications that has done to the cell to make sure we can roll them back to their original values\n\t\tthis.modifications = {};\n\n\t\t// spans object for cell's original merge values\n\t\tthis.spans = {\n\t\t\trow: 1,\n\t\t\tcol: 1,\n\t\t};\n\n\t\tthis.remainingSpans = {\n\t\t\trow: 0,\n\t\t\tcol: 0,\n\t\t};\n\n\t\t/**\n\t\t * Cache cell element's original span values.\n\t\t *\n\t\t * @private\n\t\t */\n\t\tthis.cacheSpanValues = () => {\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\tObject.keys(this.spans).map((k) => {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(this.spans, k)) {\n\t\t\t\t\tconst defaultVal = this.spans[k];\n\n\t\t\t\t\tthis.spans[k] = this.element.getAttribute(`${k}Span`) || defaultVal;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tthis.cacheSpanValues();\n\n\t\t/**\n\t\t * Get original span value of cell object.\n\t\t *\n\t\t * @param {string} spanType span type, available values are row-column\n\t\t * @param {boolean} fromElement instead of original value, get the assigned span value from HTMLElement itself\n\t\t * @throws An error will be given for invalid span type\n\t\t */\n\t\tthis.getSpan = (spanType, fromElement = false) => {\n\t\t\tconst spanVal = fromElement ? this.getElement().getAttribute(`${spanType}Span`) : this.spans[spanType];\n\t\t\tif (spanVal) {\n\t\t\t\treturn spanVal;\n\t\t\t}\n\t\t\tthrow new Error(`no span value found with the given type of [${spanType}]`);\n\t\t};\n\n\t\tthis.getRemainingSpans = (spanType) => {\n\t\t\treturn this.remainingSpans[spanType];\n\t\t};\n\n\t\tthis.setRemainingSpans = (spanType, value) => {\n\t\t\tthis.remainingSpans[spanType] = value;\n\t\t};\n\n\t\t/**\n\t\t * Get cell element.\n\t\t *\n\t\t * @return {HTMLElement} cell element\n\t\t */\n\t\tthis.getElement = () => {\n\t\t\treturn this.element;\n\t\t};\n\n\t\t/**\n\t\t * Create a cell element.\n\t\t *\n\t\t * @private\n\t\t * @return {HTMLTableDataCellElement} created cell element\n\t\t */\n\t\tthis.createCellElement = () => {\n\t\t\treturn document.createElement('td');\n\t\t};\n\n\t\t// create a new cell element if no cellElement argument is given with constructor function\n\t\tif (!cellElement) {\n\t\t\tthis.element = this.createCellElement();\n\t\t}\n\n\t\t/**\n\t\t * Add attribute to cell element.\n\t\t *\n\t\t * This function have the ability to add/remove attributes from cell element.\n\t\t * All attributes modified with this function will be cached with their before value for an easy reset on demand.\n\t\t *\n\t\t * @param {string} attributeKey attribute name in camelCase format, for sub-keys, use dot object notation\n\t\t * @param {any} attributeValue attribute value\n\t\t * @param {boolean} [append=false] append the value or replace it\n\t\t * @param {string} [glue=,] glue to join attribute value if append option is enabled\n\t\t */\n\t\tthis.setAttribute = (attributeKey, attributeValue, append = false, glue = ',') => {\n\t\t\tlet defaultVal = this.getElement()[attributeKey];\n\n\t\t\t// if attribute value is a function or an object, it means we pulled a whole declaration instead of only inline attribute values, in that case, use getAttribute to get only inline values related to that attribute\n\t\t\tif (typeof defaultVal === 'function' || typeof defaultVal === 'object') {\n\t\t\t\tdefaultVal = this.getElement().getAttribute(attributeKey);\n\t\t\t}\n\n\t\t\t// if there is already a default value defined, use that instead\n\t\t\tif (this.modifications[attributeKey]) {\n\t\t\t\tdefaultVal = this.modifications[attributeKey].default;\n\t\t\t}\n\n\t\t\tlet currentVal = defaultVal;\n\n\t\t\t// join attributes\n\t\t\tif (append) {\n\t\t\t\tcurrentVal += `${currentVal}${glue}${attributeValue}`;\n\t\t\t} else {\n\t\t\t\tcurrentVal = attributeValue;\n\t\t\t}\n\n\t\t\tthis.modifications[attributeKey] = { value: currentVal, default: defaultVal };\n\n\t\t\tthis.getElement()[attributeKey] = currentVal;\n\t\t};\n\n\t\t/**\n\t\t * Set row/colspan for cell.\n\t\t *\n\t\t * @param {string} spanType span type\n\t\t * @param {number} value value to assign to span\n\t\t * @return {boolean} if any space left to render the element\n\t\t */\n\t\tthis.setSpan = (spanType, value) => {\n\t\t\t// working on main cell\n\t\t\tif (!this.isReference()) {\n\t\t\t\tconst valueToApply = this.getSpan(spanType) - value < 0 ? this.getSpan(spanType) : value;\n\n\t\t\t\tthis.setAttribute(`${spanType}Span`, valueToApply);\n\n\t\t\t\t// calculate remaining cells amount to merge in this span type\n\t\t\t\tthis.setRemainingSpans(spanType, this.getSpan(spanType) - valueToApply);\n\n\t\t\t\t// set visibility of connected merge group cells to false to not render them since we added necessary span values to main cell which will leak into their position\n\t\t\t\tfor (let mc = 0; mc < valueToApply - 1; mc += 1) {\n\t\t\t\t\tif (this.mergedCells[spanType] && this.mergedCells[spanType][mc]) {\n\t\t\t\t\t\tthis.mergedCells[spanType][mc].setMergedRenderStatus(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// working on reference\n\n\t\t\tif (!this.getMergedRenderStatus()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst remainingVal = this.referenceObject.getRemainingSpans(spanType);\n\n\t\t\t// no space left to put cell\n\t\t\tif (remainingVal === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst valueToApply = remainingVal - value < 0 ? remainingVal : value;\n\n\t\t\tconst remainingParentSpans = remainingVal - valueToApply;\n\t\t\tthis.referenceObject.setRemainingSpans(spanType, remainingParentSpans);\n\n\t\t\tthis.setAttribute(`${spanType}Span`, valueToApply);\n\n\t\t\t// change render status of remaining connected merge cells\n\t\t\tif (remainingParentSpans !== 0) {\n\t\t\t\tconst totalConnectedCells = this.referenceObject.mergedCells[spanType].length;\n\t\t\t\tconst startIndex = totalConnectedCells - remainingVal + 1;\n\t\t\t\tconst endIndex = startIndex + valueToApply - 1;\n\n\t\t\t\tfor (let mc = startIndex; mc < endIndex; mc += 1) {\n\t\t\t\t\tthis.mergedCells[spanType][mc].setMergedRenderStatus(false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\n\t\t/**\n\t\t * Reset a modified attribute to its default value\n\t\t *\n\t\t * @param {string} attributeKey attribute name\n\t\t */\n\t\tthis.resetAttribute = (attributeKey) => {\n\t\t\tif (this.modifications[attributeKey]) {\n\t\t\t\tthis.getElement()[attributeKey] = this.modifications[attributeKey].default;\n\t\t\t\tthis.modifications[attributeKey] = undefined;\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Reset all modified attributes of cell element to their default values.\n\t\t */\n\t\tthis.resetAllAttributes = () => {\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\tObject.keys(this.modifications).map((k) => {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(this.modifications, k)) {\n\t\t\t\t\tthis.resetAttribute(k);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\treturn {\n\t\t\tgetElement: this.getElement,\n\t\t\tel: this.element,\n\t\t\tsetAttribute: this.setAttribute,\n\t\t\tresetAllAttributes: this.resetAllAttributes,\n\t\t\tgetSpan: this.getSpan,\n\t\t\tsetSpan: this.setSpan,\n\t\t\tgetRemainingSpans: this.getRemainingSpans,\n\t\t\tsetRemainingSpans: this.setRemainingSpans,\n\t\t\tisReference: this.isReference,\n\t\t\taddToMergedCells: this.addToMergedCells,\n\t\t\tmergedCells: this.mergedCells,\n\t\t\tsetMergedRenderStatus: this.setMergedRenderStatus,\n\t\t\tgetMergedRenderStatus: this.getMergedRenderStatus,\n\t\t};\n\t}\n\n\tCellObject.spanTypes = { row: 'row', column: 'col' };\n\n\t/**\n\t * Object implementation for table element operations.\n\t *\n\t * @param {HTMLElement} tableEl table element\n\t * @return {Object} instance\n\t * @class\n\t */\n\tfunction TableObject(tableEl) {\n\t\t/**\n\t\t * Table element.\n\t\t *\n\t\t * @private\n\t\t * @type {HTMLElement}\n\t\t */\n\t\tthis.tableElement = tableEl;\n\n\t\t/**\n\t\t * Parsed table object.\n\t\t *\n\t\t * @private\n\t\t * @type {Array}\n\t\t */\n\t\tthis.parsedTable = [];\n\n\t\t/**\n\t\t * An array of created table rows elements that are id'd according to their index in array.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tthis.rowCache = [];\n\n\t\t/**\n\t\t * Original table elements minus the cells.\n\t\t *\n\t\t * @type {Object}\n\t\t * @private\n\t\t */\n\t\tthis.originals = { rows: [] };\n\n\t\t/**\n\t\t * Row colors of original table.\n\t\t *\n\t\t * @type {{even: string, header: string, odd: string}}\n\t\t */\n\t\tthis.rowColors = {\n\t\t\theader: null,\n\t\t\teven: null,\n\t\t\todd: null,\n\t\t};\n\n\t\t/**\n\t\t * Add cell to parsed array.\n\t\t *\n\t\t * @private\n\t\t * @param {number} r row id\n\t\t * @param {number} c column id\n\t\t * @param {CellObject} cellObject cell object to add to parsed array\n\t\t */\n\t\tthis.addToParsed = (r, c, cellObject) => {\n\t\t\tif (!this.parsedTable[r]) {\n\t\t\t\tthis.parsedTable[r] = [];\n\t\t\t}\n\n\t\t\tthis.parsedTable[r][c] = cellObject;\n\t\t};\n\n\t\t/**\n\t\t * Assign table cells into row and column numbers.\n\t\t *\n\t\t * @private\n\t\t */\n\t\tthis.parseTable = () => {\n\t\t\tconst rows = Array.from(this.tableElement.querySelectorAll('tr'));\n\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\trows.map((r, ri) => {\n\t\t\t\t// cache original rows for future use\n\t\t\t\tthis.originals.rows.push(r);\n\n\t\t\t\tconst cells = Array.from(r.querySelectorAll('td'));\n\n\t\t\t\tlet currentIndex = 0;\n\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\tcells.map((c, ci) => {\n\t\t\t\t\tconst currentCellObject = new CellObject(c);\n\t\t\t\t\tthis.addToParsed(ri, currentIndex, currentCellObject);\n\t\t\t\t\tcurrentIndex += 1;\n\n\t\t\t\t\tconst spanRow = currentCellObject.getSpan(CellObject.spanTypes.row);\n\t\t\t\t\tconst spanCol = currentCellObject.getSpan(CellObject.spanTypes.column);\n\n\t\t\t\t\tif (spanRow > 1) {\n\t\t\t\t\t\tfor (let sr = 1; sr < spanRow; sr += 1) {\n\t\t\t\t\t\t\tconst referenceCell = new CellObject(c, currentCellObject);\n\t\t\t\t\t\t\tcurrentCellObject.addToMergedCells('row', referenceCell);\n\t\t\t\t\t\t\tthis.addToParsed(ri + sr, ci, referenceCell);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (spanCol > 1) {\n\t\t\t\t\t\tfor (let sc = 1; sc < spanCol; sc += 1) {\n\t\t\t\t\t\t\tconst referenceCell = new CellObject(c, currentCellObject);\n\t\t\t\t\t\t\tcurrentCellObject.addToMergedCells('column', referenceCell);\n\t\t\t\t\t\t\tthis.addToParsed(ri, currentIndex, referenceCell);\n\t\t\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.parseRowColors(rows);\n\t\t};\n\n\t\t/**\n\t\t * Parse row colors of original table for futures uses.\n\t\t *\n\t\t * @param {Array} rows html row elements\n\t\t * @private\n\t\t */\n\t\tthis.parseRowColors = (rows) => {\n\t\t\tif (!rows || rows.length <= 0) {\n\t\t\t\tlogToConsole('no rows are found to parse their colors', 'error');\n\t\t\t}\n\n\t\t\t// get row colors if they are defined as datasets on table element\n\t\t\tconst headerDatasetColor = this.tableElement.dataset.wptbHeaderBackgroundColor;\n\t\t\tconst evenRowDatasetColor = this.tableElement.dataset.wptbEvenRowBackgroundColor;\n\t\t\tconst oddRowDatasetColor = this.tableElement.dataset.wptbOddRowBackgroundColor;\n\n\t\t\t// header row color\n\t\t\tthis.rowColors.header =\n\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\theaderDatasetColor !== undefined\n\t\t\t\t\t? headerDatasetColor\n\t\t\t\t\t: rows[0].style.backgroundColor === ''\n\t\t\t\t\t? null\n\t\t\t\t\t: rows[0].style.backgroundColor;\n\n\t\t\t// calculate needed number of rows to get even and odd row background colors\n\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\tconst rowsNeeded = rows.length / 3 >= 1 ? 0 : rows.length === 1 ? 2 : (rows.length - 1) % 2;\n\n\t\t\t// create additional rows and add them to table to get their row background colors since table row count may be lower to get even/odd rows\n\t\t\tfor (let rn = 0; rn < rowsNeeded; rn += 1) {\n\t\t\t\tconst tempRow = document.createElement('tr');\n\n\t\t\t\tthis.tableElement.querySelector('tbody').appendChild(tempRow);\n\t\t\t\trows.push(tempRow);\n\t\t\t}\n\n\t\t\t// even & odd row colors\n\t\t\t// dataset colors have priority over colors gathered from computed row styles\n\t\t\tthis.rowColors.even = evenRowDatasetColor || getComputedStyle(rows[1]).backgroundColor;\n\t\t\tthis.rowColors.odd = evenRowDatasetColor ? oddRowDatasetColor : getComputedStyle(rows[2]).backgroundColor;\n\n\t\t\t// remove created rows from DOM\n\t\t\tfor (let r = 0; r < rowsNeeded; r += 1) {\n\t\t\t\trows[rows.length - (r + 1)].remove();\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Add a row to the table.\n\t\t *\n\t\t * @param {Array} classList an array of class names to be added to row\n\t\t * @param {boolean} fromOriginals use rows from original table instead of creating a new one\n\t\t * @param {number} originalIndex original row index\n\t\t */\n\t\tthis.addRow = (classList, fromOriginals = false, originalIndex = 0) => {\n\t\t\tif (!Array.isArray(classList)) {\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\tclassList = [classList];\n\t\t\t}\n\n\t\t\tconst tableBody = this.tableElement.querySelector('tbody');\n\t\t\tlet tempRow;\n\n\t\t\tif (!fromOriginals) {\n\t\t\t\tconst range = document.createRange();\n\t\t\t\trange.setStart(tableBody, 0);\n\t\t\t\t// eslint-disable-next-line prefer-destructuring\n\t\t\t\ttempRow = range.createContextualFragment(``).childNodes[0];\n\t\t\t} else {\n\t\t\t\ttempRow = this.originals.rows[originalIndex];\n\t\t\t}\n\n\t\t\t// add row to table body\n\t\t\ttableBody.appendChild(tempRow);\n\n\t\t\t// cache row for future use\n\t\t\tthis.rowCache.push(tempRow);\n\n\t\t\treturn { el: tempRow, id: this.rowCache.length - 1 };\n\t\t};\n\n\t\t/**\n\t\t * Clear the contents of table element.\n\t\t */\n\t\tthis.clearTable = () => {\n\t\t\t// clear row cache\n\t\t\tthis.rowCache = [];\n\n\t\t\t// clear children of `tbody` element\n\t\t\tthis.tableElement.querySelector('tbody').innerHTML = '';\n\t\t};\n\n\t\t/**\n\t\t * Get row element from cache.\n\t\t *\n\t\t * @param {number} id row id\n\t\t * @return {null|HTMLElement} row element if present or null if not\n\t\t */\n\t\tthis.getRow = (id) => {\n\t\t\tif (this.rowCache[id]) {\n\t\t\t\treturn this.rowCache[id];\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tlogToConsole(`no row with id [${id}] found in the cache.`, 'warn');\n\t\t\treturn null;\n\t\t};\n\n\t\t/**\n\t\t * Get maximum number of rows available at table.\n\t\t *\n\t\t * @return {number} maximum amount of rows\n\t\t */\n\t\tthis.maxRows = () => {\n\t\t\treturn this.parsedTable.length;\n\t\t};\n\n\t\t/**\n\t\t * Get the number of maximum available column count in the table.\n\t\t *\n\t\t * @param {boolean} mergedHeader if header is merged or not\n\t\t * @return {number} maximum available column count\n\t\t */\n\t\tthis.maxColumns = (mergedHeader) => {\n\t\t\tif (mergedHeader) {\n\t\t\t\treturn this.parsedTable[0].length;\n\t\t\t}\n\n\t\t\treturn this.parsedTable.reduce((p, c) => {\n\t\t\t\tif (c.length > p) {\n\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\tp = c.length;\n\t\t\t\t}\n\n\t\t\t\treturn p;\n\t\t\t}, 0);\n\t\t};\n\n\t\t/**\n\t\t * Get the table cell at specified row-column location.\n\t\t *\n\t\t * As in arrays, row and column numbering starts from number 0.\n\t\t *\n\t\t * @param {number} r row number\n\t\t * @param {number} c column number\n\t\t * @param {boolean} returnObject return object instead of HTMLElement\n\t\t * @return {HTMLElement | null | CellObject} element if address is possible, null if not\n\t\t */\n\t\tthis.getCell = (r, c, returnObject = false) => {\n\t\t\ttry {\n\t\t\t\tif (this.parsedTable[r][c]) {\n\t\t\t\t\tif (returnObject) {\n\t\t\t\t\t\treturn this.parsedTable[r][c];\n\t\t\t\t\t}\n\t\t\t\t\treturn this.parsedTable[r][c].el;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tlogToConsole(`no cell found at the given address of [${r}-${c}]`, 'warn');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tlogToConsole(`no cell found at the given address of [${r}-${c}]`, 'warn');\n\t\t\treturn null;\n\t\t};\n\n\t\t/**\n\t\t * Get cells at a given row.\n\t\t *\n\t\t * @param {number} rowId row id\n\t\t * @param {boolean} returnObj return an array of CellObject instead\n\t\t * @return {Array} cells in row\n\t\t */\n\t\tthis.getCellsAtRow = (rowId, returnObj = false) => {\n\t\t\tconst cells = [];\n\t\t\tfor (let c = 0; c < this.maxColumns(); c += 1) {\n\t\t\t\tconst tempCell = this.getCell(rowId, c, returnObj);\n\t\t\t\tif (tempCell) {\n\t\t\t\t\tcells.push(tempCell);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn cells;\n\t\t};\n\n\t\t/**\n\t\t * Append the cell with given ids to a cached row\n\t\t *\n\t\t * @param {number} cellRowId cell row id\n\t\t * @param {number} cellColumnId cell column id\n\t\t * @param {number} rowId id of row in row cache\n\t\t */\n\t\tthis.appendToRow = (cellRowId, cellColumnId, rowId) => {\n\t\t\tconst cachedRow = this.getRow(rowId);\n\t\t\tconst cell = this.getCell(cellRowId, cellColumnId, true);\n\n\t\t\tif (cell && cachedRow) {\n\t\t\t\tcachedRow.appendChild(cell.getElement());\n\t\t\t}\n\t\t\treturn cell;\n\t\t};\n\n\t\t/**\n\t\t * Append html element to a cached row.\n\t\t *\n\t\t * @param {HTMLElement} el element\n\t\t * @param {number} rowId if of row in row cache\n\t\t */\n\t\tthis.appendElementToRow = (el, rowId) => {\n\t\t\tconst cachedRow = this.getRow(rowId);\n\n\t\t\tif (el && cachedRow) {\n\t\t\t\tcachedRow.appendChild(el);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Add cell object to a cached row.\n\t\t *\n\t\t * @param {CellObject} cellObj cell object\n\t\t * @param {number} rowId row id\n\t\t */\n\t\tthis.appendObjectToRow = (cellObj, rowId) => {\n\t\t\tconst cachedRow = this.getRow(rowId);\n\t\t\tif (cellObj && cachedRow) {\n\t\t\t\tcachedRow.appendChild(cellObj.getElement());\n\t\t\t}\n\t\t};\n\n\t\tthis.getParsedTable = () => {\n\t\t\treturn this.parsedTable;\n\t\t};\n\n\t\tthis.parseTable();\n\n\t\treturn {\n\t\t\tmaxRows: this.maxRows,\n\t\t\tmaxColumns: this.maxColumns,\n\t\t\taddRow: this.addRow,\n\t\t\tclearTable: this.clearTable,\n\t\t\tgetCell: this.getCell,\n\t\t\tappendToRow: this.appendToRow,\n\t\t\tappendElementToRow: this.appendElementToRow,\n\t\t\tappendObjectToRow: this.appendObjectToRow,\n\t\t\tgetCellsAtRow: this.getCellsAtRow,\n\t\t\tel: this.tableElement,\n\t\t\trowColors: this.rowColors,\n\t\t\tgetParsedTable: this.getParsedTable,\n\t\t};\n\t}\n\n\t// default options for responsive class\n\tconst responsiveClassDefaultOptions = {\n\t\tquery: '.wptb-preview-table',\n\t\tdefaultClasses: ['wptb-plugin-responsive-base'],\n\t\tbindToResize: false,\n\t};\n\n\t/**\n\t * Class for handling operations related to responsive functionalities of tables.\n\t *\n\t * @class\n\t * @param {Object} options options object\n\t */\n\tfunction ResponsiveFront(options = {}) {\n\t\t// merge default options with user sent options\n\t\t// this.options = { ...responsiveClassDefaultOptions, ...options };\n\t\tthis.options = { ...responsiveClassDefaultOptions, ...options };\n\n\t\tthis.elements = Array.from(document.querySelectorAll(this.options.query));\n\n\t\tthis.elementObjects = this.elements.map((e) => {\n\t\t\treturn {\n\t\t\t\tel: e,\n\t\t\t\ttableObject: new TableObject(e),\n\t\t\t};\n\t\t});\n\n\t\t/**\n\t\t * Whether given element's background is transparent or not.\n\t\t *\n\t\t * @param {HTMLElement} element html element\n\t\t * @return {boolean} transparent or not\n\t\t */\n\t\tconst isBackgroundTransparent = (element) => {\n\t\t\tlet status = false;\n\t\t\tif (element.style.backgroundColor) {\n\t\t\t\tconst regexp = new RegExp(/^rgba\\(\\s?0\\s?,\\s?0\\s?,\\s?0\\s?,\\s?0\\s?\\)$/g);\n\n\t\t\t\tstatus = element.style.backgroundColor.match(regexp) !== null;\n\t\t\t}\n\n\t\t\treturn status;\n\t\t};\n\n\t\t/**\n\t\t * Bind rebuilding of tables to window resize event.\n\t\t */\n\t\tthis.bindRebuildToResize = () => {\n\t\t\t// eslint-disable-next-line @wordpress/no-global-event-listener\n\t\t\twindow.addEventListener('resize', () => {\n\t\t\t\tthis.rebuildTables();\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Get responsive directives of table element.\n\t\t *\n\t\t * @private\n\t\t * @param {HTMLElement} el table element\n\t\t * @return {Object | null} JSON representation of the directive element, if not available, null will be returned\n\t\t */\n\t\tthis.getDirective = (el) => {\n\t\t\tconst directiveString = el.dataset.wptbResponsiveDirectives;\n\n\t\t\tif (!directiveString) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn JSON.parse(atob(directiveString));\n\t\t};\n\n\t\t/**\n\t\t * Add default classes to rebuilt tables.\n\t\t *\n\t\t * This classes are added to lay out a base style for the responsive table.\n\t\t *\n\t\t * @param {HTMLElement} el table element\n\t\t */\n\t\tthis.addDefaultClasses = (el) => {\n\t\t\tel.classList.add(this.options.defaultClasses);\n\t\t};\n\n\t\t/**\n\t\t * Remove default classes from target table.\n\t\t *\n\t\t * @param {HTMLElement} el table element\n\t\t */\n\t\tthis.removeDefaultClasses = (el) => {\n\t\t\tel.classList.remove(this.options.defaultClasses);\n\t\t};\n\n\t\t/**\n\t\t * Scroll operation related adjustments to responsive process.\n\t\t *\n\t\t * @param {Node} tableElement table element\n\t\t * @param {boolean} revertToOriginal revert to original state\n\t\t */\n\t\tconst scrollOperations = (tableElement, revertToOriginal) => {\n\t\t\tconst scrollFunctionalityStatus = tableElement.dataset.wptbHorizontalScrollStatus;\n\n\t\t\tif (scrollFunctionalityStatus) {\n\t\t\t\tconst matrixContainer = tableElement.parentNode;\n\t\t\t\tif (revertToOriginal) {\n\t\t\t\t\tconst storedMaxWidth = tableElement.dataset.wptbTableContainerMaxWidth;\n\n\t\t\t\t\tmatrixContainer.style.width = `${storedMaxWidth}px`;\n\t\t\t\t} else {\n\t\t\t\t\tmatrixContainer.style.width = '';\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Rebuild table in auto mode.\n\t\t *\n\t\t * Main characteristic of auto mode is table is rebuilt by stacking rows/columns on top of each other, leaving minimal effort from user to create a responsive table at breakpoints.\n\t\t *\n\t\t * @param {HTMLElement} tableEl table element\n\t\t * @param {string} sizeRange range id for current screen size\n\t\t * @param {Object} autoOption mode options\n\t\t * @param {TableObject} tableObj table object\n\t\t */\n\t\tthis.autoBuild = (tableEl, sizeRange, autoOption, tableObj) => {\n\t\t\t// base options\n\t\t\tconst direction = autoOption.cellStackDirection[sizeRange];\n\t\t\t// eslint-disable-next-line prefer-destructuring\n\t\t\tconst topRowAsHeader = autoOption.topRowAsHeader[sizeRange];\n\t\t\tconst cellsPerRow = autoOption.cellsPerRow[sizeRange];\n\n\t\t\t// new options\n\t\t\tconst staticTopRow = autoOption.staticTopRow ? autoOption.staticTopRow[sizeRange] : false;\n\t\t\tconst repeatMergedHeader =\n\t\t\t\t// check for undefined for backward compatibility of older tables\n\t\t\t\t/* eslint-disable no-nested-ternary */\n\t\t\t\tautoOption.repeatMergedHeader === undefined || autoOption.repeatMergedHeader[sizeRange] === true\n\t\t\t\t\t? topRowAsHeader\n\t\t\t\t\t\t? autoOption.repeatMergedHeader\n\t\t\t\t\t\t\t? autoOption.repeatMergedHeader[sizeRange]\n\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t: false\n\t\t\t\t\t: false;\n\t\t\t/* eslint-enable no-nested-ternary */\n\n\t\t\ttableObj.clearTable();\n\n\t\t\tif (sizeRange === 'desktop') {\n\t\t\t\tscrollOperations(tableEl, true);\n\t\t\t\tthis.buildDefault(tableObj);\n\t\t\t\tthis.removeDefaultClasses(tableEl);\n\t\t\t} else {\n\t\t\t\tscrollOperations(tableEl, false);\n\t\t\t\tthis.autoDirectionBuild(\n\t\t\t\t\ttableObj,\n\t\t\t\t\tdirection,\n\t\t\t\t\ttopRowAsHeader,\n\t\t\t\t\tstaticTopRow,\n\t\t\t\t\tcellsPerRow,\n\t\t\t\t\trepeatMergedHeader\n\t\t\t\t);\n\t\t\t\tthis.addDefaultClasses(tableEl);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Rebuild table with a direction to read cells.\n\t\t *\n\t\t * Direction in question in here is either by row or column:\n\t\t * * row: cells will be read row by row, in each row starting from the first column\n\t\t * * column: cells will be read column by column, in each column starting from the first row of the table\n\t\t *\n\t\t * @param {TableObject} tableObj table object\n\t\t * @param {string} direction direction to read cells, possible options [row, column]\n\t\t * @param {boolean} topRowAsHeader use top row as header\n\t\t * @param {boolean} staticTopRow use top row as static\n\t\t * @param {number} cellsPerRow cells per row\n\t\t * @param {boolean} repeatMergedHeader repeat merged top header if top row as header option is enabled\n\t\t */\n\t\tthis.autoDirectionBuild = (\n\t\t\ttableObj,\n\t\t\tdirection,\n\t\t\ttopRowAsHeader = false,\n\t\t\tstaticTopRow = false,\n\t\t\tcellsPerRow = 1,\n\t\t\trepeatMergedHeader = true\n\t\t) => {\n\t\t\tconst rows = tableObj.maxRows();\n\t\t\tconst columns = tableObj.maxColumns();\n\t\t\tconst isRowStacked = direction === 'row';\n\n\t\t\t// build table with top row as header\n\t\t\tif (topRowAsHeader) {\n\t\t\t\tthis.headerBuild(tableObj, direction, cellsPerRow, repeatMergedHeader);\n\t\t\t} else {\n\t\t\t\t// cell stack direction is selected as row\n\t\t\t\t// for future new functionality additions, keep different cell stack direction logic separate instead of generalizing the inner logic\n\t\t\t\t// eslint-disable-next-line no-lonely-if\n\t\t\t\tif (isRowStacked) {\n\t\t\t\t\tconst allCellsByRow = [];\n\t\t\t\t\tlet rowStartIndex = 0;\n\n\t\t\t\t\t// static top row option is enabled\n\t\t\t\t\tif (staticTopRow) {\n\t\t\t\t\t\tconst topCells = tableObj.getCellsAtRow(0, true);\n\n\t\t\t\t\t\tconst baseCells = topCells.filter((c) => !c.isReference());\n\n\t\t\t\t\t\tif (baseCells.length > 0) {\n\t\t\t\t\t\t\trowStartIndex += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\tbaseCells.map((b) => {\n\t\t\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\t\t\ttableObj.appendObjectToRow(b, rowObj.id);\n\n\t\t\t\t\t\t\tif (!b.el.style.backgroundColor || isBackgroundTransparent(b.el)) {\n\t\t\t\t\t\t\t\tconst bgColor = tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t: getComputedStyle(rowObj.el).backgroundColor;\n\t\t\t\t\t\t\t\tb.setAttribute('style', `background-color: ${bgColor}`, true, ';');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\n\t\t\t\t\t\t\tb.setAttribute('colSpan', cellsPerRow);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// get cells by reading row by row\n\t\t\t\t\tfor (let r = rowStartIndex; r < rows; r += 1) {\n\t\t\t\t\t\t// eslint-disable-next-line no-loop-func\n\t\t\t\t\t\ttableObj.getCellsAtRow(r, true).forEach((c) => {\n\t\t\t\t\t\t\t// only use non reference cells to avoid duplication for non top row as header tables\n\t\t\t\t\t\t\tif (!c.isReference()) {\n\t\t\t\t\t\t\t\tallCellsByRow.push(c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cellCount = allCellsByRow.length;\n\n\t\t\t\t\tfor (let c = 0, r = 0; c < cellCount; c += cellsPerRow, r += 1) {\n\t\t\t\t\t\t// const rowId = tableObj.addRow('wptb-row').id;\n\t\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\t\t// place cells by 'cells by row' option value\n\t\t\t\t\t\tfor (let pR = 0; pR < cellsPerRow; pR += 1) {\n\t\t\t\t\t\t\tconst tempCell = allCellsByRow[c + pR];\n\n\t\t\t\t\t\t\tif (tempCell) {\n\t\t\t\t\t\t\t\ttableObj.appendElementToRow(tempCell.getElement(), rowObj.id);\n\n\t\t\t\t\t\t\t\ttempCell.resetAllAttributes();\n\t\t\t\t\t\t\t\ttempCell.setAttribute('style', 'width: 100% !important', true, ';');\n\t\t\t\t\t\t\t\ttempCell.setAttribute('colSpan', 1);\n\t\t\t\t\t\t\t\ttempCell.setAttribute('rowSpan', 1);\n\n\t\t\t\t\t\t\t\tif (!tempCell.el.style.backgroundColor || isBackgroundTransparent(tempCell.el)) {\n\t\t\t\t\t\t\t\t\tconst currentTableColor =\n\t\t\t\t\t\t\t\t\t\ttableObj.rowColors[(rowStartIndex + r) % 2 === 0 ? 'odd' : 'even'];\n\t\t\t\t\t\t\t\t\ttempCell.el.style.backgroundColor =\n\t\t\t\t\t\t\t\t\t\tcurrentTableColor || getComputedStyle(rowObj.el).backgroundColor;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// preserve original row colors for even and odd rows\n\t\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// cell stack direction is selected as column\n\t\t\t\telse {\n\t\t\t\t\tconst allCellsByCol = [];\n\t\t\t\t\tlet rowStartIndex = 0;\n\n\t\t\t\t\t// static top row option is enabled\n\t\t\t\t\tif (staticTopRow) {\n\t\t\t\t\t\tconst topCells = tableObj.getCellsAtRow(0, true);\n\n\t\t\t\t\t\tconst baseCells = topCells.filter((t) => !t.isReference());\n\n\t\t\t\t\t\tif (baseCells.length > 0) {\n\t\t\t\t\t\t\trowStartIndex += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\tbaseCells.map((b) => {\n\t\t\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\t\t\ttableObj.appendObjectToRow(b, rowObj.id);\n\n\t\t\t\t\t\t\tif (!b.el.style.backgroundColor || isBackgroundTransparent(b.el)) {\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\t\t\tb.el.style.backgroundColor = tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t: getComputedStyle(rowObj.el).backgroundColor;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\n\t\t\t\t\t\t\tb.setAttribute('colSpan', cellsPerRow);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// read all cells column by column\n\t\t\t\t\tfor (let c = 0; c < columns; c += 1) {\n\t\t\t\t\t\tfor (let r = rowStartIndex; r < rows; r += 1) {\n\t\t\t\t\t\t\tconst tCell = tableObj.getCell(r, c, true);\n\t\t\t\t\t\t\t// only use non reference cells to avoid duplication for non top row as header tables\n\t\t\t\t\t\t\tif (tCell && !tCell.isReference()) {\n\t\t\t\t\t\t\t\tallCellsByCol.push(tCell);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cellCount = allCellsByCol.length;\n\n\t\t\t\t\tfor (let c = 0, r = 0; c < cellCount; c += cellsPerRow, r += 1) {\n\t\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\t\tfor (let cR = 0; cR < cellsPerRow; cR += 1) {\n\t\t\t\t\t\t\tconst tempCell = allCellsByCol[c + cR];\n\n\t\t\t\t\t\t\tif (tempCell) {\n\t\t\t\t\t\t\t\ttableObj.appendElementToRow(tempCell.getElement(), rowObj.id);\n\n\t\t\t\t\t\t\t\ttempCell.resetAllAttributes();\n\t\t\t\t\t\t\t\ttempCell.setAttribute('style', 'width: 100% !important', true, ';');\n\t\t\t\t\t\t\t\ttempCell.setAttribute('colSpan', 1);\n\t\t\t\t\t\t\t\ttempCell.setAttribute('rowSpan', 1);\n\n\t\t\t\t\t\t\t\tif (!tempCell.el.style.backgroundColor || isBackgroundTransparent(tempCell.el)) {\n\t\t\t\t\t\t\t\t\tconst currentTableColor =\n\t\t\t\t\t\t\t\t\t\ttableObj.rowColors[(rowStartIndex + r) % 2 === 0 ? 'odd' : 'even'];\n\t\t\t\t\t\t\t\t\ttempCell.el.style.backgroundColor =\n\t\t\t\t\t\t\t\t\t\tcurrentTableColor || getComputedStyle(rowObj.el).backgroundColor;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// preserve original row colors for even and odd rows\n\t\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Build table with top row assigned as header.\n\t\t *\n\t\t * @param {TableObject} tableObj table object\n\t\t * @param {string} direction cell stack direction, possible options are [row, column]\n\t\t * @param {number} itemsPerHeader items bound to each header element\n\t\t * @param {boolean} repeatMergedHeader repeat merged header\n\t\t */\n\t\tthis.headerBuild = (tableObj, direction, itemsPerHeader = 1, repeatMergedHeader = true) => {\n\t\t\t// cells at header\n\t\t\t// applying header row color to cells\n\t\t\tconst headerCells = tableObj.getCellsAtRow(0, true).map((h) => {\n\t\t\t\th.resetAllAttributes();\n\t\t\t\tif (!h.el.style.backgroundColor || isBackgroundTransparent(h.el)) {\n\t\t\t\t\th.setAttribute('style', `background-color: ${tableObj.rowColors.header}`, true, ';');\n\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\t});\n\n\t\t\tconst stackedAsColumn = direction === 'column';\n\n\t\t\t// row count\n\t\t\tconst rows = tableObj.maxRows();\n\t\t\t// column count\n\t\t\tconst columns = tableObj.maxColumns();\n\n\t\t\tconst rowBorderStyle = '3px solid gray';\n\n\t\t\t// stack direction is column\n\t\t\tif (stackedAsColumn) {\n\t\t\t\t/**\n\t\t\t\t * Add header cells as new row to table.\n\t\t\t\t *\n\t\t\t\t * @param {boolean} addBorder add top border to header row\n\t\t\t\t */\n\t\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\t\tfunction addHeaderCells(addBorder = false) {\n\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\tif (addBorder) {\n\t\t\t\t\t\trowObj.el.style.borderTop = rowBorderStyle;\n\t\t\t\t\t}\n\n\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\theaderCells.map((h) => {\n\t\t\t\t\t\t// clone header cell to reuse it for multiple rows\n\t\t\t\t\t\tconst cellClone = h.el.cloneNode(true);\n\t\t\t\t\t\ttableObj.appendElementToRow(cellClone, rowObj.id);\n\t\t\t\t\t\tif (!cellClone.style.backgroundColor || isBackgroundTransparent(cellClone)) {\n\t\t\t\t\t\t\tcellClone.style.backgroundColor = `${getComputedStyle(rowObj.el).backgroundColor}`;\n\t\t\t\t\t\t\tif (cellClone.style.backgroundColor) cellClone.style.backgroundColor += ' !important';\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\t\t\t\t}\n\n\t\t\t\t// count of header rows that will be created\n\t\t\t\tlet headerCount = Math.ceil((rows - 1) / itemsPerHeader);\n\n\t\t\t\t// in a situation where no cells are bind to header, only render header\n\t\t\t\theaderCount = headerCount === 0 ? 1 : headerCount;\n\n\t\t\t\t// row index on original table\n\t\t\t\tlet currentOriginalRow = 1;\n\t\t\t\tfor (let r = 0; r < headerCount; r += 1) {\n\t\t\t\t\t// create header row and add to table\n\t\t\t\t\taddHeaderCells(r > 0);\n\t\t\t\t\tfor (let c = 0; c < itemsPerHeader; c += 1) {\n\t\t\t\t\t\t// break iteration when current row surpasses original row amount\n\t\t\t\t\t\tif (currentOriginalRow >= rows) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\t\t// apply row color relative to current header row\n\t\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\t\t\t\t\t\tfor (let cc = 0; cc < columns; cc += 1) {\n\t\t\t\t\t\t\tconst currentCell = tableObj.getCell(currentOriginalRow, cc, true);\n\n\t\t\t\t\t\t\tif (currentCell) {\n\t\t\t\t\t\t\t\tcurrentCell.resetAllAttributes();\n\n\t\t\t\t\t\t\t\t// status to decide whether render cell or not\n\t\t\t\t\t\t\t\tlet cellAddStatus = true;\n\n\t\t\t\t\t\t\t\tconst rowSpan = currentCell.getSpan(CellObject.spanTypes.row);\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t\t\t\t\tconst colSpan = currentCell.getSpan(CellObject.spanTypes.column);\n\n\t\t\t\t\t\t\t\tif (rowSpan > 1) {\n\t\t\t\t\t\t\t\t\t// items remaining in current header\n\t\t\t\t\t\t\t\t\tconst remainingItems = itemsPerHeader - c;\n\n\t\t\t\t\t\t\t\t\t// calculate whether to apply full rowspan value or remaining item value depending on the current position of the cell\n\t\t\t\t\t\t\t\t\tconst currentRowSpan = Math.min(rowSpan, remainingItems);\n\n\t\t\t\t\t\t\t\t\tcellAddStatus = currentCell.setSpan(CellObject.spanTypes.row, currentRowSpan);\n\t\t\t\t\t\t\t\t\t// reset render status of cell to visible for future use\n\t\t\t\t\t\t\t\t\tcurrentCell.setMergedRenderStatus(true);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (cellAddStatus) {\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t!currentCell.el.style.backgroundColor ||\n\t\t\t\t\t\t\t\t\t\tisBackgroundTransparent(currentCell.el)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tcurrentCell.setAttribute(\n\t\t\t\t\t\t\t\t\t\t\t'style',\n\t\t\t\t\t\t\t\t\t\t\t`background-color: ${tableObj.rowColors[c % 2 === 0 ? 'even' : 'odd']}`,\n\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ttableObj.appendObjectToRow(currentCell, rowObj.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentOriginalRow += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// stack direction is row\n\t\t\t\t// number of headers that will be created\n\t\t\t\tlet headerCount = Math.ceil((rows - 1) / itemsPerHeader);\n\n\t\t\t\t// in a situation where no cells are bind to header, only render header\n\t\t\t\theaderCount = headerCount === 0 ? 1 : headerCount;\n\n\t\t\t\tlet currentOriginalRow = 1;\n\n\t\t\t\tfor (let hc = 0; hc < headerCount; hc += 1) {\n\t\t\t\t\tfor (let c = 0; c < columns; c += 1) {\n\t\t\t\t\t\tconst rowObj = tableObj.addRow('wptb-row');\n\n\t\t\t\t\t\tif (hc > 0 && c === 0) {\n\t\t\t\t\t\t\trowObj.el.style.borderTop = rowBorderStyle;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (repeatMergedHeader || hc === 0) {\n\t\t\t\t\t\t\tconst headerCellObject = tableObj.getCell(0, c, true);\n\t\t\t\t\t\t\t// const clonedHeaderCell = headerCells[c]?.el.cloneNode(true);\n\n\t\t\t\t\t\t\tif (!headerCellObject.isReference()) {\n\t\t\t\t\t\t\t\tconst clonedHeaderCell = headerCellObject.el.cloneNode(true);\n\n\t\t\t\t\t\t\t\t// apply header row color to header cell\n\t\t\t\t\t\t\t\tclonedHeaderCell.style.backgroundColor = `${tableObj.rowColors.header} !important`;\n\t\t\t\t\t\t\t\ttableObj.appendElementToRow(clonedHeaderCell, rowObj.id);\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t!clonedHeaderCell.style.backgroundColor ||\n\t\t\t\t\t\t\t\t\tisBackgroundTransparent(clonedHeaderCell)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tclonedHeaderCell.style.backgroundColor = `${\n\t\t\t\t\t\t\t\t\t\tgetComputedStyle(rowObj.el).backgroundColor\n\t\t\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\t\t\tif (clonedHeaderCell.style.backgroundColor)\n\t\t\t\t\t\t\t\t\t\tclonedHeaderCell.style.backgroundColor += ' !important';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!repeatMergedHeader) {\n\t\t\t\t\t\t\t\t\tclonedHeaderCell.setAttribute('rowSpan', columns * headerCount);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tclonedHeaderCell.setAttribute('rowSpan', clonedHeaderCell.getAttribute('colSpan'));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tclonedHeaderCell.setAttribute('colSpan', 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// clear out row color to override row color with cell colors\n\t\t\t\t\t\trowObj.el.style.backgroundColor = '#ffffff00';\n\n\t\t\t\t\t\tfor (let r = 0; r < itemsPerHeader; r += 1) {\n\t\t\t\t\t\t\tif (currentOriginalRow + r >= rows) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// const currentCell = tableObj.appendToRow(currentOriginalRow + r, c, rowObj.id);\n\t\t\t\t\t\t\tconst currentCell = tableObj.getCell(currentOriginalRow + r, c, true);\n\n\t\t\t\t\t\t\tif (currentCell) {\n\t\t\t\t\t\t\t\tcurrentCell.resetAllAttributes();\n\n\t\t\t\t\t\t\t\tlet cellAddStatus = true;\n\n\t\t\t\t\t\t\t\tconst rowSpan = currentCell.getSpan(CellObject.spanTypes.row);\n\t\t\t\t\t\t\t\tconst colSpan = currentCell.getSpan(CellObject.spanTypes.column);\n\n\t\t\t\t\t\t\t\tif (rowSpan > 1 || colSpan > 1) {\n\t\t\t\t\t\t\t\t\tconst remainingItems = itemsPerHeader - r;\n\n\t\t\t\t\t\t\t\t\tconst currentRowSpan = Math.min(rowSpan, remainingItems);\n\n\t\t\t\t\t\t\t\t\tcellAddStatus = currentCell.setSpan(CellObject.spanTypes.row, currentRowSpan);\n\n\t\t\t\t\t\t\t\t\tconst rS = currentCell.el.getAttribute('rowSpan');\n\t\t\t\t\t\t\t\t\tconst cS = currentCell.el.getAttribute('colSpan');\n\n\t\t\t\t\t\t\t\t\t// switch span values\n\t\t\t\t\t\t\t\t\tcurrentCell.setAttribute('rowSpan', cS);\n\t\t\t\t\t\t\t\t\tcurrentCell.setAttribute('colSpan', rS);\n\n\t\t\t\t\t\t\t\t\tcurrentCell.setMergedRenderStatus(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (cellAddStatus) {\n\t\t\t\t\t\t\t\t\t// color index for the cell, this will be used to reflect table row colors to cells. currently, grouping up the same items with the same color code\n\t\t\t\t\t\t\t\t\tlet colorIndex = (currentOriginalRow + r + hc) % 2 === 0 ? 'even' : 'odd';\n\n\t\t\t\t\t\t\t\t\t// for better visuals and distinction for tables with 1 item per header, using this calculation for color index\n\t\t\t\t\t\t\t\t\tif (itemsPerHeader === 1) {\n\t\t\t\t\t\t\t\t\t\tcolorIndex = currentOriginalRow % 2 === 0 ? 'even' : 'odd';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t!currentCell.el.style.backgroundColor ||\n\t\t\t\t\t\t\t\t\t\tisBackgroundTransparent(currentCell.el)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tcurrentCell.setAttribute(\n\t\t\t\t\t\t\t\t\t\t\t'style',\n\t\t\t\t\t\t\t\t\t\t\t`background-color: ${tableObj.rowColors[colorIndex]}`,\n\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ttableObj.appendObjectToRow(currentCell, rowObj.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrentOriginalRow += itemsPerHeader;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Build table in its default form.\n\t\t *\n\t\t * Default form of table is the layout it has in desktop breakpoint.\n\t\t *\n\t\t * @param {TableObject} tableObj table object\n\t\t */\n\t\tthis.buildDefault = (tableObj) => {\n\t\t\tconst rows = tableObj.maxRows();\n\t\t\tconst columns = tableObj.maxColumns();\n\n\t\t\tfor (let r = 0; r < rows; r += 1) {\n\t\t\t\tconst rowId = tableObj.addRow('', true, r).id;\n\t\t\t\tfor (let c = 0; c < columns; c += 1) {\n\t\t\t\t\tconst tempCell = tableObj.getCell(r, c, true);\n\n\t\t\t\t\t// only render cell if a valid cell is found and it is not a reference\n\t\t\t\t\tif (tempCell && !tempCell.isReference()) {\n\t\t\t\t\t\t// reset all modified attributes of cell to their default values\n\t\t\t\t\t\ttempCell.resetAllAttributes();\n\t\t\t\t\t\ttableObj.appendElementToRow(tempCell.getElement(), rowId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Calculate range id for given size value.\n\t\t *\n\t\t * @param {number} val value\n\t\t * @param {Object} stops an object containing stop ids as keys and respective sizes as values\n\t\t * @return {string} range id\n\t\t */\n\t\tthis.calculateRangeId = (val, stops) => {\n\t\t\t// eslint-disable-next-line prefer-destructuring\n\t\t\tconst sortedStops = Object.keys(stops).sort((a, b) => stops[a].width - stops[b].width);\n\n\t\t\tlet rangeId = sortedStops[0];\n\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\tsortedStops.map((s) => {\n\t\t\t\tif (val >= stops[s].width) {\n\t\t\t\t\trangeId = s;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn rangeId;\n\t\t};\n\n\t\t/**\n\t\t * Add html related indicators for responsive operation.\n\t\t *\n\t\t * @param {Node} tableElement target table element\n\t\t * @param {string} breakpointId current breakpoint for responsive process\n\t\t */\n\t\tconst htmlResponsiveIndicators = (tableElement, breakpointId) => {\n\t\t\tif (tableElement && breakpointId) {\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\ttableElement.dataset.wptbBreakpoint = breakpointId;\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Rebuild table according to its responsive directives.\n\t\t *\n\t\t * @private\n\t\t * @param {HTMLElement} el table element\n\t\t * @param {number} size size in pixels\n\t\t * @param {TableObject} tableObj table object instance\n\t\t * @throws An error will be given for invalid mode name\n\t\t */\n\t\tthis.rebuildTable = (el, size, tableObj) => {\n\t\t\tconst directive = this.getDirective(el);\n\n\t\t\tif (directive) {\n\t\t\t\tif (!directive.responsiveEnabled) {\n\t\t\t\t\t// this.buildDefault(tableObj);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst mode = directive.responsiveMode;\n\n\t\t\t\t// main build logic for different responsive modes should be named in the format of `{modeName}Build` to automatically call the associated function from here\n\t\t\t\tconst buildCallable = this[`${mode}Build`];\n\n\t\t\t\tif (!size) {\n\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\tsize = el.getBoundingClientRect().width;\n\t\t\t\t}\n\n\t\t\t\tconst sizeRangeId = this.calculateRangeId(size, directive.breakpoints);\n\n\t\t\t\tif (buildCallable) {\n\t\t\t\t\tconst modeOptions = directive.modeOptions[mode];\n\n\t\t\t\t\t// if current breakpoint is disabled, render default table instead\n\t\t\t\t\tif (modeOptions.disabled && modeOptions.disabled[sizeRangeId]) {\n\t\t\t\t\t\ttableObj.clearTable();\n\t\t\t\t\t\tthis.buildDefault(tableObj);\n\t\t\t\t\t\tthis.removeDefaultClasses(el);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuildCallable.call(this, el, sizeRangeId, modeOptions, tableObj);\n\t\t\t\t\t}\n\n\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\tWPTB_RecalculateIndexes(el);\n\t\t\t\t\tconst tabEvent = new CustomEvent('table:rebuilt', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\tsizeRangeId,\n\t\t\t\t\t\t\ttopRowAsHeader: directive.modeOptions[mode].topRowAsHeader,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tel.dispatchEvent(tabEvent);\n\n\t\t\t\t\t// add html indicators to target table\n\t\t\t\t\thtmlResponsiveIndicators(el, sizeRangeId);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`No build mode named as [${mode}] found.`);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Rebuild tables with the given screen size.\n\t\t *\n\t\t * @param {number} size screen size\n\t\t */\n\t\tthis.rebuildTables = (size) => {\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\tthis.elementObjects.map((o) => {\n\t\t\t\tlet innerSize = size;\n\t\t\t\tif (!size) {\n\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\tinnerSize = window.innerWidth;\n\n\t\t\t\t\tconst directives = this.getDirective(o.el);\n\t\t\t\t\t// calculate size according to relative width directive\n\t\t\t\t\tif (directives && directives.relativeWidth) {\n\t\t\t\t\t\tswitch (directives.relativeWidth) {\n\t\t\t\t\t\t\tcase 'window':\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\t\t\tinnerSize = window.innerWidth;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'container':\n\t\t\t\t\t\t\t\t// get the size of the container table is in\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\t\t\tinnerSize = o.el.parentNode.parentNode.parentNode.clientWidth;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\t\t\tinnerSize = window.innerWidth;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.rebuildTable(o.el, innerSize, o.tableObject);\n\t\t\t});\n\t\t};\n\n\t\tif (this.options.bindToResize) {\n\t\t\tthis.bindRebuildToResize();\n\t\t}\n\n\t\treturn {\n\t\t\trebuildTables: this.rebuildTables,\n\t\t\tgetDirective: this.getDirective,\n\t\t\tcalculateRangeId: this.calculateRangeId,\n\t\t};\n\t}\n\n\treturn ResponsiveFront;\n});\n","/**\n * Attach style pass component to global space.\n */\n(function attachToGlobal(globalKey, context, factory) {\n\t// eslint-disable-next-line no-param-reassign\n\tcontext[globalKey] = factory();\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_StylePass', self || global, function factory() {\n\t/**\n\t * Style pass component\n\t * This component will be used to either let or block theme related styling to affect table styles.\n\t *\n\t * @class\n\t */\n\tfunction StylePass() {\n\t\tthis.options = { stylesheets: {} };\n\n\t\t/**\n\t\t * Maintain the same position of table container and insert shadow root container to exact same index.\n\t\t *\n\t\t * @param {HTMLElement} shadowRootContainer\n\t\t * @param {HTMLElement} tableContainer\n\t\t *\n\t\t */\n\t\tthis.insertShadowRoot = (shadowRootContainer, tableContainer) => {\n\t\t\tconst mainParent = tableContainer.parentNode;\n\t\t\tconst parentChildren = Array.from(mainParent.children);\n\t\t\tconst tableIndex = parentChildren.indexOf(tableContainer);\n\t\t\tconst upSibling = tableIndex - 1 > 0 ? null : parentChildren[tableIndex - 1];\n\t\t\tconst downSibling = tableIndex + 1 >= parentChildren.length ? null : parentChildren[tableIndex + 1];\n\n\t\t\tthis.prepareAllStylesheets(this.options.stylesheets, shadowRootContainer.shadowRoot);\n\t\t\tthis.borrowFromTheme(tableContainer);\n\n\t\t\tshadowRootContainer.shadowRoot.appendChild(tableContainer);\n\n\t\t\tif (upSibling) {\n\t\t\t\tupSibling.insertAdjacentElement('afterend', shadowRootContainer);\n\t\t\t} else if (downSibling) {\n\t\t\t\tdownSibling.insertAdjacentElement('beforebegin', shadowRootContainer);\n\t\t\t} else {\n\t\t\t\tmainParent.appendChild(shadowRootContainer);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Borrow some theme styles and reflect them to table.\n\t\t *\n\t\t * @param {HTMLElement} tableContainer table container element\n\t\t */\n\t\tthis.borrowFromTheme = (tableContainer) => {\n\t\t\tconst table = tableContainer.querySelector('table');\n\t\t\tconst { fontFamily } = getComputedStyle(table);\n\t\t\ttable.style.fontFamily = fontFamily;\n\t\t};\n\n\t\t/**\n\t\t * Initialize and start style pass.\n\t\t *\n\t\t * @param {Object} options style pass options\n\t\t */\n\t\tthis.init = (options) => {\n\t\t\tthis.options = { ...this.options, ...options };\n\t\t\tconst tableContainers = Array.from(document.querySelectorAll('div .wptb-table-container'));\n\n\t\t\tif (tableContainers.length > 0) {\n\t\t\t\ttableContainers.map(this.setupStylePass);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Check if style pass is enabled for current table.\n\t\t *\n\t\t * @param {HTMLElement} tableContainer table container\n\t\t * @return {string} status null for disabled, true for enabled\n\t\t */\n\t\tthis.checkTableEligibility = (tableContainer) => {\n\t\t\tconst table = tableContainer.querySelector('table');\n\t\t\treturn table ? this.options.settings.disableThemeStylesForAll || table.dataset.disableThemeStyles : false;\n\t\t};\n\n\t\t/**\n\t\t * Prepare containers for necessary style pass operations.\n\t\t *\n\t\t * @param {HTMLElement} tableContainer table container\n\t\t */\n\t\tthis.setupStylePass = (tableContainer) => {\n\t\t\t// abort if style pass is not enabled for table\n\t\t\tif (!this.checkTableEligibility(tableContainer)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst container = document.createElement('div');\n\t\t\tcontainer.classList.add('wptb-shadow-root-container');\n\n\t\t\tconst mainTable = tableContainer.querySelector('table');\n\n\t\t\tconst maxWidth = mainTable.dataset.wptbTableContainerMaxWidth;\n\n\t\t\tconst scrollStatus = mainTable.dataset.wptbHorizontalScrollStatus;\n\n\t\t\t// only add max-width to shadow root container if scroll functionality is disabled\n\t\t\tif (maxWidth && !scrollStatus) {\n\t\t\t\tcontainer.style.maxWidth = `${maxWidth}px`;\n\t\t\t}\n\n\t\t\tcontainer.attachShadow({ mode: 'open' });\n\n\t\t\tthis.insertShadowRoot(container, tableContainer);\n\t\t};\n\n\t\tthis.prepareAllStylesheets = (stylesheetsObj, root) => {\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\tObject.keys(stylesheetsObj).map((action) => {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(stylesheetsObj, action)) {\n\t\t\t\t\t// eslint-disable-next-line default-case\n\t\t\t\t\tswitch (action) {\n\t\t\t\t\t\tcase 'create':\n\t\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\t\tObject.keys(stylesheetsObj[action]).map((s) => {\n\t\t\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(stylesheetsObj[action], s)) {\n\t\t\t\t\t\t\t\t\tthis.prepareStylesheet(s, stylesheetsObj[action][s], root);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\t\tstylesheetsObj[action].map((query) => {\n\t\t\t\t\t\t\t\tthis.copyStylesheet(query, root);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Copy a stylesheet to current root.\n\t\t *\n\t\t * @param {string} query query to find stylesheet\n\t\t * @param {HTMLElement} root root\n\t\t */\n\t\tthis.copyStylesheet = (query, root) => {\n\t\t\tconst styleSheet = document.querySelector(query);\n\n\t\t\tif (styleSheet) {\n\t\t\t\troot.appendChild(styleSheet.cloneNode(true));\n\t\t\t}\n\t\t};\n\n\t\tthis.prepareStylesheet = (handler, url, root) => {\n\t\t\tconst linkElement = document.createElement('link');\n\t\t\tlinkElement.setAttribute('id', handler);\n\t\t\tlinkElement.setAttribute('href', url);\n\t\t\tlinkElement.setAttribute('rel', 'stylesheet');\n\t\t\tlinkElement.setAttribute('media', 'all');\n\n\t\t\troot.appendChild(linkElement);\n\t\t};\n\t}\n\n\treturn new StylePass();\n});\n","(function assignToGlobal(key, context, factory) {\n\tif (typeof exports === 'object' && typeof module !== 'undefined') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\tcontext[key] = factory();\n\t}\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_LazyLoad', self || global, () => {\n\t/**\n\t * Lazy load animation.\n\t *\n\t * @param {Object} options options\n\t * @class\n\t */\n\tfunction LazyLoadAnimation(options) {\n\t\t/**\n\t\t * Default options.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tconst defaults = {\n\t\t\tname: '',\n\t\t\tspeed: 8,\n\t\t\tstep: 10,\n\t\t\thooks: {},\n\t\t\tdirection: 'left',\n\t\t\tperspective: 1000,\n\t\t\tflashColor: '#FFFFFF',\n\t\t};\n\n\t\t// merged instance options\n\t\tconst instanceOptions = { ...defaults, ...options };\n\n\t\t/**\n\t\t * Style tag id for custom stylesheet rules.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tconst styleId = 'wptb-lazy-load-styles';\n\n\t\tconst bufferElementClass = 'wptb-lazy-load-buffer-element';\n\t\tconst bufferElementContainerClass = 'wptb-lazy-load-buffer-element-container';\n\n\t\t/**\n\t\t * Get instance related options.\n\t\t *\n\t\t * @return {Object} options\n\t\t */\n\t\tthis.getOptions = () => {\n\t\t\treturn { ...instanceOptions };\n\t\t};\n\n\t\t/**\n\t\t * Calculate animation duration relative to its supplied speed.\n\t\t *\n\t\t * @param {number} min minimum seconds\n\t\t * @param {number} max maximum seconds\n\t\t * @return {number} animation duration\n\t\t */\n\t\tthis.calculateDuration = (min = 0.1, max = 1) => {\n\t\t\treturn Math.max(min, max) - (Math.abs(max - min) / instanceOptions.step) * instanceOptions.speed;\n\t\t};\n\n\t\t/**\n\t\t * Calculate animation direction axis.\n\t\t *\n\t\t * @param {boolean} invert whether to invert axis\n\t\t *\n\t\t * @return {string} axis name\n\t\t */\n\t\tthis.calculateAnimationDirection = (invert = false) => {\n\t\t\tconst xAxis = ['left', 'right'];\n\t\t\tconst names = ['X', 'Y'];\n\t\t\tconst indexConstant = invert ? 1 : 0;\n\n\t\t\treturn xAxis.includes(instanceOptions.direction)\n\t\t\t\t? names[(0 + indexConstant) % 2]\n\t\t\t\t: names[(1 + indexConstant) % 2];\n\t\t};\n\n\t\t/**\n\t\t * Calculate a direction constant.\n\t\t *\n\t\t * @param {boolean} invert whether to invert constant\n\t\t *\n\t\t * @return {number} direction constant\n\t\t */\n\t\tthis.calculateDirectionConstant = (invert = false) => {\n\t\t\tconst positiveConstant = ['left', 'up'];\n\t\t\treturn (invert ? -1 : 1) * (positiveConstant.includes(this.getOptions().direction) ? 1 : -1);\n\t\t};\n\n\t\t/**\n\t\t * Get supplied user hook.\n\t\t *\n\t\t * @param {string} key hook name\n\t\t * @return {null | Function} user hook function\n\t\t */\n\t\tconst getHook = (key) => {\n\t\t\tif (Object.prototype.hasOwnProperty.call(instanceOptions.hooks, key)) {\n\t\t\t\tconst userHook = instanceOptions.hooks[key];\n\t\t\t\tif (typeof userHook === 'function') {\n\t\t\t\t\treturn userHook;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\t/**\n\t\t * Call supplied user hook.\n\t\t *\n\t\t * @param {string} hookName hook name\n\t\t * @param {any} args arguments to call hook\n\t\t */\n\t\tconst callHook = (hookName, ...args) => {\n\t\t\tconst userHook = getHook(hookName);\n\t\t\tif (userHook) {\n\t\t\t\tuserHook.apply(this, args);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Delete instance.\n\t\t */\n\t\tconst cleanUp = () => {\n\t\t\tdelete this;\n\t\t};\n\n\t\t/**\n\t\t * Get buffer element.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t * @return {null | HTMLElement} buffer element\n\t\t */\n\t\tthis.getBufferElement = (imgElement) => {\n\t\t\tconst { parentNode } = imgElement;\n\t\t\treturn parentNode.querySelector(`.${bufferElementClass}`);\n\t\t};\n\n\t\t/**\n\t\t * Remove buffer element and associated options.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t */\n\t\tthis.removeBufferElement = (imgElement) => {\n\t\t\tconst bufferElement = this.getBufferElement(imgElement);\n\t\t\tif (bufferElement) {\n\t\t\t\tconst { parentNode } = bufferElement;\n\t\t\t\tparentNode.removeChild(bufferElement);\n\t\t\t\tparentNode.classList.remove(bufferElementContainerClass);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Add style element to document head.\n\t\t *\n\t\t * @param {string} content style content\n\t\t * @param {HTMLDocument} contentRoot content root\n\t\t */\n\t\tthis.addStylesheet = (content, contentRoot) => {\n\t\t\tlet lazyloadStyleSheet = contentRoot.querySelector(`style[id=\"${styleId}\"]`);\n\n\t\t\tif (!lazyloadStyleSheet) {\n\t\t\t\tlazyloadStyleSheet = contentRoot.createElement('style');\n\t\t\t\tlazyloadStyleSheet.id = styleId;\n\t\t\t\tlazyloadStyleSheet.type = 'text/css';\n\n\t\t\t\tcontentRoot.head.appendChild(lazyloadStyleSheet);\n\t\t\t}\n\n\t\t\tconst styleRules = document.createTextNode(content);\n\t\t\tlazyloadStyleSheet.innerHTML = '';\n\t\t\tlazyloadStyleSheet.appendChild(styleRules);\n\t\t};\n\n\t\t/**\n\t\t * Before animation base lifecycle hook.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t */\n\t\tthis.beforeAnimation = (imgElement) => {\n\t\t\tcallHook('beforeAnimation', imgElement);\n\t\t};\n\n\t\t/**\n\t\t * Animate element.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t */\n\t\tthis.animate = (imgElement) => {\n\t\t\tcallHook('animate', imgElement);\n\t\t};\n\n\t\t/**\n\t\t * After animation processes and cleanup.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t */\n\t\tthis.afterAnimation = (imgElement) => {\n\t\t\tcallHook('afterAnimation', imgElement);\n\t\t\tcleanUp();\n\t\t};\n\t}\n\n\t/**\n\t * Factory for lazy load animations.\n\t *\n\t * @param {Object} options factory options\n\t * @class\n\t */\n\tfunction LazyLoadAnimationFactory(options) {\n\t\tthis.getAnimation = (animationName, extraOptions = {}) => {\n\t\t\tif (options[animationName]) {\n\t\t\t\treturn new LazyLoadAnimation({ ...options[animationName], ...extraOptions });\n\t\t\t}\n\n\t\t\treturn new LazyLoadAnimation({});\n\t\t};\n\t}\n\n\t/**\n\t * Options for animation factory\n\t *\n\t * @type {Object}\n\t */\n\tconst factoryOptions = {\n\t\t/* eslint-disable no-param-reassign */\n\t\tnone: {\n\t\t\thooks: {\n\t\t\t\tanimate(imageElement) {\n\t\t\t\t\tthis.removeBufferElement(imageElement);\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tslideIn: {\n\t\t\thooks: {\n\t\t\t\tbeforeAnimation(imageElement) {\n\t\t\t\t\timageElement.parentNode.style.overflow = 'hidden';\n\n\t\t\t\t\timageElement.style.transform = `translate${this.calculateAnimationDirection()}(${\n\t\t\t\t\t\tthis.calculateDirectionConstant() * 100\n\t\t\t\t\t}%)`;\n\t\t\t\t},\n\t\t\t\tanimate(imageElement) {\n\t\t\t\t\tthis.removeBufferElement(imageElement);\n\t\t\t\t\timageElement.style.transition = `transform ${this.calculateDuration()}s ease-out`;\n\t\t\t\t\timageElement.style.transform = `translate${this.calculateAnimationDirection()}(0)`;\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tgrowSling: {\n\t\t\thooks: {\n\t\t\t\tbeforeAnimation(imageElement) {\n\t\t\t\t\timageElement.style.transform = 'scale(0.1)';\n\t\t\t\t},\n\t\t\t\tanimate(imageElement) {\n\t\t\t\t\tthis.removeBufferElement(imageElement);\n\t\t\t\t\timageElement.style.transition = `transform ${this.calculateDuration()}s cubic-bezier(0.68, -0.55, 0.27, 1.55)`;\n\t\t\t\t\timageElement.style.transform = 'scale(1)';\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tflash: {\n\t\t\thooks: {\n\t\t\t\tbeforeAnimation(imageElement) {\n\t\t\t\t\tconst flashElement = document.createElement('div');\n\t\t\t\t\tflashElement.classList.add('wptb-flash-element');\n\n\t\t\t\t\timageElement.parentNode.classList.add('wptb-lazy-load-buffer-element-container');\n\t\t\t\t\timageElement.insertAdjacentElement('afterend', flashElement);\n\n\t\t\t\t\tconst flashStyle = `@keyframes wptb-flash {0% {opacity:1;}100% {opacity: 0;}} .wptb-flash-element {position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; background-color: ${\n\t\t\t\t\t\tthis.getOptions().flashColor\n\t\t\t\t\t}}.wptb-flash-animation {animation: wptb-flash ${this.calculateDuration()}s forwards ease-out}`;\n\t\t\t\t\tthis.addStylesheet(flashStyle, imageElement.ownerDocument);\n\t\t\t\t},\n\t\t\t\tanimate(imageElement) {\n\t\t\t\t\tthis.removeBufferElement(imageElement);\n\t\t\t\t\tconst flashElement = imageElement.parentNode.querySelector('.wptb-flash-element');\n\t\t\t\t\tif (flashElement) {\n\t\t\t\t\t\timageElement.parentNode.classList.add('wptb-lazy-load-buffer-element-container');\n\n\t\t\t\t\t\tflashElement.addEventListener('animationend', (e) => {\n\t\t\t\t\t\t\tif (e.animationName === 'wptb-flash') {\n\t\t\t\t\t\t\t\timageElement.parentNode.classList.remove('wptb-lazy-load-buffer-element-container');\n\t\t\t\t\t\t\t\tflashElement.remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tflashElement.classList.add('wptb-flash-animation');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tflip: {\n\t\t\thooks: {\n\t\t\t\tbeforeAnimation(imageElement) {\n\t\t\t\t\tconst parentWrapper = imageElement.parentNode;\n\t\t\t\t\tparentWrapper.classList.add('wptb-lazy-load-card-container');\n\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\tparentWrapper.parentNode?.classList.add('wptb-lazy-load-perspective-base');\n\n\t\t\t\t\timageElement.classList.add('wptb-lazy-load-card-back', 'wptb-lazy-load-hidden-backface');\n\n\t\t\t\t\tthis.getBufferElement(imageElement).classList.add(\n\t\t\t\t\t\t'wptb-lazy-load-hidden-backface',\n\t\t\t\t\t\t'wptb-lazy-load-card-front'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst animationDirection = this.calculateAnimationDirection(true);\n\t\t\t\t\tconst rotationAmount = `${this.calculateDirectionConstant(true) * 180}deg`;\n\n\t\t\t\t\tconst styles = `.wptb-lazy-load-perspective-base{perspective: ${\n\t\t\t\t\t\tthis.getOptions().perspective\n\t\t\t\t\t}px;} .wptb-lazy-load-card-container{ transform-style: preserve-3d; transition: transform ${this.calculateDuration()}s ease-out; } .wptb-lazy-load-card-container[data-wptb-card-flip='true']{transform: rotate${animationDirection}(${rotationAmount})} [data-wptb-card-flip='true'] .wptb-lazy-load-card-front svg{ animation: none !important; opacity: 0.2;} .wptb-lazy-load-card-back { transform: rotate${animationDirection}(${rotationAmount})} .wptb-lazy-load-hidden-backface{backface-visibility: hidden;}`;\n\t\t\t\t\tthis.addStylesheet(styles, imageElement.ownerDocument);\n\t\t\t\t},\n\t\t\t\tanimate(imageElement) {\n\t\t\t\t\tconst parentWrapper = imageElement.parentNode;\n\t\t\t\t\tparentWrapper.addEventListener('transitionend', (e) => {\n\t\t\t\t\t\tif (e.propertyName === 'transform') {\n\t\t\t\t\t\t\tthis.removeBufferElement(imageElement);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparentWrapper.classList.remove('wptb-lazy-load-card-container', 'wptb-lazy-load-flip');\n\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\t\tparentWrapper.parentNode.classList.remove('wptb-lazy-load-perspective-base');\n\n\t\t\t\t\t\timageElement.classList.remove('wptb-lazy-load-card-back', 'wptb-lazy-load-hidden-backface');\n\t\t\t\t\t});\n\n\t\t\t\t\tparentWrapper.dataset.wptbCardFlip = 'true';\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t/* eslint-enable no-param-reassign */\n\t};\n\n\t/**\n\t * WPTB Lazy load functionality module.\n\t *\n\t * @class\n\t */\n\t// eslint-disable-next-line camelcase\n\tfunction WPTB_LazyLoad() {\n\t\t/**\n\t\t * Lazy load default options.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tconst defaultOptions = {\n\t\t\t// this mode will be used to manually load image elements\n\t\t\tforceMode: false,\n\t\t};\n\n\t\t/**\n\t\t * Lazy load instance options.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tlet options = {};\n\n\t\t/**\n\t\t * Scroll related cached data.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tconst cachedScrollData = {\n\t\t\tlastYPosition: 0,\n\t\t};\n\n\t\t/**\n\t\t * All available table image elements.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tconst allImages = [];\n\n\t\tconst bufferElementClass = 'wptb-lazy-load-buffer-element';\n\t\tconst bufferElementContainerClass = 'wptb-lazy-load-buffer-element-container';\n\n\t\tconst animationFactory = new LazyLoadAnimationFactory(factoryOptions);\n\n\t\t/**\n\t\t * Whether user scrolling down or up.\n\t\t *\n\t\t * @return {boolean} scrolling down or up\n\t\t */\n\t\tconst isGoingDown = () => {\n\t\t\treturn window.scrollY - cachedScrollData.lastYPosition >= 0;\n\t\t};\n\n\t\tlet animation = null;\n\n\t\t/**\n\t\t * Calculate visibility of image element depending on current position of page.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t * @param {number} currentYPos current position of page\n\t\t *\n\t\t * @return {boolean} is element visible or not\n\t\t */\n\t\tconst isElementVisible = (imgElement, currentYPos) => {\n\t\t\t// check position data of parent node instead of image element since a transformation affecting Y position of element might occurred\n\t\t\tconst { top, height, bottom } = imgElement.parentNode.getBoundingClientRect();\n\t\t\tconst { visibilityPercentage } = options;\n\n\t\t\tconst visibilityRangeTop = top + height * (visibilityPercentage / 100);\n\t\t\tconst visibilityRangeBottom = bottom - height * (visibilityPercentage / 100);\n\n\t\t\tconst visibilityVariable = isGoingDown() ? visibilityRangeTop : visibilityRangeBottom;\n\n\t\t\treturn visibilityVariable >= 0 && visibilityVariable <= currentYPos;\n\t\t};\n\n\t\t/**\n\t\t * Add a buffer element and associated options to image container.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t */\n\t\tconst addBufferElement = (imgElement) => {\n\t\t\tconst bufferElement = document.createElement('div');\n\t\t\tbufferElement.classList.add(bufferElementClass);\n\n\t\t\t// assign color to buffer element\n\t\t\tbufferElement.style.backgroundColor = options.backgroundColor;\n\n\t\t\tif (options.iconSvg) {\n\t\t\t\tbufferElement.innerHTML = `
${options.iconSvg}
`;\n\n\t\t\t\tconst svgIcon = bufferElement.querySelector('svg');\n\t\t\t\tconst iconWrapper = bufferElement.querySelector('.wptb-lazy-load-buffer-icon-wrapper');\n\n\t\t\t\t// assign icon size\n\t\t\t\ticonWrapper.style.width = `${options.iconSize}px`;\n\t\t\t\ticonWrapper.style.height = `${options.iconSize}px`;\n\n\t\t\t\t// assign icon animation related settings\n\t\t\t\ticonWrapper.dataset.wptbLazyLoadIconAnimation = options.iconAnimation;\n\n\t\t\t\tif (svgIcon) {\n\t\t\t\t\t// assign icon color\n\t\t\t\t\tsvgIcon.style.fill = options.iconColor;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// insert buffer element adjacent to image element\n\t\t\timgElement.insertAdjacentElement('afterend', bufferElement);\n\n\t\t\timgElement.parentNode.classList.add(bufferElementContainerClass);\n\n\t\t\tanimation.beforeAnimation(imgElement);\n\t\t};\n\n\t\t/**\n\t\t * Function to call when image element is loaded.\n\t\t *\n\t\t * @param {Object} e event\n\t\t */\n\t\tconst imageElementLoadCallback = (e) => {\n\t\t\tconst imageElement = e.target;\n\n\t\t\tanimation.animate(imageElement);\n\n\t\t\timageElement.removeEventListener('load', imageElementLoadCallback);\n\n\t\t\tanimation.afterAnimation(imageElement);\n\t\t};\n\n\t\t/**\n\t\t * Process image element for visibility.\n\t\t *\n\t\t * @param {HTMLElement} imgElement image element\n\t\t * @param {number} currentYPos current position of page\n\t\t */\n\t\tconst processIndividualImageElement = (imgElement, currentYPos) => {\n\t\t\tif (options.forceMode || isElementVisible(imgElement, currentYPos)) {\n\t\t\t\tconst delayCallback = () => {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\timageElementLoadCallback({ target: imgElement });\n\t\t\t\t\t}, options.delay * 1000);\n\t\t\t\t};\n\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\timgElement.dataset.wptbLazyLoadStatus = 'true';\n\n\t\t\t\timgElement.addEventListener('load', options.delay ? delayCallback : imageElementLoadCallback);\n\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\timgElement.src = imgElement.dataset.wptbLazyLoadTarget;\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Update cached last scroll position.\n\t\t *\n\t\t * @param {number} position y position\n\t\t */\n\t\tconst updateLastScrollY = (position) => {\n\t\t\tcachedScrollData.lastYPosition = position;\n\t\t};\n\n\t\t/**\n\t\t * Process array of image elements for visibility.\n\t\t *\n\t\t * @param {Array} imgElements image elements array\n\t\t * @param {number} currentYPos current position of page\n\t\t * @param {boolean} firstTimeProcess whether process is run for the first time or not\n\t\t * @param {boolean} forceLoad whether to force load images or not with force mode enabled\n\t\t */\n\t\tconst processImageElements = (imgElements, currentYPos, firstTimeProcess = false, forceLoad = false) => {\n\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\timgElements\n\t\t\t\t.filter((element) => {\n\t\t\t\t\treturn element.dataset.wptbLazyLoadStatus === 'false';\n\t\t\t\t})\n\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t.map((img) => {\n\t\t\t\t\t// updateBackgroundColor(img);\n\n\t\t\t\t\tif (firstTimeProcess) {\n\t\t\t\t\t\taddBufferElement(img);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!options.forceMode || forceLoad) {\n\t\t\t\t\t\tprocessIndividualImageElement(img, currentYPos);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\tupdateLastScrollY(window.scrollY);\n\t\t};\n\n\t\t/**\n\t\t * Get window current y position.\n\t\t *\n\t\t * @return {number} y position\n\t\t */\n\t\tconst windowCurrentYPosition = () => {\n\t\t\treturn window.innerHeight;\n\t\t};\n\n\t\t/**\n\t\t * Get all image elements inside table.\n\t\t *\n\t\t * @param {Array} allTables table array\n\t\t * @return {Array} table image elements\n\t\t */\n\t\tconst getAllTableImages = (allTables) => {\n\t\t\treturn allTables.reduce((carry, tableElement) => {\n\t\t\t\tconst images = Array.from(tableElement.querySelectorAll('.wptb-lazy-load-img'));\n\t\t\t\tcarry.push(...images);\n\t\t\t\treturn carry;\n\t\t\t}, []);\n\t\t};\n\n\t\t/**\n\t\t * Assign lazy load functionality to table elements.\n\t\t */\n\t\tconst assignLazyLoadToElements = () => {\n\t\t\tconst tables = Array.from(document.querySelectorAll('.wptb-preview-table'));\n\n\t\t\t// tables under shadow roots\n\t\t\tconst shadowTables = Array.from(document.querySelectorAll('.wptb-shadow-root-container')).reduce(\n\t\t\t\t(carry, shadowRootContainer) => {\n\t\t\t\t\tconst table = shadowRootContainer.shadowRoot.querySelector('.wptb-preview-table');\n\t\t\t\t\tif (table) {\n\t\t\t\t\t\tcarry.push(table);\n\t\t\t\t\t}\n\t\t\t\t\treturn carry;\n\t\t\t\t},\n\t\t\t\t[]\n\t\t\t);\n\n\t\t\tconst allTables = [...tables, ...shadowTables];\n\t\t\tallImages.push(...getAllTableImages(allTables));\n\n\t\t\t// process image elements on window load\n\t\t\tprocessImageElements(allImages, windowCurrentYPosition(), true);\n\n\t\t\t// only bind to scroll event if force mode is not enabled\n\t\t\tif (!options.forceMode) {\n\t\t\t\t// eslint-disable-next-line @wordpress/no-global-event-listener\n\t\t\t\twindow.addEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\t() => {\n\t\t\t\t\t\tprocessImageElements(allImages, windowCurrentYPosition());\n\t\t\t\t\t},\n\t\t\t\t\t{ passive: true }\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Force load all images.\n\t\t */\n\t\tthis.forceLoadImages = () => {\n\t\t\tprocessImageElements(allImages, null, false, true);\n\t\t};\n\n\t\t/**\n\t\t * Initialize lazy load.\n\t\t *\n\t\t * @param {Object} initOptions options object\n\t\t */\n\t\tthis.init = (initOptions) => {\n\t\t\tif (initOptions && typeof initOptions === 'object') {\n\t\t\t\toptions = { ...defaultOptions, ...initOptions };\n\n\t\t\t\tif (options.enabled) {\n\t\t\t\t\tanimation = animationFactory.getAnimation(options.imageLoadAnimation, {\n\t\t\t\t\t\tspeed: options.imageLoadAnimationSpeed,\n\t\t\t\t\t\tdirection: options.imageLoadAnimationDirection,\n\t\t\t\t\t\tperspective: options.imageLoadAnimationPerspective,\n\t\t\t\t\t\t...options,\n\t\t\t\t\t});\n\t\t\t\t\tassignLazyLoadToElements();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// eslint-disable-next-line camelcase\n\treturn new WPTB_LazyLoad();\n});\n","/* eslint-disable camelcase */\n(function assignToGlobal(key, context, factory) {\n\tcontext[key] = factory();\n\t// eslint-disable-next-line no-restricted-globals\n})('WPTB_ScrollManager', self || global, () => {\n\t/**\n\t * Scroll manager for WPTB.\n\t *\n\t * @param {Object} scrollOptions options\n\t * @class\n\t */\n\tfunction WPTB_ScrollManager(scrollOptions) {\n\t\tconst { frontendCalculationStatus } = scrollOptions;\n\n\t\t/**\n\t\t * Prepare tables for scroll functionality.\n\t\t *\n\t\t * @param {Node} tableElement table element\n\t\t */\n\t\tconst prepareTableForScroll = (tableElement) => {\n\t\t\tconst mainContainer = tableElement.parentNode.parentNode;\n\t\t\tconst matrixContainer = tableElement.parentNode;\n\n\t\t\tmainContainer.dataset.wptbHorizontalScrollStatus = 'true';\n\t\t\tconst storedMaxWidth = mainContainer.style.maxWidth;\n\t\t\tmainContainer.style.maxWidth = '';\n\n\t\t\tmatrixContainer.style.width = storedMaxWidth;\n\t\t};\n\n\t\t/**\n\t\t * Initialize scroll manager processes.\n\t\t */\n\t\tthis.init = () => {\n\t\t\tconst tableElements = Array.from(document.querySelectorAll('table[data-wptb-horizontal-scroll-status]'));\n\n\t\t\t// only start preparing tables for scroll functionality if backend didn't\n\t\t\t// main factor for that is if server didn't implement `mb_convert_encoding` function\n\t\t\tif (frontendCalculationStatus) {\n\t\t\t\ttableElements.map(prepareTableForScroll);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * @module WPTB_ScrollManager\n\t */\n\treturn WPTB_ScrollManager;\n});\n","document.addEventListener('DOMContentLoaded', function () {\n\tconst tableContainers = document.getElementsByClassName('wptb-table-container');\n\n\t/**\n\t * Adds hover color change support for supported button elements.\n\t *\n\t * @param {string} querySelector query selector string\n\t */\n\tfunction addHoverSupport(querySelector) {\n\t\tconst buttons = Array.from(document.querySelectorAll(querySelector));\n\n\t\t// eslint-disable-next-line array-callback-return\n\t\tbuttons.map((b) => {\n\t\t\tb.addEventListener('mouseenter', (e) => {\n\t\t\t\tconst el = e.target;\n\t\t\t\t// hover background-color\n\t\t\t\tif (el.dataset.wptbElementHoverBgColor) {\n\t\t\t\t\tel.style.backgroundColor = el.dataset.wptbElementHoverBgColor;\n\t\t\t\t}\n\t\t\t\t// hover color\n\t\t\t\tif (el.dataset.wptbElementHoverTextColor) {\n\t\t\t\t\tel.style.color = el.dataset.wptbElementHoverTextColor;\n\t\t\t\t}\n\t\t\t\t// hover scale\n\t\t\t\tif (el.dataset.wptbElementHoverScale) {\n\t\t\t\t\tel.style.transform = `scale(${b.dataset.wptbElementHoverScale})`;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tb.addEventListener('mouseleave', (e) => {\n\t\t\t\t// reset all supported hover properties to their default value\n\t\t\t\tconst el = e.target;\n\t\t\t\tif (el.dataset.wptbElementHoverBgColor) {\n\t\t\t\t\tel.style.backgroundColor = el.dataset.wptbElementBgColor;\n\t\t\t\t}\n\t\t\t\tif (el.dataset.wptbElementHoverTextColor) {\n\t\t\t\t\tel.style.color = el.dataset.wptbElementColor;\n\t\t\t\t}\n\t\t\t\tif (el.dataset.wptbElementHoverScale) {\n\t\t\t\t\tel.style.transform = 'scale(1)';\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// add all kind of functions that have event listeners before responsive table reconstruction to make sure those event listeners are carried over to their clones\n\taddHoverSupport('.wptb-preview-table .wptb-button');\n\n\twptb_tdDefaultWidth();\n\twptb_tableReconstraction();\n\n\tfunction wptb_tableReconstraction() {\n\t\tfor (let i = 0; i < tableContainers.length; i++) {\n\t\t\tconst tableContainer = tableContainers[i];\n\n\t\t\t// Set default indicator of creating a new table in true\n\t\t\tlet createNewTableIndic = true;\n\n\t\t\tlet previewTable = tableContainer.getElementsByClassName('wptb-preview-table');\n\t\t\tlet tableContainerMatrix = tableContainer.getElementsByClassName('wptb-table-container-matrix');\n\n\t\t\tif (previewTable.length > 0 && tableContainerMatrix.length > 0) {\n\t\t\t\tpreviewTable = previewTable[0];\n\t\t\t\ttableContainerMatrix = tableContainerMatrix[0];\n\t\t\t\tpreviewTable.style.display = 'table';\n\n\t\t\t\tif (previewTable.dataset.wptbTableAlignment) {\n\t\t\t\t\tconst { wptbTableAlignment } = previewTable.dataset;\n\n\t\t\t\t\tconst wptbTableContainerWidth = tableContainer.offsetWidth;\n\t\t\t\t\tif (wptbTableContainerWidth < previewTable.offsetWidth) {\n\t\t\t\t\t\tpreviewTable.style.float = null;\n\t\t\t\t\t} else if (wptbTableAlignment == 'center') {\n\t\t\t\t\t\tpreviewTable.style.float = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpreviewTable.style.float = wptbTableAlignment;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (wptbTableAlignment == 'center') {\n\t\t\t\t\t\ttableContainer.style.float = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttableContainer.style.float = wptbTableAlignment;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// check data parametrs reconstraction and wptbAdaptiveTable if they are both equal 1 then continue\n\t\t\t\tif (previewTable.dataset.reconstraction == 1 && previewTable.dataset.wptbAdaptiveTable == 1) {\n\t\t\t\t\t// get widths for wptb-table-container and wptb-preview-table\n\t\t\t\t\tconst tableContainerWidth = tableContainer.offsetWidth;\n\t\t\t\t\tconst previewTableWidth = previewTable.offsetWidth;\n\n\t\t\t\t\t// get count of table columns\n\t\t\t\t\tlet tableColumns;\n\t\t\t\t\tconst previewTableRows = previewTable.rows;\n\t\t\t\t\tif (previewTableRows.length > 0) {\n\t\t\t\t\t\tconst firstRow = previewTableRows[0];\n\t\t\t\t\t\tconst tdsRow = firstRow.querySelectorAll('td');\n\n\t\t\t\t\t\ttableColumns = tdsRow.length;\n\t\t\t\t\t}\n\n\t\t\t\t\t// check the top line if it is presented as a title\n\t\t\t\t\tconst tablePreviewHeadIndic = previewTable.classList.contains('wptb-table-preview-head');\n\n\t\t\t\t\t// check conditions: if table top row is as \"header\" - table must have more that two columns,\n\t\t\t\t\t// otherwise table must have more taht one columns\n\t\t\t\t\tlet tableReconstructed = false;\n\t\t\t\t\tlet wptbPreviewTableMobile;\n\t\t\t\t\tif ((!tablePreviewHeadIndic || tableColumns > 2) && tableColumns > 1) {\n\t\t\t\t\t\t// if width of wptb-table-container less then width of wptb-preview-table -\n\t\t\t\t\t\t// continue the way creation new mobile table\n\t\t\t\t\t\tif (tableContainerWidth < previewTableWidth) {\n\t\t\t\t\t\t\ttableContainer.style.overflow = 'unset';\n\n\t\t\t\t\t\t\t// hide wptb-table-container-matrix\n\t\t\t\t\t\t\tif (tableContainerMatrix && !tableContainerMatrix.classList.contains('wptb-matrix-hide')) {\n\t\t\t\t\t\t\t\ttableContainerMatrix.classList.add('wptb-matrix-hide');\n\t\t\t\t\t\t\t\ttableReconstructed = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpreviewTable.classList.add('wptb-mobile-view-active');\n\n\t\t\t\t\t\t\tif (previewTable.rows && tableColumns) {\n\t\t\t\t\t\t\t\t// we get the estimated cell width\n\t\t\t\t\t\t\t\tconst tdWidth = previewTableWidth / tableColumns;\n\n\t\t\t\t\t\t\t\t// get the quantity of whole Columns that are can placed in the container\n\t\t\t\t\t\t\t\tlet wholeColumnsInContainer = Math.floor(tableContainerWidth / tdWidth);\n\t\t\t\t\t\t\t\tif (wholeColumnsInContainer < 1) wholeColumnsInContainer = 1;\n\n\t\t\t\t\t\t\t\t// check for the existence of a mobile table\n\t\t\t\t\t\t\t\t// if it available, check this table for compliance\n\t\t\t\t\t\t\t\t// with our conditions. If it compliance, remain this table\n\t\t\t\t\t\t\t\t// and cancel creating a new table ( createNewTableIndic = false ).\n\t\t\t\t\t\t\t\tif (tableContainer.getElementsByClassName('wptb-preview-table-mobile').length > 0) {\n\t\t\t\t\t\t\t\t\twptbPreviewTableMobile = tableContainer.getElementsByClassName(\n\t\t\t\t\t\t\t\t\t\t'wptb-preview-table-mobile'\n\t\t\t\t\t\t\t\t\t)[0];\n\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.classList.remove('wptb-mobile-hide');\n\t\t\t\t\t\t\t\t\tconst dataWholeColumnInContainer =\n\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.dataset.wholeColumnsInContainer;\n\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tdataWholeColumnInContainer == wholeColumnsInContainer &&\n\t\t\t\t\t\t\t\t\t\tpreviewTable.classList.contains('wptb-table-preview-head')\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tcreateNewTableIndic = false;\n\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\tdataWholeColumnInContainer == wholeColumnsInContainer &&\n\t\t\t\t\t\t\t\t\t\t!previewTable.classList.contains('wptb-table-preview-head') &&\n\t\t\t\t\t\t\t\t\t\t(tableContainerWidth > 480 || wptbPreviewTableMobile.column == 1)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tcreateNewTableIndic = false;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.parentNode.removeChild(wptbPreviewTableMobile);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// if indicator of creating of table \"true\" - continue\n\t\t\t\t\t\t\t\tif (createNewTableIndic) {\n\t\t\t\t\t\t\t\t\t// create new table for mobile devices\n\t\t\t\t\t\t\t\t\tconst newTable = document.createElement('table');\n\t\t\t\t\t\t\t\t\tconst newTableTbody = document.createElement('tbody');\n\t\t\t\t\t\t\t\t\tnewTable.appendChild(newTableTbody);\n\n\t\t\t\t\t\t\t\t\t// add css class for new mobile table\n\t\t\t\t\t\t\t\t\tnewTable.classList.add('wptb-preview-table-mobile');\n\t\t\t\t\t\t\t\t\tconst infArr = previewTable.className.match(/wptb-element-main(.+)-(\\d+)/i);\n\t\t\t\t\t\t\t\t\tif (infArr && Array.isArray(infArr)) {\n\t\t\t\t\t\t\t\t\t\tnewTable.classList.add(infArr[0]);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// get number of rows for wptb-preview-table\n\t\t\t\t\t\t\t\t\tconst tableRows = previewTable.rows.length;\n\n\t\t\t\t\t\t\t\t\t// In this variable must have quantity columns of the last section of the new table\n\t\t\t\t\t\t\t\t\tlet newTableLastSectionFilledColumns;\n\n\t\t\t\t\t\t\t\t\t// set valuesIsSaved in 'false'\n\t\t\t\t\t\t\t\t\t// if the parameters newTableLastSectionFilledColumns get\n\t\t\t\t\t\t\t\t\t// optimal values, valuesIsSaved must have value 'true'\n\t\t\t\t\t\t\t\t\tlet valuesIsSaved = false;\n\n\t\t\t\t\t\t\t\t\t// check if top row is as \"header\"\n\t\t\t\t\t\t\t\t\tif (previewTable.classList.contains('wptb-table-preview-head')) {\n\t\t\t\t\t\t\t\t\t\t// quantity rows without top row\n\t\t\t\t\t\t\t\t\t\tconst tableRowsWithoutHeader = tableRows - 1;\n\n\t\t\t\t\t\t\t\t\t\t// this variable will have quantity columns in new mobile table\n\t\t\t\t\t\t\t\t\t\tlet newTableColumnsWithoutLeftHeader;\n\n\t\t\t\t\t\t\t\t\t\t// if quantity of rows in desktop table more than\n\t\t\t\t\t\t\t\t\t\t// quantity whole columns which are can placed in the container,\n\t\t\t\t\t\t\t\t\t\t// execute \"loop for\"\n\t\t\t\t\t\t\t\t\t\tif (tableRows > wholeColumnsInContainer) {\n\t\t\t\t\t\t\t\t\t\t\t// this code, сyclical reduces the number of columns in the new table,\n\t\t\t\t\t\t\t\t\t\t\t// until the optimal view is obtained so that the last block of the new table\n\t\t\t\t\t\t\t\t\t\t\t// has more than half the columns compared to the previous blocks\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < tableRowsWithoutHeader; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader = wholeColumnsInContainer - 1 - i;\n\t\t\t\t\t\t\t\t\t\t\t\tif (newTableColumnsWithoutLeftHeader <= 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader = 1;\n\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns =\n\t\t\t\t\t\t\t\t\t\t\t\t\ttableRowsWithoutHeader % newTableColumnsWithoutLeftHeader;\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (newTableLastSectionFilledColumns == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader <= 6 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t2 * newTableLastSectionFilledColumns <\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns < newTableColumnsWithoutLeftHeader\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader > 6 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader <= 12 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1.8 * newTableLastSectionFilledColumns <\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns < newTableColumnsWithoutLeftHeader\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader > 12 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader <= 18 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1.6 * newTableLastSectionFilledColumns <\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns < newTableColumnsWithoutLeftHeader\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnewTableColumnsWithoutLeftHeader = tableRowsWithoutHeader;\n\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns = 0;\n\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// if all necessary values ​​are available ( ), execute\n\t\t\t\t\t\t\t\t\t\tif (valuesIsSaved) {\n\t\t\t\t\t\t\t\t\t\t\tlet countRows;\n\t\t\t\t\t\t\t\t\t\t\tif (newTableColumnsWithoutLeftHeader > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tcountRows =\n\t\t\t\t\t\t\t\t\t\t\t\t\ttableColumns *\n\t\t\t\t\t\t\t\t\t\t\t\t\tMath.ceil(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttableRowsWithoutHeader / newTableColumnsWithoutLeftHeader\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tcountRows = tableColumns;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tconst sectionNumberLast = Math.floor((countRows - 1) / tableColumns);\n\t\t\t\t\t\t\t\t\t\t\tlet tdStyles;\n\t\t\t\t\t\t\t\t\t\t\tfor (let j = 0; j < countRows; j++) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst sectionNumber = Math.floor(j / tableColumns);\n\t\t\t\t\t\t\t\t\t\t\t\tconst tr = document.createElement('tr');\n\t\t\t\t\t\t\t\t\t\t\t\tconst tdLeftHeader = previewTable.rows[0].children[\n\t\t\t\t\t\t\t\t\t\t\t\t\tj - sectionNumber * tableColumns\n\t\t\t\t\t\t\t\t\t\t\t\t].cloneNode(true);\n\t\t\t\t\t\t\t\t\t\t\t\tlet td;\n\t\t\t\t\t\t\t\t\t\t\t\tconst rowFirstStyles = window.getComputedStyle(previewTable.rows[0]);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!tdLeftHeader.style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.backgroundColor = rowFirstStyles.backgroundColor;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.width = null;\n\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.height = null;\n\t\t\t\t\t\t\t\t\t\t\t\t// tdLeftHeader.removeAttribute('data-x-index');\n\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.removeAttribute('data-wptb-css-td-auto-width');\n\t\t\t\t\t\t\t\t\t\t\t\ttdStyles = window.getComputedStyle(previewTable.querySelector('td'));\n\t\t\t\t\t\t\t\t\t\t\t\tif (tdStyles.borderTopColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.borderColor = tdStyles.borderTopColor;\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.borderColor = tdStyles.borderBottomColor;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (sectionNumber > 0 && j % tableColumns == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.borderTopWidth = '5px';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\ttr.appendChild(tdLeftHeader);\n\n\t\t\t\t\t\t\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet k = newTableColumnsWithoutLeftHeader * sectionNumber + 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tk < newTableColumnsWithoutLeftHeader * (sectionNumber + 1) + 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tk++\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (k < previewTable.rows.length) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd = previewTable.rows[k].children[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tj - sectionNumber * tableColumns\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t].cloneNode(true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst rowKStyles = window.getComputedStyle(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpreviewTable.rows[k]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!td.style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.backgroundColor = rowKStyles.backgroundColor;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.width = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.height = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// td.removeAttribute('data-x-index');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.removeAttribute('data-wptb-css-td-auto-width');\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd = document.createElement('td');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.borderWidth = '0px';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.background = '#fff';\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttdStyles = window.getComputedStyle(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpreviewTable.querySelector('td')\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (tdStyles.borderTopColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.borderColor = tdStyles.borderTopColor;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.borderColor = tdStyles.borderBottomColor;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (sectionNumber > 0 && j % tableColumns == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttd.style.borderTopWidth = '5px';\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableTbody.appendChild(tr);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlet newTableColumns;\n\t\t\t\t\t\t\t\t\t\tif (tableContainerWidth > 480) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < tableColumns; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns = wholeColumnsInContainer - i;\n\t\t\t\t\t\t\t\t\t\t\t\tif (newTableColumns == 0) newTableColumns = 1;\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns = tableColumns % newTableColumns;\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (newTableLastSectionFilledColumns == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns <= 6 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns - 2 * newTableLastSectionFilledColumns <= 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns < newTableColumns\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns > 6 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns <= 12 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns - 1.8 * newTableLastSectionFilledColumns <= 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns < newTableColumns\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns > 12 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns <= 18 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns - 1.6 * newTableLastSectionFilledColumns <= 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns < newTableColumns\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnewTableColumns = 1;\n\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns = 0;\n\t\t\t\t\t\t\t\t\t\t\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\tnewTable.column = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconst increaseRatioRows = Math.ceil(tableColumns / newTableColumns);\n\n\t\t\t\t\t\t\t\t\t\tconst newTableRows = increaseRatioRows * tableRows;\n\n\t\t\t\t\t\t\t\t\t\tif (valuesIsSaved) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < newTableRows; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst sectionNumber = Math.floor(i / tableRows);\n\t\t\t\t\t\t\t\t\t\t\t\tconst tr = document.createElement('tr');\n\t\t\t\t\t\t\t\t\t\t\t\tlet jMax;\n\t\t\t\t\t\t\t\t\t\t\t\tlet jStart;\n\t\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\t\tsectionNumber != increaseRatioRows - 1 ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTableLastSectionFilledColumns == 0\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tjStart = sectionNumber * newTableColumns;\n\t\t\t\t\t\t\t\t\t\t\t\t\tjMax = newTableColumns * (1 + sectionNumber);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tjStart = tableColumns - newTableLastSectionFilledColumns;\n\t\t\t\t\t\t\t\t\t\t\t\t\tjMax = tableColumns;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tconst row = previewTable.rows[i - sectionNumber * tableRows];\n\t\t\t\t\t\t\t\t\t\t\t\ttr.classList = row.classList;\n\t\t\t\t\t\t\t\t\t\t\t\ttr.style.backgroundColor = row.style.backgroundColor;\n\n\t\t\t\t\t\t\t\t\t\t\t\tfor (let j = jStart; j < jMax; j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst newTd = row.children[j].cloneNode(true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!newTd.style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst rowStyles = window.getComputedStyle(row);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewTd.style.backgroundColor = rowStyles.backgroundColor;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTd.style.width = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTd.style.height = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// newTd.removeAttribute('data-x-index');\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewTd.removeAttribute('data-wptb-css-td-auto-width');\n\t\t\t\t\t\t\t\t\t\t\t\t\ttr.appendChild(newTd);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableTbody.appendChild(tr);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tnewTable.dataset.wholeColumnsInContainer = wholeColumnsInContainer;\n\t\t\t\t\t\t\t\t\tconst images = newTable.querySelectorAll('[srcset]');\n\t\t\t\t\t\t\t\t\tif (images.length > 0) {\n\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < images.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\timages[i].removeAttribute('srcset');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twptbPreviewTableMobile = newTable;\n\t\t\t\t\t\t\t\t\ttableContainer.appendChild(newTable);\n\t\t\t\t\t\t\t\t\ttableReconstructed = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\ttableContainerMatrix &&\n\t\t\t\t\t\t\ttableContainerMatrix.classList.contains('wptb-matrix-hide')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\ttableContainerMatrix.classList.remove('wptb-matrix-hide');\n\t\t\t\t\t\t\ttableReconstructed = true;\n\t\t\t\t\t\t\tpreviewTable.classList.remove('wptb-mobile-view-active');\n\t\t\t\t\t\t\twptbPreviewTableMobile = tableContainer.querySelector('.wptb-preview-table-mobile');\n\t\t\t\t\t\t\tif (wptbPreviewTableMobile) {\n\t\t\t\t\t\t\t\ttableContainer\n\t\t\t\t\t\t\t\t\t.getElementsByClassName('wptb-preview-table-mobile')[0]\n\t\t\t\t\t\t\t\t\t.classList.add('wptb-mobile-hide');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttableContainer.style.overflow = 'auto';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpreviewTable.style.minWidth = 'auto';\n\t\t\t\t\t}\n\n\t\t\t\t\tWPTB_RecalculateIndexes(previewTable);\n\n\t\t\t\t\tif (tableReconstructed) {\n\t\t\t\t\t\tWPTB_RecalculateIndexes(wptbPreviewTableMobile);\n\t\t\t\t\t\tconst tabEvent = new CustomEvent('table:rebuilt', { detail: true, bubbles: true });\n\t\t\t\t\t\tpreviewTable.dispatchEvent(tabEvent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction wptb_tdDefaultWidth() {\n\t\tconst wptbTableContainers = document.getElementsByClassName('wptb-table-container');\n\t\t// let frontendEditLink = document.querySelectorAll( '.wptb-frontend-table-edit-link' );\n\t\tfor (let i = 0; i < wptbTableContainers.length; i++) {\n\t\t\tconst wptbTableContainer = wptbTableContainers[i];\n\n\t\t\twptbTableContainer.classList.add(`wptb-table-container-${i}`);\n\n\t\t\tlet table = wptbTableContainer.getElementsByClassName('wptb-preview-table');\n\t\t\tif (table.length > 0) {\n\t\t\t\ttable = table[0];\n\n\t\t\t\t// added check for horizontal scroll functionality while adding max width property to table container style\n\t\t\t\tif (\n\t\t\t\t\ttable.dataset.wptbTableContainerMaxWidth &&\n\t\t\t\t\t!table.dataset.wptbTableHorizontalScrollStatus &&\n\t\t\t\t\t!wptbTableContainer.dataset.wptbHorizontalScrollStatus\n\t\t\t\t) {\n\t\t\t\t\twptbTableContainer.style.maxWidth = `${table.dataset.wptbTableContainerMaxWidth}px`;\n\t\t\t\t}\n\t\t\t\ttable.classList.remove('wptb-table-preview-static-indic');\n\n\t\t\t\ttable.mergingСellsHorizontally = false;\n\t\t\t\tconst tds = table.querySelectorAll('td');\n\t\t\t\tfor (let j = 0; j < tds.length; j++) {\n\t\t\t\t\tif (tds[j].colSpan > 1) {\n\t\t\t\t\t\ttable.mergingСellsHorizontally = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst wptbTableContainerWidth = wptbTableContainer.offsetWidth;\n\n\t\t\t\tconst td = table.querySelector('td');\n\t\t\t\tconst tdStyleObj = window.getComputedStyle(td, null);\n\t\t\t\tconst tdBorderLeftWidth = tdStyleObj.getPropertyValue('border-left-width');\n\t\t\t\tconst tdBorderRightWidth = tdStyleObj.getPropertyValue('border-right-width');\n\t\t\t\tconst tdPaddingLeftWidth = tdStyleObj.getPropertyValue('padding-left');\n\t\t\t\tconst tdPaddingRightWidth = tdStyleObj.getPropertyValue('padding-left');\n\t\t\t\tconst tdPaddingCommon = parseFloat(tdPaddingLeftWidth, 10) + parseFloat(tdPaddingRightWidth, 10);\n\t\t\t\tconst tableTdBorderCommonWidth = parseFloat(tdBorderLeftWidth, 10) + parseFloat(tdBorderRightWidth, 10);\n\t\t\t\tconst { wptbTableTdsSumMaxWidth } = table.dataset;\n\t\t\t\tconst { wptbFixedWidthSize } = table.dataset;\n\t\t\t\tconst { wptbCellsWidthAutoCount } = table.dataset;\n\t\t\t\tlet styleElementCreate = false;\n\t\t\t\tlet tableTdWidthAuto;\n\n\t\t\t\t/**\n\t\t\t\t * Table width logic to determine final width on rendered tables.\n\t\t\t\t */\n\t\t\t\tconst tableWidthLogic = () => {\n\t\t\t\t\t// eslint-disable-next-line no-shadow\n\t\t\t\t\tconst wptbTableContainerWidth = wptbTableContainer.offsetWidth;\n\t\t\t\t\tif (wptbTableTdsSumMaxWidth < wptbTableContainerWidth) {\n\t\t\t\t\t\tif (wptbCellsWidthAutoCount) {\n\t\t\t\t\t\t\ttable.style.minWidth = '100%';\n\n\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tif (table.mergingСellsHorizontally) {\n\t\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\t\tconst tableTdsWidthAutoCommon = wptbTableContainerWidth - wptbFixedWidthSize;\n\t\t\t\t\t\t\t\ttableTdWidthAuto = tableTdsWidthAutoCommon / wptbCellsWidthAutoCount;\n\t\t\t\t\t\t\t\ttableTdWidthAuto = tableTdWidthAuto - tdPaddingCommon - tableTdBorderCommonWidth;\n\t\t\t\t\t\t\t\tstyleElementCreate = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttable.style.width = '100%';\n\n\t\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t\t// frontendEditLink[i].style.width = '100%';\n\t\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = '100%';\n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\ttable.style.minWidth = null;\n\t\t\t\t\t\t\ttable.style.maxWidth = `${wptbTableTdsSumMaxWidth}px`;\n\n\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t// frontendEditLink[i].style.width = null;\n\t\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = null;\n\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttable.style.maxWidth = null;\n\t\t\t\t\t\ttable.style.minWidth = `${table.dataset.wptbTableTdsSumMaxWidth}px`;\n\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\ttableTdWidthAuto = table.dataset.wptbTdWidthAuto ? table.dataset.wptbTdWidthAuto : '100';\n\t\t\t\t\t\tstyleElementCreate = true;\n\n\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = '100%';\n\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = table.dataset.wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t// frontendEditLink[i].style.width = null;\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// if current table container width is equal or lower than zero, than it means it is hidden through css styles, width calculations should be done when it becomes visible again\n\t\t\t\tif (wptbTableContainerWidth <= 0) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Calculate element visibility status.\n\t\t\t\t\t *\n\t\t\t\t\t * @param {Element} element element to check\n\t\t\t\t\t * @return {boolean} whether element is visible or not\n\t\t\t\t\t */\n\t\t\t\t\tconst elementVisibilityStatus = (element) => {\n\t\t\t\t\t\tconst { display, visibility } = getComputedStyle(element);\n\t\t\t\t\t\treturn display !== 'none' || visibility === 'visible';\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Find parent element that is responsible for hiding our table.\n\t\t\t\t\t *\n\t\t\t\t\t * This function is recursive, it will keep searching parents till it hit 'body' element.\n\t\t\t\t\t *\n\t\t\t\t\t * @param {Element} currentElement current element in check\n\t\t\t\t\t * @return {null|Element} found parent or null\n\t\t\t\t\t */\n\t\t\t\t\tconst findParentWithNoDisplay = (currentElement) => {\n\t\t\t\t\t\tconst currentParent = currentElement.parentNode;\n\t\t\t\t\t\tconst parentDisplayStatus = elementVisibilityStatus(currentParent);\n\t\t\t\t\t\t// lower cased element name\n\t\t\t\t\t\tconst parentType = currentParent.nodeName.toLowerCase();\n\n\t\t\t\t\t\t// if parent is visible make a recursive call\n\t\t\t\t\t\tif (!parentDisplayStatus && parentType !== 'body') {\n\t\t\t\t\t\t\treturn findParentWithNoDisplay(currentParent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// hit body element, should return null to signal a problem with current DOM\n\t\t\t\t\t\tif (parentType === 'body') {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn currentParent;\n\t\t\t\t\t};\n\n\t\t\t\t\t// find parent container with hidden display property\n\t\t\t\t\tconst culpritParent = findParentWithNoDisplay(wptbTableContainer);\n\t\t\t\t\tif (culpritParent) {\n\t\t\t\t\t\t// setup a mutation observer to detect visibility change of parent which is responsible for hiding our table\n\t\t\t\t\t\tconst config = { attributes: true, childList: false, subtree: false };\n\t\t\t\t\t\tconst parentObserver = new MutationObserver((mutationRecord) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\t\t\tmutationRecord.map((mutation) => {\n\t\t\t\t\t\t\t\t\tconst currentVisibility = elementVisibilityStatus(mutation.target);\n\t\t\t\t\t\t\t\t\tconst { width: containerWidth } = mutation.target.getBoundingClientRect();\n\n\t\t\t\t\t\t\t\t\t// call width logic and start calculations for our table since it is visible now\n\t\t\t\t\t\t\t\t\tif (currentVisibility && containerWidth > 0) {\n\t\t\t\t\t\t\t\t\t\ttableWidthLogic();\n\n\t\t\t\t\t\t\t\t\t\t// disconnect observer\n\t\t\t\t\t\t\t\t\t\tparentObserver.disconnect();\n\n\t\t\t\t\t\t\t\t\t\t// get out of iteration\n\t\t\t\t\t\t\t\t\t\tthrow new Error('get out of iteration');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t// do nothing since an error is thrown to get out of array iteration\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// observe parent for visibility changes\n\t\t\t\t\t\tparentObserver.observe(culpritParent, config);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// if no hidden parent element is found, it means our table is visible, continue normally\n\t\t\t\t\ttableWidthLogic();\n\t\t\t\t}\n\n\t\t\t\tconst { head } = document;\n\t\t\t\tif (head) {\n\t\t\t\t\tconst cssForTdsWidthAutoOld = head.querySelector(`style[data-wptb-td-auto-width-${i}=\"true\"]`);\n\n\t\t\t\t\tif (cssForTdsWidthAutoOld) {\n\t\t\t\t\t\thead.removeChild(cssForTdsWidthAutoOld);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (styleElementCreate) {\n\t\t\t\t\tconst cssForTdsWidthAuto = document.createElement('style');\n\t\t\t\t\tcssForTdsWidthAuto.setAttribute(`data-wptb-td-auto-width-${i}`, true);\n\t\t\t\t\tcssForTdsWidthAuto.innerHTML = `.wptb-table-container-${i} table td[data-wptb-css-td-auto-width=true]{width:${tableTdWidthAuto}px}`;\n\t\t\t\t\tif (head) {\n\t\t\t\t\t\thead.appendChild(cssForTdsWidthAuto);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\twindow.addEventListener('resize', () => {\n\t\twptb_tdDefaultWidth();\n\t\twptb_tableReconstraction();\n\t});\n\n\t// code for adding of old css styles for correct view\n\tconst elements = document.getElementsByClassName('wptb-ph-element');\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element.classList.contains('wptb-list-item-container')) {\n\t\t\telement.classList.remove('wptb-list-item-container');\n\t\t\telement.classList.add('wptb-list-container');\n\t\t}\n\n\t\tif (element.classList.contains('wptb-button-container')) {\n\t\t\tconst infArr = element.className.match(/wptb-size-([A-Z]+)/i);\n\t\t\tif (infArr && Array.isArray(infArr)) {\n\t\t\t\tconst wptbSize = infArr[0];\n\t\t\t\tconst wptbSizeNew = wptbSize.toLowerCase();\n\n\t\t\t\telement.classList.remove(wptbSize);\n\n\t\t\t\tconst wptbButtonWrapper = element.querySelector('.wptb-button-wrapper');\n\t\t\t\tif (wptbButtonWrapper) {\n\t\t\t\t\twptbButtonWrapper.classList.add(wptbSizeNew);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// responsive setup\n\t// eslint-disable-next-line no-unused-vars\n\tconst responsiveFront = new WPTB_ResponsiveFrontend({\n\t\tquery: '.wptb-preview-table',\n\t\tbindToResize: true,\n\t});\n\n\t// sorting table\n\tfunction sortingTable() {\n\t\tconst tables = document.querySelectorAll('.wptb-preview-table');\n\t\tfor (let i = 0; i < tables.length; i += 1) {\n\t\t\tconst sortableTable = new WPTB_SortableTable({ table: tables[i] });\n\t\t\tsortableTable.sortableTableInitialization(responsiveFront);\n\t\t}\n\t}\n\n\tsortingTable();\n\tconst responsiveFrontReady = new CustomEvent('responsive:front', {\n\t\tdetail: {\n\t\t\tresponsiveFront,\n\t\t},\n\t});\n\tdocument.dispatchEvent(responsiveFrontReady);\n\n\t// initialize scroll manager\n\tnew WPTB_ScrollManager(WptbFrontendData.scrollManager).init();\n\n\t// apply defined extra styles to tables if there is any\n\tWPTB_ExtraStyles.applyStyles(WPTB_ExtraStyles.modes.frontEnd, WptbFrontendData.generalStyles);\n\n\t// rebuild tables according to current responsive mode\n\tresponsiveFront.rebuildTables();\n\n\t// initialize lazy load module\n\tWPTB_LazyLoad.init(WptbFrontendData.lazyLoad);\n\n\t// initialize style pass\n\tWPTB_StylePass.init(WptbFrontendData.stylePass);\n});\n"]}