2 var Print=
function(t){this.table=t,this.element=!1,this.manualBlock=!1};Print.prototype.initialize=
function(){window.addEventListener(
"beforeprint",this.replaceTable.bind(
this)),window.addEventListener(
"afterprint",
this.cleanup.bind(
this))},Print.prototype.replaceTable=
function(){this.manualBlock||(this.element=document.createElement(
"div"),this.element.classList.add(
"tabulator-print-table"),this.element.appendChild(this.table.modules.htmlTableExport.genereateTable(
this.table.options.printConfig,
this.table.options.printCopyStyle,
this.table.options.printVisibleRows,
"print")),this.table.element.style.display=
"none",
this.table.element.parentNode.insertBefore(
this.element,
this.table.element))},Print.prototype.cleanup=
function(){document.body.classList.remove(
"tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display=
"")},Print.prototype.printFullscreen=
function(t,e,i){var n,l,o=window.scrollX,s=window.scrollY,a=document.createElement(
"div"),r=document.createElement(
"div"),p=this.table.modules.htmlTableExport.genereateTable(
void 0!==i?i:this.table.options.printConfig,
void 0!==e?e:
this.table.options.printCopyStyle,t,
"print");this.manualBlock=!0,this.element=document.createElement(
"div"),this.element.classList.add(
"tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add(
"tabulator-print-header"),n=
"function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,
"string"==typeof n?a.innerHTML=n:a.appendChild(n),this.element.appendChild(a)),this.element.appendChild(p),this.table.options.printFooter&&(r.classList.add(
"tabulator-print-footer"),l=
"function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,
"string"==typeof l?r.innerHTML=l:r.appendChild(l),this.element.appendChild(r)),document.body.classList.add(
"tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,p),window.print(),this.cleanup(),window.scrollTo(o,s),this.manualBlock=!1},Tabulator.prototype.registerModule(
"print",Print);