WP Table Builder – WordPress Table Plugin - Version 1.3.6

Version Description

  • FIX: An issue with style pass affecting some browsers.
Download this release

Release Info

Developer imtiazrayhan
Plugin Icon 128x128 WP Table Builder – WordPress Table Plugin
Version 1.3.6
Comparing to
See all releases

Code changes from version 1.3.5 to 1.3.6

inc/admin/class-tables.php CHANGED
@@ -29,7 +29,7 @@ class Tables {
29
  add_filter( 'manage_wptb-tables_posts_columns', [ $this, 'addHeader' ] );
30
  add_filter( 'post_row_actions', [ $this, 'customizeActions' ], 10, 2 );
31
  add_action( 'manage_wptb-tables_posts_custom_column', [ $this, 'addContent' ], 10, 2 );
32
- add_filter( 'get_post_metadata', [ $this, 'post_content_filter' ], 100, 4 );
33
  }
34
 
35
  /**
29
  add_filter( 'manage_wptb-tables_posts_columns', [ $this, 'addHeader' ] );
30
  add_filter( 'post_row_actions', [ $this, 'customizeActions' ], 10, 2 );
31
  add_action( 'manage_wptb-tables_posts_custom_column', [ $this, 'addContent' ], 10, 2 );
32
+ // add_filter( 'get_post_metadata', [ $this, 'post_content_filter' ], 100, 4 );
33
  }
34
 
35
  /**
inc/admin/managers/what-is-new-manager.php CHANGED
@@ -40,7 +40,7 @@ class What_Is_New_Manager {
40
 
41
  add_filter( 'wp-table-builder/filter/builder_script_data', [ __CLASS__, 'add_frontend_script_data' ] );
42
 
43
- add_filter( 'plugin_row_meta', [ __CLASS__, 'add_win_plugin_row' ], 10, 3 );
44
  }
45
  }
46
 
40
 
41
  add_filter( 'wp-table-builder/filter/builder_script_data', [ __CLASS__, 'add_frontend_script_data' ] );
42
 
43
+ // add_filter( 'plugin_row_meta', [ __CLASS__, 'add_win_plugin_row' ], 10, 3 );
44
  }
45
  }
46
 
inc/frontend/js/frontend-only/WPTB_StylePass.js CHANGED
@@ -76,7 +76,7 @@
76
  */
77
  this.checkTableEligibility = (tableContainer) => {
78
  const table = tableContainer.querySelector('table');
79
- return table.dataset.disableThemeStyles;
80
  };
81
 
82
  /**
76
  */
77
  this.checkTableEligibility = (tableContainer) => {
78
  const table = tableContainer.querySelector('table');
79
+ return table ? table.dataset.disableThemeStyles : false;
80
  };
81
 
