/* tableExport.jquery.plugin Version 1.9.10 Copyright (c) 2015-2018 hhurz, https://github.com/hhurz Original Work Copyright (c) 2014 Giri Raj Licensed under the MIT License */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,f,u){c instanceof String&&(c=String(c));for(var C=c.length,D=0;Dk&&"undefined"!=typeof Q[k]&&-1!=c.inArray(Q[k],a.ignoreColumn))&&(r=!0):r=!0;return r}function B(b,d,k,r,g){if("function"===typeof g){var h=!1;"function"===typeof a.onIgnoreRow&&(h=a.onIgnoreRow(c(b),k));if(!1===h&&-1==c.inArray(k,a.ignoreRow)&&-1==c.inArray(k-r,a.ignoreRow)&&P(c(b))){var x=c(b).find(d),q=0;x.each(function(b){var d=c(this), a,h=R(this),r=S(this);c.each(G,function(){if(k>=this.s.r&&k<=this.e.r&&q>=this.s.c&&q<=this.e.c)for(a=0;a<=this.e.c-this.s.c;++a)g(null,k,q++)});if(!1===Ba(d,x.length,b)){if(r||h)h=h||1,G.push({s:{r:k,c:q},e:{r:k+(r||1)-1,c:q+h-1}});g(this,k,q++)}if(h)for(a=0;a=this.s.r&&k<=this.e.r&&q>=this.s.c&&q<=this.e.c)for(aa=0;aa<=this.e.c-this.s.c;++aa)g(null,k,q++)})}}}function na(b,d){!0===a.consoleLog&&console.log(b.output());if("string"===a.outputMode)return b.output(); if("base64"===a.outputMode)return L(b.output());if("window"===a.outputMode)window.URL=window.URL||window.webkitURL,window.open(window.URL.createObjectURL(b.output("blob")));else try{var k=b.output("blob");saveAs(k,a.fileName+".pdf")}catch(r){H(a.fileName+".pdf","data:application/pdf"+(d?"":";base64")+",",d?b.output("blob"):b.output())}}function oa(b,d,a){var k=0;"undefined"!==typeof a&&(k=a.colspan);if(0<=k){for(var g=b.width,c=b.textPos.x,x=d.table.columns.indexOf(d.column),q=1;qx&&(f=Math.min(b.width,this.width),l=this.height*f/this.width);f*=e;l*=e;lb.textPos.x&&k+f>b.textPos.x+b.width){if(0<=".,!%*;:=-".indexOf(e.charAt(0))){var l=e.charAt(0);f=a.doc.getStringUnitWidth(l)*a.doc.internal.getFontSize();k+f<=b.textPos.x+b.width&&(a.doc.autoTableText(l,k,g,h),e=e.substring(1,e.length));f=a.doc.getStringUnitWidth(e)*a.doc.internal.getFontSize()}k= b.textPos.x;g+=a.doc.internal.getFontSize()}for(;e.length&&k+f>b.textPos.x+b.width;)e=e.substring(0,e.length-1),f=a.doc.getStringUnitWidth(e)*a.doc.internal.getFontSize();a.doc.autoTableText(e,k,g,h);k+=f}if(x||q)c(d).is("b")?x=!1:c(d).is("i")&&(q=!1),a.doc.setFontType(x||q?x?"bold":"italic":"normal");d=d.nextSibling}b.textPos.x=k;b.textPos.y=g}else a.doc.autoTableText(b.text,b.textPos.x,b.textPos.y,h)}}function da(b,a,c){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"), "g"),c)}function ha(b){b=da(b||"0",a.numbers.html.thousandsSeparator,"");b=da(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function Da(b){-1/gi,"\u2060"),n=c("
").html(m).contents();e=!1;m="";c.each(n.text().split("\u2028"),function(b,a){0e?1:0)).split(".");1==n.length&&(n[1]="");var p=3e?"-":"")+(a.numbers.output.thousandsSeparator?(p?n[0].substr(0,p)+a.numbers.output.thousandsSeparator:"")+n[0].substr(p).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):n[0])+(n[1].length?a.numbers.output.decimalMark+n[1]:"")}}else r=h;!0===a.escape&&(r=escape(r));"function"===typeof a.onCellData&&(r=a.onCellData(g,d,k,r))}return r}function Ea(b,a,c){return a+"-"+c.toLowerCase()} function ba(b,a){(b=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(b))&&(a=[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]);return a}function ta(b){var a=M(b,"text-align"),c=M(b,"font-weight"),r=M(b,"font-style"),g="";"start"==a&&(a="rtl"==M(b,"direction")?"right":"left");700<=c&&(g="bold");"italic"==r&&(g+=r);""===g&&(g="normal");a={style:{align:a,bcolor:ba(M(b,"background-color"),[255,255,255]),color:ba(M(b,"color"),[0,0,0]),fstyle:g},colspan:R(b),rowspan:S(b)};null!==b&&(b=b.getBoundingClientRect(), a.rect={width:b.width,height:b.height});return a}function R(b){var a=c(b).data("tableexport-colspan");"undefined"==typeof a&&c(b).is("[colspan]")&&(a=c(b).attr("colspan"));return parseInt(a)||0}function S(b){var a=c(b).data("tableexport-rowspan");"undefined"==typeof a&&c(b).is("[rowspan]")&&(a=c(b).attr("rowspan"));return parseInt(a)||0}function M(b,a){try{return window.getComputedStyle?(a=a.replace(/([a-z])([A-Z])/,Ea),window.getComputedStyle(b,null).getPropertyValue(a)):b.currentStyle?b.currentStyle[a]: b.style[a]}catch(k){}return""}function ca(b,a,c){a=M(b,a).match(/\d+/);if(null!==a){a=a[0];b=b.parentElement;var d=document.createElement("div");d.style.overflow="hidden";d.style.visibility="hidden";b.appendChild(d);d.style.width=100+c;c=100/d.offsetWidth;b.removeChild(d);return a*c}return 0}function ia(){if(!(this instanceof ia))return new ia;this.SheetNames=[];this.Sheets={}}function ua(a){for(var b=new ArrayBuffer(a.length),c=new Uint8Array(b),e=0;e!=a.length;++e)c[e]=a.charCodeAt(e)&255;return b} function Fa(a){for(var b={},c={s:{c:1E7,r:1E7},e:{c:0,r:0}},e=0;e!=a.length;++e)for(var g=0;g!=a[e].length;++g){c.s.r>e&&(c.s.r=e);c.s.c>g&&(c.s.c=g);c.e.rc.s.c&& (b["!ref"]=XLSX.utils.encode_range(c));return b}function qa(a){var b=0,c;if(0===a.length)return b;var e=0;for(c=a.length;eh?g+=String.fromCharCode(h):(127h?g+=String.fromCharCode(h>>6|192):(g+=String.fromCharCode(h>>12|224),g+=String.fromCharCode(h>>6&63|128)),g+=String.fromCharCode(h&63|128))}a=g}for(;e>2;f=(f&3)<<4|g>>4;var q=(g&15)<<2|b>>6;var l=b&63;isNaN(g)?q=l=64:isNaN(b)&&(l=64);c=c+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(q)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)}return c}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelFileFormat:"xlshtml",excelPageOrientation:"portrait",excelRTL:!1,excelstyles:[],exportHiddenCells:!1,fileName:"tableExport",htmlContent:!1,ignoreColumn:[], ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},onDocCreated:null,autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{doc:null,onAfterAutotable:null,onBeforeAutotable:null,onAutotableText:null,onTable:null, outputImages:!0}}},maxNestedTables:1,numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,onCellHtmlData:null,onIgnoreRow:null,onMsoNumberFormat:null,outputMode:"file",pdfmake:{enabled:!1,docDefinition:{pageOrientation:"portrait",defaultStyle:{font:"Roboto"}},fonts:{}},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"Table",type:"csv",worksheetName:""},v=this,ea=null,p=[],t=[],l=0,n="",Q=[],G=[],K=[],T=!1;c.extend(!0, a,f);a.maxNestedTables=0<=a.maxNestedTables?a.maxNestedTables:1;Q=O(v);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var I="",W=0;G=[];l=0;var ja=function(b,d,k){b.each(function(){n="";B(this,d,l,k+b.length,function(b,c,d){var g=n,h="";if(null!==b)if(b=z(b,c,d),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&b.toLocaleString(),h=da(c,"\t"," ");else if(b instanceof Date)h=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(h=da(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure), 0<=h.indexOf(a.csvSeparator)||/[\r\n ]/g.test(h))h=a.csvEnclosure+h+a.csvEnclosure;n=g+(h+("tsv"==a.type?"\t":a.csvSeparator))});n=c.trim(n).substring(0,n.length-1);0"+z(a,c,e)+""});l++});J+="";var va=1;t=u(c(v));c(t).each(function(){var a=1;n="";B(this,"td,th",l,p.length+t.length,function(b,c,e){n+=""+z(b,c,e)+"";a++});0"!=n&&(J+=''+n+"",va++);l++});J+=""; !0===a.consoleLog&&console.log(J);if("string"===a.outputMode)return J;if("base64"===a.outputMode)return L(J);try{A=new Blob([J],{type:"application/xml;charset=utf-8"}),saveAs(A,a.fileName+".xml")}catch(b){H(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",J)}}else if("excel"===a.type&&"xmlss"===a.excelFileFormat){var la=[],F=[];c(v).filter(function(){return P(c(this))}).each(function(){function b(a,b,d){var g=[];c(a).each(function(){var b=0,e=0;n="";B(this,"td,th",l,d+a.length,function(a, d,h){if(null!==a){var k="";d=z(a,d,h);h="String";if(!1!==jQuery.isNumeric(d))h="Number";else{var f=Da(d);!1!==f&&(d=f,h="Number",k+=' ss:StyleID="pct1"')}"Number"!==h&&(d=d.replace(/\n/g,"
"));f=R(a);a=S(a);c.each(g,function(){if(l>=this.s.r&&l<=this.e.r&&e>=this.s.c&&e<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)e++,b++});if(a||f)a=a||1,f=f||1,g.push({s:{r:l,c:e},e:{r:l+a-1,c:e+f-1}});1'+c("
").text(d).html()+"\r";e++}});0\r'+n+"\r");l++});return a.length}var d=c(this),e="";"string"===typeof a.worksheetName&&a.worksheetName.length?e=a.worksheetName+" "+(F.length+1):"undefined"!==typeof a.worksheetName[F.length]&&(e=a.worksheetName[F.length]);e.length||(e=d.find("caption").text()||"");e.length||(e="Table "+(F.length+1));e=c.trim(e.replace(/[\\\/[\]*:?'"]/g, "").substring(0,31));F.push(c("
").text(e).html());!1===a.exportHiddenCells&&(K=d.find("tr, th, td").filter(":hidden"),T=0\r";e=0;e+=b(d.find("thead").first().find(a.theadSelector),"th,td",e);b(u(d),"td,th",e);E+="\r";la.push(E);!0===a.consoleLog&&console.log(E)});f={};for(var y={},m,N,V=0,aa=F.length;V\r\r\r\r '+ (new Date).toISOString()+'\r\r\r \r\r\r 9000\r 13860\r 0\r 0\r False\r False\r\r\r \r \r \r\r'; for(y=0;y\r'+la[y],f=a.excelRTL?f+'\r\r\r':f+'\r',f+="\r";f+="\r";!0===a.consoleLog&&console.log(f);if("string"===a.outputMode)return f;if("base64"===a.outputMode)return L(f);try{A=new Blob([f],{type:"application/xml;charset=utf-8"}), saveAs(A,a.fileName+".xml")}catch(b){H(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",f)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){f="excel"==a.type||"xls"==a.type?"excel":"word";y="excel"==f?"xls":"doc";m='xmlns:x="urn:schemas-microsoft-com:office:'+f+'"';var E="",X="";c(v).filter(function(){return P(c(this))}).each(function(){var b=c(this);""===X&&(X=a.worksheetName||b.find("caption").text()||"Table",X=c.trim(X.replace(/[\\\/[\]*:?'"]/g,"").substring(0, 31)));!1===a.exportHiddenCells&&(K=b.find("tr, th, td").filter(":hidden"),T=0";p=b.find("thead").first().find(a.theadSelector);p.each(function(){n="";B(this,"th,td",l,p.length,function(b,e,f){if(null!==b){var d="";n+=""}});0"+n+"");l++});E+="";t=u(b);c(t).each(function(){var b=c(this);n="";B(this,"td,th",l,p.length+t.length,function(d,e,g){if(null!==d){var h=z(d,e,g),k="",f=c(d).data("tableexport-msonumberformat");"undefined"==typeof f&&"function"===typeof a.onMsoNumberFormat&&(f=a.onMsoNumberFormat(d,e,g));"undefined"!=typeof f&&""!==f&&(k="style=\"mso-number-format:'"+f+"'");for(var l in a.excelstyles)a.excelstyles.hasOwnProperty(l)&& (f=c(d).css(a.excelstyles[l]),""===f&&(f=b.css(a.excelstyles[l])),""!==f&&"0px none rgb(0, 0, 0)"!=f&&"rgba(0, 0, 0, 0)"!=f&&(k+=""===k?'style="':";",k+=a.excelstyles[l]+":"+f));n+=""));n+=">"+h+""}});0"+n+"");l++});a.displayTableName&&(E+=""+z(c("

"+a.tableName+"

"))+""); E+="";!0===a.consoleLog&&console.log(E)});m=''+('')+"";"excel"===f&&(m+="\x3c!--[if gte mso 9]>",m+="",m+="",m+="",m+="",m+="",m+=X,m+="",m+="",m+="",a.excelRTL&&(m+=""), m+="",m+="",m+="",m+="",m+="",m+="";"landscape"===a.excelPageOrientation&&(m+="@page { size:"+a.excelPageOrientation+"; mso-page-orientation:"+a.excelPageOrientation+"; }");m+="br {mso-data-placement:same-cell;}";m+="";m+="";m+="";m+=E;m+="";m+="";!0===a.consoleLog&&console.log(m);if("string"===a.outputMode)return m;if("base64"===a.outputMode)return L(m); try{A=new Blob([m],{type:"application/vnd.ms-"+a.type}),saveAs(A,a.fileName+"."+y)}catch(b){H(a.fileName+"."+y,"data:application/vnd.ms-"+f+";base64,",m)}}else if("xlsx"==a.type){var wa=[],ma=[];l=0;t=c(v).find("thead").first().find(a.theadSelector).toArray();t.push.apply(t,u(c(v)));c(t).each(function(){var b=[];B(this,"th,td",l,t.length,function(d,e,f){if("undefined"!==typeof d&&null!==d){f=z(d,e,f);e=R(d);d=S(d);c.each(ma,function(){if(l>=this.s.r&&l<=this.e.r&&b.length>=this.s.c&&b.length<=this.e.c)for(var a= 0;a<=this.e.c-this.s.c;++a)b.push(null)});if(d||e)e=e||1,ma.push({s:{r:l,c:b.length},e:{r:l+(d||1)-1,c:b.length+e-1}});"function"!==typeof a.onCellData&&""!==f&&f==+f&&(f=+f);b.push(""!==f?f:null);if(e)for(d=0;dza){a>Y.a0[0]&&(fa="a0",Z="l");for(var d in Y)Y.hasOwnProperty(d)&&Y[d][1]>a&&(fa=d,Z="l",Y[d][0]>a&&(Z="p"));za=a}}});a.jspdf.format=""===fa?"a4":fa;a.jspdf.orientation=""===Z?"w":Z}if(null==e.doc&&(e.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format),"function"===typeof a.jspdf.onDocCreated))a.jspdf.onDocCreated(e.doc); !0===e.outputImages&&(e.images={});"undefined"!=typeof e.images&&(c(v).filter(function(){return P(c(this))}).each(function(){var b=0;G=[];!1===a.exportHiddenCells&&(K=c(this).find("tr, th, td").filter(":hidden"),T=0a.styles.rowHeight&&(a.styles.rowHeight=f)}"undefined"!=typeof g.style&&!0!==g.style.hidden&&(a.styles.halign=g.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=g.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=g.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=g.style.fstyle))}});"function"!== typeof d.createdCell&&(d.createdCell=function(a,b){b=e.rowoptions[b.row.index+":"+b.column.dataKey];"undefined"!=typeof b&&"undefined"!=typeof b.style&&!0!==b.style.hidden&&(a.styles.halign=b.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=b.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof d.drawHeaderCell&&(d.drawHeaderCell=function(a,b){var c=e.columns[b.column.dataKey]; return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?oa(a,b,c):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var c=e.rowoptions[b.row.index+":"+b.column.dataKey];if(oa(a,b,c))if(e.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle),"undefined"!=typeof c&&"undefined"!=typeof c.kids&&0e.dh||"undefined"==typeof e.dh)e.dh=b;e.dw=a.width/c.rect.width;b=a.textPos.y;ra(a,c.kids,e);a.textPos.y=b;sa(a,c.kids,e)}else sa(a, {},e);return!1});e.headerrows=[];p=c(this).find("thead").find(a.theadSelector);p.each(function(){b=0;e.headerrows[l]=[];B(this,"th,td",l,p.length,function(a,c,d){var f=ta(a);f.title=z(a,c,d);f.key=b++;f.rowIndex=l;e.headerrows[l].push(f)});l++});if(0