/* tableExport.jquery.plugin Version 1.9.9 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,h,u){c instanceof String&&(c=String(c));for(var C=c.length,D=0;Df&&"undefined"!=typeof Q[f]&&-1!=c.inArray(Q[f],a.ignoreColumn))&&(p=!0):p=!0;return p}function B(b,d,f,p,g){if("function"===typeof g){var l=!1;"function"===typeof a.onIgnoreRow&&(l=a.onIgnoreRow(c(b),f));if(!1===l&&-1==c.inArray(f,a.ignoreRow)&&-1==c.inArray(f-p,a.ignoreRow)&&P(c(b))){var x=c(b).find(d),r=0;x.each(function(b){var d=c(this),a,l=R(this),p= S(this);c.each(G,function(){if(f>=this.s.r&&f<=this.e.r&&r>=this.s.c&&r<=this.e.c)for(a=0;a<=this.e.c-this.s.c;++a)g(null,f,r++)});if(!1===Ba(d,x.length,b)){if(p||l)l=l||1,G.push({s:{r:f,c:r},e:{r:f+(p||1)-1,c:r+l-1}});g(this,f,r++)}if(l)for(a=0;a=this.s.r&&f<=this.e.r&&r>=this.s.c&&r<=this.e.c)for(aa=0;aa<=this.e.c-this.s.c;++aa)g(null,f,r++)})}}}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 f=b.output("blob");saveAs(f,a.fileName+".pdf")}catch(p){H(a.fileName+".pdf","data:application/pdf"+(d?"":";base64")+",",d?b.output("blob"):b.output())}}function oa(b,d,a){var f=0;"undefined"!==typeof a&&(f=a.colspan);if(0<=f){for(var g=b.width,c=b.textPos.x,x=d.table.columns.indexOf(d.column),r=1;rx&&(h=Math.min(b.width,this.width),k=this.height*h/this.width);h*=e;k*=e;kb.textPos.x&&d+h>b.textPos.x+b.width){if(0<=".,!%*;:=-".indexOf(e.charAt(0))){var k=e.charAt(0);h=f.doc.getStringUnitWidth(k)*f.doc.internal.getFontSize();d+h<=b.textPos.x+b.width&&(f.doc.autoTableText(k,d,g,l),e=e.substring(1,e.length));h=f.doc.getStringUnitWidth(e)*f.doc.internal.getFontSize()}d= b.textPos.x;g+=f.doc.internal.getFontSize()}for(;e.length&&d+h>b.textPos.x+b.width;)e=e.substring(0,e.length-1),h=f.doc.getStringUnitWidth(e)*f.doc.internal.getFontSize();f.doc.autoTableText(e,d,g,l);d+=h}if(x||r)c(a).is("b")?x=!1:c(a).is("i")&&(r=!1),f.doc.setFontType(x||r?x?"bold":"italic":"normal");a=a.nextSibling}b.textPos.x=d;b.textPos.y=g}else f.doc.autoTableText(b.text,b.textPos.x,b.textPos.y,l)}}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"),m=c("
").html(n).contents();e=!1;n="";c.each(m.text().split("\u2028"),function(b,a){0e?1:0)).split(".");1==m.length&&(m[1]="");var q=3e?"-":"")+(a.numbers.output.thousandsSeparator?(q?m[0].substr(0,q)+a.numbers.output.thousandsSeparator:"")+m[0].substr(q).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):m[0])+(m[1].length?a.numbers.output.decimalMark+m[1]:"")}}else p=l;!0===a.escape&&(p=escape(p));"function"===typeof a.onCellData&&(p=a.onCellData(g,d,f,p))}return p}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"),p=M(b,"font-style"),g="";"start"==a&&(a="rtl"==M(b,"direction")?"right":"left");700<=c&&(g="bold");"italic"==p&&(g+=p);""===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(f){}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;el?g+=String.fromCharCode(l):(127l?g+=String.fromCharCode(l>>6|192):(g+=String.fromCharCode(l>>12|224),g+=String.fromCharCode(l>>6&63|128)),g+=String.fromCharCode(l&63|128))}a=g}for(;e>2;h=(h&3)<<4|g>>4;var r=(g&15)<<2|b>>6;var k=b&63;isNaN(g)?r=k=64:isNaN(b)&&(k=64);c=c+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k)}return c}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelFileFormat:"xlshtml",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}}},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,q=[],t=[],k=0,m="",Q=[],G=[],K=[],T=!1;c.extend(!0,a,h);Q=O(v);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var I= "",W=0;G=[];k=0;var ja=function(b,d,f){b.each(function(){m="";B(this,d,k,f+b.length,function(b,c,d){var g=m,f="";if(null!==b)if(b=z(b,c,d),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&b.toLocaleString(),f=da(c,"\t"," ");else if(b instanceof Date)f=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(f=da(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=f.indexOf(a.csvSeparator)||/[\r\n ]/g.test(f))f=a.csvEnclosure+f+a.csvEnclosure;m=g+(f+("tsv"==a.type?"\t":a.csvSeparator))}); m=c.trim(m).substring(0,m.length-1);0"});k++});J+="";var va=1;t=u(c(v));c(t).each(function(){var a=1;m="";B(this,"td,th",k,q.length+t.length,function(b,c,e){m+=""+z(b,c,e)+"";a++});0"!=m&&(J+=''+m+"",va++);k++});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,f=0;m="";B(this,"td,th",k,d+a.length,function(a,d,l){if(null!==a){var e="";d=z(a,d,l);l="String";if(!1!==jQuery.isNumeric(d))l="Number";else{var h=Da(d);!1!== h&&(d=h,l="Number",e+=' ss:StyleID="pct1"')}"Number"!==l&&(d=d.replace(/\n/g,"
"));h=R(a);a=S(a);c.each(g,function(){if(k>=this.s.r&&k<=this.e.r&&f>=this.s.c&&f<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f++,b++});if(a||h)a=a||1,h=h||1,g.push({s:{r:k,c:f},e:{r:k+a-1,c:f+h-1}});1'+c("
").text(d).html()+"\r"; f++}});0\r'+m+"\r");k++});return a.length}var d=c(this),f="";"string"===typeof a.worksheetName&&a.worksheetName.length?f=a.worksheetName+" "+(F.length+1):"undefined"!==typeof a.worksheetName[F.length]&&(f=a.worksheetName[F.length]);f.length||(f=d.find("caption").text()||"");f.length||(f="Table "+(F.length+1));f=c.trim(f.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));F.push(c("
").text(f).html());!1===a.exportHiddenCells&&(K=d.find("tr, th, td").filter(":hidden"), T=0\r";f=0;f+=b(d.find("thead").first().find(a.theadSelector),"th,td",f);b(u(d),"td,th",f);E+="\r";la.push(E);!0===a.consoleLog&&console.log(E)});h={};for(var y={},n,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],h=a.excelRTL?h+'\r\r\r':h+'\r',h+="\r";h+="\r";!0===a.consoleLog&&console.log(h);if("string"===a.outputMode)return h;if("base64"===a.outputMode)return L(h);try{A=new Blob([h],{type:"application/xml;charset=utf-8"}), saveAs(A,a.fileName+".xml")}catch(b){H(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",h)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){h="excel"==a.type||"xls"==a.type?"excel":"word";y="excel"==h?"xls":"doc";n='xmlns:x="urn:schemas-microsoft-com:office:'+h+'"';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";q=b.find("thead").first().find(a.theadSelector);q.each(function(){m="";B(this,"th,td",k,q.length,function(b,f,e){if(null!==b){var g="";m+=""}});0"+m+"");k++});E+="";t=u(b);c(t).each(function(){var b=c(this);m="";B(this,"td,th",k,q.length+t.length,function(d,e,g){if(null!==d){var f=z(d,e,g),h="",k=c(d).data("tableexport-msonumberformat");"undefined"==typeof k&&"function"===typeof a.onMsoNumberFormat&&(k=a.onMsoNumberFormat(d,e,g));"undefined"!=typeof k&&""!==k&&(h="style=\"mso-number-format:'"+k+"'");for(var p in a.excelstyles)a.excelstyles.hasOwnProperty(p)&& (k=c(d).css(a.excelstyles[p]),""===k&&(k=b.css(a.excelstyles[p])),""!==k&&"0px none rgb(0, 0, 0)"!=k&&"rgba(0, 0, 0, 0)"!=k&&(h+=""===h?'style="':";",h+=a.excelstyles[p]+":"+k));m+=""));m+=">"+f+""}});0"+m+"");k++});a.displayTableName&&(E+=""+z(c("

"+a.tableName+"

"))+""); E+="";!0===a.consoleLog&&console.log(E)});n=''+('')+"";"excel"===h&&(n+="\x3c!--[if gte mso 9]>",n+="",n+="",n+="",n+="",n+="",n+=X,n+="",n+="",n+="",a.excelRTL&&(n+=""), n+="",n+="",n+="",n+="",n+="",n+="br {mso-data-placement:same-cell;}";n+="";n+="";n+=E;n+="";n+="";!0===a.consoleLog&&console.log(n);if("string"===a.outputMode)return n;if("base64"===a.outputMode)return L(n);try{A=new Blob([n],{type:"application/vnd.ms-"+a.type}),saveAs(A,a.fileName+"."+y)}catch(b){H(a.fileName+"."+y,"data:application/vnd.ms-"+h+";base64,", n)}}else if("xlsx"==a.type){var wa=[],ma=[];k=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",k,t.length,function(d,e,h){if("undefined"!==typeof d&&null!==d){h=z(d,e,h);e=R(d);d=S(d);c.each(ma,function(){if(k>=this.s.r&&k<=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:k,c:b.length},e:{r:k+(d||1)-1,c:b.length+e-1}});"function"!==typeof a.onCellData&& ""!==h&&h==+h&&(h=+h);b.push(""!==h?h: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=[];q=c(this).find("thead").find(a.theadSelector); q.each(function(){b=0;e.headerrows[k]=[];B(this,"th,td",k,q.length,function(a,c,d){var g=ta(a);g.title=z(a,c,d);g.key=b++;g.rowIndex=k;e.headerrows[k].push(g)});k++});if(0