82
  /**
inc/frontend/js/frontend-only/wp-table-builder-frontend.js CHANGED
@@ -852,6 +852,7 @@
852
  // rebuild tables according to current responsive mode
853
  responsiveFront.rebuildTables();
854
 
 
855
  // initialize style pass
856
  WPTB_StylePass.init(WptbFrontendData.stylePass);
857
  });
852
  // rebuild tables according to current responsive mode
853
  responsiveFront.rebuildTables();
854
 
855
+
856
  // initialize style pass
857
  WPTB_StylePass.init(WptbFrontendData.stylePass);
858
  });
inc/frontend/js/wp-table-builder-frontend.js CHANGED
@@ -1,2 +1,2 @@
1
- function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],o=!0,a=!1,n=void 0;try{for(var l,s=e[Symbol.iterator]();!(o=(l=s.next()).done)&&(r.push(l.value),!t||r.length!==t);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw n}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}!function(e,t,r){"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=r():t[e]=r()}("WPTB_ExtraStyles",self||global,function(){return new function(){var e,l=this;function s(r,e){var e=e.replaceAll(/(\r?\n)|(\/\*.+?\*\/)|(\s*!important)/g,"").replaceAll(";"," !important;").split("}"),o=[];return e.map(function(e){var t=new RegExp(/(.+?)\{/g).exec(e);t&&o.push(e.replace(t[1],"".concat(r," ").concat(t[1])))}),"".concat(o.join("}"),"}")}function i(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=document.createElement("style");r.type="text/css",r.id="wptb-general-styles",t?t.insertAdjacentElement("beforebegin",r):(l.currentMode===l.modes.block?l.baseDocument:l.baseDocument.querySelector("head")).appendChild(r),t=s(".wptb-preview-table",e),r.appendChild(document.createTextNode(t))}function o(e){var t,r,o,a,n=e.dataset.wptbExtraStyles;n&&(a=atob(n),t="wptb-extra-styles-"+(o=_slicedToArray(e.getAttribute("class").match(/wptb-element-main-table_setting-(?:startedid-)?(\d+)/),2)[1]),(n=null==(r=l.baseDocument.querySelector("head"))?void 0:r.querySelector("#".concat(t)))||((n=document.createElement("style")).type="text/css",n.id=t,e.dataset.disableThemeStyles&&l.currentMode===l.modes.frontEnd||l.currentMode===l.modes.block?(e.insertAdjacentElement("beforebegin",n),l.modes.frontEnd&&l.generalStyles&&i(l.generalStyles,e)):r.appendChild(n)),o=".wptb-element-main-table_setting-".concat(o),a=s(o,a),n.innerHTML="",n.appendChild(document.createTextNode(a)))}this.modes={builder:"builder",frontEnd:"frontEnd",block:"block"},this.baseDocument=document,this.currentMode=this.modes.builder,this.generalStyles="";var a=(_defineProperty(e={},this.modes.builder,".wptb-table-setup .wptb-preview-table"),_defineProperty(e,this.modes.block,".wptb-block-table-setup .wptb-preview-table"),_defineProperty(e,this.modes.frontEnd,".wptb-table-container .wptb-preview-table"),e);this.applyStyles=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:l.modes.frontEnd,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document;l.baseDocument=r,l.currentMode=e,l.generalStyles=t;r=Array.from(l.baseDocument.querySelectorAll(a[e]));r&&r.map(o),e!==l.modes.frontEnd&&e!==l.modes.block||!t||i(t)}}}),function(e,t,r){"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=r():t[e]=r()}("WPTB_Logger",self||global,function(){var t={normal:"#48BB78"};return{prepareMessage:function(e){return"%c WP Table Builder %c {message} ".replace("{message}",e)},prepareMessageStyle:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"normal";return"background-color: {bgColor} ; padding: 3px; color: #FFF; border-radius: 0 5px 5px 0;".replace("{bgColor}",t[t[e]?e:"normal"])},log:function(e){console.log(this.prepareMessage(e),"border-radius:5px 0 0 5px; background-color: #3299D1; padding: 3px; color: #FFF; font-weight: bold;",this.prepareMessageStyle("normal"))}}});var WPTB_CutGlueTable={cutTableHorizontally:function(e,t){if(t&&t.rows[e])for(var r=0;r<e;r++)for(var o=t.rows[r].children,a=0;a<o.length;a++)if(1<o[a].rowSpan&&o[a].rowSpan>e-r){var n=o[a].rowSpan-e+r;o[a].rowSpan=e-r,o[a].dataset.sameCellBeforeDivision||(o[a].dataset.sameCellBeforeDivision="r"+r+"c"+a);var l=void 0,l=t.hasOwnProperty("wptbCell")?(l=new t.wptbCell(t.mark)).getDOMElement():document.createElement("td"),s=o[a].getAttribute("style");l.setAttribute("style",s),l.colSpan=o[a].colSpan,l.rowSpan=n,l.dataset.sameCellBeforeDivision=o[a].dataset.sameCellBeforeDivision;for(var n=o[a].dataset.xIndex,i=parseInt(n)+parseInt(o[a].colSpan),d=void 0;!d&&i<t.maxCols;)d=t.rows[e].querySelector('[data-x-index="'+i+'"]'),i++;t.rows[e].insertBefore(l,d),WPTB_RecalculateIndexes(t)}},glueTableHorizontally:function(e){if(e){for(var t=_toConsumableArray(e.getElementsByTagName("td")),r=0;r<t.length;r++)if(t[r].hasAttribute("data-same-cell-before-division"))for(var o=t[r].dataset.sameCellBeforeDivision,a=e.querySelectorAll('[data-same-cell-before-division="'+o+'"]'),n=0;n<a.length;n++)if(a[n]&&a[n+1]&&a[n].parentNode&&a[n+1].parentNode&&!a[n].parentNode.classList.contains("wptb-row-moving")&&!a[n+1].parentNode.classList.contains("wptb-row-moving")&&a[n+1].dataset.yIndex==parseInt(a[n].dataset.yIndex)+parseInt(a[n].rowSpan)){a[n].rowSpan+=a[n+1].rowSpan;for(var l=_toConsumableArray(a[n+1].children),s=0;s<l.length;s++)a[n].appendChild(l[s]);a[n+1].parentNode.removeChild(a[n+1])}WPTB_RecalculateIndexes(e)}},cutTableVertically:function(e,t){for(var r=0;r<t.rows.length;r++){if(e<t.maxCols&&0!=e&&!t.rows[r].querySelector('[data-x-index="'+e+'"]'))for(var o,a,n,l=t.rows[r].children,s=void 0,i=l.length,d=void 0,c=0;c<i;c++)if(1<l[c].colSpan&&parseInt(l[c].dataset.xIndex)<e&&parseInt(l[c].dataset.xIndex)+parseInt(l[c].colSpan)>e){s=t.hasOwnProperty("wptbCell")?(s=new t.wptbCell(t.mark)).getDOMElement():document.createElement("td"),o=l[c].rowSpan,a=l[c].colSpan,l[c].colSpan=e-l[c].dataset.xIndex,n=a-l[c].colSpan,l[c].dataset.sameCellBeforeDivision||(l[c].dataset.sameCellBeforeDivision="r"+r+"c"+c);var u=l[c].getAttribute("style");s.setAttribute("style",u);u=t.querySelector('[data-x-index="'+e+'"]');u&&(s.style.width=u.style.width);u=t.querySelector('[data-y-index="'+r+'"]');u&&(s.style.height=u.style.height),d=l[c+1]||null,t.rows[r].insertBefore(s,d),s.colSpan=n,s.rowSpan=o,s.dataset.sameCellBeforeDivision=l[c].dataset.sameCellBeforeDivision,r+=o-1;break}WPTB_RecalculateIndexes(t)}},glueTableVertically:function(e){if(e){for(var t=_toConsumableArray(e.getElementsByTagName("td")),r=0;r<t.length;r++)if(t[r].hasAttribute("data-same-cell-before-division"))for(var o=t[r].dataset.sameCellBeforeDivision,a=_toConsumableArray(e.querySelectorAll('[data-same-cell-before-division="'+o+'"]')),n=null,l=0;l<a.length;l++)if(a[l]&&a[l+1]&&!a[l].classList.contains("wptb-column-moving")&&!a[l+1].classList.contains("wptb-column-moving")&&a[l+1].dataset.xIndex==parseInt(a[l].dataset.xIndex)+parseInt(a[l].colSpan)){a[n=null==n?l:n].colSpan+=a[l+1].colSpan;for(var s=_toConsumableArray(a[l+1].children),i=0;i<s.length;i++)a[n].appendChild(s[i]);a[l+1].parentNode.removeChild(a[l+1])}WPTB_RecalculateIndexes(e)}}},WPTB_GetDirectionAfterReconstruction=function(o,a,n,r,l){var s=0,i=o.maxCols,e={},d=[];return l&&l.getDirective(o)?e.switch=function(e){var t=l.getDirective(o),r="desktop";return e&&e.detail&&(r=e.detail.sizeRangeId),d=[a,1],"desktop"!==r?t.hasOwnProperty("modeOptions")&&(e=t.responsiveMode,(e=t.modeOptions[e]).hasOwnProperty("topRowAsHeader")&&e.topRowAsHeader.hasOwnProperty(r)&&e.topRowAsHeader[r]?e.hasOwnProperty("cellStackDirection")&&e.cellStackDirection.hasOwnProperty(r)&&("row"===e.cellStackDirection[r]?(d=[n,2],s=i-1):"column"===e.cellStackDirection[r]&&e.hasOwnProperty("cellsPerRow")&&(s=e.cellsPerRow[r])):s=0):s=0,{type:d,itemsPerHeader:s}}:e.switch=function(e){if(d=[a,1],o.classList.contains("wptb-mobile-view-active")){o.classList.contains("wptb-table-preview-head")&&(d=[n,2])===r&&(s=i-1);var t=o.parentNode.parentNode.querySelector(".wptb-preview-table-mobile");return{type:d,itemsPerHeader:s,newTable:t}}return{type:d,itemsPerHeader:s}},e};function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_SortableTable",self||global,function(){return function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},$=this.table=e.table;WPTB_RecalculateIndexes($);var n=this;function t(e,t,r){var o,a,n;"TD"===e.target.tagName?(o=null==e.offsetX?e.layerX:e.offsetX,a=null==e.offsetY?e.layerY:e.offsetY,n=!1,(n="vertical"===t&&e.target.clientWidth-o<=35||"horizontal"===t&&o<=35?!0:n)&&(e.target.clientHeight-35)/2<a&&(e.target.clientHeight+35)/2>a?r.classList.add("sortable-hover"):r.classList.remove("sortable-hover")):r.classList.remove("sortable-hover")}function d(e){t(e,"vertical",this)}function c(e){t(e,"horizontal",this)}function u(){this.classList.remove("sortable-hover")}function r(e,t){if(e.target&&"TD"===e.target.tagName&&!$.parentNode.classList.contains("wptb-preview-table-manage-cells")){var r=e.currentTarget,o=!1;if("vertical"===t&&e.target.dataset.hasOwnProperty("sortedVertical")){var a=[],n=[];if(this.itemsPerHeader&&this.itemsPerHeader<r.rows.length){WPTB_RecalculateIndexes(r);for(var l=_toConsumableArray(r.rows),s=r.querySelector("tbody")?r.querySelector("tbody"):r,i=0;i<l.length;i++)i<e.target.dataset.yIndex?(a.push(l[i]),s.removeChild(l[i])):i>parseInt(e.target.dataset.yIndex,10)+this.itemsPerHeader&&(n.push(l[i]),s.removeChild(l[i]));WPTB_RecalculateIndexes(r)}var d,c,u=r.querySelectorAll('[data-x-index="'.concat(e.target.dataset.xIndex,'"]'));(u=_toConsumableArray(u)).map(function(e){(d=parseInt(e.rowSpan,10))||(d=1),c=e.dataset.yIndex,WPTB_CutGlueTable.cutTableHorizontally(c,r),c+=d,WPTB_CutGlueTable.cutTableHorizontally(c,r)});for(var p,b=[],f=0,h=[],y=0;y<u.length;y++){var m=Q(e,r,u,y,f,"vertical");if(m&&m.hasOwnProperty("i"))u=m.tds,y=m.i;else{for(var g=(u=m?m.tds:u)[y],w=(w=parseInt(g.rowSpan,10))||1,f=parseInt(g.dataset.yIndex,10)+w,m=Y(g),v=[],S=0;S<w;S++)v.push(r.rows[parseInt(g.dataset.yIndex,10)+S]),h.push(parseInt(g.dataset.yIndex,10)+S);0<g.dataset.yIndex?b.push({rowsTd:v,value:m}):p=v}}var C=U(e,"sortedVertical");if(!C)return;if(b.length&&b.sort(function(e,t){return X(C,e,t)}),b.unshift({rowsTd:p}),b.length<r.rows.length)for(var T,A=0;A<r.rows.length;A++)-1<h.indexOf(A)||((T=[]).push(r.rows[A]),b.push({rowsTd:T}));var x,R,E,k=r.querySelector("tbody");k.innerHTML="",b.map(function(e){e.rowsTd.map(function(e){k.appendChild(e)})}),!a.length||(x=r.querySelector("tbody")?r.querySelector("tbody"):r)&&(R=x.querySelector("tr"),a.map(function(e){x.insertBefore(e,R)})),n.length&&(E=r.querySelector("tbody")?r.querySelector("tbody"):r,k&&n.map(function(e){E.appendChild(e)})),WPTB_RecalculateIndexes(r),WPTB_CutGlueTable.glueTableHorizontally(r),o=!0}else if("horizontal"===t&&"0"===e.target.dataset.xIndex){var _,I,P=r.querySelectorAll('[data-y-index="'.concat(e.target.dataset.yIndex,'"]'));(P=_toConsumableArray(P)).map(function(e){(_=parseInt(e.colSpan,10))||(_=1),I=e.dataset.xIndex,WPTB_CutGlueTable.cutTableVertically(I,r),I+=_,WPTB_CutGlueTable.cutTableVertically(I,r)});for(var O,j=[],B=0,L=0;L<P.length;L++){var M=Q(e,r,P,L,B,"horizontal");if(M&&M.hasOwnProperty("i"))P=M.tds,L=M.i;else{for(var W=(P=M?M.tds:P)[L],H=(H=parseInt(W.colSpan,10))||1,B=parseInt(W.dataset.xIndex,10)+H,M=Y(W),q=[],D=0;D<H;D++){var N=_toConsumableArray(r.querySelectorAll('[data-x-index="'.concat(parseInt(W.dataset.xIndex,10)+D,'"]')));q.push(N)}0<W.dataset.xIndex?j.push({columnsTd:q,value:M}):O=q}}var z=U(e,"sortedHorizontal");if(!z)return;if(j.length&&j.sort(function(e,t){return X(z,e,t)}),j.unshift({columnsTd:O}),j.length<r.maxCols)for(var V=r.maxCols-j.length,F=0;F<V;F++){var G=_toConsumableArray(r.querySelectorAll('[data-x-index="'.concat(parseInt(r.maxCols,10)-parseInt(V,10)+F,'"]')));j.push({columnsTd:[G]})}for(var K=0;K<r.rows.length;K++)r.rows[K].innerHTML="";j.map(function(e){e.columnsTd.map(function(e){e.map(function(e){r.rows[e.dataset.yIndex].appendChild(e)})})}),WPTB_RecalculateIndexes(r),WPTB_CutGlueTable.glueTableVertically(r),o=!0}o&&(function(){for(var e=_toConsumableArray(r.getElementsByTagName("td")),t=0;t<e.length;t++)e[t].hasAttribute("data-same-cell-before-division")&&e[t].removeAttribute("data-same-cell-before-division")}(),r.hasOwnProperty("tableSM")&&(new(r.tableSM())).tableStateSet(),this.reassignElementsStyles("td"),this.reassignElementsStyles("tr"))}}function U(e,t){return!(!e.currentTarget||!e.currentTarget.classList.contains("wptb-preview-table")&&!e.currentTarget.classList.contains("wptb-preview-table-mobile"))&&(e.target.dataset[t]&&"ask"!==e.target.dataset[t]?e.target.dataset[t]="ask":e.target.dataset[t]="desk",e.target.dataset[t])}function X(e,t,r){var o=0<arguments.length&&void 0!==e?e:"ask",a=1<arguments.length?t:void 0,n=2<arguments.length?r:void 0,a=a.value,n=n.value;return parseInt(a)&&parseInt(n)&&(a=parseInt(a),n=parseInt(n)),"ask"===o?a<n?-1:a===n?0:1:a<n?1:a===n?0:-1}function Y(e){for(var t=e.querySelectorAll(".wptb-text-container"),t=_toConsumableArray(t),r="",o=0;o<t.length;o++)r+=t[o].innerText,o!==t.length-1&&(r+=" ");return r}function Q(e,t,r,o,a,n){var l,s,i,d,c,u,p=r[o],b=!1;if("vertical"===n?(s="colSpan",i="data-y-index",d="yIndex",c="xIndex",y="rowSpan",u=t.rows.length):"horizontal"===n&&(s="rowSpan",i="data-x-index",d="xIndex",c="yIndex",y="colSpan",u=t.maxCols),0<p.dataset[d]-a)for(var f=t.querySelectorAll("[".concat(i,'="').concat(a,'"]')),h=0;h<f.length;h++)if(l=(l=f[h][s])||1,f[h].dataset[c]<e.target.dataset[c]&&parseInt(f[h].dataset[c],10)+parseInt(l,10)>e.target.dataset[c]){r.splice(o,0,f[h]),b=!0,o--;break}if(b)return{tds:r,i:o};var y=(y=parseInt(p[y],10))||1;if(o==r.length-1&&parseInt(p.dataset[d],10)+y<u){f=t.querySelectorAll("[".concat(i,'="').concat(parseInt(p.dataset[d],10)+y,'"]'));for(var m=0;m<f.length;m++)if(l=(l=f[m][s])||1,f[m].dataset[c]<e.target.dataset[c]&&parseInt(f[m].dataset[c],10)+parseInt(l,10)>e.target.dataset[c]){r.push(f[m]),b=!0;break}}return!!b&&{tds:r}}return this.itemsPerHeader=0,this.tableMaxCols=$.maxCols,this.cellsStylesScheme={},this.rowsStylesScheme={},this.sortModeSwitcher=function(e,t){t&&(this.sortModeSwitcher("horizontal",!1),this.sortModeSwitcher("vertical",!1)),"vertical"===e?(this.table.removeEventListener("click",this.sortableTableVerticalStart,!1),t?(this.sortingCellMouseMoveSwitcher("vertical",!0),this.table.addEventListener("click",this.sortableTableVerticalStart,!1),this.table.dataset.wptbSortableTableVertical="1",this.createTableElementsStylesScheme("td"),this.createTableElementsStylesScheme("tr")):(this.sortingCellMouseMoveSwitcher("vertical",!1),delete this.table.dataset.wptbSortableTableVertical)):"horizontal"===e&&(this.table.removeEventListener("click",this.sortableTableHorizontalStart,!1),t?(this.sortingCellMouseMoveSwitcher("horizontal",!0),this.table.addEventListener("click",this.sortableTableHorizontalStart,!1),this.table.dataset.wptbSortableTableHorizontal="1",this.createTableElementsStylesScheme("td"),this.createTableElementsStylesScheme("tr")):(this.sortingCellMouseMoveSwitcher("horizontal",!1),delete this.table.dataset.wptbSortableTableHorizontal))},this.tableObjectChange=function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];return this.table.classList.contains("wptb-mobile-view-active")&&e?this.table=$.parentNode.parentNode.querySelector(".wptb-preview-table-mobile"):this.table.classList.contains("wptb-preview-table-mobile")&&!e&&(this.table=$.parentNode.querySelector(".wptb-preview-table")),this.table},this.createTableElementsStylesScheme=function(e){this.tableObjectChange();var t=this.table.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var o=t[r],a=window.getComputedStyle(o,null).getPropertyValue("background-color"),n="";"td"===e?(n=o.dataset.xIndex+"-"+o.dataset.yIndex,this.cellsStylesScheme[n]={backgroundColor:a}):"tr"===e&&(n=String(r),this.rowsStylesScheme[n]={backgroundColor:a})}this.tableObjectChange(!1)},this.reassignElementsStyles=function(e){this.tableObjectChange();var t,r=this.table.querySelectorAll(e);if("td"===e?t=this.cellsStylesScheme:"tr"===e&&(t=this.rowsStylesScheme),r.length)for(var o=0;o<r.length;o++){var a=r[o],n="";if("td"===e?n=a.dataset.xIndex+"-"+a.dataset.yIndex:"tr"===e&&(n=o),t.hasOwnProperty(n)){var l,s=t[n];for(l in s)a.style[l]=s[l]}}this.tableObjectChange(!1)},this.sortableTableInitialization=function(e){var t,r,o,a;this.table.dataset.wptbSortableTableVertical&&"1"===this.table.dataset.wptbSortableTableVertical?(t="vertical",r="horizontal"):this.table.dataset.wptbSortableTableHorizontal&&"1"===this.table.dataset.wptbSortableTableHorizontal&&(t="horizontal",r="vertical"),t&&"string"==typeof t&&r&&"string"==typeof r&&(o=WPTB_GetDirectionAfterReconstruction(this.table,t,r,"vertical",e),"object"===_typeof(o)&&o.hasOwnProperty("switch")&&((a=function(e){var t=o.switch(e);"object"===_typeof(t)&&(this.itemsPerHeader=t.itemsPerHeader,t.hasOwnProperty("newTable")?(e=this.table,this.table=t.newTable,this.sortModeSwitcher(t.type[0],!0),this.table=e):this.sortModeSwitcher(t.type[0],!0))}).call(n),this.table.addEventListener("table:rebuilt",function(e){a.call(n,e)},!1)))},this.sortingCellMouseMoveSwitcher=function(e,t){var r=this;function o(e,t,r){e.removeEventListener("mousemove",t,!1),e.removeEventListener("mouseleave",u,!1),r&&(e.addEventListener("mousemove",t,!1),e.addEventListener("mouseleave",u,!1))}function a(e,t,r){r?e.dataset[t]&&"desk-disabled"===e.dataset[t]?e.dataset[t]="desk":e.dataset[t]="ask":"ask"===e.dataset[t]?e.dataset[t]="ask-disabled":"desk"===e.dataset[t]&&(e.dataset[t]="desk-disabled")}var n=this.table.querySelectorAll("td");if(n.length&&(n=_toConsumableArray(n)).map(function(e){o(e,d,!1),a(e,"sortedVertical",!1),o(e,c,!1),a(e,"sortedHorizontal",!1)}),t)if("vertical"===e)for(var l=this.table.rows.length,s=0;0<l;){var i=this.table.querySelectorAll('[data-y-index="'.concat(s,'"]'));(i=_toConsumableArray(i)).map(function(e){o(e,d,t),a(e,"sortedVertical",t)}),this.itemsPerHeader?(l-=this.itemsPerHeader+1,s+=this.itemsPerHeader+1):l=0}else"horizontal"===e&&(e=this.table.querySelectorAll('[data-x-index="0"]'),(e=_toConsumableArray(e)).map(function(e){2<r.table.querySelectorAll('[data-y-index="'.concat(e.dataset.yIndex,'"]')).length&&(o(e,c,t),a(e,"sortedHorizontal",t))}))},this.sortableTableVerticalStart=function(e){r.call(n,e,"vertical")},this.sortableTableHorizontalStart=function(e){r.call(n,e,"horizontal")},this}});var WPTB_RecalculateIndexes=function(e){for(var t,r=e.getElementsByTagName("tr"),o=0,a=0,n=[],l=0;l<r.length;l++){t=r[l].getElementsByTagName("td"),null==n[l]&&(n[l]=[]);for(var s=0,i=0;i<t.length;i++){if(null!=n[l][i])for(var d=0;d<100;d++){if(null==n[l][s]){n[l][s]=t[i],t[i].dataset.xIndex=s;break}s++}else n[l][i]=t[i],t[i].dataset.xIndex=s;if(t[i].dataset.yIndex=l,1<t[i].colSpan)for(var c=1;c<t[i].colSpan;c++)s++,n[l][s]="tdDummy";if(1<t[i].rowSpan)for(var u=1;u<t[i].rowSpan;u++){null==n[l+u]&&(n[l+u]=[]);for(var p=0;p<t[i].colSpan;p++)n[l+u][s-t[i].colSpan+1+p]="tdDummy"}s++}t.length>o&&(o=t.length),0==l&&(a=s)}e.columns=o,e.maxCols=a};function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_ResponsiveFrontend",self||global,function(){function i(e,t){var r=1<arguments.length&&void 0!==t?t:"log";if("undefined"!=typeof process&&"development"===process.env.NODE_ENV){if(!console[r])throw new Error("no logging type found with given type value of [".concat(r,"]"));console[r]("[WPTB]: ".concat(e))}}function O(e){var i=this,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return this.element=e,this.referenceObject=t,this.mergedRenderStatus=!0,this.mergedCells={row:[],column:[]},this.getMergedRenderStatus=function(){return i.mergedRenderStatus},this.setMergedRenderStatus=function(e){i.mergedRenderStatus=e},this.addToMergedCells=function(e,t){i.mergedCells[e].push(t)},this.isReference=function(){return null!==i.referenceObject},this.isReference()&&(this.element=e.cloneNode(!0)),this.modifications={},this.spans={row:1,col:1},this.remainingSpans={row:0,col:0},this.cacheSpanValues=function(){Object.keys(i.spans).map(function(e){var t;Object.prototype.hasOwnProperty.call(i.spans,e)&&(t=i.spans[e],i.spans[e]=i.element.getAttribute("".concat(e,"Span"))||t)})},this.cacheSpanValues(),this.getSpan=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1]?i.getElement().getAttribute("".concat(e,"Span")):i.spans[e];if(t)return t;throw new Error("no span value found with the given type of [".concat(e,"]"))},this.getRemainingSpans=function(e){return i.remainingSpans[e]},this.setRemainingSpans=function(e,t){i.remainingSpans[e]=t},this.getElement=function(){return i.element},this.createCellElement=function(){return document.createElement("td")},e||(this.element=this.createCellElement()),this.setAttribute=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:",",a=i.getElement()[e];"function"!=typeof a&&"object"!==_typeof(a)||(a=i.getElement().getAttribute(e));var n=a=i.modifications[e]?i.modifications[e].default:a;r?n+="".concat(n).concat(o).concat(t):n=t,i.modifications[e]={value:n,default:a},i.getElement()[e]=n},this.setSpan=function(e,t){if(!i.isReference()){var r=i.getSpan(e)-t<0?i.getSpan(e):t;i.setAttribute("".concat(e,"Span"),r),i.setRemainingSpans(e,i.getSpan(e)-r);for(var o=0;o<r-1;o+=1)i.mergedCells[e]&&i.mergedCells[e][o]&&i.mergedCells[e][o].setMergedRenderStatus(!1);return!0}if(!i.getMergedRenderStatus())return!1;var a=i.referenceObject.getRemainingSpans(e);if(0===a)return!1;var n=a-t<0?a:t,t=a-n;if(i.referenceObject.setRemainingSpans(e,t),i.setAttribute("".concat(e,"Span"),n),0!=t)for(var a=i.referenceObject.mergedCells[e].length-a+1,l=a+n-1,s=a;s<l;s+=1)i.mergedCells[e][s].setMergedRenderStatus(!1);return!0},this.resetAttribute=function(e){i.modifications[e]&&(i.getElement()[e]=i.modifications[e].default,i.modifications[e]=void 0)},this.resetAllAttributes=function(){Object.keys(i.modifications).map(function(e){Object.prototype.hasOwnProperty.call(i.modifications,e)&&i.resetAttribute(e)})},{getElement:this.getElement,el:this.element,setAttribute:this.setAttribute,resetAllAttributes:this.resetAllAttributes,getSpan:this.getSpan,setSpan:this.setSpan,getRemainingSpans:this.getRemainingSpans,setRemainingSpans:this.setRemainingSpans,isReference:this.isReference,addToMergedCells:this.addToMergedCells,mergedCells:this.mergedCells,setMergedRenderStatus:this.setMergedRenderStatus,getMergedRenderStatus:this.getMergedRenderStatus}}function t(e){var u=this;return this.tableElement=e,this.parsedTable=[],this.rowCache=[],this.originals={rows:[]},this.rowColors={header:null,even:null,odd:null},this.addToParsed=function(e,t,r){u.parsedTable[e]||(u.parsedTable[e]=[]),u.parsedTable[e][t]=r},this.parseTable=function(){var e=Array.from(u.tableElement.querySelectorAll("tr"));e.map(function(e,d){u.originals.rows.push(e);var e=Array.from(e.querySelectorAll("td")),c=0;e.map(function(e,t){var r=new O(e);u.addToParsed(d,c,r),c+=1;var o=r.getSpan(O.spanTypes.row),a=r.getSpan(O.spanTypes.column);if(1<o)for(var n=1;n<o;n+=1){var l=new O(e,r);r.addToMergedCells("row",l),u.addToParsed(d+n,t,l)}if(1<a)for(var s=1;s<a;s+=1){var i=new O(e,r);r.addToMergedCells("column",i),u.addToParsed(d,c,i),c+=1}})}),u.parseRowColors(e)},this.parseRowColors=function(e){(!e||e.length<=0)&&i("no rows are found to parse their colors","error");var t=u.tableElement.dataset.wptbHeaderBackgroundColor,r=u.tableElement.dataset.wptbEvenRowBackgroundColor,o=u.tableElement.dataset.wptbOddRowBackgroundColor;u.rowColors.header=void 0!==t?t:""===e[0].style.backgroundColor?null:e[0].style.backgroundColor;for(var a=1<=e.length/3?0:1===e.length?2:(e.length-1)%2,n=0;n<a;n+=1){var l=document.createElement("tr");u.tableElement.querySelector("tbody").appendChild(l),e.push(l)}u.rowColors.even=r||getComputedStyle(e[1]).backgroundColor,u.rowColors.odd=r?o:getComputedStyle(e[2]).backgroundColor;for(var s=0;s<a;s+=1)e[e.length-(s+1)].remove()},this.addRow=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;Array.isArray(e)||(e=[e]);var o=u.tableElement.querySelector("tbody"),a=t?u.originals.rows[r]:((a=document.createRange()).setStart(o,0),a.createContextualFragment('<tr class="'.concat(e.join(" "),'"></tr>')).childNodes[0]);return o.appendChild(a),u.rowCache.push(a),{el:a,id:u.rowCache.length-1}},this.clearTable=function(){u.rowCache=[],u.tableElement.querySelector("tbody").innerHTML=""},this.getRow=function(e){return u.rowCache[e]||(i("no row with id [".concat(e,"] found in the cache."),"warn"),null)},this.maxRows=function(){return u.parsedTable.length},this.maxColumns=function(e){return e?u.parsedTable[0].length:u.parsedTable.reduce(function(e,t){return e=t.length>e?t.length:e},0)},this.getCell=function(t,r){var e=2<arguments.length&&void 0!==arguments[2]&&arguments[2];try{if(u.parsedTable[t][r])return e?u.parsedTable[t][r]:u.parsedTable[t][r].el}catch(e){return i("no cell found at the given address of [".concat(t,"-").concat(r,"]"),"warn"),null}return i("no cell found at the given address of [".concat(t,"-").concat(r,"]"),"warn"),null},this.getCellsAtRow=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=[],o=0;o<u.maxColumns();o+=1){var a=u.getCell(e,o,t);a&&r.push(a)}return r},this.appendToRow=function(e,t,r){r=u.getRow(r),t=u.getCell(e,t,!0);return t&&r&&r.appendChild(t.getElement()),t},this.appendElementToRow=function(e,t){t=u.getRow(t);e&&t&&t.appendChild(e)},this.appendObjectToRow=function(e,t){t=u.getRow(t);e&&t&&t.appendChild(e.getElement())},this.getParsedTable=function(){return u.parsedTable},this.parseTable(),{maxRows:this.maxRows,maxColumns:this.maxColumns,addRow:this.addRow,clearTable:this.clearTable,getCell:this.getCell,appendToRow:this.appendToRow,appendElementToRow:this.appendElementToRow,appendObjectToRow:this.appendObjectToRow,getCellsAtRow:this.getCellsAtRow,el:this.tableElement,rowColors:this.rowColors,getParsedTable:this.getParsedTable}}var r={query:".wptb-preview-table",defaultClasses:["wptb-plugin-responsive-base"],bindToResize:!(O.spanTypes={row:"row",column:"col"})};return function(){var v=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};function P(e){var t,r=!1;return e.style.backgroundColor&&(t=new RegExp(/^rgba\(\s?0\s?,\s?0\s?,\s?0\s?,\s?0\s?\)$/g),r=null!==e.style.backgroundColor.match(t)),r}return this.options=_objectSpread(_objectSpread({},r),e),this.elements=Array.from(document.querySelectorAll(this.options.query)),this.elementObjects=this.elements.map(function(e){return{el:e,tableObject:new t(e)}}),this.bindRebuildToResize=function(){window.addEventListener("resize",function(){v.rebuildTables()})},this.getDirective=function(e){e=e.dataset.wptbResponsiveDirectives;return e?JSON.parse(atob(e)):null},this.addDefaultClasses=function(e){e.classList.add(v.options.defaultClasses)},this.removeDefaultClasses=function(e){e.classList.remove(v.options.defaultClasses)},this.autoBuild=function(e,t,r,o){var a=r.cellStackDirection[t],n=r.topRowAsHeader[t],l=r.cellsPerRow[t],s=!!r.staticTopRow&&r.staticTopRow[t],r=(void 0===r.repeatMergedHeader||!0===r.repeatMergedHeader[t])&&(!!n&&(!r.repeatMergedHeader||r.repeatMergedHeader[t]));o.clearTable(),"desktop"===t?(v.buildDefault(o),v.removeDefaultClasses(e)):(v.autoDirectionBuild(o,a,n,s,l,r),v.addDefaultClasses(e))},this.autoDirectionBuild=function(c,e){var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],u=3<arguments.length&&void 0!==arguments[3]&&arguments[3],p=4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,r=!(5<arguments.length&&void 0!==arguments[5])||arguments[5],b=c.maxRows(),o=c.maxColumns(),a="row"===e;if(t)v.headerBuild(c,e,p,r);else if(a)!function(){var t=[],o=0;u&&c.getCellsAtRow(0,!0).filter(function(e){return!e.isReference()}).map(function(e){o+=1;var t,r=c.addRow("wptb-row");c.appendObjectToRow(e,r.id),e.el.style.backgroundColor&&!P(e.el)||(t=c.rowColors.header||getComputedStyle(r.el).backgroundColor,e.setAttribute("style","background-color: ".concat(t),!0,";")),r.el.style.backgroundColor="#ffffff00",e.setAttribute("colSpan",p)});for(var e=o;e<b;e+=1)c.getCellsAtRow(e,!0).forEach(function(e){e.isReference()||t.push(e)});for(var r=t.length,a=0,n=0;a<r;a+=p,n+=1){for(var l=c.addRow("wptb-row"),s=0;s<p;s+=1){var i,d=t[a+s];d&&(c.appendElementToRow(d.getElement(),l.id),d.resetAllAttributes(),d.setAttribute("style","width: 100% !important",!0,";"),d.setAttribute("colSpan",1),d.setAttribute("rowSpan",1),d.el.style.backgroundColor&&!P(d.el)||(i=c.rowColors[(o+n)%2==0?"odd":"even"],d.el.style.backgroundColor=i||getComputedStyle(l.el).backgroundColor))}l.el.style.backgroundColor="#ffffff00"}}();else{var n=[],l=0;u&&c.getCellsAtRow(0,!0).filter(function(e){return!e.isReference()}).map(function(e){l+=1;var t,r=c.addRow("wptb-row");c.appendObjectToRow(e,r.id),e.el.style.backgroundColor&&!P(e.el)||(t=c.rowColors.header||getComputedStyle(r.el).backgroundColor,e.el.style.backgroundColor=t),r.el.style.backgroundColor="#ffffff00",e.setAttribute("colSpan",p)});for(var s=0;s<o;s+=1)for(var i=l;i<b;i+=1){var d=c.getCell(i,s,!0);d&&!d.isReference()&&n.push(d)}for(var f=n.length,h=0,y=0;h<f;h+=p,y+=1){for(var m=c.addRow("wptb-row"),g=0;g<p;g+=1){var w=n[h+g];w&&(c.appendElementToRow(w.getElement(),m.id),w.resetAllAttributes(),w.setAttribute("style","width: 100% !important",!0,";"),w.setAttribute("colSpan",1),w.setAttribute("rowSpan",1),w.el.style.backgroundColor&&!P(w.el)||(w.el.style.backgroundColor=0===y?c.rowColors.header||getComputedStyle(m.el).backgroundColor:c.rowColors[y%2==0?"odd":"even"]))}m.el.style.backgroundColor="#ffffff00"}}},this.headerBuild=function(r,e){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,o=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],a=r.getCellsAtRow(0,!0).map(function(e){return e.resetAllAttributes(),e.el.style.backgroundColor&&!P(e.el)||e.setAttribute("style","background-color: ".concat(r.rowColors.header),!0,";"),e}),n="column"===e,l=r.maxRows(),s=r.maxColumns(),i="3px solid gray";if(n)for(var d=0===(d=Math.ceil((l-1)/t))?1:d,c=1,u=0;u<d;u+=1){!function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=r.addRow("wptb-row");e&&(t.el.style.borderTop=i),a.map(function(e){e=e.el.cloneNode(!0);r.appendElementToRow(e,t.id),e.style.backgroundColor&&!P(e)||(e.style.backgroundColor="".concat(getComputedStyle(t.el).backgroundColor),e.style.backgroundColor&&(e.style.backgroundColor+=" !important"))}),t.el.style.backgroundColor="#ffffff00"}(0<u);for(var p=0;p<t&&!(l<=c);p+=1){var b=r.addRow("wptb-row");b.el.style.backgroundColor="#ffffff00";for(var f=0;f<s;f+=1){var h,y,m,g=r.getCell(c,f,!0);g&&(g.resetAllAttributes(),m=!0,h=g.getSpan(O.spanTypes.row),g.getSpan(O.spanTypes.column),1<h&&(y=t-p,y=Math.min(h,y),m=g.setSpan(O.spanTypes.row,y),g.setMergedRenderStatus(!0)),m&&(g.el.style.backgroundColor&&!P(g.el)||g.setAttribute("style","background-color: ".concat(r.rowColors[p%2==0?"even":"odd"]),!0,";"),r.appendObjectToRow(g,b.id)))}c+=1}}else for(var w=0===(w=Math.ceil((l-1)/t))?1:w,v=1,S=0;S<w;S+=1){for(var C=0;C<s;C+=1){var T,A,x=r.addRow("wptb-row");0<S&&0===C&&(x.el.style.borderTop=i),!o&&0!==S||(T=r.getCell(0,C,!0)).isReference()||((A=T.el.cloneNode(!0)).style.backgroundColor="".concat(r.rowColors.header," !important"),r.appendElementToRow(A,x.id),A.style.backgroundColor&&!P(A)||(A.style.backgroundColor="".concat(getComputedStyle(x.el).backgroundColor),A.style.backgroundColor&&(A.style.backgroundColor+=" !important")),o?A.setAttribute("rowSpan",A.getAttribute("colSpan")):A.setAttribute("rowSpan",s*w),A.setAttribute("colSpan",1)),x.el.style.backgroundColor="#ffffff00";for(var R=0;R<t&&!(l<=v+R);R+=1){var E,k,_,I=r.getCell(v+R,C,!0);I&&(I.resetAllAttributes(),_=!0,k=I.getSpan(O.spanTypes.row),I.getSpan(O.spanTypes.column),1<k&&(E=t-R,k=Math.min(k,E),_=I.setSpan(O.spanTypes.row,k),E=I.el.getAttribute("rowSpan"),k=I.el.getAttribute("colSpan"),I.setAttribute("rowSpan",k),I.setAttribute("colSpan",E),I.setMergedRenderStatus(!0)),_&&(_=1===t?v%2==0?"even":"odd":(v+R+S)%2==0?"even":"odd",I.el.style.backgroundColor&&!P(I.el)||I.setAttribute("style","background-color: ".concat(r.rowColors[_]),!0,";"),r.appendObjectToRow(I,x.id)))}}v+=t}},this.buildDefault=function(e){for(var t=e.maxRows(),r=e.maxColumns(),o=0;o<t;o+=1)for(var a=e.addRow("",!0,o).id,n=0;n<r;n+=1){var l=e.getCell(o,n,!0);l&&!l.isReference()&&(l.resetAllAttributes(),e.appendElementToRow(l.getElement(),a))}},this.calculateRangeId=function(t,r){var e=Object.keys(r).sort(function(e,t){return r[e].width-r[t].width}),o=e[0];return e.map(function(e){t>=r[e].width&&(o=e)}),o},this.rebuildTable=function(e,t,r){var o=v.getDirective(e);if(o&&o.responsiveEnabled){var a=o.responsiveMode,n=v["".concat(a,"Build")];t=t||e.getBoundingClientRect().width;var l=v.calculateRangeId(t,o.breakpoints);if(!n)throw new Error("No build mode named as [".concat(a,"] found."));t=o.modeOptions[a];n.call(v,e,l,t,r),WPTB_RecalculateIndexes(e);a=new CustomEvent("table:rebuilt",{detail:{sizeRangeId:l,topRowAsHeader:o.modeOptions[a].topRowAsHeader}});e.dispatchEvent(a)}},this.rebuildTables=function(o){v.elementObjects.map(function(e){var t=o;if(!o){var t=window.innerWidth,r=v.getDirective(e.el);if(r&&r.relativeWidth)switch(r.relativeWidth){case"window":t=window.innerWidth;break;case"container":t=e.el.parentNode.parentNode.parentNode.clientWidth;break;default:t=window.innerWidth}}v.rebuildTable(e.el,t,e.tableObject)})},this.options.bindToResize&&this.bindRebuildToResize(),{rebuildTables:this.rebuildTables,getDirective:this.getDirective,calculateRangeId:this.calculateRangeId}}}),function(e){(self||global)["WPTB_StylePass"]=e()}(function(){return new function(){var l=this;this.options={stylesheets:{}},this.insertShadowRoot=function(e,t){var r=t.parentNode,o=Array.from(r.children),a=o.indexOf(t),n=0<a-1?null:o[a-1],a=a+1>=o.length?null:o[a+1];l.prepareAllStylesheets(l.options.stylesheets,e.shadowRoot),l.borrowFromTheme(t),e.shadowRoot.appendChild(t),n?n.insertAdjacentElement("afterend",e):a?a.insertAdjacentElement("beforebegin",e):r.appendChild(e)},this.borrowFromTheme=function(e){var t=e.querySelector("table"),e=getComputedStyle(t).fontFamily;t.style.fontFamily=e},this.init=function(e){l.options=_objectSpread(_objectSpread({},l.options),e);e=Array.from(document.querySelectorAll("div .wptb-table-container"));0<e.length&&e.map(l.setupStylePass)},this.checkTableEligibility=function(e){return e.querySelector("table").dataset.disableThemeStyles},this.setupStylePass=function(e){var t,r;l.checkTableEligibility(e)&&((t=document.createElement("div")).classList.add("wptb-shadow-root-container"),(r=e.querySelector("table").dataset.wptbTableContainerMaxWidth)&&(t.style.maxWidth="".concat(r,"px")),t.attachShadow({mode:"open"}),l.insertShadowRoot(t,e))},this.prepareAllStylesheets=function(t,r){Object.keys(t).map(function(e){Object.prototype.hasOwnProperty.call(t,e)&&l.prepareStylesheet(e,t[e],r)})},this.prepareStylesheet=function(e,t,r){var o=document.createElement("link");o.setAttribute("id",e),o.setAttribute("href",t),o.setAttribute("rel","stylesheet"),o.setAttribute("media","all"),r.appendChild(o)}}}),jQuery,jQuery(document).ready(function(e){var t,F=document.getElementsByClassName("wptb-table-container");function r(){for(var e=0;e<F.length;e++){var t=F[e],r=!0,o=t.getElementsByClassName("wptb-preview-table"),a=t.getElementsByClassName("wptb-table-container-matrix");if(0<o.length&&0<a.length){o=o[0],a=a[0];if(o.style.display="table",o.dataset.wptbTableAlignment&&(d=o.dataset.wptbTableAlignment,t.offsetWidth<o.offsetWidth?o.style.float=null:o.style.float="center"==d?null:d,t.style.float="center"==d?null:d),1==o.dataset.reconstraction&&1==o.dataset.wptbAdaptiveTable){var n=t.offsetWidth,l=o.offsetWidth,s=void 0,i=o.rows;0<i.length&&(s=i[0].querySelectorAll("td").length);var d=!1,i=void 0;if((!o.classList.contains("wptb-table-preview-head")||2<s)&&1<s)if(n<l){if(t.style.overflow="unset",a&&!a.classList.contains("wptb-matrix-hide")&&(a.classList.add("wptb-matrix-hide"),d=!0),o.classList.add("wptb-mobile-view-active"),o.rows&&s){var l=l/s,c=Math.floor(n/l);if(c<1&&(c=1),0<t.getElementsByClassName("wptb-preview-table-mobile").length&&((i=t.getElementsByClassName("wptb-preview-table-mobile")[0]).classList.remove("wptb-mobile-hide"),(u=i.dataset.wholeColumnsInContainer)==c&&o.classList.contains("wptb-table-preview-head")||u==c&&!o.classList.contains("wptb-table-preview-head")&&(480<n||1==i.column)?r=!1:i.parentNode.removeChild(i)),r){var u=document.createElement("table"),p=document.createElement("tbody");u.appendChild(p),u.classList.add("wptb-preview-table-mobile");r=o.className.match(/wptb-element-main(.+)-(\d+)/i);r&&Array.isArray(r)&&u.classList.add(r[0]);var b=o.rows.length,f=void 0,h=!1;if(o.classList.contains("wptb-table-preview-head")){var y=b-1,m=void 0;if(c<b)for(var g=0;g<y;g++){if(0==(f=y%(m=(m=c-1-g)<=0?1:m))){h=!0;break}if(0<m&&m<=6&&m-2*f<0&&f<m){h=!0;break}if(6<m&&m<=12&&m-1.8*f<0&&f<m){h=!0;break}if(12<m&&m<=18&&m-1.6*f<0&&f<m){h=!0;break}}else m=y,h=!(f=0);if(h)for(var w=void 0,w=0<m?s*Math.ceil(y/m):s,v=(Math.floor((w-1)/s),void 0),S=0;S<w;S++){var C=Math.floor(S/s),T=document.createElement("tr"),A=o.rows[0].children[S-C*s].cloneNode(!0),x=void 0,R=window.getComputedStyle(o.rows[0]);A.style.backgroundColor||(A.style.backgroundColor=R.backgroundColor),A.style.width=null,A.style.height=null,A.removeAttribute("data-wptb-css-td-auto-width"),(v=window.getComputedStyle(o.querySelector("td"))).borderTopColor?A.style.borderColor=v.borderTopColor:A.style.borderColor=v.borderBottomColor,0<C&&S%s==0&&(A.style.borderTopWidth="5px"),T.appendChild(A);for(var E,k=m*C+1;k<m*(C+1)+1;k++)k<o.rows.length?(x=o.rows[k].children[S-C*s].cloneNode(!0),E=window.getComputedStyle(o.rows[k]),x.style.backgroundColor||(x.style.backgroundColor=E.backgroundColor),x.style.width=null,x.style.height=null,x.removeAttribute("data-wptb-css-td-auto-width")):((x=document.createElement("td")).style.borderWidth="0px",x.style.background="#fff"),(v=window.getComputedStyle(o.querySelector("td"))).borderTopColor?x.style.borderColor=v.borderTopColor:x.style.borderColor=v.borderBottomColor,0<C&&S%s==0&&(x.style.borderTopWidth="5px"),T.appendChild(x);p.appendChild(T)}}else{var _=void 0;if(480<n)for(var I=0;I<s;I++){if(0==(f=s%(_=0==(_=c-I)?1:_))){h=!0;break}if(0<_&&_<=6&&_-2*f<=0&&f<_){h=!0;break}if(6<_&&_<=12&&_-1.8*f<=0&&f<_){h=!0;break}if(12<_&&_<=18&&_-1.6*f<=0&&f<_){h=!0;break}}else _=1,h=!(f=0),u.column=1;var P=Math.ceil(s/_),O=P*b;if(h)for(var j=0;j<O;j++){var B=Math.floor(j/b),L=document.createElement("tr"),M=void 0,W=void 0,M=B!=P-1||0==f?(W=B*_,_*(1+B)):(W=s-f,s),H=o.rows[j-B*b];L.classList=H.classList,L.style.backgroundColor=H.style.backgroundColor;for(var q=W;q<M;q++){var D,N=H.children[q].cloneNode(!0);N.style.backgroundColor||(D=window.getComputedStyle(H),N.style.backgroundColor=D.backgroundColor),N.style.width=null,N.style.height=null,N.removeAttribute("data-wptb-css-td-auto-width"),L.appendChild(N)}p.appendChild(L)}}u.dataset.wholeColumnsInContainer=c;var z=u.querySelectorAll("[srcset]");if(0<z.length)for(var V=0;V<z.length;V++)z[V].removeAttribute("srcset");i=u,t.appendChild(u),d=!0}}}else a&&a.classList.contains("wptb-matrix-hide")&&(a.classList.remove("wptb-matrix-hide"),d=!0,o.classList.remove("wptb-mobile-view-active"),(i=t.querySelector(".wptb-preview-table-mobile"))&&t.getElementsByClassName("wptb-preview-table-mobile")[0].classList.add("wptb-mobile-hide"),t.style.overflow="auto");else o.style.minWidth="auto";WPTB_RecalculateIndexes(o),d&&(WPTB_RecalculateIndexes(i),i=new CustomEvent("table:rebuilt",{detail:!0,bubbles:!0}),o.dispatchEvent(i))}}}}function o(){for(var C=document.getElementsByClassName("wptb-table-container"),e=0;e<C.length;e++)!function(e){var t=C[e];t.classList.add("wptb-table-container-".concat(e));var r=t.getElementsByClassName("wptb-preview-table");if(0<r.length){(r=r[0]).dataset.wptbTableContainerMaxWidth&&(t.style.maxWidth="".concat(r.dataset.wptbTableContainerMaxWidth,"px")),r.classList.remove("wptb-table-preview-static-indic"),r.mergingСellsHorizontally=!1;for(var o=r.querySelectorAll("td"),a=0;a<o.length;a++)1<o[a].colSpan&&(r.mergingСellsHorizontally=!0);function n(){var e=t.offsetWidth;y<e?g?(r.style.minWidth="100%",r.mergingСellsHorizontally?(r.style.width="auto",l=(l=(e-m)/g)-f-h,w=!0):r.style.width="100%"):(r.style.width="auto",r.style.minWidth=null,r.style.maxWidth="".concat(y,"px")):(r.style.maxWidth=null,r.style.minWidth="".concat(r.dataset.wptbTableTdsSumMaxWidth,"px"),r.style.width="auto",l=r.dataset.wptbTdWidthAuto||"100",w=!0)}var l,s,i,d=t.offsetWidth,c=r.querySelector("td"),u=window.getComputedStyle(c,null),p=u.getPropertyValue("border-left-width"),b=u.getPropertyValue("border-right-width"),c=u.getPropertyValue("padding-left"),u=u.getPropertyValue("padding-left"),f=parseFloat(c,10)+parseFloat(u,10),h=parseFloat(p,10)+parseFloat(b,10),y=r.dataset.wptbTableTdsSumMaxWidth,m=r.dataset.wptbFixedWidthSize,g=r.dataset.wptbCellsWidthAutoCount,w=!1;d<=0?(s=function(e){var t=getComputedStyle(e),e=t.display,t=t.visibility;return"none"!==e||"visible"===t},(S=function e(t){var r=t.parentNode,o=s(r),t=r.nodeName.toLowerCase();return o||"body"===t?"body"===t?null:r:e(r)}(t))&&(i=new MutationObserver(function(e){try{e.map(function(e){var t=s(e.target),e=e.target.getBoundingClientRect().width;if(t&&0<e)throw n(),i.disconnect(),new Error("get out of iteration")})}catch(e){}})).observe(S,{attributes:!0,childList:!1,subtree:!1})):n();var v,S=document.head;!S||(v=S.querySelector("style[data-wptb-td-auto-width-".concat(e,'="true"]')))&&S.removeChild(v),w&&((v=document.createElement("style")).setAttribute("data-wptb-td-auto-width-".concat(e),!0),v.innerHTML=".wptb-table-container-".concat(e," table td[data-wptb-css-td-auto-width=true]{width:").concat(l,"px}"),S&&S.appendChild(v))}}(e)}t=".wptb-preview-table .wptb-button",Array.from(document.querySelectorAll(t)).map(function(t){t.addEventListener("mouseenter",function(e){e=e.target;e.dataset.wptbElementHoverBgColor&&(e.style.backgroundColor=e.dataset.wptbElementHoverBgColor),e.dataset.wptbElementHoverTextColor&&(e.style.color=e.dataset.wptbElementHoverTextColor),e.dataset.wptbElementHoverScale&&(e.style.transform="scale(".concat(t.dataset.wptbElementHoverScale,")"))}),t.addEventListener("mouseleave",function(e){e=e.target;e.dataset.wptbElementHoverBgColor&&(e.style.backgroundColor=e.dataset.wptbElementBgColor),e.dataset.wptbElementHoverTextColor&&(e.style.color=e.dataset.wptbElementColor),e.dataset.wptbElementHoverScale&&(e.style.transform="scale(1)")})}),o(),r(),e(window).resize(function(){o(),r()});for(var a=document.getElementsByClassName("wptb-ph-element"),n=0;n<a.length;n++){var l,s,i=a[n];i.classList.contains("wptb-list-item-container")&&(i.classList.remove("wptb-list-item-container"),i.classList.add("wptb-list-container")),!i.classList.contains("wptb-button-container")||(s=i.className.match(/wptb-size-([A-Z]+)/i))&&Array.isArray(s)&&(s=(l=s[0]).toLowerCase(),i.classList.remove(l),(i=i.querySelector(".wptb-button-wrapper"))&&i.classList.add(s))}var d=new WPTB_ResponsiveFrontend({query:".wptb-preview-table",bindToResize:!0});!function(){for(var e=document.querySelectorAll(".wptb-preview-table"),t=0;t<e.length;t+=1)new WPTB_SortableTable({table:e[t]}).sortableTableInitialization(d)}();e=new CustomEvent("responsive:front",{detail:{responsiveFront:d}});document.dispatchEvent(e),WPTB_ExtraStyles.applyStyles(WPTB_ExtraStyles.modes.frontEnd,WptbFrontendData.generalStyles),d.rebuildTables(),WPTB_StylePass.init(WptbFrontendData.stylePass)});
2
  //# sourceMappingURL=wp-table-builder-frontend.js.map
1
+ function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],o=!0,a=!1,n=void 0;try{for(var l,s=e[Symbol.iterator]();!(o=(l=s.next()).done)&&(r.push(l.value),!t||r.length!==t);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw n}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}!function(e,t,r){"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=r():t[e]=r()}("WPTB_ExtraStyles",self||global,function(){return new function(){var e,l=this;function s(r,e){var e=e.replaceAll(/(\r?\n)|(\/\*.+?\*\/)|(\s*!important)/g,"").replaceAll(";"," !important;").split("}"),o=[];return e.map(function(e){var t=new RegExp(/(.+?)\{/g).exec(e);t&&o.push(e.replace(t[1],"".concat(r," ").concat(t[1])))}),"".concat(o.join("}"),"}")}function i(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=document.createElement("style");r.type="text/css",r.id="wptb-general-styles",t?t.insertAdjacentElement("beforebegin",r):(l.currentMode===l.modes.block?l.baseDocument:l.baseDocument.querySelector("head")).appendChild(r),t=s(".wptb-preview-table",e),r.appendChild(document.createTextNode(t))}function o(e){var t,r,o,a,n=e.dataset.wptbExtraStyles;n&&(a=atob(n),t="wptb-extra-styles-"+(o=_slicedToArray(e.getAttribute("class").match(/wptb-element-main-table_setting-(?:startedid-)?(\d+)/),2)[1]),(n=null==(r=l.baseDocument.querySelector("head"))?void 0:r.querySelector("#".concat(t)))||((n=document.createElement("style")).type="text/css",n.id=t,e.dataset.disableThemeStyles&&l.currentMode===l.modes.frontEnd||l.currentMode===l.modes.block?(e.insertAdjacentElement("beforebegin",n),l.modes.frontEnd&&l.generalStyles&&i(l.generalStyles,e)):r.appendChild(n)),o=".wptb-element-main-table_setting-".concat(o),a=s(o,a),n.innerHTML="",n.appendChild(document.createTextNode(a)))}this.modes={builder:"builder",frontEnd:"frontEnd",block:"block"},this.baseDocument=document,this.currentMode=this.modes.builder,this.generalStyles="";var a=(_defineProperty(e={},this.modes.builder,".wptb-table-setup .wptb-preview-table"),_defineProperty(e,this.modes.block,".wptb-block-table-setup .wptb-preview-table"),_defineProperty(e,this.modes.frontEnd,".wptb-table-container .wptb-preview-table"),e);this.applyStyles=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:l.modes.frontEnd,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document;l.baseDocument=r,l.currentMode=e,l.generalStyles=t;r=Array.from(l.baseDocument.querySelectorAll(a[e]));r&&r.map(o),e!==l.modes.frontEnd&&e!==l.modes.block||!t||i(t)}}}),function(e,t,r){"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=r():t[e]=r()}("WPTB_Logger",self||global,function(){var t={normal:"#48BB78"};return{prepareMessage:function(e){return"%c WP Table Builder %c {message} ".replace("{message}",e)},prepareMessageStyle:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"normal";return"background-color: {bgColor} ; padding: 3px; color: #FFF; border-radius: 0 5px 5px 0;".replace("{bgColor}",t[t[e]?e:"normal"])},log:function(e){console.log(this.prepareMessage(e),"border-radius:5px 0 0 5px; background-color: #3299D1; padding: 3px; color: #FFF; font-weight: bold;",this.prepareMessageStyle("normal"))}}});var WPTB_CutGlueTable={cutTableHorizontally:function(e,t){if(t&&t.rows[e])for(var r=0;r<e;r++)for(var o=t.rows[r].children,a=0;a<o.length;a++)if(1<o[a].rowSpan&&o[a].rowSpan>e-r){var n=o[a].rowSpan-e+r;o[a].rowSpan=e-r,o[a].dataset.sameCellBeforeDivision||(o[a].dataset.sameCellBeforeDivision="r"+r+"c"+a);var l=void 0,l=t.hasOwnProperty("wptbCell")?(l=new t.wptbCell(t.mark)).getDOMElement():document.createElement("td"),s=o[a].getAttribute("style");l.setAttribute("style",s),l.colSpan=o[a].colSpan,l.rowSpan=n,l.dataset.sameCellBeforeDivision=o[a].dataset.sameCellBeforeDivision;for(var n=o[a].dataset.xIndex,i=parseInt(n)+parseInt(o[a].colSpan),d=void 0;!d&&i<t.maxCols;)d=t.rows[e].querySelector('[data-x-index="'+i+'"]'),i++;t.rows[e].insertBefore(l,d),WPTB_RecalculateIndexes(t)}},glueTableHorizontally:function(e){if(e){for(var t=_toConsumableArray(e.getElementsByTagName("td")),r=0;r<t.length;r++)if(t[r].hasAttribute("data-same-cell-before-division"))for(var o=t[r].dataset.sameCellBeforeDivision,a=e.querySelectorAll('[data-same-cell-before-division="'+o+'"]'),n=0;n<a.length;n++)if(a[n]&&a[n+1]&&a[n].parentNode&&a[n+1].parentNode&&!a[n].parentNode.classList.contains("wptb-row-moving")&&!a[n+1].parentNode.classList.contains("wptb-row-moving")&&a[n+1].dataset.yIndex==parseInt(a[n].dataset.yIndex)+parseInt(a[n].rowSpan)){a[n].rowSpan+=a[n+1].rowSpan;for(var l=_toConsumableArray(a[n+1].children),s=0;s<l.length;s++)a[n].appendChild(l[s]);a[n+1].parentNode.removeChild(a[n+1])}WPTB_RecalculateIndexes(e)}},cutTableVertically:function(e,t){for(var r=0;r<t.rows.length;r++){if(e<t.maxCols&&0!=e&&!t.rows[r].querySelector('[data-x-index="'+e+'"]'))for(var o,a,n,l=t.rows[r].children,s=void 0,i=l.length,d=void 0,c=0;c<i;c++)if(1<l[c].colSpan&&parseInt(l[c].dataset.xIndex)<e&&parseInt(l[c].dataset.xIndex)+parseInt(l[c].colSpan)>e){s=t.hasOwnProperty("wptbCell")?(s=new t.wptbCell(t.mark)).getDOMElement():document.createElement("td"),o=l[c].rowSpan,a=l[c].colSpan,l[c].colSpan=e-l[c].dataset.xIndex,n=a-l[c].colSpan,l[c].dataset.sameCellBeforeDivision||(l[c].dataset.sameCellBeforeDivision="r"+r+"c"+c);var u=l[c].getAttribute("style");s.setAttribute("style",u);u=t.querySelector('[data-x-index="'+e+'"]');u&&(s.style.width=u.style.width);u=t.querySelector('[data-y-index="'+r+'"]');u&&(s.style.height=u.style.height),d=l[c+1]||null,t.rows[r].insertBefore(s,d),s.colSpan=n,s.rowSpan=o,s.dataset.sameCellBeforeDivision=l[c].dataset.sameCellBeforeDivision,r+=o-1;break}WPTB_RecalculateIndexes(t)}},glueTableVertically:function(e){if(e){for(var t=_toConsumableArray(e.getElementsByTagName("td")),r=0;r<t.length;r++)if(t[r].hasAttribute("data-same-cell-before-division"))for(var o=t[r].dataset.sameCellBeforeDivision,a=_toConsumableArray(e.querySelectorAll('[data-same-cell-before-division="'+o+'"]')),n=null,l=0;l<a.length;l++)if(a[l]&&a[l+1]&&!a[l].classList.contains("wptb-column-moving")&&!a[l+1].classList.contains("wptb-column-moving")&&a[l+1].dataset.xIndex==parseInt(a[l].dataset.xIndex)+parseInt(a[l].colSpan)){a[n=null==n?l:n].colSpan+=a[l+1].colSpan;for(var s=_toConsumableArray(a[l+1].children),i=0;i<s.length;i++)a[n].appendChild(s[i]);a[l+1].parentNode.removeChild(a[l+1])}WPTB_RecalculateIndexes(e)}}},WPTB_GetDirectionAfterReconstruction=function(o,a,n,r,l){var s=0,i=o.maxCols,e={},d=[];return l&&l.getDirective(o)?e.switch=function(e){var t=l.getDirective(o),r="desktop";return e&&e.detail&&(r=e.detail.sizeRangeId),d=[a,1],"desktop"!==r?t.hasOwnProperty("modeOptions")&&(e=t.responsiveMode,(e=t.modeOptions[e]).hasOwnProperty("topRowAsHeader")&&e.topRowAsHeader.hasOwnProperty(r)&&e.topRowAsHeader[r]?e.hasOwnProperty("cellStackDirection")&&e.cellStackDirection.hasOwnProperty(r)&&("row"===e.cellStackDirection[r]?(d=[n,2],s=i-1):"column"===e.cellStackDirection[r]&&e.hasOwnProperty("cellsPerRow")&&(s=e.cellsPerRow[r])):s=0):s=0,{type:d,itemsPerHeader:s}}:e.switch=function(e){if(d=[a,1],o.classList.contains("wptb-mobile-view-active")){o.classList.contains("wptb-table-preview-head")&&(d=[n,2])===r&&(s=i-1);var t=o.parentNode.parentNode.querySelector(".wptb-preview-table-mobile");return{type:d,itemsPerHeader:s,newTable:t}}return{type:d,itemsPerHeader:s}},e};function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_SortableTable",self||global,function(){return function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},$=this.table=e.table;WPTB_RecalculateIndexes($);var n=this;function t(e,t,r){var o,a,n;"TD"===e.target.tagName?(o=null==e.offsetX?e.layerX:e.offsetX,a=null==e.offsetY?e.layerY:e.offsetY,n=!1,(n="vertical"===t&&e.target.clientWidth-o<=35||"horizontal"===t&&o<=35?!0:n)&&(e.target.clientHeight-35)/2<a&&(e.target.clientHeight+35)/2>a?r.classList.add("sortable-hover"):r.classList.remove("sortable-hover")):r.classList.remove("sortable-hover")}function d(e){t(e,"vertical",this)}function c(e){t(e,"horizontal",this)}function u(){this.classList.remove("sortable-hover")}function r(e,t){if(e.target&&"TD"===e.target.tagName&&!$.parentNode.classList.contains("wptb-preview-table-manage-cells")){var r=e.currentTarget,o=!1;if("vertical"===t&&e.target.dataset.hasOwnProperty("sortedVertical")){var a=[],n=[];if(this.itemsPerHeader&&this.itemsPerHeader<r.rows.length){WPTB_RecalculateIndexes(r);for(var l=_toConsumableArray(r.rows),s=r.querySelector("tbody")?r.querySelector("tbody"):r,i=0;i<l.length;i++)i<e.target.dataset.yIndex?(a.push(l[i]),s.removeChild(l[i])):i>parseInt(e.target.dataset.yIndex,10)+this.itemsPerHeader&&(n.push(l[i]),s.removeChild(l[i]));WPTB_RecalculateIndexes(r)}var d,c,u=r.querySelectorAll('[data-x-index="'.concat(e.target.dataset.xIndex,'"]'));(u=_toConsumableArray(u)).map(function(e){(d=parseInt(e.rowSpan,10))||(d=1),c=e.dataset.yIndex,WPTB_CutGlueTable.cutTableHorizontally(c,r),c+=d,WPTB_CutGlueTable.cutTableHorizontally(c,r)});for(var p,b=[],f=0,h=[],y=0;y<u.length;y++){var m=Q(e,r,u,y,f,"vertical");if(m&&m.hasOwnProperty("i"))u=m.tds,y=m.i;else{for(var g=(u=m?m.tds:u)[y],w=(w=parseInt(g.rowSpan,10))||1,f=parseInt(g.dataset.yIndex,10)+w,m=Y(g),v=[],S=0;S<w;S++)v.push(r.rows[parseInt(g.dataset.yIndex,10)+S]),h.push(parseInt(g.dataset.yIndex,10)+S);0<g.dataset.yIndex?b.push({rowsTd:v,value:m}):p=v}}var C=U(e,"sortedVertical");if(!C)return;if(b.length&&b.sort(function(e,t){return X(C,e,t)}),b.unshift({rowsTd:p}),b.length<r.rows.length)for(var T,A=0;A<r.rows.length;A++)-1<h.indexOf(A)||((T=[]).push(r.rows[A]),b.push({rowsTd:T}));var x,R,E,k=r.querySelector("tbody");k.innerHTML="",b.map(function(e){e.rowsTd.map(function(e){k.appendChild(e)})}),!a.length||(x=r.querySelector("tbody")?r.querySelector("tbody"):r)&&(R=x.querySelector("tr"),a.map(function(e){x.insertBefore(e,R)})),n.length&&(E=r.querySelector("tbody")?r.querySelector("tbody"):r,k&&n.map(function(e){E.appendChild(e)})),WPTB_RecalculateIndexes(r),WPTB_CutGlueTable.glueTableHorizontally(r),o=!0}else if("horizontal"===t&&"0"===e.target.dataset.xIndex){var _,I,P=r.querySelectorAll('[data-y-index="'.concat(e.target.dataset.yIndex,'"]'));(P=_toConsumableArray(P)).map(function(e){(_=parseInt(e.colSpan,10))||(_=1),I=e.dataset.xIndex,WPTB_CutGlueTable.cutTableVertically(I,r),I+=_,WPTB_CutGlueTable.cutTableVertically(I,r)});for(var O,j=[],B=0,L=0;L<P.length;L++){var M=Q(e,r,P,L,B,"horizontal");if(M&&M.hasOwnProperty("i"))P=M.tds,L=M.i;else{for(var W=(P=M?M.tds:P)[L],H=(H=parseInt(W.colSpan,10))||1,B=parseInt(W.dataset.xIndex,10)+H,M=Y(W),q=[],D=0;D<H;D++){var N=_toConsumableArray(r.querySelectorAll('[data-x-index="'.concat(parseInt(W.dataset.xIndex,10)+D,'"]')));q.push(N)}0<W.dataset.xIndex?j.push({columnsTd:q,value:M}):O=q}}var z=U(e,"sortedHorizontal");if(!z)return;if(j.length&&j.sort(function(e,t){return X(z,e,t)}),j.unshift({columnsTd:O}),j.length<r.maxCols)for(var V=r.maxCols-j.length,F=0;F<V;F++){var G=_toConsumableArray(r.querySelectorAll('[data-x-index="'.concat(parseInt(r.maxCols,10)-parseInt(V,10)+F,'"]')));j.push({columnsTd:[G]})}for(var K=0;K<r.rows.length;K++)r.rows[K].innerHTML="";j.map(function(e){e.columnsTd.map(function(e){e.map(function(e){r.rows[e.dataset.yIndex].appendChild(e)})})}),WPTB_RecalculateIndexes(r),WPTB_CutGlueTable.glueTableVertically(r),o=!0}o&&(function(){for(var e=_toConsumableArray(r.getElementsByTagName("td")),t=0;t<e.length;t++)e[t].hasAttribute("data-same-cell-before-division")&&e[t].removeAttribute("data-same-cell-before-division")}(),r.hasOwnProperty("tableSM")&&(new(r.tableSM())).tableStateSet(),this.reassignElementsStyles("td"),this.reassignElementsStyles("tr"))}}function U(e,t){return!(!e.currentTarget||!e.currentTarget.classList.contains("wptb-preview-table")&&!e.currentTarget.classList.contains("wptb-preview-table-mobile"))&&(e.target.dataset[t]&&"ask"!==e.target.dataset[t]?e.target.dataset[t]="ask":e.target.dataset[t]="desk",e.target.dataset[t])}function X(e,t,r){var o=0<arguments.length&&void 0!==e?e:"ask",a=1<arguments.length?t:void 0,n=2<arguments.length?r:void 0,a=a.value,n=n.value;return parseInt(a)&&parseInt(n)&&(a=parseInt(a),n=parseInt(n)),"ask"===o?a<n?-1:a===n?0:1:a<n?1:a===n?0:-1}function Y(e){for(var t=e.querySelectorAll(".wptb-text-container"),t=_toConsumableArray(t),r="",o=0;o<t.length;o++)r+=t[o].innerText,o!==t.length-1&&(r+=" ");return r}function Q(e,t,r,o,a,n){var l,s,i,d,c,u,p=r[o],b=!1;if("vertical"===n?(s="colSpan",i="data-y-index",d="yIndex",c="xIndex",y="rowSpan",u=t.rows.length):"horizontal"===n&&(s="rowSpan",i="data-x-index",d="xIndex",c="yIndex",y="colSpan",u=t.maxCols),0<p.dataset[d]-a)for(var f=t.querySelectorAll("[".concat(i,'="').concat(a,'"]')),h=0;h<f.length;h++)if(l=(l=f[h][s])||1,f[h].dataset[c]<e.target.dataset[c]&&parseInt(f[h].dataset[c],10)+parseInt(l,10)>e.target.dataset[c]){r.splice(o,0,f[h]),b=!0,o--;break}if(b)return{tds:r,i:o};var y=(y=parseInt(p[y],10))||1;if(o==r.length-1&&parseInt(p.dataset[d],10)+y<u){f=t.querySelectorAll("[".concat(i,'="').concat(parseInt(p.dataset[d],10)+y,'"]'));for(var m=0;m<f.length;m++)if(l=(l=f[m][s])||1,f[m].dataset[c]<e.target.dataset[c]&&parseInt(f[m].dataset[c],10)+parseInt(l,10)>e.target.dataset[c]){r.push(f[m]),b=!0;break}}return!!b&&{tds:r}}return this.itemsPerHeader=0,this.tableMaxCols=$.maxCols,this.cellsStylesScheme={},this.rowsStylesScheme={},this.sortModeSwitcher=function(e,t){t&&(this.sortModeSwitcher("horizontal",!1),this.sortModeSwitcher("vertical",!1)),"vertical"===e?(this.table.removeEventListener("click",this.sortableTableVerticalStart,!1),t?(this.sortingCellMouseMoveSwitcher("vertical",!0),this.table.addEventListener("click",this.sortableTableVerticalStart,!1),this.table.dataset.wptbSortableTableVertical="1",this.createTableElementsStylesScheme("td"),this.createTableElementsStylesScheme("tr")):(this.sortingCellMouseMoveSwitcher("vertical",!1),delete this.table.dataset.wptbSortableTableVertical)):"horizontal"===e&&(this.table.removeEventListener("click",this.sortableTableHorizontalStart,!1),t?(this.sortingCellMouseMoveSwitcher("horizontal",!0),this.table.addEventListener("click",this.sortableTableHorizontalStart,!1),this.table.dataset.wptbSortableTableHorizontal="1",this.createTableElementsStylesScheme("td"),this.createTableElementsStylesScheme("tr")):(this.sortingCellMouseMoveSwitcher("horizontal",!1),delete this.table.dataset.wptbSortableTableHorizontal))},this.tableObjectChange=function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];return this.table.classList.contains("wptb-mobile-view-active")&&e?this.table=$.parentNode.parentNode.querySelector(".wptb-preview-table-mobile"):this.table.classList.contains("wptb-preview-table-mobile")&&!e&&(this.table=$.parentNode.querySelector(".wptb-preview-table")),this.table},this.createTableElementsStylesScheme=function(e){this.tableObjectChange();var t=this.table.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var o=t[r],a=window.getComputedStyle(o,null).getPropertyValue("background-color"),n="";"td"===e?(n=o.dataset.xIndex+"-"+o.dataset.yIndex,this.cellsStylesScheme[n]={backgroundColor:a}):"tr"===e&&(n=String(r),this.rowsStylesScheme[n]={backgroundColor:a})}this.tableObjectChange(!1)},this.reassignElementsStyles=function(e){this.tableObjectChange();var t,r=this.table.querySelectorAll(e);if("td"===e?t=this.cellsStylesScheme:"tr"===e&&(t=this.rowsStylesScheme),r.length)for(var o=0;o<r.length;o++){var a=r[o],n="";if("td"===e?n=a.dataset.xIndex+"-"+a.dataset.yIndex:"tr"===e&&(n=o),t.hasOwnProperty(n)){var l,s=t[n];for(l in s)a.style[l]=s[l]}}this.tableObjectChange(!1)},this.sortableTableInitialization=function(e){var t,r,o,a;this.table.dataset.wptbSortableTableVertical&&"1"===this.table.dataset.wptbSortableTableVertical?(t="vertical",r="horizontal"):this.table.dataset.wptbSortableTableHorizontal&&"1"===this.table.dataset.wptbSortableTableHorizontal&&(t="horizontal",r="vertical"),t&&"string"==typeof t&&r&&"string"==typeof r&&(o=WPTB_GetDirectionAfterReconstruction(this.table,t,r,"vertical",e),"object"===_typeof(o)&&o.hasOwnProperty("switch")&&((a=function(e){var t=o.switch(e);"object"===_typeof(t)&&(this.itemsPerHeader=t.itemsPerHeader,t.hasOwnProperty("newTable")?(e=this.table,this.table=t.newTable,this.sortModeSwitcher(t.type[0],!0),this.table=e):this.sortModeSwitcher(t.type[0],!0))}).call(n),this.table.addEventListener("table:rebuilt",function(e){a.call(n,e)},!1)))},this.sortingCellMouseMoveSwitcher=function(e,t){var r=this;function o(e,t,r){e.removeEventListener("mousemove",t,!1),e.removeEventListener("mouseleave",u,!1),r&&(e.addEventListener("mousemove",t,!1),e.addEventListener("mouseleave",u,!1))}function a(e,t,r){r?e.dataset[t]&&"desk-disabled"===e.dataset[t]?e.dataset[t]="desk":e.dataset[t]="ask":"ask"===e.dataset[t]?e.dataset[t]="ask-disabled":"desk"===e.dataset[t]&&(e.dataset[t]="desk-disabled")}var n=this.table.querySelectorAll("td");if(n.length&&(n=_toConsumableArray(n)).map(function(e){o(e,d,!1),a(e,"sortedVertical",!1),o(e,c,!1),a(e,"sortedHorizontal",!1)}),t)if("vertical"===e)for(var l=this.table.rows.length,s=0;0<l;){var i=this.table.querySelectorAll('[data-y-index="'.concat(s,'"]'));(i=_toConsumableArray(i)).map(function(e){o(e,d,t),a(e,"sortedVertical",t)}),this.itemsPerHeader?(l-=this.itemsPerHeader+1,s+=this.itemsPerHeader+1):l=0}else"horizontal"===e&&(e=this.table.querySelectorAll('[data-x-index="0"]'),(e=_toConsumableArray(e)).map(function(e){2<r.table.querySelectorAll('[data-y-index="'.concat(e.dataset.yIndex,'"]')).length&&(o(e,c,t),a(e,"sortedHorizontal",t))}))},this.sortableTableVerticalStart=function(e){r.call(n,e,"vertical")},this.sortableTableHorizontalStart=function(e){r.call(n,e,"horizontal")},this}});var WPTB_RecalculateIndexes=function(e){for(var t,r=e.getElementsByTagName("tr"),o=0,a=0,n=[],l=0;l<r.length;l++){t=r[l].getElementsByTagName("td"),null==n[l]&&(n[l]=[]);for(var s=0,i=0;i<t.length;i++){if(null!=n[l][i])for(var d=0;d<100;d++){if(null==n[l][s]){n[l][s]=t[i],t[i].dataset.xIndex=s;break}s++}else n[l][i]=t[i],t[i].dataset.xIndex=s;if(t[i].dataset.yIndex=l,1<t[i].colSpan)for(var c=1;c<t[i].colSpan;c++)s++,n[l][s]="tdDummy";if(1<t[i].rowSpan)for(var u=1;u<t[i].rowSpan;u++){null==n[l+u]&&(n[l+u]=[]);for(var p=0;p<t[i].colSpan;p++)n[l+u][s-t[i].colSpan+1+p]="tdDummy"}s++}t.length>o&&(o=t.length),0==l&&(a=s)}e.columns=o,e.maxCols=a};function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_ResponsiveFrontend",self||global,function(){function i(e,t){var r=1<arguments.length&&void 0!==t?t:"log";if("undefined"!=typeof process&&"development"===process.env.NODE_ENV){if(!console[r])throw new Error("no logging type found with given type value of [".concat(r,"]"));console[r]("[WPTB]: ".concat(e))}}function O(e){var i=this,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return this.element=e,this.referenceObject=t,this.mergedRenderStatus=!0,this.mergedCells={row:[],column:[]},this.getMergedRenderStatus=function(){return i.mergedRenderStatus},this.setMergedRenderStatus=function(e){i.mergedRenderStatus=e},this.addToMergedCells=function(e,t){i.mergedCells[e].push(t)},this.isReference=function(){return null!==i.referenceObject},this.isReference()&&(this.element=e.cloneNode(!0)),this.modifications={},this.spans={row:1,col:1},this.remainingSpans={row:0,col:0},this.cacheSpanValues=function(){Object.keys(i.spans).map(function(e){var t;Object.prototype.hasOwnProperty.call(i.spans,e)&&(t=i.spans[e],i.spans[e]=i.element.getAttribute("".concat(e,"Span"))||t)})},this.cacheSpanValues(),this.getSpan=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1]?i.getElement().getAttribute("".concat(e,"Span")):i.spans[e];if(t)return t;throw new Error("no span value found with the given type of [".concat(e,"]"))},this.getRemainingSpans=function(e){return i.remainingSpans[e]},this.setRemainingSpans=function(e,t){i.remainingSpans[e]=t},this.getElement=function(){return i.element},this.createCellElement=function(){return document.createElement("td")},e||(this.element=this.createCellElement()),this.setAttribute=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:",",a=i.getElement()[e];"function"!=typeof a&&"object"!==_typeof(a)||(a=i.getElement().getAttribute(e));var n=a=i.modifications[e]?i.modifications[e].default:a;r?n+="".concat(n).concat(o).concat(t):n=t,i.modifications[e]={value:n,default:a},i.getElement()[e]=n},this.setSpan=function(e,t){if(!i.isReference()){var r=i.getSpan(e)-t<0?i.getSpan(e):t;i.setAttribute("".concat(e,"Span"),r),i.setRemainingSpans(e,i.getSpan(e)-r);for(var o=0;o<r-1;o+=1)i.mergedCells[e]&&i.mergedCells[e][o]&&i.mergedCells[e][o].setMergedRenderStatus(!1);return!0}if(!i.getMergedRenderStatus())return!1;var a=i.referenceObject.getRemainingSpans(e);if(0===a)return!1;var n=a-t<0?a:t,t=a-n;if(i.referenceObject.setRemainingSpans(e,t),i.setAttribute("".concat(e,"Span"),n),0!=t)for(var a=i.referenceObject.mergedCells[e].length-a+1,l=a+n-1,s=a;s<l;s+=1)i.mergedCells[e][s].setMergedRenderStatus(!1);return!0},this.resetAttribute=function(e){i.modifications[e]&&(i.getElement()[e]=i.modifications[e].default,i.modifications[e]=void 0)},this.resetAllAttributes=function(){Object.keys(i.modifications).map(function(e){Object.prototype.hasOwnProperty.call(i.modifications,e)&&i.resetAttribute(e)})},{getElement:this.getElement,el:this.element,setAttribute:this.setAttribute,resetAllAttributes:this.resetAllAttributes,getSpan:this.getSpan,setSpan:this.setSpan,getRemainingSpans:this.getRemainingSpans,setRemainingSpans:this.setRemainingSpans,isReference:this.isReference,addToMergedCells:this.addToMergedCells,mergedCells:this.mergedCells,setMergedRenderStatus:this.setMergedRenderStatus,getMergedRenderStatus:this.getMergedRenderStatus}}function t(e){var u=this;return this.tableElement=e,this.parsedTable=[],this.rowCache=[],this.originals={rows:[]},this.rowColors={header:null,even:null,odd:null},this.addToParsed=function(e,t,r){u.parsedTable[e]||(u.parsedTable[e]=[]),u.parsedTable[e][t]=r},this.parseTable=function(){var e=Array.from(u.tableElement.querySelectorAll("tr"));e.map(function(e,d){u.originals.rows.push(e);var e=Array.from(e.querySelectorAll("td")),c=0;e.map(function(e,t){var r=new O(e);u.addToParsed(d,c,r),c+=1;var o=r.getSpan(O.spanTypes.row),a=r.getSpan(O.spanTypes.column);if(1<o)for(var n=1;n<o;n+=1){var l=new O(e,r);r.addToMergedCells("row",l),u.addToParsed(d+n,t,l)}if(1<a)for(var s=1;s<a;s+=1){var i=new O(e,r);r.addToMergedCells("column",i),u.addToParsed(d,c,i),c+=1}})}),u.parseRowColors(e)},this.parseRowColors=function(e){(!e||e.length<=0)&&i("no rows are found to parse their colors","error");var t=u.tableElement.dataset.wptbHeaderBackgroundColor,r=u.tableElement.dataset.wptbEvenRowBackgroundColor,o=u.tableElement.dataset.wptbOddRowBackgroundColor;u.rowColors.header=void 0!==t?t:""===e[0].style.backgroundColor?null:e[0].style.backgroundColor;for(var a=1<=e.length/3?0:1===e.length?2:(e.length-1)%2,n=0;n<a;n+=1){var l=document.createElement("tr");u.tableElement.querySelector("tbody").appendChild(l),e.push(l)}u.rowColors.even=r||getComputedStyle(e[1]).backgroundColor,u.rowColors.odd=r?o:getComputedStyle(e[2]).backgroundColor;for(var s=0;s<a;s+=1)e[e.length-(s+1)].remove()},this.addRow=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;Array.isArray(e)||(e=[e]);var o=u.tableElement.querySelector("tbody"),a=t?u.originals.rows[r]:((a=document.createRange()).setStart(o,0),a.createContextualFragment('<tr class="'.concat(e.join(" "),'"></tr>')).childNodes[0]);return o.appendChild(a),u.rowCache.push(a),{el:a,id:u.rowCache.length-1}},this.clearTable=function(){u.rowCache=[],u.tableElement.querySelector("tbody").innerHTML=""},this.getRow=function(e){return u.rowCache[e]||(i("no row with id [".concat(e,"] found in the cache."),"warn"),null)},this.maxRows=function(){return u.parsedTable.length},this.maxColumns=function(e){return e?u.parsedTable[0].length:u.parsedTable.reduce(function(e,t){return e=t.length>e?t.length:e},0)},this.getCell=function(t,r){var e=2<arguments.length&&void 0!==arguments[2]&&arguments[2];try{if(u.parsedTable[t][r])return e?u.parsedTable[t][r]:u.parsedTable[t][r].el}catch(e){return i("no cell found at the given address of [".concat(t,"-").concat(r,"]"),"warn"),null}return i("no cell found at the given address of [".concat(t,"-").concat(r,"]"),"warn"),null},this.getCellsAtRow=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=[],o=0;o<u.maxColumns();o+=1){var a=u.getCell(e,o,t);a&&r.push(a)}return r},this.appendToRow=function(e,t,r){r=u.getRow(r),t=u.getCell(e,t,!0);return t&&r&&r.appendChild(t.getElement()),t},this.appendElementToRow=function(e,t){t=u.getRow(t);e&&t&&t.appendChild(e)},this.appendObjectToRow=function(e,t){t=u.getRow(t);e&&t&&t.appendChild(e.getElement())},this.getParsedTable=function(){return u.parsedTable},this.parseTable(),{maxRows:this.maxRows,maxColumns:this.maxColumns,addRow:this.addRow,clearTable:this.clearTable,getCell:this.getCell,appendToRow:this.appendToRow,appendElementToRow:this.appendElementToRow,appendObjectToRow:this.appendObjectToRow,getCellsAtRow:this.getCellsAtRow,el:this.tableElement,rowColors:this.rowColors,getParsedTable:this.getParsedTable}}var r={query:".wptb-preview-table",defaultClasses:["wptb-plugin-responsive-base"],bindToResize:!(O.spanTypes={row:"row",column:"col"})};return function(){var v=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};function P(e){var t,r=!1;return e.style.backgroundColor&&(t=new RegExp(/^rgba\(\s?0\s?,\s?0\s?,\s?0\s?,\s?0\s?\)$/g),r=null!==e.style.backgroundColor.match(t)),r}return this.options=_objectSpread(_objectSpread({},r),e),this.elements=Array.from(document.querySelectorAll(this.options.query)),this.elementObjects=this.elements.map(function(e){return{el:e,tableObject:new t(e)}}),this.bindRebuildToResize=function(){window.addEventListener("resize",function(){v.rebuildTables()})},this.getDirective=function(e){e=e.dataset.wptbResponsiveDirectives;return e?JSON.parse(atob(e)):null},this.addDefaultClasses=function(e){e.classList.add(v.options.defaultClasses)},this.removeDefaultClasses=function(e){e.classList.remove(v.options.defaultClasses)},this.autoBuild=function(e,t,r,o){var a=r.cellStackDirection[t],n=r.topRowAsHeader[t],l=r.cellsPerRow[t],s=!!r.staticTopRow&&r.staticTopRow[t],r=(void 0===r.repeatMergedHeader||!0===r.repeatMergedHeader[t])&&(!!n&&(!r.repeatMergedHeader||r.repeatMergedHeader[t]));o.clearTable(),"desktop"===t?(v.buildDefault(o),v.removeDefaultClasses(e)):(v.autoDirectionBuild(o,a,n,s,l,r),v.addDefaultClasses(e))},this.autoDirectionBuild=function(c,e){var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],u=3<arguments.length&&void 0!==arguments[3]&&arguments[3],p=4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,r=!(5<arguments.length&&void 0!==arguments[5])||arguments[5],b=c.maxRows(),o=c.maxColumns(),a="row"===e;if(t)v.headerBuild(c,e,p,r);else if(a)!function(){var t=[],o=0;u&&c.getCellsAtRow(0,!0).filter(function(e){return!e.isReference()}).map(function(e){o+=1;var t,r=c.addRow("wptb-row");c.appendObjectToRow(e,r.id),e.el.style.backgroundColor&&!P(e.el)||(t=c.rowColors.header||getComputedStyle(r.el).backgroundColor,e.setAttribute("style","background-color: ".concat(t),!0,";")),r.el.style.backgroundColor="#ffffff00",e.setAttribute("colSpan",p)});for(var e=o;e<b;e+=1)c.getCellsAtRow(e,!0).forEach(function(e){e.isReference()||t.push(e)});for(var r=t.length,a=0,n=0;a<r;a+=p,n+=1){for(var l=c.addRow("wptb-row"),s=0;s<p;s+=1){var i,d=t[a+s];d&&(c.appendElementToRow(d.getElement(),l.id),d.resetAllAttributes(),d.setAttribute("style","width: 100% !important",!0,";"),d.setAttribute("colSpan",1),d.setAttribute("rowSpan",1),d.el.style.backgroundColor&&!P(d.el)||(i=c.rowColors[(o+n)%2==0?"odd":"even"],d.el.style.backgroundColor=i||getComputedStyle(l.el).backgroundColor))}l.el.style.backgroundColor="#ffffff00"}}();else{var n=[],l=0;u&&c.getCellsAtRow(0,!0).filter(function(e){return!e.isReference()}).map(function(e){l+=1;var t,r=c.addRow("wptb-row");c.appendObjectToRow(e,r.id),e.el.style.backgroundColor&&!P(e.el)||(t=c.rowColors.header||getComputedStyle(r.el).backgroundColor,e.el.style.backgroundColor=t),r.el.style.backgroundColor="#ffffff00",e.setAttribute("colSpan",p)});for(var s=0;s<o;s+=1)for(var i=l;i<b;i+=1){var d=c.getCell(i,s,!0);d&&!d.isReference()&&n.push(d)}for(var f=n.length,h=0,y=0;h<f;h+=p,y+=1){for(var m=c.addRow("wptb-row"),g=0;g<p;g+=1){var w=n[h+g];w&&(c.appendElementToRow(w.getElement(),m.id),w.resetAllAttributes(),w.setAttribute("style","width: 100% !important",!0,";"),w.setAttribute("colSpan",1),w.setAttribute("rowSpan",1),w.el.style.backgroundColor&&!P(w.el)||(w.el.style.backgroundColor=0===y?c.rowColors.header||getComputedStyle(m.el).backgroundColor:c.rowColors[y%2==0?"odd":"even"]))}m.el.style.backgroundColor="#ffffff00"}}},this.headerBuild=function(r,e){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,o=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],a=r.getCellsAtRow(0,!0).map(function(e){return e.resetAllAttributes(),e.el.style.backgroundColor&&!P(e.el)||e.setAttribute("style","background-color: ".concat(r.rowColors.header),!0,";"),e}),n="column"===e,l=r.maxRows(),s=r.maxColumns(),i="3px solid gray";if(n)for(var d=0===(d=Math.ceil((l-1)/t))?1:d,c=1,u=0;u<d;u+=1){!function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=r.addRow("wptb-row");e&&(t.el.style.borderTop=i),a.map(function(e){e=e.el.cloneNode(!0);r.appendElementToRow(e,t.id),e.style.backgroundColor&&!P(e)||(e.style.backgroundColor="".concat(getComputedStyle(t.el).backgroundColor),e.style.backgroundColor&&(e.style.backgroundColor+=" !important"))}),t.el.style.backgroundColor="#ffffff00"}(0<u);for(var p=0;p<t&&!(l<=c);p+=1){var b=r.addRow("wptb-row");b.el.style.backgroundColor="#ffffff00";for(var f=0;f<s;f+=1){var h,y,m,g=r.getCell(c,f,!0);g&&(g.resetAllAttributes(),m=!0,h=g.getSpan(O.spanTypes.row),g.getSpan(O.spanTypes.column),1<h&&(y=t-p,y=Math.min(h,y),m=g.setSpan(O.spanTypes.row,y),g.setMergedRenderStatus(!0)),m&&(g.el.style.backgroundColor&&!P(g.el)||g.setAttribute("style","background-color: ".concat(r.rowColors[p%2==0?"even":"odd"]),!0,";"),r.appendObjectToRow(g,b.id)))}c+=1}}else for(var w=0===(w=Math.ceil((l-1)/t))?1:w,v=1,S=0;S<w;S+=1){for(var C=0;C<s;C+=1){var T,A,x=r.addRow("wptb-row");0<S&&0===C&&(x.el.style.borderTop=i),!o&&0!==S||(T=r.getCell(0,C,!0)).isReference()||((A=T.el.cloneNode(!0)).style.backgroundColor="".concat(r.rowColors.header," !important"),r.appendElementToRow(A,x.id),A.style.backgroundColor&&!P(A)||(A.style.backgroundColor="".concat(getComputedStyle(x.el).backgroundColor),A.style.backgroundColor&&(A.style.backgroundColor+=" !important")),o?A.setAttribute("rowSpan",A.getAttribute("colSpan")):A.setAttribute("rowSpan",s*w),A.setAttribute("colSpan",1)),x.el.style.backgroundColor="#ffffff00";for(var R=0;R<t&&!(l<=v+R);R+=1){var E,k,_,I=r.getCell(v+R,C,!0);I&&(I.resetAllAttributes(),_=!0,k=I.getSpan(O.spanTypes.row),I.getSpan(O.spanTypes.column),1<k&&(E=t-R,k=Math.min(k,E),_=I.setSpan(O.spanTypes.row,k),E=I.el.getAttribute("rowSpan"),k=I.el.getAttribute("colSpan"),I.setAttribute("rowSpan",k),I.setAttribute("colSpan",E),I.setMergedRenderStatus(!0)),_&&(_=1===t?v%2==0?"even":"odd":(v+R+S)%2==0?"even":"odd",I.el.style.backgroundColor&&!P(I.el)||I.setAttribute("style","background-color: ".concat(r.rowColors[_]),!0,";"),r.appendObjectToRow(I,x.id)))}}v+=t}},this.buildDefault=function(e){for(var t=e.maxRows(),r=e.maxColumns(),o=0;o<t;o+=1)for(var a=e.addRow("",!0,o).id,n=0;n<r;n+=1){var l=e.getCell(o,n,!0);l&&!l.isReference()&&(l.resetAllAttributes(),e.appendElementToRow(l.getElement(),a))}},this.calculateRangeId=function(t,r){var e=Object.keys(r).sort(function(e,t){return r[e].width-r[t].width}),o=e[0];return e.map(function(e){t>=r[e].width&&(o=e)}),o},this.rebuildTable=function(e,t,r){var o=v.getDirective(e);if(o&&o.responsiveEnabled){var a=o.responsiveMode,n=v["".concat(a,"Build")];t=t||e.getBoundingClientRect().width;var l=v.calculateRangeId(t,o.breakpoints);if(!n)throw new Error("No build mode named as [".concat(a,"] found."));t=o.modeOptions[a];n.call(v,e,l,t,r),WPTB_RecalculateIndexes(e);a=new CustomEvent("table:rebuilt",{detail:{sizeRangeId:l,topRowAsHeader:o.modeOptions[a].topRowAsHeader}});e.dispatchEvent(a)}},this.rebuildTables=function(o){v.elementObjects.map(function(e){var t=o;if(!o){var t=window.innerWidth,r=v.getDirective(e.el);if(r&&r.relativeWidth)switch(r.relativeWidth){case"window":t=window.innerWidth;break;case"container":t=e.el.parentNode.parentNode.parentNode.clientWidth;break;default:t=window.innerWidth}}v.rebuildTable(e.el,t,e.tableObject)})},this.options.bindToResize&&this.bindRebuildToResize(),{rebuildTables:this.rebuildTables,getDirective:this.getDirective,calculateRangeId:this.calculateRangeId}}}),function(e){(self||global)["WPTB_StylePass"]=e()}(function(){return new function(){var l=this;this.options={stylesheets:{}},this.insertShadowRoot=function(e,t){var r=t.parentNode,o=Array.from(r.children),a=o.indexOf(t),n=0<a-1?null:o[a-1],a=a+1>=o.length?null:o[a+1];l.prepareAllStylesheets(l.options.stylesheets,e.shadowRoot),l.borrowFromTheme(t),e.shadowRoot.appendChild(t),n?n.insertAdjacentElement("afterend",e):a?a.insertAdjacentElement("beforebegin",e):r.appendChild(e)},this.borrowFromTheme=function(e){var t=e.querySelector("table"),e=getComputedStyle(t).fontFamily;t.style.fontFamily=e},this.init=function(e){l.options=_objectSpread(_objectSpread({},l.options),e);e=Array.from(document.querySelectorAll("div .wptb-table-container"));0<e.length&&e.map(l.setupStylePass)},this.checkTableEligibility=function(e){e=e.querySelector("table");return!!e&&e.dataset.disableThemeStyles},this.setupStylePass=function(e){var t,r;l.checkTableEligibility(e)&&((t=document.createElement("div")).classList.add("wptb-shadow-root-container"),(r=e.querySelector("table").dataset.wptbTableContainerMaxWidth)&&(t.style.maxWidth="".concat(r,"px")),t.attachShadow({mode:"open"}),l.insertShadowRoot(t,e))},this.prepareAllStylesheets=function(t,r){Object.keys(t).map(function(e){Object.prototype.hasOwnProperty.call(t,e)&&l.prepareStylesheet(e,t[e],r)})},this.prepareStylesheet=function(e,t,r){var o=document.createElement("link");o.setAttribute("id",e),o.setAttribute("href",t),o.setAttribute("rel","stylesheet"),o.setAttribute("media","all"),r.appendChild(o)}}}),jQuery,jQuery(document).ready(function(e){var t,F=document.getElementsByClassName("wptb-table-container");function r(){for(var e=0;e<F.length;e++){var t=F[e],r=!0,o=t.getElementsByClassName("wptb-preview-table"),a=t.getElementsByClassName("wptb-table-container-matrix");if(0<o.length&&0<a.length){o=o[0],a=a[0];if(o.style.display="table",o.dataset.wptbTableAlignment&&(d=o.dataset.wptbTableAlignment,t.offsetWidth<o.offsetWidth?o.style.float=null:o.style.float="center"==d?null:d,t.style.float="center"==d?null:d),1==o.dataset.reconstraction&&1==o.dataset.wptbAdaptiveTable){var n=t.offsetWidth,l=o.offsetWidth,s=void 0,i=o.rows;0<i.length&&(s=i[0].querySelectorAll("td").length);var d=!1,i=void 0;if((!o.classList.contains("wptb-table-preview-head")||2<s)&&1<s)if(n<l){if(t.style.overflow="unset",a&&!a.classList.contains("wptb-matrix-hide")&&(a.classList.add("wptb-matrix-hide"),d=!0),o.classList.add("wptb-mobile-view-active"),o.rows&&s){var l=l/s,c=Math.floor(n/l);if(c<1&&(c=1),0<t.getElementsByClassName("wptb-preview-table-mobile").length&&((i=t.getElementsByClassName("wptb-preview-table-mobile")[0]).classList.remove("wptb-mobile-hide"),(u=i.dataset.wholeColumnsInContainer)==c&&o.classList.contains("wptb-table-preview-head")||u==c&&!o.classList.contains("wptb-table-preview-head")&&(480<n||1==i.column)?r=!1:i.parentNode.removeChild(i)),r){var u=document.createElement("table"),p=document.createElement("tbody");u.appendChild(p),u.classList.add("wptb-preview-table-mobile");r=o.className.match(/wptb-element-main(.+)-(\d+)/i);r&&Array.isArray(r)&&u.classList.add(r[0]);var b=o.rows.length,f=void 0,h=!1;if(o.classList.contains("wptb-table-preview-head")){var y=b-1,m=void 0;if(c<b)for(var g=0;g<y;g++){if(0==(f=y%(m=(m=c-1-g)<=0?1:m))){h=!0;break}if(0<m&&m<=6&&m-2*f<0&&f<m){h=!0;break}if(6<m&&m<=12&&m-1.8*f<0&&f<m){h=!0;break}if(12<m&&m<=18&&m-1.6*f<0&&f<m){h=!0;break}}else m=y,h=!(f=0);if(h)for(var w=void 0,w=0<m?s*Math.ceil(y/m):s,v=(Math.floor((w-1)/s),void 0),S=0;S<w;S++){var C=Math.floor(S/s),T=document.createElement("tr"),A=o.rows[0].children[S-C*s].cloneNode(!0),x=void 0,R=window.getComputedStyle(o.rows[0]);A.style.backgroundColor||(A.style.backgroundColor=R.backgroundColor),A.style.width=null,A.style.height=null,A.removeAttribute("data-wptb-css-td-auto-width"),(v=window.getComputedStyle(o.querySelector("td"))).borderTopColor?A.style.borderColor=v.borderTopColor:A.style.borderColor=v.borderBottomColor,0<C&&S%s==0&&(A.style.borderTopWidth="5px"),T.appendChild(A);for(var E,k=m*C+1;k<m*(C+1)+1;k++)k<o.rows.length?(x=o.rows[k].children[S-C*s].cloneNode(!0),E=window.getComputedStyle(o.rows[k]),x.style.backgroundColor||(x.style.backgroundColor=E.backgroundColor),x.style.width=null,x.style.height=null,x.removeAttribute("data-wptb-css-td-auto-width")):((x=document.createElement("td")).style.borderWidth="0px",x.style.background="#fff"),(v=window.getComputedStyle(o.querySelector("td"))).borderTopColor?x.style.borderColor=v.borderTopColor:x.style.borderColor=v.borderBottomColor,0<C&&S%s==0&&(x.style.borderTopWidth="5px"),T.appendChild(x);p.appendChild(T)}}else{var _=void 0;if(480<n)for(var I=0;I<s;I++){if(0==(f=s%(_=0==(_=c-I)?1:_))){h=!0;break}if(0<_&&_<=6&&_-2*f<=0&&f<_){h=!0;break}if(6<_&&_<=12&&_-1.8*f<=0&&f<_){h=!0;break}if(12<_&&_<=18&&_-1.6*f<=0&&f<_){h=!0;break}}else _=1,h=!(f=0),u.column=1;var P=Math.ceil(s/_),O=P*b;if(h)for(var j=0;j<O;j++){var B=Math.floor(j/b),L=document.createElement("tr"),M=void 0,W=void 0,M=B!=P-1||0==f?(W=B*_,_*(1+B)):(W=s-f,s),H=o.rows[j-B*b];L.classList=H.classList,L.style.backgroundColor=H.style.backgroundColor;for(var q=W;q<M;q++){var D,N=H.children[q].cloneNode(!0);N.style.backgroundColor||(D=window.getComputedStyle(H),N.style.backgroundColor=D.backgroundColor),N.style.width=null,N.style.height=null,N.removeAttribute("data-wptb-css-td-auto-width"),L.appendChild(N)}p.appendChild(L)}}u.dataset.wholeColumnsInContainer=c;var z=u.querySelectorAll("[srcset]");if(0<z.length)for(var V=0;V<z.length;V++)z[V].removeAttribute("srcset");i=u,t.appendChild(u),d=!0}}}else a&&a.classList.contains("wptb-matrix-hide")&&(a.classList.remove("wptb-matrix-hide"),d=!0,o.classList.remove("wptb-mobile-view-active"),(i=t.querySelector(".wptb-preview-table-mobile"))&&t.getElementsByClassName("wptb-preview-table-mobile")[0].classList.add("wptb-mobile-hide"),t.style.overflow="auto");else o.style.minWidth="auto";WPTB_RecalculateIndexes(o),d&&(WPTB_RecalculateIndexes(i),i=new CustomEvent("table:rebuilt",{detail:!0,bubbles:!0}),o.dispatchEvent(i))}}}}function o(){for(var C=document.getElementsByClassName("wptb-table-container"),e=0;e<C.length;e++)!function(e){var t=C[e];t.classList.add("wptb-table-container-".concat(e));var r=t.getElementsByClassName("wptb-preview-table");if(0<r.length){(r=r[0]).dataset.wptbTableContainerMaxWidth&&(t.style.maxWidth="".concat(r.dataset.wptbTableContainerMaxWidth,"px")),r.classList.remove("wptb-table-preview-static-indic"),r.mergingСellsHorizontally=!1;for(var o=r.querySelectorAll("td"),a=0;a<o.length;a++)1<o[a].colSpan&&(r.mergingСellsHorizontally=!0);function n(){var e=t.offsetWidth;y<e?g?(r.style.minWidth="100%",r.mergingСellsHorizontally?(r.style.width="auto",l=(l=(e-m)/g)-f-h,w=!0):r.style.width="100%"):(r.style.width="auto",r.style.minWidth=null,r.style.maxWidth="".concat(y,"px")):(r.style.maxWidth=null,r.style.minWidth="".concat(r.dataset.wptbTableTdsSumMaxWidth,"px"),r.style.width="auto",l=r.dataset.wptbTdWidthAuto||"100",w=!0)}var l,s,i,d=t.offsetWidth,c=r.querySelector("td"),u=window.getComputedStyle(c,null),p=u.getPropertyValue("border-left-width"),b=u.getPropertyValue("border-right-width"),c=u.getPropertyValue("padding-left"),u=u.getPropertyValue("padding-left"),f=parseFloat(c,10)+parseFloat(u,10),h=parseFloat(p,10)+parseFloat(b,10),y=r.dataset.wptbTableTdsSumMaxWidth,m=r.dataset.wptbFixedWidthSize,g=r.dataset.wptbCellsWidthAutoCount,w=!1;d<=0?(s=function(e){var t=getComputedStyle(e),e=t.display,t=t.visibility;return"none"!==e||"visible"===t},(S=function e(t){var r=t.parentNode,o=s(r),t=r.nodeName.toLowerCase();return o||"body"===t?"body"===t?null:r:e(r)}(t))&&(i=new MutationObserver(function(e){try{e.map(function(e){var t=s(e.target),e=e.target.getBoundingClientRect().width;if(t&&0<e)throw n(),i.disconnect(),new Error("get out of iteration")})}catch(e){}})).observe(S,{attributes:!0,childList:!1,subtree:!1})):n();var v,S=document.head;!S||(v=S.querySelector("style[data-wptb-td-auto-width-".concat(e,'="true"]')))&&S.removeChild(v),w&&((v=document.createElement("style")).setAttribute("data-wptb-td-auto-width-".concat(e),!0),v.innerHTML=".wptb-table-container-".concat(e," table td[data-wptb-css-td-auto-width=true]{width:").concat(l,"px}"),S&&S.appendChild(v))}}(e)}t=".wptb-preview-table .wptb-button",Array.from(document.querySelectorAll(t)).map(function(t){t.addEventListener("mouseenter",function(e){e=e.target;e.dataset.wptbElementHoverBgColor&&(e.style.backgroundColor=e.dataset.wptbElementHoverBgColor),e.dataset.wptbElementHoverTextColor&&(e.style.color=e.dataset.wptbElementHoverTextColor),e.dataset.wptbElementHoverScale&&(e.style.transform="scale(".concat(t.dataset.wptbElementHoverScale,")"))}),t.addEventListener("mouseleave",function(e){e=e.target;e.dataset.wptbElementHoverBgColor&&(e.style.backgroundColor=e.dataset.wptbElementBgColor),e.dataset.wptbElementHoverTextColor&&(e.style.color=e.dataset.wptbElementColor),e.dataset.wptbElementHoverScale&&(e.style.transform="scale(1)")})}),o(),r(),e(window).resize(function(){o(),r()});for(var a=document.getElementsByClassName("wptb-ph-element"),n=0;n<a.length;n++){var l,s,i=a[n];i.classList.contains("wptb-list-item-container")&&(i.classList.remove("wptb-list-item-container"),i.classList.add("wptb-list-container")),!i.classList.contains("wptb-button-container")||(s=i.className.match(/wptb-size-([A-Z]+)/i))&&Array.isArray(s)&&(s=(l=s[0]).toLowerCase(),i.classList.remove(l),(i=i.querySelector(".wptb-button-wrapper"))&&i.classList.add(s))}var d=new WPTB_ResponsiveFrontend({query:".wptb-preview-table",bindToResize:!0});!function(){for(var e=document.querySelectorAll(".wptb-preview-table"),t=0;t<e.length;t+=1)new WPTB_SortableTable({table:e[t]}).sortableTableInitialization(d)}();e=new CustomEvent("responsive:front",{detail:{responsiveFront:d}});document.dispatchEvent(e),WPTB_ExtraStyles.applyStyles(WPTB_ExtraStyles.modes.frontEnd,WptbFrontendData.generalStyles),d.rebuildTables(),WPTB_StylePass.init(WptbFrontendData.stylePass)});
2
  //# sourceMappingURL=wp-table-builder-frontend.js.map
inc/frontend/js/wp-table-builder-frontend.js.map CHANGED
@@ -1 +1 @@
1
- {"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","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","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","_objectSpread","elementObjects","tableObject","bindRebuildToResize","rebuildTables","directiveString","wptbResponsiveDirectives","JSON","parse","addDefaultClasses","removeDefaultClasses","autoBuild","sizeRange","autoOption","tableObj","direction","staticTopRow","repeatMergedHeader","buildDefault","autoDirectionBuild","isRowStacked","headerBuild","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","tabEvent","CustomEvent","dispatchEvent","o","innerSize","innerWidth","relativeWidth","stylesheets","insertShadowRoot","shadowRootContainer","tableContainer","mainParent","parentChildren","tableIndex","upSibling","downSibling","prepareAllStylesheets","shadowRoot","borrowFromTheme","fontFamily","init","tableContainers","setupStylePass","checkTableEligibility","container","maxWidth","wptbTableContainerMaxWidth","attachShadow","stylesheetsObj","root","prepareStylesheet","handler","url","linkElement","jQuery","ready","$","getElementsByClassName","wptb_tableReconstraction","createNewTableIndic","previewTable","tableContainerMatrix","display","wptbTableAlignment","offsetWidth","reconstraction","wptbAdaptiveTable","tableContainerWidth","previewTableWidth","tableColumns","previewTableRows","tableReconstructed","wptbPreviewTableMobile","overflow","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","images","minWidth","bubbles","wptb_tdDefaultWidth","wptbTableContainers","wptbTableContainer","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","transform","wptbElementBgColor","wptbElementColor","resize","wptbSize","wptbSizeNew","wptbButtonWrapper","WPTB_ResponsiveFrontend","tables","WPTB_SortableTable","sortingTable","responsiveFrontReady","WPTB_ExtraStyles","WptbFrontendData","WPTB_StylePass","stylePass"],"mappings":"wsFAGA,SAAcA,EAAKC,EAASC,GACL,oBAAXC,QAA6C,YAAnB,oBAAOC,QAAP,YAAAC,QAAOD,UAC3CD,OAAOC,QAAUF,IAGjBD,EAAQD,GAAOE,IALjB,CAQG,mBAAoBI,MAAQC,OAAQ,WAqMtC,OAAO,IA5LP,WAA4B,IAAAC,EAAAC,EAAAC,KAiEF,SAAnBC,EAAoBC,EAAQC,GAEjC,IAEMC,EAF+BD,EAfdE,WAAW,yCAA0C,IAG7DA,WAAW,IAAK,gBAcKC,MAAM,KACpCC,EAAsB,GAY5B,OATAH,EAAYI,IAAI,SAACF,GAChB,IACMG,EADS,IAAIC,OAAO,YACHC,KAAKL,GAExBG,GACHF,EAAoBK,KAAKN,EAAMO,QAAQJ,EAAQ,GAAtB,GAAAK,OAA6BZ,EAA7B,KAAAY,OAAuCL,EAAQ,QAI1E,GAAAK,OAAUP,EAAoBQ,KAAK,KAAnC,KAS0B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Q5C,UAAUwD,IAAI,yBAGnBZ,EAAQ5C,UAAUC,SAAS,2BACxBwa,EAAS7X,EAAQ8X,UAAUpe,MAAM,yBACzBW,MAAMkT,QAAQsK,KAErBmF,GADAD,EAAWlF,EAAO,IACK4D,cAE7Bzb,EAAQ5C,UAAUyD,OAAOkc,IAEnBE,EAAoBjd,EAAQvH,cAAc,0BAE/CwkB,EAAkB7f,UAAUwD,IAAIoc,IAQpC,IAAMle,EAAkB,IAAIoe,wBAAwB,CACnD/N,MAAO,sBACPE,cAAc,KAIf,WAEC,IADA,IAAM8N,EAASnlB,SAASuC,iBAAiB,uBAChCc,EAAI,EAAGA,EAAI8hB,EAAOtlB,OAAQwD,GAAK,EACjB,IAAI+hB,mBAAmB,CAAEjiB,MAAOgiB,EAAO9hB,KAC/CwL,4BAA4B/H,GAI5Cue,GACMC,EAAuB,IAAInJ,YAAY,mBAAoB,CAChE7U,OAAQ,CACPR,gBAAAA,KAGF9G,SAASoc,cAAckJ,GAGvBC,iBAAiBrjB,YAAYqjB,iBAAiBjlB,MAAMuB,SAAU2jB,iBAAiB9lB,eAG/EoH,EAAgB+Q,gBAGhB4N,eAAenI,KAAKkI,iBAAiBE","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('.wptb-preview-table', generalStyles);\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.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}\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 {[HTMLElement]} 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(`<tr class=\"${classList.join(' ')}\"></tr>`).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 mergedHeader\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\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 * 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\tthis.buildDefault(tableObj);\n\t\t\t\tthis.removeDefaultClasses(tableEl);\n\t\t\t} else {\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\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\tbaseCells.map((b) => {\n\t\t\t\t\t\t\trowStartIndex += 1;\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\t// @deprecated\n\t\t\t\t\t\t\t\t\t// const bgColor =\n\t\t\t\t\t\t\t\t\t// \tr === 0\n\t\t\t\t\t\t\t\t\t// \t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t// \t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t// \t\t\t: getComputedStyle(rowObj.el).backgroundColor\n\t\t\t\t\t\t\t\t\t// \t\t: tableObj.rowColors[r % 2 === 0 ? 'odd' : 'even'];\n\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\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\tbaseCells.map((b) => {\n\t\t\t\t\t\t\trowStartIndex += 1;\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\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\t\t\tb.el.style.backgroundColor = bgColor;\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\ttempCell.el.style.backgroundColor =\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\t\t\t\t\t\tr === 0\n\t\t\t\t\t\t\t\t\t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t\t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t\t\t\t: getComputedStyle(rowObj.el).backgroundColor\n\t\t\t\t\t\t\t\t\t\t\t: tableObj.rowColors[r % 2 === 0 ? 'odd' : 'even'];\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\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\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) {\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 * 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\t\t\t\t\tbuildCallable.call(this, el, sizeRangeId, modeOptions, tableObj);\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\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.dataset.disableThemeStyles;\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\t\t\tconst maxWidth = tableContainer.querySelector('table').dataset.wptbTableContainerMaxWidth;\n\t\t\tif (maxWidth) {\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((s) => {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(stylesheetsObj, s)) {\n\t\t\t\t\tthis.prepareStylesheet(s, stylesheetsObj[s], root);\n\t\t\t\t}\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 ($) {\n\t/**\n\t * All of the code for your public-facing JavaScript source\n\t * should reside in this file.\n\t *\n\t * Note: It has been assumed you will write jQuery code here, so the\n\t * $ function reference has been prepared for usage within the scope\n\t * of this function.\n\t *\n\t * This enables you to define handlers, for when the DOM is ready:\n\t *\n\t * $(function() {\n\t *\n\t * });\n\t *\n\t * When the window is loaded:\n\t *\n\t * $( window ).load(function() {\n\t *\n\t * });\n\t *\n\t * ...and/or other possibilities.\n\t *\n\t * Ideally, it is not considered best practise to attach more than a\n\t * single DOM-ready or window-load handler for a particular page.\n\t * Although scripts in the WordPress core, Plugins and Themes may be\n\t * practising this, we should strive to set a better example in our own work.\n\t *\n\t * The file is enqueued from inc/frontend/class-frontend.php.\n\t */\n\n\tjQuery(document).ready(function ($) {\n\t\tconst tableContainers = document.getElementsByClassName('wptb-table-container');\n\n\t\t/**\n\t\t * Adds hover color change support for supported button elements.\n\t\t *\n\t\t * @param {string} querySelector query selector string\n\t\t */\n\t\tfunction addHoverSupport(querySelector) {\n\t\t\tconst buttons = Array.from(document.querySelectorAll(querySelector));\n\n\t\t\tbuttons.map((b) => {\n\t\t\t\tb.addEventListener('mouseenter', (e) => {\n\t\t\t\t\tconst el = e.target;\n\t\t\t\t\t// hover background-color\n\t\t\t\t\tif (el.dataset.wptbElementHoverBgColor) {\n\t\t\t\t\t\tel.style.backgroundColor = el.dataset.wptbElementHoverBgColor;\n\t\t\t\t\t}\n\t\t\t\t\t// hover color\n\t\t\t\t\tif (el.dataset.wptbElementHoverTextColor) {\n\t\t\t\t\t\tel.style.color = el.dataset.wptbElementHoverTextColor;\n\t\t\t\t\t}\n\t\t\t\t\t// hover scale\n\t\t\t\t\tif (el.dataset.wptbElementHoverScale) {\n\t\t\t\t\t\tel.style.transform = `scale(${b.dataset.wptbElementHoverScale})`;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tb.addEventListener('mouseleave', (e) => {\n\t\t\t\t\t// reset all supported hover properties to their default value\n\t\t\t\t\tconst el = e.target;\n\t\t\t\t\tif (el.dataset.wptbElementHoverBgColor) {\n\t\t\t\t\t\tel.style.backgroundColor = el.dataset.wptbElementBgColor;\n\t\t\t\t\t}\n\t\t\t\t\tif (el.dataset.wptbElementHoverTextColor) {\n\t\t\t\t\t\tel.style.color = el.dataset.wptbElementColor;\n\t\t\t\t\t}\n\t\t\t\t\tif (el.dataset.wptbElementHoverScale) {\n\t\t\t\t\t\tel.style.transform = 'scale(1)';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\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\t\taddHoverSupport('.wptb-preview-table .wptb-button');\n\n\t\t/**\n\t\t * function wptb_tableContainerSectionSmall\n\t\t * add class ( wptb-section-small ) in small width\n\t\t * remove this class in large width\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tfunction wptb_tableContainerSectionSmall() {\n\t\t\tconst wptbTableContainer = jQuery('.wptb-table-container');\n\t\t\tconst sw = wptbTableContainer.width();\n\t\t\tif (wptbTableContainer.length > 0) {\n\t\t\t\tif (sw < 480) {\n\t\t\t\t\twptbTableContainer.addClass('wptb-section-small');\n\t\t\t\t} else {\n\t\t\t\t\twptbTableContainer.removeClass('wptb-section-small');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * function wptb_tableGenerateMobile\n\t\t * generates a mobile view of the table\n\t\t * when the top row of the table is not a heading\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tfunction wptb_tableGenerateMobile() {\n\t\t\tconst wptbTableContainer = document.getElementsByClassName('wptb-table-container');\n\t\t\tconst wptbPreviewTable = document.getElementsByClassName('wptb-preview-table');\n\t\t\tconst wptbPreviewTableMobile = document.getElementsByClassName('wptb-preview-table-mobile');\n\t\t\tif (wptbTableContainer.length > 0 && wptbPreviewTable.length > 0) {\n\t\t\t\tconst sw = wptbTableContainer[0].offsetWidth;\n\t\t\t\tif (sw < 480) {\n\t\t\t\t\twptbPreviewTable[0].style.display = 'none';\n\n\t\t\t\t\tif (wptbPreviewTableMobile.length == 0) {\n\t\t\t\t\t\tconst tableRows = wptbPreviewTable[0].rows;\n\t\t\t\t\t\tconst tableRowTop = tableRows[0];\n\t\t\t\t\t\tconst tableRowTopChildren = tableRowTop.children;\n\t\t\t\t\t\tlet columnCount = 0;\n\n\t\t\t\t\t\tfor (let i = 0; i < tableRowTopChildren.length; i++) {\n\t\t\t\t\t\t\tcolumnCount += tableRowTopChildren[i].colSpan;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst newTableArray = [];\n\n\t\t\t\t\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\t\t\t\t\tnewTableArray[i] = [];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < tableRows.length; i++) {\n\t\t\t\t\t\t\tconst rowChildren = tableRows[i].children;\n\n\t\t\t\t\t\t\tfor (let j = 0; j < columnCount; j++) {\n\t\t\t\t\t\t\t\tif (rowChildren[j].dataset.xIndex == j) {\n\t\t\t\t\t\t\t\t\tconst tdNew = rowChildren[j].cloneNode(true);\n\t\t\t\t\t\t\t\t\tif (tableRows[i].style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\ttdNew.style.backgroundColor = tableRows[i].style.backgroundColor;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewTableArray[j].push(tdNew);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewTableArray[j].push('');\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\tconst table = document.createElement('table');\n\t\t\t\t\t\ttable.classList.add('wptb-preview-table-mobile');\n\t\t\t\t\t\tconst tableStyle = wptbPreviewTable[0].getAttribute('style');\n\t\t\t\t\t\ttable.setAttribute('style', tableStyle);\n\t\t\t\t\t\ttable.style.display = 'table';\n\t\t\t\t\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\t\t\t\t\tconst row = table.insertRow(-1);\n\t\t\t\t\t\t\trow.classList.add('wptb-row');\n\n\t\t\t\t\t\t\tfor (let j = 0; j < tableRows.length; j++) {\n\t\t\t\t\t\t\t\tif (newTableArray[i][j]) {\n\t\t\t\t\t\t\t\t\trow.appendChild(newTableArray[i][j]);\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\twptbTableContainer[0].appendChild(table);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twptbPreviewTableMobile[0].style.display = 'table';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twptbPreviewTable[0].style.display = 'table';\n\t\t\t\t\tif (wptbPreviewTableMobile.length > 0) {\n\t\t\t\t\t\twptbPreviewTableMobile[0].style.display = 'none';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twptb_tdDefaultWidth();\n\t\twptb_tableReconstraction();\n\n\t\t// when window resize call wpcd_archiveSectionSmall and wptb_tableGenerateMobile\n\t\t$(window).resize(function () {\n\t\t\twptb_tdDefaultWidth();\n\t\t\twptb_tableReconstraction();\n\t\t});\n\n\t\tfunction wptb_tableReconstraction() {\n\t\t\tfor (let i = 0; i < tableContainers.length; i++) {\n\t\t\t\tconst tableContainer = tableContainers[i];\n\n\t\t\t\t// Set default indicator of creating a new table in true\n\t\t\t\tlet createNewTableIndic = true;\n\n\t\t\t\tlet previewTable = tableContainer.getElementsByClassName('wptb-preview-table');\n\t\t\t\tlet tableContainerMatrix = tableContainer.getElementsByClassName('wptb-table-container-matrix');\n\n\t\t\t\tif (previewTable.length > 0 && tableContainerMatrix.length > 0) {\n\t\t\t\t\tpreviewTable = previewTable[0];\n\t\t\t\t\ttableContainerMatrix = tableContainerMatrix[0];\n\t\t\t\t\tpreviewTable.style.display = 'table';\n\n\t\t\t\t\tif (previewTable.dataset.wptbTableAlignment) {\n\t\t\t\t\t\tconst { wptbTableAlignment } = previewTable.dataset;\n\n\t\t\t\t\t\tconst wptbTableContainerWidth = tableContainer.offsetWidth;\n\t\t\t\t\t\tif (wptbTableContainerWidth < previewTable.offsetWidth) {\n\t\t\t\t\t\t\tpreviewTable.style.float = null;\n\t\t\t\t\t\t} else if (wptbTableAlignment == 'center') {\n\t\t\t\t\t\t\tpreviewTable.style.float = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpreviewTable.style.float = wptbTableAlignment;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (wptbTableAlignment == 'center') {\n\t\t\t\t\t\t\ttableContainer.style.float = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttableContainer.style.float = wptbTableAlignment;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// check data parametrs reconstraction and wptbAdaptiveTable if they are both equal 1 then continue\n\t\t\t\t\tif (previewTable.dataset.reconstraction == 1 && previewTable.dataset.wptbAdaptiveTable == 1) {\n\t\t\t\t\t\t// get widths for wptb-table-container and wptb-preview-table\n\t\t\t\t\t\tconst tableContainerWidth = tableContainer.offsetWidth;\n\t\t\t\t\t\tconst previewTableWidth = previewTable.offsetWidth;\n\n\t\t\t\t\t\t// get count of table columns\n\t\t\t\t\t\tlet tableColumns;\n\t\t\t\t\t\tconst previewTableRows = previewTable.rows;\n\t\t\t\t\t\tif (previewTableRows.length > 0) {\n\t\t\t\t\t\t\tconst firstRow = previewTableRows[0];\n\t\t\t\t\t\t\tconst tdsRow = firstRow.querySelectorAll('td');\n\n\t\t\t\t\t\t\ttableColumns = tdsRow.length;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check the top line if it is presented as a title\n\t\t\t\t\t\tconst tablePreviewHeadIndic = previewTable.classList.contains('wptb-table-preview-head');\n\n\t\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\t// otherwise table must have more taht one columns\n\t\t\t\t\t\tlet tableReconstructed = false;\n\t\t\t\t\t\tlet wptbPreviewTableMobile;\n\t\t\t\t\t\tif ((!tablePreviewHeadIndic || tableColumns > 2) && tableColumns > 1) {\n\t\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\t// continue the way creation new mobile table\n\t\t\t\t\t\t\tif (tableContainerWidth < previewTableWidth) {\n\t\t\t\t\t\t\t\ttableContainer.style.overflow = 'unset';\n\n\t\t\t\t\t\t\t\t// hide wptb-table-container-matrix\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\ttableContainerMatrix &&\n\t\t\t\t\t\t\t\t\t!tableContainerMatrix.classList.contains('wptb-matrix-hide')\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\ttableContainerMatrix.classList.add('wptb-matrix-hide');\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\tpreviewTable.classList.add('wptb-mobile-view-active');\n\n\t\t\t\t\t\t\t\tif (previewTable.rows && tableColumns) {\n\t\t\t\t\t\t\t\t\t// we get the estimated cell width\n\t\t\t\t\t\t\t\t\tconst tdWidth = previewTableWidth / tableColumns;\n\n\t\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\t\tlet wholeColumnsInContainer = Math.floor(tableContainerWidth / tdWidth);\n\t\t\t\t\t\t\t\t\tif (wholeColumnsInContainer < 1) wholeColumnsInContainer = 1;\n\n\t\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\t// if it available, check this table for compliance\n\t\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\t// and cancel creating a new table ( createNewTableIndic = false ).\n\t\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\t\twptbPreviewTableMobile = tableContainer.getElementsByClassName(\n\t\t\t\t\t\t\t\t\t\t\t'wptb-preview-table-mobile'\n\t\t\t\t\t\t\t\t\t\t)[0];\n\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.classList.remove('wptb-mobile-hide');\n\t\t\t\t\t\t\t\t\t\tconst dataWholeColumnInContainer =\n\t\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.dataset.wholeColumnsInContainer;\n\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tdataWholeColumnInContainer == wholeColumnsInContainer &&\n\t\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\t) {\n\t\t\t\t\t\t\t\t\t\t\tcreateNewTableIndic = false;\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tdataWholeColumnInContainer == wholeColumnsInContainer &&\n\t\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\t(tableContainerWidth > 480 || wptbPreviewTableMobile.column == 1)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcreateNewTableIndic = false;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.parentNode.removeChild(wptbPreviewTableMobile);\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\t//\n\t\t\t\t\t\t\t\t\t// if indicator of creating of table \"true\" - continue\n\t\t\t\t\t\t\t\t\tif (createNewTableIndic) {\n\t\t\t\t\t\t\t\t\t\t// create new table for mobile devices\n\t\t\t\t\t\t\t\t\t\tconst newTable = document.createElement('table');\n\t\t\t\t\t\t\t\t\t\tconst newTableTbody = document.createElement('tbody');\n\t\t\t\t\t\t\t\t\t\tnewTable.appendChild(newTableTbody);\n\n\t\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\t\tnewTable.classList.add('wptb-preview-table-mobile');\n\t\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\t\tif (infArr && Array.isArray(infArr)) {\n\t\t\t\t\t\t\t\t\t\t\tnewTable.classList.add(infArr[0]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\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\t\tconst tableRows = previewTable.rows.length;\n\n\t\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\t\tlet newTableLastSectionFilledColumns;\n\n\t\t\t\t\t\t\t\t\t\t// set valuesIsSaved in 'false'\n\t\t\t\t\t\t\t\t\t\t// if the parameters newTableLastSectionFilledColumns get\n\t\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\t\tlet valuesIsSaved = false;\n\n\t\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\t\tif (previewTable.classList.contains('wptb-table-preview-head')) {\n\t\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\t\tconst tableRowsWithoutHeader = tableRows - 1;\n\n\t\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\t\tlet newTableColumnsWithoutLeftHeader;\n\n\t\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\t// quantity whole columns which are can placed in the container,\n\t\t\t\t\t\t\t\t\t\t\t// execute \"loop for\"\n\t\t\t\t\t\t\t\t\t\t\tif (tableRows > wholeColumnsInContainer) {\n\t\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\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\t// has more than half the columns compared to the previous blocks\n\t\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\t\tnewTableColumnsWithoutLeftHeader = wholeColumnsInContainer - 1 - i;\n\t\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\t\tnewTableColumnsWithoutLeftHeader = 1;\n\n\t\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\t\ttableRowsWithoutHeader % newTableColumnsWithoutLeftHeader;\n\n\t\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumnsWithoutLeftHeader <= 6 &&\n\t\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\t\t2 * newTableLastSectionFilledColumns <\n\t\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\t\tnewTableLastSectionFilledColumns <\n\t\t\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) {\n\t\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\t\tbreak;\n\t\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\t\tnewTableColumnsWithoutLeftHeader > 6 &&\n\t\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\t\tnewTableColumnsWithoutLeftHeader -\n\t\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\t\t0 &&\n\t\t\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\t\t\tnewTableColumnsWithoutLeftHeader\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumnsWithoutLeftHeader <= 18 &&\n\t\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\t\t1.6 * newTableLastSectionFilledColumns <\n\t\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\t\tnewTableLastSectionFilledColumns <\n\t\t\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) {\n\t\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\t\tbreak;\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\tcontinue;\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}\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\tnewTableColumnsWithoutLeftHeader = tableRowsWithoutHeader;\n\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\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\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\t\tif (valuesIsSaved) {\n\t\t\t\t\t\t\t\t\t\t\t\tlet countRows;\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\tcountRows =\n\t\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\t\tMath.ceil(\n\t\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\t);\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\tcountRows = tableColumns;\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\tconst sectionNumberLast = Math.floor((countRows - 1) / tableColumns);\n\t\t\t\t\t\t\t\t\t\t\t\tlet tdStyles;\n\t\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\t\tconst sectionNumber = Math.floor(j / tableColumns);\n\t\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\t\tconst tdLeftHeader = previewTable.rows[0].children[\n\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].cloneNode(true);\n\t\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\t\tconst rowFirstStyles = window.getComputedStyle(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpreviewTable.rows[0]\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 (!tdLeftHeader.style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.backgroundColor =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trowFirstStyles.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\ttdLeftHeader.style.width = null;\n\t\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\t// tdLeftHeader.removeAttribute('data-x-index');\n\t\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\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\ttdLeftHeader.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\ttdLeftHeader.style.borderColor = tdStyles.borderBottomColor;\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 (sectionNumber > 0 && j % tableColumns == 0) {\n\t\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\t}\n\t\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\t\tfor (\n\t\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\t\tk < newTableColumnsWithoutLeftHeader * (sectionNumber + 1) + 1;\n\t\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\t) {\n\t\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\t\ttd = previewTable.rows[k].children[\n\t\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\t].cloneNode(true);\n\t\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\t\tpreviewTable.rows[k]\n\t\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\t\tif (!td.style.backgroundColor) {\n\t\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\t}\n\n\t\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\t\ttd.style.height = null;\n\t\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\t\ttd.removeAttribute('data-wptb-css-td-auto-width');\n\t\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\t\ttd = document.createElement('td');\n\t\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\t\ttd.style.background = '#fff';\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\ttdStyles = window.getComputedStyle(\n\t\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\t);\n\t\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\t\ttd.style.borderColor = tdStyles.borderTopColor;\n\t\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\t\ttd.style.borderColor = tdStyles.borderBottomColor;\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\tif (sectionNumber > 0 && j % tableColumns == 0) {\n\t\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\t}\n\n\t\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\t}\n\n\t\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\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\tlet newTableColumns;\n\t\t\t\t\t\t\t\t\t\t\tif (tableContainerWidth > 480) {\n\t\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\t\tnewTableColumns = wholeColumnsInContainer - i;\n\t\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\t\tnewTableLastSectionFilledColumns = tableColumns % newTableColumns;\n\n\t\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumns <= 6 &&\n\t\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\t\tnewTableLastSectionFilledColumns < newTableColumns\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumns <= 12 &&\n\t\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\t\tnewTableLastSectionFilledColumns < newTableColumns\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumns <= 18 &&\n\t\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\t\tnewTableLastSectionFilledColumns < newTableColumns\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\t\tvaluesIsSaved = true;\n\t\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\t} else {\n\t\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\t}\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} else {\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns = 1;\n\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\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\tnewTable.column = 1;\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 increaseRatioRows = Math.ceil(tableColumns / newTableColumns);\n\n\t\t\t\t\t\t\t\t\t\t\tconst newTableRows = increaseRatioRows * tableRows;\n\n\t\t\t\t\t\t\t\t\t\t\tif (valuesIsSaved) {\n\t\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\t\tconst sectionNumber = Math.floor(i / tableRows);\n\t\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\t\tlet jMax;\n\t\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\t\tif (\n\t\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\t\tnewTableLastSectionFilledColumns == 0\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\t\tjStart = sectionNumber * newTableColumns;\n\t\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\t} else {\n\t\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\t\tjMax = tableColumns;\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\tconst row = previewTable.rows[i - sectionNumber * tableRows];\n\t\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\t\ttr.style.backgroundColor = row.style.backgroundColor;\n\n\t\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\t\tconst newTd = row.children[j].cloneNode(true);\n\t\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\t\tconst rowStyles = window.getComputedStyle(row);\n\t\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\t}\n\t\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\t\tnewTd.style.height = null;\n\t\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\t\tnewTd.removeAttribute('data-wptb-css-td-auto-width');\n\t\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\t}\n\n\t\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\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnewTable.dataset.wholeColumnsInContainer = wholeColumnsInContainer;\n\t\t\t\t\t\t\t\t\t\tconst images = newTable.querySelectorAll('[srcset]');\n\t\t\t\t\t\t\t\t\t\tif (images.length > 0) {\n\t\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\t\timages[i].removeAttribute('srcset');\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\twptbPreviewTableMobile = newTable;\n\t\t\t\t\t\t\t\t\t\ttableContainer.appendChild(newTable);\n\t\t\t\t\t\t\t\t\t\ttableReconstructed = true;\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} else if (\n\t\t\t\t\t\t\t\ttableContainerMatrix &&\n\t\t\t\t\t\t\t\ttableContainerMatrix.classList.contains('wptb-matrix-hide')\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\ttableContainerMatrix.classList.remove('wptb-matrix-hide');\n\t\t\t\t\t\t\t\ttableReconstructed = true;\n\t\t\t\t\t\t\t\tpreviewTable.classList.remove('wptb-mobile-view-active');\n\t\t\t\t\t\t\t\twptbPreviewTableMobile = tableContainer.querySelector('.wptb-preview-table-mobile');\n\t\t\t\t\t\t\t\tif (wptbPreviewTableMobile) {\n\t\t\t\t\t\t\t\t\ttableContainer\n\t\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\t.classList.add('wptb-mobile-hide');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttableContainer.style.overflow = 'auto';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpreviewTable.style.minWidth = 'auto';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tWPTB_RecalculateIndexes(previewTable);\n\n\t\t\t\t\t\tif (tableReconstructed) {\n\t\t\t\t\t\t\tWPTB_RecalculateIndexes(wptbPreviewTableMobile);\n\t\t\t\t\t\t\tconst tabEvent = new CustomEvent('table:rebuilt', { detail: true, bubbles: true });\n\t\t\t\t\t\t\tpreviewTable.dispatchEvent(tabEvent);\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\tfunction wptb_tdDefaultWidth() {\n\t\t\tconst wptbTableContainers = document.getElementsByClassName('wptb-table-container');\n\t\t\t// let frontendEditLink = document.querySelectorAll( '.wptb-frontend-table-edit-link' );\n\t\t\tfor (let i = 0; i < wptbTableContainers.length; i++) {\n\t\t\t\tconst wptbTableContainer = wptbTableContainers[i];\n\n\t\t\t\twptbTableContainer.classList.add(`wptb-table-container-${i}`);\n\n\t\t\t\tlet table = wptbTableContainer.getElementsByClassName('wptb-preview-table');\n\t\t\t\tif (table.length > 0) {\n\t\t\t\t\ttable = table[0];\n\n\t\t\t\t\tif (table.dataset.wptbTableContainerMaxWidth) {\n\t\t\t\t\t\twptbTableContainer.style.maxWidth = `${table.dataset.wptbTableContainerMaxWidth}px`;\n\t\t\t\t\t}\n\t\t\t\t\ttable.classList.remove('wptb-table-preview-static-indic');\n\n\t\t\t\t\ttable.mergingСellsHorizontally = false;\n\t\t\t\t\tconst tds = table.querySelectorAll('td');\n\t\t\t\t\tfor (let j = 0; j < tds.length; j++) {\n\t\t\t\t\t\tif (tds[j].colSpan > 1) {\n\t\t\t\t\t\t\ttable.mergingСellsHorizontally = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst wptbTableContainerWidth = wptbTableContainer.offsetWidth;\n\n\t\t\t\t\tconst td = table.querySelector('td');\n\t\t\t\t\tconst tdStyleObj = window.getComputedStyle(td, null);\n\t\t\t\t\tconst tdBorderLeftWidth = tdStyleObj.getPropertyValue('border-left-width');\n\t\t\t\t\tconst tdBorderRightWidth = tdStyleObj.getPropertyValue('border-right-width');\n\t\t\t\t\tconst tdPaddingLeftWidth = tdStyleObj.getPropertyValue('padding-left');\n\t\t\t\t\tconst tdPaddingRightWidth = tdStyleObj.getPropertyValue('padding-left');\n\t\t\t\t\tconst tdPaddingCommon = parseFloat(tdPaddingLeftWidth, 10) + parseFloat(tdPaddingRightWidth, 10);\n\t\t\t\t\tconst tableTdBorderCommonWidth =\n\t\t\t\t\t\tparseFloat(tdBorderLeftWidth, 10) + parseFloat(tdBorderRightWidth, 10);\n\t\t\t\t\tconst { wptbTableTdsSumMaxWidth } = table.dataset;\n\t\t\t\t\tconst { wptbFixedWidthSize } = table.dataset;\n\t\t\t\t\tconst { wptbCellsWidthAutoCount } = table.dataset;\n\t\t\t\t\tlet styleElementCreate = false;\n\t\t\t\t\tlet tableTdWidthAuto;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Table width logic to determine final width on rendered tables.\n\t\t\t\t\t */\n\t\t\t\t\tconst tableWidthLogic = () => {\n\t\t\t\t\t\t// eslint-disable-next-line no-shadow\n\t\t\t\t\t\tconst wptbTableContainerWidth = wptbTableContainer.offsetWidth;\n\t\t\t\t\t\tif (wptbTableTdsSumMaxWidth < wptbTableContainerWidth) {\n\t\t\t\t\t\t\tif (wptbCellsWidthAutoCount) {\n\t\t\t\t\t\t\t\ttable.style.minWidth = '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.minWidth = wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\t\tif (table.mergingСellsHorizontally) {\n\t\t\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\t\t\tconst tableTdsWidthAutoCommon = wptbTableContainerWidth - wptbFixedWidthSize;\n\t\t\t\t\t\t\t\t\ttableTdWidthAuto = tableTdsWidthAutoCommon / wptbCellsWidthAutoCount;\n\t\t\t\t\t\t\t\t\ttableTdWidthAuto = tableTdWidthAuto - tdPaddingCommon - tableTdBorderCommonWidth;\n\t\t\t\t\t\t\t\t\tstyleElementCreate = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttable.style.width = '100%';\n\n\t\t\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t\t\t// frontendEditLink[i].style.width = '100%';\n\t\t\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = '100%';\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} else {\n\t\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\t\ttable.style.minWidth = null;\n\t\t\t\t\t\t\t\ttable.style.maxWidth = `${wptbTableTdsSumMaxWidth}px`;\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 = null;\n\t\t\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = null;\n\t\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = wptbTableTdsSumMaxWidth + 'px';\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.maxWidth = null;\n\t\t\t\t\t\t\ttable.style.minWidth = `${table.dataset.wptbTableTdsSumMaxWidth}px`;\n\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\ttableTdWidthAuto = table.dataset.wptbTdWidthAuto ? table.dataset.wptbTdWidthAuto : '100';\n\t\t\t\t\t\t\tstyleElementCreate = true;\n\n\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = '100%';\n\t\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = table.dataset.wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t\t// frontendEditLink[i].style.width = null;\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\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\t\tif (wptbTableContainerWidth <= 0) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Calculate element visibility status.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param {Element} element element to check\n\t\t\t\t\t\t * @return {boolean} whether element is visible or not\n\t\t\t\t\t\t */\n\t\t\t\t\t\tconst elementVisibilityStatus = (element) => {\n\t\t\t\t\t\t\tconst { display, visibility } = getComputedStyle(element);\n\t\t\t\t\t\t\treturn display !== 'none' || visibility === 'visible';\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Find parent element that is responsible for hiding our table.\n\t\t\t\t\t\t *\n\t\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\t *\n\t\t\t\t\t\t * @param {Element} currentElement current element in check\n\t\t\t\t\t\t * @return {null|Element} found parent or null\n\t\t\t\t\t\t */\n\t\t\t\t\t\tconst findParentWithNoDisplay = (currentElement) => {\n\t\t\t\t\t\t\tconst currentParent = currentElement.parentNode;\n\t\t\t\t\t\t\tconst parentDisplayStatus = elementVisibilityStatus(currentParent);\n\t\t\t\t\t\t\t// lower cased element name\n\t\t\t\t\t\t\tconst parentType = currentParent.nodeName.toLowerCase();\n\n\t\t\t\t\t\t\t// if parent is visible make a recursive call\n\t\t\t\t\t\t\tif (!parentDisplayStatus && parentType !== 'body') {\n\t\t\t\t\t\t\t\treturn findParentWithNoDisplay(currentParent);\n\t\t\t\t\t\t\t}\n\t\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\t\tif (parentType === 'body') {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn currentParent;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// find parent container with hidden display property\n\t\t\t\t\t\tconst culpritParent = findParentWithNoDisplay(wptbTableContainer);\n\t\t\t\t\t\tif (culpritParent) {\n\t\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\t\tconst config = { attributes: true, childList: false, subtree: false };\n\t\t\t\t\t\t\tconst parentObserver = new MutationObserver((mutationRecord) => {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\t\t\t\tmutationRecord.map((mutation) => {\n\t\t\t\t\t\t\t\t\t\tconst currentVisibility = elementVisibilityStatus(mutation.target);\n\t\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\t// call width logic and start calculations for our table since it is visible now\n\t\t\t\t\t\t\t\t\t\tif (currentVisibility && containerWidth > 0) {\n\t\t\t\t\t\t\t\t\t\t\ttableWidthLogic();\n\n\t\t\t\t\t\t\t\t\t\t\t// disconnect observer\n\t\t\t\t\t\t\t\t\t\t\tparentObserver.disconnect();\n\n\t\t\t\t\t\t\t\t\t\t\t// get out of iteration\n\t\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\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} catch (e) {\n\t\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\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// observe parent for visibility changes\n\t\t\t\t\t\t\tparentObserver.observe(culpritParent, config);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\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\t\ttableWidthLogic();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { head } = document;\n\t\t\t\t\tif (head) {\n\t\t\t\t\t\tconst cssForTdsWidthAutoOld = head.querySelector(`style[data-wptb-td-auto-width-${i}=\"true\"]`);\n\n\t\t\t\t\t\tif (cssForTdsWidthAutoOld) {\n\t\t\t\t\t\t\thead.removeChild(cssForTdsWidthAutoOld);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (styleElementCreate) {\n\t\t\t\t\t\tconst cssForTdsWidthAuto = document.createElement('style');\n\t\t\t\t\t\tcssForTdsWidthAuto.setAttribute(`data-wptb-td-auto-width-${i}`, true);\n\t\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\t\tif (head) {\n\t\t\t\t\t\t\thead.appendChild(cssForTdsWidthAuto);\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// code for adding of old css styles for correct view\n\t\tconst elements = document.getElementsByClassName('wptb-ph-element');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tconst element = elements[i];\n\t\t\tif (element.classList.contains('wptb-list-item-container')) {\n\t\t\t\telement.classList.remove('wptb-list-item-container');\n\t\t\t\telement.classList.add('wptb-list-container');\n\t\t\t}\n\n\t\t\tif (element.classList.contains('wptb-button-container')) {\n\t\t\t\tconst infArr = element.className.match(/wptb-size-([A-Z]+)/i);\n\t\t\t\tif (infArr && Array.isArray(infArr)) {\n\t\t\t\t\tconst wptbSize = infArr[0];\n\t\t\t\t\tconst wptbSizeNew = wptbSize.toLowerCase();\n\n\t\t\t\t\telement.classList.remove(wptbSize);\n\n\t\t\t\t\tconst wptbButtonWrapper = element.querySelector('.wptb-button-wrapper');\n\t\t\t\t\tif (wptbButtonWrapper) {\n\t\t\t\t\t\twptbButtonWrapper.classList.add(wptbSizeNew);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// responsive setup\n\t\t// eslint-disable-next-line no-unused-vars\n\t\tconst responsiveFront = new WPTB_ResponsiveFrontend({\n\t\t\tquery: '.wptb-preview-table',\n\t\t\tbindToResize: true,\n\t\t});\n\n\t\t// sorting table\n\t\tfunction sortingTable() {\n\t\t\tconst tables = document.querySelectorAll('.wptb-preview-table');\n\t\t\tfor (let i = 0; i < tables.length; i += 1) {\n\t\t\t\tconst sortableTable = new WPTB_SortableTable({ table: tables[i] });\n\t\t\t\tsortableTable.sortableTableInitialization(responsiveFront);\n\t\t\t}\n\t\t}\n\n\t\tsortingTable();\n\t\tconst responsiveFrontReady = new CustomEvent('responsive:front', {\n\t\t\tdetail: {\n\t\t\t\tresponsiveFront,\n\t\t\t},\n\t\t});\n\t\tdocument.dispatchEvent(responsiveFrontReady);\n\n\t\t// apply defined extra styles to tables if there is any\n\t\tWPTB_ExtraStyles.applyStyles(WPTB_ExtraStyles.modes.frontEnd, WptbFrontendData.generalStyles);\n\n\t\t// rebuild tables according to current responsive mode\n\t\tresponsiveFront.rebuildTables();\n\n\t\t// initialize style pass\n\t\tWPTB_StylePass.init(WptbFrontendData.stylePass);\n\t});\n})(jQuery);\n"]}
1
+ {"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","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","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","_objectSpread","elementObjects","tableObject","bindRebuildToResize","rebuildTables","directiveString","wptbResponsiveDirectives","JSON","parse","addDefaultClasses","removeDefaultClasses","autoBuild","sizeRange","autoOption","tableObj","direction","staticTopRow","repeatMergedHeader","buildDefault","autoDirectionBuild","isRowStacked","headerBuild","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","tabEvent","CustomEvent","dispatchEvent","o","innerSize","innerWidth","relativeWidth","stylesheets","insertShadowRoot","shadowRootContainer","tableContainer","mainParent","parentChildren","tableIndex","upSibling","downSibling","prepareAllStylesheets","shadowRoot","borrowFromTheme","fontFamily","init","tableContainers","setupStylePass","checkTableEligibility","container","maxWidth","wptbTableContainerMaxWidth","attachShadow","stylesheetsObj","root","prepareStylesheet","handler","url","linkElement","jQuery","ready","$","getElementsByClassName","wptb_tableReconstraction","createNewTableIndic","previewTable","tableContainerMatrix","display","wptbTableAlignment","offsetWidth","reconstraction","wptbAdaptiveTable","tableContainerWidth","previewTableWidth","tableColumns","previewTableRows","tableReconstructed","wptbPreviewTableMobile","overflow","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","images","minWidth","bubbles","wptb_tdDefaultWidth","wptbTableContainers","wptbTableContainer","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","transform","wptbElementBgColor","wptbElementColor","resize","wptbSize","wptbSizeNew","wptbButtonWrapper","WPTB_ResponsiveFrontend","tables","WPTB_SortableTable","sortingTable","responsiveFrontReady","WPTB_ExtraStyles","WptbFrontendData","WPTB_StylePass","stylePass"],"mappings":"wsFAGA,SAAcA,EAAKC,EAASC,GACL,oBAAXC,QAA6C,YAAnB,oBAAOC,QAAP,YAAAC,QAAOD,UAC3CD,OAAOC,QAAUF,IAGjBD,EAAQD,GAAOE,IALjB,CAQG,mBAAoBI,MAAQC,OAAQ,WAqMtC,OAAO,IA5LP,WAA4B,IAAAC,EAAAC,EAAAC,KAiEF,SAAnBC,EAAoBC,EAAQC,GAEjC,IAEMC,EAF+BD,EAfdE,WAAW,yCAA0C,IAG7DA,WAAW,IAAK,gBAcKC,MAAM,KACpCC,EAAsB,GAY5B,OATAH,EAAYI,IAAI,SAACF,GAChB,IACMG,EADS,IAAIC,OAAO,YACHC,KAAKL,GAExBG,GACHF,EAAoBK,KAAKN,EAAMO,QAAQJ,EAAQ,GAAtB,GAAAK,OAA6BZ,EAA7B,KAAAY,OAAuCL,EAAQ,QAI1E,GAAAK,OAAUP,EAAoBQ,KAAK,KAAnC,KAS0B,SAArBC,EAAsBC,GAAsC,IAAvBC,EAAuB,EAAAC,UAAAC,aAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAT,KAClDG,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,EAAQ8X,UAAUpe,MAAM,yBACzBW,MAAMkT,QAAQsK,KAErBmF,GADAD,EAAWlF,EAAO,IACK4D,cAE7Bzb,EAAQ5C,UAAUyD,OAAOkc,IAEnBE,EAAoBjd,EAAQvH,cAAc,0BAE/CwkB,EAAkB7f,UAAUwD,IAAIoc,IAQpC,IAAMle,EAAkB,IAAIoe,wBAAwB,CACnD/N,MAAO,sBACPE,cAAc,KAIf,WAEC,IADA,IAAM8N,EAASnlB,SAASuC,iBAAiB,uBAChCc,EAAI,EAAGA,EAAI8hB,EAAOtlB,OAAQwD,GAAK,EACjB,IAAI+hB,mBAAmB,CAAEjiB,MAAOgiB,EAAO9hB,KAC/CwL,4BAA4B/H,GAI5Cue,GACMC,EAAuB,IAAInJ,YAAY,mBAAoB,CAChE7U,OAAQ,CACPR,gBAAAA,KAGF9G,SAASoc,cAAckJ,GAGvBC,iBAAiBrjB,YAAYqjB,iBAAiBjlB,MAAMuB,SAAU2jB,iBAAiB9lB,eAG/EoH,EAAgB+Q,gBAIhB4N,eAAenI,KAAKkI,iBAAiBE","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('.wptb-preview-table', generalStyles);\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.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}\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 {[HTMLElement]} 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(`<tr class=\"${classList.join(' ')}\"></tr>`).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 mergedHeader\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\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 * 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\tthis.buildDefault(tableObj);\n\t\t\t\tthis.removeDefaultClasses(tableEl);\n\t\t\t} else {\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\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\tbaseCells.map((b) => {\n\t\t\t\t\t\t\trowStartIndex += 1;\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\t// @deprecated\n\t\t\t\t\t\t\t\t\t// const bgColor =\n\t\t\t\t\t\t\t\t\t// \tr === 0\n\t\t\t\t\t\t\t\t\t// \t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t// \t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t// \t\t\t: getComputedStyle(rowObj.el).backgroundColor\n\t\t\t\t\t\t\t\t\t// \t\t: tableObj.rowColors[r % 2 === 0 ? 'odd' : 'even'];\n\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\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\tbaseCells.map((b) => {\n\t\t\t\t\t\t\trowStartIndex += 1;\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\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\t\t\tb.el.style.backgroundColor = bgColor;\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\ttempCell.el.style.backgroundColor =\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\t\t\t\t\t\tr === 0\n\t\t\t\t\t\t\t\t\t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t\t\t\t? tableObj.rowColors.header\n\t\t\t\t\t\t\t\t\t\t\t\t: getComputedStyle(rowObj.el).backgroundColor\n\t\t\t\t\t\t\t\t\t\t\t: tableObj.rowColors[r % 2 === 0 ? 'odd' : 'even'];\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\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\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) {\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 * 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\t\t\t\t\tbuildCallable.call(this, el, sizeRangeId, modeOptions, tableObj);\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\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 ? 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\t\t\tconst maxWidth = tableContainer.querySelector('table').dataset.wptbTableContainerMaxWidth;\n\t\t\tif (maxWidth) {\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((s) => {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(stylesheetsObj, s)) {\n\t\t\t\t\tthis.prepareStylesheet(s, stylesheetsObj[s], root);\n\t\t\t\t}\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 ($) {\n\t/**\n\t * All of the code for your public-facing JavaScript source\n\t * should reside in this file.\n\t *\n\t * Note: It has been assumed you will write jQuery code here, so the\n\t * $ function reference has been prepared for usage within the scope\n\t * of this function.\n\t *\n\t * This enables you to define handlers, for when the DOM is ready:\n\t *\n\t * $(function() {\n\t *\n\t * });\n\t *\n\t * When the window is loaded:\n\t *\n\t * $( window ).load(function() {\n\t *\n\t * });\n\t *\n\t * ...and/or other possibilities.\n\t *\n\t * Ideally, it is not considered best practise to attach more than a\n\t * single DOM-ready or window-load handler for a particular page.\n\t * Although scripts in the WordPress core, Plugins and Themes may be\n\t * practising this, we should strive to set a better example in our own work.\n\t *\n\t * The file is enqueued from inc/frontend/class-frontend.php.\n\t */\n\n\tjQuery(document).ready(function ($) {\n\t\tconst tableContainers = document.getElementsByClassName('wptb-table-container');\n\n\t\t/**\n\t\t * Adds hover color change support for supported button elements.\n\t\t *\n\t\t * @param {string} querySelector query selector string\n\t\t */\n\t\tfunction addHoverSupport(querySelector) {\n\t\t\tconst buttons = Array.from(document.querySelectorAll(querySelector));\n\n\t\t\tbuttons.map((b) => {\n\t\t\t\tb.addEventListener('mouseenter', (e) => {\n\t\t\t\t\tconst el = e.target;\n\t\t\t\t\t// hover background-color\n\t\t\t\t\tif (el.dataset.wptbElementHoverBgColor) {\n\t\t\t\t\t\tel.style.backgroundColor = el.dataset.wptbElementHoverBgColor;\n\t\t\t\t\t}\n\t\t\t\t\t// hover color\n\t\t\t\t\tif (el.dataset.wptbElementHoverTextColor) {\n\t\t\t\t\t\tel.style.color = el.dataset.wptbElementHoverTextColor;\n\t\t\t\t\t}\n\t\t\t\t\t// hover scale\n\t\t\t\t\tif (el.dataset.wptbElementHoverScale) {\n\t\t\t\t\t\tel.style.transform = `scale(${b.dataset.wptbElementHoverScale})`;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tb.addEventListener('mouseleave', (e) => {\n\t\t\t\t\t// reset all supported hover properties to their default value\n\t\t\t\t\tconst el = e.target;\n\t\t\t\t\tif (el.dataset.wptbElementHoverBgColor) {\n\t\t\t\t\t\tel.style.backgroundColor = el.dataset.wptbElementBgColor;\n\t\t\t\t\t}\n\t\t\t\t\tif (el.dataset.wptbElementHoverTextColor) {\n\t\t\t\t\t\tel.style.color = el.dataset.wptbElementColor;\n\t\t\t\t\t}\n\t\t\t\t\tif (el.dataset.wptbElementHoverScale) {\n\t\t\t\t\t\tel.style.transform = 'scale(1)';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\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\t\taddHoverSupport('.wptb-preview-table .wptb-button');\n\n\t\t/**\n\t\t * function wptb_tableContainerSectionSmall\n\t\t * add class ( wptb-section-small ) in small width\n\t\t * remove this class in large width\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tfunction wptb_tableContainerSectionSmall() {\n\t\t\tconst wptbTableContainer = jQuery('.wptb-table-container');\n\t\t\tconst sw = wptbTableContainer.width();\n\t\t\tif (wptbTableContainer.length > 0) {\n\t\t\t\tif (sw < 480) {\n\t\t\t\t\twptbTableContainer.addClass('wptb-section-small');\n\t\t\t\t} else {\n\t\t\t\t\twptbTableContainer.removeClass('wptb-section-small');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * function wptb_tableGenerateMobile\n\t\t * generates a mobile view of the table\n\t\t * when the top row of the table is not a heading\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tfunction wptb_tableGenerateMobile() {\n\t\t\tconst wptbTableContainer = document.getElementsByClassName('wptb-table-container');\n\t\t\tconst wptbPreviewTable = document.getElementsByClassName('wptb-preview-table');\n\t\t\tconst wptbPreviewTableMobile = document.getElementsByClassName('wptb-preview-table-mobile');\n\t\t\tif (wptbTableContainer.length > 0 && wptbPreviewTable.length > 0) {\n\t\t\t\tconst sw = wptbTableContainer[0].offsetWidth;\n\t\t\t\tif (sw < 480) {\n\t\t\t\t\twptbPreviewTable[0].style.display = 'none';\n\n\t\t\t\t\tif (wptbPreviewTableMobile.length == 0) {\n\t\t\t\t\t\tconst tableRows = wptbPreviewTable[0].rows;\n\t\t\t\t\t\tconst tableRowTop = tableRows[0];\n\t\t\t\t\t\tconst tableRowTopChildren = tableRowTop.children;\n\t\t\t\t\t\tlet columnCount = 0;\n\n\t\t\t\t\t\tfor (let i = 0; i < tableRowTopChildren.length; i++) {\n\t\t\t\t\t\t\tcolumnCount += tableRowTopChildren[i].colSpan;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst newTableArray = [];\n\n\t\t\t\t\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\t\t\t\t\tnewTableArray[i] = [];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < tableRows.length; i++) {\n\t\t\t\t\t\t\tconst rowChildren = tableRows[i].children;\n\n\t\t\t\t\t\t\tfor (let j = 0; j < columnCount; j++) {\n\t\t\t\t\t\t\t\tif (rowChildren[j].dataset.xIndex == j) {\n\t\t\t\t\t\t\t\t\tconst tdNew = rowChildren[j].cloneNode(true);\n\t\t\t\t\t\t\t\t\tif (tableRows[i].style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\ttdNew.style.backgroundColor = tableRows[i].style.backgroundColor;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewTableArray[j].push(tdNew);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewTableArray[j].push('');\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\tconst table = document.createElement('table');\n\t\t\t\t\t\ttable.classList.add('wptb-preview-table-mobile');\n\t\t\t\t\t\tconst tableStyle = wptbPreviewTable[0].getAttribute('style');\n\t\t\t\t\t\ttable.setAttribute('style', tableStyle);\n\t\t\t\t\t\ttable.style.display = 'table';\n\t\t\t\t\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\t\t\t\t\tconst row = table.insertRow(-1);\n\t\t\t\t\t\t\trow.classList.add('wptb-row');\n\n\t\t\t\t\t\t\tfor (let j = 0; j < tableRows.length; j++) {\n\t\t\t\t\t\t\t\tif (newTableArray[i][j]) {\n\t\t\t\t\t\t\t\t\trow.appendChild(newTableArray[i][j]);\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\twptbTableContainer[0].appendChild(table);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twptbPreviewTableMobile[0].style.display = 'table';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twptbPreviewTable[0].style.display = 'table';\n\t\t\t\t\tif (wptbPreviewTableMobile.length > 0) {\n\t\t\t\t\t\twptbPreviewTableMobile[0].style.display = 'none';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twptb_tdDefaultWidth();\n\t\twptb_tableReconstraction();\n\n\t\t// when window resize call wpcd_archiveSectionSmall and wptb_tableGenerateMobile\n\t\t$(window).resize(function () {\n\t\t\twptb_tdDefaultWidth();\n\t\t\twptb_tableReconstraction();\n\t\t});\n\n\t\tfunction wptb_tableReconstraction() {\n\t\t\tfor (let i = 0; i < tableContainers.length; i++) {\n\t\t\t\tconst tableContainer = tableContainers[i];\n\n\t\t\t\t// Set default indicator of creating a new table in true\n\t\t\t\tlet createNewTableIndic = true;\n\n\t\t\t\tlet previewTable = tableContainer.getElementsByClassName('wptb-preview-table');\n\t\t\t\tlet tableContainerMatrix = tableContainer.getElementsByClassName('wptb-table-container-matrix');\n\n\t\t\t\tif (previewTable.length > 0 && tableContainerMatrix.length > 0) {\n\t\t\t\t\tpreviewTable = previewTable[0];\n\t\t\t\t\ttableContainerMatrix = tableContainerMatrix[0];\n\t\t\t\t\tpreviewTable.style.display = 'table';\n\n\t\t\t\t\tif (previewTable.dataset.wptbTableAlignment) {\n\t\t\t\t\t\tconst { wptbTableAlignment } = previewTable.dataset;\n\n\t\t\t\t\t\tconst wptbTableContainerWidth = tableContainer.offsetWidth;\n\t\t\t\t\t\tif (wptbTableContainerWidth < previewTable.offsetWidth) {\n\t\t\t\t\t\t\tpreviewTable.style.float = null;\n\t\t\t\t\t\t} else if (wptbTableAlignment == 'center') {\n\t\t\t\t\t\t\tpreviewTable.style.float = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpreviewTable.style.float = wptbTableAlignment;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (wptbTableAlignment == 'center') {\n\t\t\t\t\t\t\ttableContainer.style.float = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttableContainer.style.float = wptbTableAlignment;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// check data parametrs reconstraction and wptbAdaptiveTable if they are both equal 1 then continue\n\t\t\t\t\tif (previewTable.dataset.reconstraction == 1 && previewTable.dataset.wptbAdaptiveTable == 1) {\n\t\t\t\t\t\t// get widths for wptb-table-container and wptb-preview-table\n\t\t\t\t\t\tconst tableContainerWidth = tableContainer.offsetWidth;\n\t\t\t\t\t\tconst previewTableWidth = previewTable.offsetWidth;\n\n\t\t\t\t\t\t// get count of table columns\n\t\t\t\t\t\tlet tableColumns;\n\t\t\t\t\t\tconst previewTableRows = previewTable.rows;\n\t\t\t\t\t\tif (previewTableRows.length > 0) {\n\t\t\t\t\t\t\tconst firstRow = previewTableRows[0];\n\t\t\t\t\t\t\tconst tdsRow = firstRow.querySelectorAll('td');\n\n\t\t\t\t\t\t\ttableColumns = tdsRow.length;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check the top line if it is presented as a title\n\t\t\t\t\t\tconst tablePreviewHeadIndic = previewTable.classList.contains('wptb-table-preview-head');\n\n\t\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\t// otherwise table must have more taht one columns\n\t\t\t\t\t\tlet tableReconstructed = false;\n\t\t\t\t\t\tlet wptbPreviewTableMobile;\n\t\t\t\t\t\tif ((!tablePreviewHeadIndic || tableColumns > 2) && tableColumns > 1) {\n\t\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\t// continue the way creation new mobile table\n\t\t\t\t\t\t\tif (tableContainerWidth < previewTableWidth) {\n\t\t\t\t\t\t\t\ttableContainer.style.overflow = 'unset';\n\n\t\t\t\t\t\t\t\t// hide wptb-table-container-matrix\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\ttableContainerMatrix &&\n\t\t\t\t\t\t\t\t\t!tableContainerMatrix.classList.contains('wptb-matrix-hide')\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\ttableContainerMatrix.classList.add('wptb-matrix-hide');\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\tpreviewTable.classList.add('wptb-mobile-view-active');\n\n\t\t\t\t\t\t\t\tif (previewTable.rows && tableColumns) {\n\t\t\t\t\t\t\t\t\t// we get the estimated cell width\n\t\t\t\t\t\t\t\t\tconst tdWidth = previewTableWidth / tableColumns;\n\n\t\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\t\tlet wholeColumnsInContainer = Math.floor(tableContainerWidth / tdWidth);\n\t\t\t\t\t\t\t\t\tif (wholeColumnsInContainer < 1) wholeColumnsInContainer = 1;\n\n\t\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\t// if it available, check this table for compliance\n\t\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\t// and cancel creating a new table ( createNewTableIndic = false ).\n\t\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\t\twptbPreviewTableMobile = tableContainer.getElementsByClassName(\n\t\t\t\t\t\t\t\t\t\t\t'wptb-preview-table-mobile'\n\t\t\t\t\t\t\t\t\t\t)[0];\n\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.classList.remove('wptb-mobile-hide');\n\t\t\t\t\t\t\t\t\t\tconst dataWholeColumnInContainer =\n\t\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.dataset.wholeColumnsInContainer;\n\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tdataWholeColumnInContainer == wholeColumnsInContainer &&\n\t\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\t) {\n\t\t\t\t\t\t\t\t\t\t\tcreateNewTableIndic = false;\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tdataWholeColumnInContainer == wholeColumnsInContainer &&\n\t\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\t(tableContainerWidth > 480 || wptbPreviewTableMobile.column == 1)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcreateNewTableIndic = false;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\twptbPreviewTableMobile.parentNode.removeChild(wptbPreviewTableMobile);\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\t//\n\t\t\t\t\t\t\t\t\t// if indicator of creating of table \"true\" - continue\n\t\t\t\t\t\t\t\t\tif (createNewTableIndic) {\n\t\t\t\t\t\t\t\t\t\t// create new table for mobile devices\n\t\t\t\t\t\t\t\t\t\tconst newTable = document.createElement('table');\n\t\t\t\t\t\t\t\t\t\tconst newTableTbody = document.createElement('tbody');\n\t\t\t\t\t\t\t\t\t\tnewTable.appendChild(newTableTbody);\n\n\t\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\t\tnewTable.classList.add('wptb-preview-table-mobile');\n\t\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\t\tif (infArr && Array.isArray(infArr)) {\n\t\t\t\t\t\t\t\t\t\t\tnewTable.classList.add(infArr[0]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\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\t\tconst tableRows = previewTable.rows.length;\n\n\t\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\t\tlet newTableLastSectionFilledColumns;\n\n\t\t\t\t\t\t\t\t\t\t// set valuesIsSaved in 'false'\n\t\t\t\t\t\t\t\t\t\t// if the parameters newTableLastSectionFilledColumns get\n\t\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\t\tlet valuesIsSaved = false;\n\n\t\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\t\tif (previewTable.classList.contains('wptb-table-preview-head')) {\n\t\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\t\tconst tableRowsWithoutHeader = tableRows - 1;\n\n\t\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\t\tlet newTableColumnsWithoutLeftHeader;\n\n\t\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\t// quantity whole columns which are can placed in the container,\n\t\t\t\t\t\t\t\t\t\t\t// execute \"loop for\"\n\t\t\t\t\t\t\t\t\t\t\tif (tableRows > wholeColumnsInContainer) {\n\t\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\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\t// has more than half the columns compared to the previous blocks\n\t\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\t\tnewTableColumnsWithoutLeftHeader = wholeColumnsInContainer - 1 - i;\n\t\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\t\tnewTableColumnsWithoutLeftHeader = 1;\n\n\t\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\t\ttableRowsWithoutHeader % newTableColumnsWithoutLeftHeader;\n\n\t\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumnsWithoutLeftHeader <= 6 &&\n\t\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\t\t2 * newTableLastSectionFilledColumns <\n\t\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\t\tnewTableLastSectionFilledColumns <\n\t\t\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) {\n\t\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\t\tbreak;\n\t\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\t\tnewTableColumnsWithoutLeftHeader > 6 &&\n\t\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\t\tnewTableColumnsWithoutLeftHeader -\n\t\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\t\t0 &&\n\t\t\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\t\t\tnewTableColumnsWithoutLeftHeader\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumnsWithoutLeftHeader <= 18 &&\n\t\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\t\t1.6 * newTableLastSectionFilledColumns <\n\t\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\t\tnewTableLastSectionFilledColumns <\n\t\t\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) {\n\t\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\t\tbreak;\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\tcontinue;\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}\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\tnewTableColumnsWithoutLeftHeader = tableRowsWithoutHeader;\n\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\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\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\t\tif (valuesIsSaved) {\n\t\t\t\t\t\t\t\t\t\t\t\tlet countRows;\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\tcountRows =\n\t\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\t\tMath.ceil(\n\t\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\t);\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\tcountRows = tableColumns;\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\tconst sectionNumberLast = Math.floor((countRows - 1) / tableColumns);\n\t\t\t\t\t\t\t\t\t\t\t\tlet tdStyles;\n\t\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\t\tconst sectionNumber = Math.floor(j / tableColumns);\n\t\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\t\tconst tdLeftHeader = previewTable.rows[0].children[\n\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].cloneNode(true);\n\t\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\t\tconst rowFirstStyles = window.getComputedStyle(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpreviewTable.rows[0]\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 (!tdLeftHeader.style.backgroundColor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttdLeftHeader.style.backgroundColor =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trowFirstStyles.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\ttdLeftHeader.style.width = null;\n\t\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\t// tdLeftHeader.removeAttribute('data-x-index');\n\t\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\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\ttdLeftHeader.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\ttdLeftHeader.style.borderColor = tdStyles.borderBottomColor;\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 (sectionNumber > 0 && j % tableColumns == 0) {\n\t\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\t}\n\t\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\t\tfor (\n\t\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\t\tk < newTableColumnsWithoutLeftHeader * (sectionNumber + 1) + 1;\n\t\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\t) {\n\t\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\t\ttd = previewTable.rows[k].children[\n\t\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\t].cloneNode(true);\n\t\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\t\tpreviewTable.rows[k]\n\t\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\t\tif (!td.style.backgroundColor) {\n\t\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\t}\n\n\t\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\t\ttd.style.height = null;\n\t\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\t\ttd.removeAttribute('data-wptb-css-td-auto-width');\n\t\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\t\ttd = document.createElement('td');\n\t\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\t\ttd.style.background = '#fff';\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\ttdStyles = window.getComputedStyle(\n\t\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\t);\n\t\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\t\ttd.style.borderColor = tdStyles.borderTopColor;\n\t\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\t\ttd.style.borderColor = tdStyles.borderBottomColor;\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\tif (sectionNumber > 0 && j % tableColumns == 0) {\n\t\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\t}\n\n\t\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\t}\n\n\t\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\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\tlet newTableColumns;\n\t\t\t\t\t\t\t\t\t\t\tif (tableContainerWidth > 480) {\n\t\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\t\tnewTableColumns = wholeColumnsInContainer - i;\n\t\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\t\tnewTableLastSectionFilledColumns = tableColumns % newTableColumns;\n\n\t\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumns <= 6 &&\n\t\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\t\tnewTableLastSectionFilledColumns < newTableColumns\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumns <= 12 &&\n\t\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\t\tnewTableLastSectionFilledColumns < newTableColumns\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\t\tvaluesIsSaved = true;\n\t\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\t} else if (\n\t\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\t\tnewTableColumns <= 18 &&\n\t\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\t\tnewTableLastSectionFilledColumns < newTableColumns\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\t\tvaluesIsSaved = true;\n\t\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\t} else {\n\t\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\t}\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} else {\n\t\t\t\t\t\t\t\t\t\t\t\tnewTableColumns = 1;\n\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\tvaluesIsSaved = true;\n\t\t\t\t\t\t\t\t\t\t\t\tnewTable.column = 1;\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 increaseRatioRows = Math.ceil(tableColumns / newTableColumns);\n\n\t\t\t\t\t\t\t\t\t\t\tconst newTableRows = increaseRatioRows * tableRows;\n\n\t\t\t\t\t\t\t\t\t\t\tif (valuesIsSaved) {\n\t\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\t\tconst sectionNumber = Math.floor(i / tableRows);\n\t\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\t\tlet jMax;\n\t\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\t\tif (\n\t\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\t\tnewTableLastSectionFilledColumns == 0\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\t\tjStart = sectionNumber * newTableColumns;\n\t\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\t} else {\n\t\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\t\tjMax = tableColumns;\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\tconst row = previewTable.rows[i - sectionNumber * tableRows];\n\t\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\t\ttr.style.backgroundColor = row.style.backgroundColor;\n\n\t\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\t\tconst newTd = row.children[j].cloneNode(true);\n\t\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\t\tconst rowStyles = window.getComputedStyle(row);\n\t\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\t}\n\t\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\t\tnewTd.style.height = null;\n\t\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\t\tnewTd.removeAttribute('data-wptb-css-td-auto-width');\n\t\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\t}\n\n\t\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\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnewTable.dataset.wholeColumnsInContainer = wholeColumnsInContainer;\n\t\t\t\t\t\t\t\t\t\tconst images = newTable.querySelectorAll('[srcset]');\n\t\t\t\t\t\t\t\t\t\tif (images.length > 0) {\n\t\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\t\timages[i].removeAttribute('srcset');\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\twptbPreviewTableMobile = newTable;\n\t\t\t\t\t\t\t\t\t\ttableContainer.appendChild(newTable);\n\t\t\t\t\t\t\t\t\t\ttableReconstructed = true;\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} else if (\n\t\t\t\t\t\t\t\ttableContainerMatrix &&\n\t\t\t\t\t\t\t\ttableContainerMatrix.classList.contains('wptb-matrix-hide')\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\ttableContainerMatrix.classList.remove('wptb-matrix-hide');\n\t\t\t\t\t\t\t\ttableReconstructed = true;\n\t\t\t\t\t\t\t\tpreviewTable.classList.remove('wptb-mobile-view-active');\n\t\t\t\t\t\t\t\twptbPreviewTableMobile = tableContainer.querySelector('.wptb-preview-table-mobile');\n\t\t\t\t\t\t\t\tif (wptbPreviewTableMobile) {\n\t\t\t\t\t\t\t\t\ttableContainer\n\t\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\t.classList.add('wptb-mobile-hide');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttableContainer.style.overflow = 'auto';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpreviewTable.style.minWidth = 'auto';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tWPTB_RecalculateIndexes(previewTable);\n\n\t\t\t\t\t\tif (tableReconstructed) {\n\t\t\t\t\t\t\tWPTB_RecalculateIndexes(wptbPreviewTableMobile);\n\t\t\t\t\t\t\tconst tabEvent = new CustomEvent('table:rebuilt', { detail: true, bubbles: true });\n\t\t\t\t\t\t\tpreviewTable.dispatchEvent(tabEvent);\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\tfunction wptb_tdDefaultWidth() {\n\t\t\tconst wptbTableContainers = document.getElementsByClassName('wptb-table-container');\n\t\t\t// let frontendEditLink = document.querySelectorAll( '.wptb-frontend-table-edit-link' );\n\t\t\tfor (let i = 0; i < wptbTableContainers.length; i++) {\n\t\t\t\tconst wptbTableContainer = wptbTableContainers[i];\n\n\t\t\t\twptbTableContainer.classList.add(`wptb-table-container-${i}`);\n\n\t\t\t\tlet table = wptbTableContainer.getElementsByClassName('wptb-preview-table');\n\t\t\t\tif (table.length > 0) {\n\t\t\t\t\ttable = table[0];\n\n\t\t\t\t\tif (table.dataset.wptbTableContainerMaxWidth) {\n\t\t\t\t\t\twptbTableContainer.style.maxWidth = `${table.dataset.wptbTableContainerMaxWidth}px`;\n\t\t\t\t\t}\n\t\t\t\t\ttable.classList.remove('wptb-table-preview-static-indic');\n\n\t\t\t\t\ttable.mergingСellsHorizontally = false;\n\t\t\t\t\tconst tds = table.querySelectorAll('td');\n\t\t\t\t\tfor (let j = 0; j < tds.length; j++) {\n\t\t\t\t\t\tif (tds[j].colSpan > 1) {\n\t\t\t\t\t\t\ttable.mergingСellsHorizontally = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst wptbTableContainerWidth = wptbTableContainer.offsetWidth;\n\n\t\t\t\t\tconst td = table.querySelector('td');\n\t\t\t\t\tconst tdStyleObj = window.getComputedStyle(td, null);\n\t\t\t\t\tconst tdBorderLeftWidth = tdStyleObj.getPropertyValue('border-left-width');\n\t\t\t\t\tconst tdBorderRightWidth = tdStyleObj.getPropertyValue('border-right-width');\n\t\t\t\t\tconst tdPaddingLeftWidth = tdStyleObj.getPropertyValue('padding-left');\n\t\t\t\t\tconst tdPaddingRightWidth = tdStyleObj.getPropertyValue('padding-left');\n\t\t\t\t\tconst tdPaddingCommon = parseFloat(tdPaddingLeftWidth, 10) + parseFloat(tdPaddingRightWidth, 10);\n\t\t\t\t\tconst tableTdBorderCommonWidth =\n\t\t\t\t\t\tparseFloat(tdBorderLeftWidth, 10) + parseFloat(tdBorderRightWidth, 10);\n\t\t\t\t\tconst { wptbTableTdsSumMaxWidth } = table.dataset;\n\t\t\t\t\tconst { wptbFixedWidthSize } = table.dataset;\n\t\t\t\t\tconst { wptbCellsWidthAutoCount } = table.dataset;\n\t\t\t\t\tlet styleElementCreate = false;\n\t\t\t\t\tlet tableTdWidthAuto;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Table width logic to determine final width on rendered tables.\n\t\t\t\t\t */\n\t\t\t\t\tconst tableWidthLogic = () => {\n\t\t\t\t\t\t// eslint-disable-next-line no-shadow\n\t\t\t\t\t\tconst wptbTableContainerWidth = wptbTableContainer.offsetWidth;\n\t\t\t\t\t\tif (wptbTableTdsSumMaxWidth < wptbTableContainerWidth) {\n\t\t\t\t\t\t\tif (wptbCellsWidthAutoCount) {\n\t\t\t\t\t\t\t\ttable.style.minWidth = '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.minWidth = wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\t\tif (table.mergingСellsHorizontally) {\n\t\t\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\t\t\tconst tableTdsWidthAutoCommon = wptbTableContainerWidth - wptbFixedWidthSize;\n\t\t\t\t\t\t\t\t\ttableTdWidthAuto = tableTdsWidthAutoCommon / wptbCellsWidthAutoCount;\n\t\t\t\t\t\t\t\t\ttableTdWidthAuto = tableTdWidthAuto - tdPaddingCommon - tableTdBorderCommonWidth;\n\t\t\t\t\t\t\t\t\tstyleElementCreate = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttable.style.width = '100%';\n\n\t\t\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t\t\t// frontendEditLink[i].style.width = '100%';\n\t\t\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = '100%';\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} else {\n\t\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\t\ttable.style.minWidth = null;\n\t\t\t\t\t\t\t\ttable.style.maxWidth = `${wptbTableTdsSumMaxWidth}px`;\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 = null;\n\t\t\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = null;\n\t\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = wptbTableTdsSumMaxWidth + 'px';\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.maxWidth = null;\n\t\t\t\t\t\t\ttable.style.minWidth = `${table.dataset.wptbTableTdsSumMaxWidth}px`;\n\t\t\t\t\t\t\ttable.style.width = 'auto';\n\t\t\t\t\t\t\ttableTdWidthAuto = table.dataset.wptbTdWidthAuto ? table.dataset.wptbTdWidthAuto : '100';\n\t\t\t\t\t\t\tstyleElementCreate = true;\n\n\t\t\t\t\t\t\t// if( frontendEditLink && frontendEditLink[i] ) {\n\t\t\t\t\t\t\t// frontendEditLink[i].style.maxWidth = '100%';\n\t\t\t\t\t\t\t// frontendEditLink[i].style.minWidth = table.dataset.wptbTableTdsSumMaxWidth + 'px';\n\t\t\t\t\t\t\t// frontendEditLink[i].style.width = null;\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\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\t\tif (wptbTableContainerWidth <= 0) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Calculate element visibility status.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param {Element} element element to check\n\t\t\t\t\t\t * @return {boolean} whether element is visible or not\n\t\t\t\t\t\t */\n\t\t\t\t\t\tconst elementVisibilityStatus = (element) => {\n\t\t\t\t\t\t\tconst { display, visibility } = getComputedStyle(element);\n\t\t\t\t\t\t\treturn display !== 'none' || visibility === 'visible';\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Find parent element that is responsible for hiding our table.\n\t\t\t\t\t\t *\n\t\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\t *\n\t\t\t\t\t\t * @param {Element} currentElement current element in check\n\t\t\t\t\t\t * @return {null|Element} found parent or null\n\t\t\t\t\t\t */\n\t\t\t\t\t\tconst findParentWithNoDisplay = (currentElement) => {\n\t\t\t\t\t\t\tconst currentParent = currentElement.parentNode;\n\t\t\t\t\t\t\tconst parentDisplayStatus = elementVisibilityStatus(currentParent);\n\t\t\t\t\t\t\t// lower cased element name\n\t\t\t\t\t\t\tconst parentType = currentParent.nodeName.toLowerCase();\n\n\t\t\t\t\t\t\t// if parent is visible make a recursive call\n\t\t\t\t\t\t\tif (!parentDisplayStatus && parentType !== 'body') {\n\t\t\t\t\t\t\t\treturn findParentWithNoDisplay(currentParent);\n\t\t\t\t\t\t\t}\n\t\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\t\tif (parentType === 'body') {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn currentParent;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// find parent container with hidden display property\n\t\t\t\t\t\tconst culpritParent = findParentWithNoDisplay(wptbTableContainer);\n\t\t\t\t\t\tif (culpritParent) {\n\t\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\t\tconst config = { attributes: true, childList: false, subtree: false };\n\t\t\t\t\t\t\tconst parentObserver = new MutationObserver((mutationRecord) => {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line array-callback-return\n\t\t\t\t\t\t\t\t\tmutationRecord.map((mutation) => {\n\t\t\t\t\t\t\t\t\t\tconst currentVisibility = elementVisibilityStatus(mutation.target);\n\t\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\t// call width logic and start calculations for our table since it is visible now\n\t\t\t\t\t\t\t\t\t\tif (currentVisibility && containerWidth > 0) {\n\t\t\t\t\t\t\t\t\t\t\ttableWidthLogic();\n\n\t\t\t\t\t\t\t\t\t\t\t// disconnect observer\n\t\t\t\t\t\t\t\t\t\t\tparentObserver.disconnect();\n\n\t\t\t\t\t\t\t\t\t\t\t// get out of iteration\n\t\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\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} catch (e) {\n\t\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\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// observe parent for visibility changes\n\t\t\t\t\t\t\tparentObserver.observe(culpritParent, config);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\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\t\ttableWidthLogic();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { head } = document;\n\t\t\t\t\tif (head) {\n\t\t\t\t\t\tconst cssForTdsWidthAutoOld = head.querySelector(`style[data-wptb-td-auto-width-${i}=\"true\"]`);\n\n\t\t\t\t\t\tif (cssForTdsWidthAutoOld) {\n\t\t\t\t\t\t\thead.removeChild(cssForTdsWidthAutoOld);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (styleElementCreate) {\n\t\t\t\t\t\tconst cssForTdsWidthAuto = document.createElement('style');\n\t\t\t\t\t\tcssForTdsWidthAuto.setAttribute(`data-wptb-td-auto-width-${i}`, true);\n\t\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\t\tif (head) {\n\t\t\t\t\t\t\thead.appendChild(cssForTdsWidthAuto);\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// code for adding of old css styles for correct view\n\t\tconst elements = document.getElementsByClassName('wptb-ph-element');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tconst element = elements[i];\n\t\t\tif (element.classList.contains('wptb-list-item-container')) {\n\t\t\t\telement.classList.remove('wptb-list-item-container');\n\t\t\t\telement.classList.add('wptb-list-container');\n\t\t\t}\n\n\t\t\tif (element.classList.contains('wptb-button-container')) {\n\t\t\t\tconst infArr = element.className.match(/wptb-size-([A-Z]+)/i);\n\t\t\t\tif (infArr && Array.isArray(infArr)) {\n\t\t\t\t\tconst wptbSize = infArr[0];\n\t\t\t\t\tconst wptbSizeNew = wptbSize.toLowerCase();\n\n\t\t\t\t\telement.classList.remove(wptbSize);\n\n\t\t\t\t\tconst wptbButtonWrapper = element.querySelector('.wptb-button-wrapper');\n\t\t\t\t\tif (wptbButtonWrapper) {\n\t\t\t\t\t\twptbButtonWrapper.classList.add(wptbSizeNew);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// responsive setup\n\t\t// eslint-disable-next-line no-unused-vars\n\t\tconst responsiveFront = new WPTB_ResponsiveFrontend({\n\t\t\tquery: '.wptb-preview-table',\n\t\t\tbindToResize: true,\n\t\t});\n\n\t\t// sorting table\n\t\tfunction sortingTable() {\n\t\t\tconst tables = document.querySelectorAll('.wptb-preview-table');\n\t\t\tfor (let i = 0; i < tables.length; i += 1) {\n\t\t\t\tconst sortableTable = new WPTB_SortableTable({ table: tables[i] });\n\t\t\t\tsortableTable.sortableTableInitialization(responsiveFront);\n\t\t\t}\n\t\t}\n\n\t\tsortingTable();\n\t\tconst responsiveFrontReady = new CustomEvent('responsive:front', {\n\t\t\tdetail: {\n\t\t\t\tresponsiveFront,\n\t\t\t},\n\t\t});\n\t\tdocument.dispatchEvent(responsiveFrontReady);\n\n\t\t// apply defined extra styles to tables if there is any\n\t\tWPTB_ExtraStyles.applyStyles(WPTB_ExtraStyles.modes.frontEnd, WptbFrontendData.generalStyles);\n\n\t\t// rebuild tables according to current responsive mode\n\t\tresponsiveFront.rebuildTables();\n\n\n\t\t// initialize style pass\n\t\tWPTB_StylePass.init(WptbFrontendData.stylePass);\n\t});\n})(jQuery);\n"]}
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wptb, imtiazrayhan, istiakrayhan, ultimateblocks, wpcdplugin, wple
3
  Tags: table, table builder, drag and drop
4
  Requires at least: 4.9
5
  Tested up to: 5.7
6
- Stable tag: 1.3.5
7
  Requires PHP: 5.6
8
  License: GPL3+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -88,6 +88,10 @@ That's it. You're done!
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  = 1.3.5 =
92
 
93
  * FIX: Transparent background color bug that is affecting some tables.
3
  Tags: table, table builder, drag and drop
4
  Requires at least: 4.9
5
  Tested up to: 5.7
6
+ Stable tag: 1.3.6
7
  Requires PHP: 5.6
8
  License: GPL3+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
88
 
89
  == Changelog ==
90
 
91
+ = 1.3.6 =
92
+
93
+ * FIX: An issue with style pass affecting some browsers.
94
+
95
  = 1.3.5 =
96
 
97
  * FIX: Transparent background color bug that is affecting some tables.
wp-table-builder.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WP Table Builder
16
  * Plugin URI: https://wptablebuilder.com/
17
  * Description: Drag and Drop Responsive Table Builder Plugin for WordPress.
18
- * Version: 1.3.5
19
  * Author: WP Table Builder
20
  * Author URI: https://wptablebuilder.com//
21
  * License: GPL-3.0+
15
  * Plugin Name: WP Table Builder
16
  * Plugin URI: https://wptablebuilder.com/
17
  * Description: Drag and Drop Responsive Table Builder Plugin for WordPress.
18
+ * Version: 1.3.6
19
  * Author: WP Table Builder
20
  * Author URI: https://wptablebuilder.com//
21
  * License: GPL-3.0+