/* tableExport.jquery.plugin Version 1.9.8 Copyright (c) 2015-2017 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,e,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(e),q=0;x.each(function(b){var e=c(this),a,h=parseInt(this.getAttribute("colspan")),r=parseInt(this.getAttribute("rowspan")); G.forEach(function(b){if(k>=b.s.r&&k<=b.e.r&&q>=b.s.c&&q<=b.e.c)for(a=0;a<=b.e.c-b.s.c;++a)g(null,k,q++)});if(!1===za(e,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=b.s.r&&k<=b.e.r&&q>=b.s.c&&q<=b.e.c)for(Y=0;Y<=b.e.c-b.s.c;++Y)g(null,k,q++)})}}}function la(b,e){!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"+(e?"":";base64")+",",e?b.output("blob"):b.output())}}function ma(b,e,a){var k=0;"undefined"!==typeof a&&(k=a.colspan);if(0<=k){for(var g=b.width,c=b.textPos.x,x=e.table.columns.indexOf(e.column),q=1;qx&&(f=Math.min(b.width,this.width),l=this.height*f/this.width);f*=d;l*=d;lb.textPos.x&&k+f>b.textPos.x+b.width){if(0<=".,!%*;:=-".indexOf(d.charAt(0))){var l=d.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),d=d.substring(1,d.length));f=a.doc.getStringUnitWidth(d)*a.doc.internal.getFontSize()}k= b.textPos.x;g+=a.doc.internal.getFontSize()}for(;d.length&&k+f>b.textPos.x+b.width;)d=d.substring(0,d.length-1),f=a.doc.getStringUnitWidth(d)*a.doc.internal.getFontSize();a.doc.autoTableText(d,k,g,h);k+=f}if(x||q)c(e).is("b")?x=!1:c(e).is("i")&&(q=!1),a.doc.setFontType(x||q?x?"bold":"italic":"normal");e=e.nextSibling}b.textPos.x=k;b.textPos.y=g}else a.doc.autoTableText(b.text,b.textPos.x,b.textPos.y,h)}}function ba(b,a,c){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"), "g"),c)}function ea(b){b=ba(b||"0",a.numbers.html.thousandsSeparator,"");b=ba(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function Ba(b){-1/gi,"\u2060"),m=c("
").html(n).contents();d=!1;n="";c.each(m.text().split("\u2028"),function(b,a){0d?1:0)).split(".");1==m.length&&(m[1]="");var p=3d?"-":"")+(a.numbers.output.thousandsSeparator?(p?m[0].substr(0,p)+a.numbers.output.thousandsSeparator:"")+m[0].substr(p).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):m[0])+(m[1].length?a.numbers.output.decimalMark+m[1]:"")}}else r=h;!0===a.escape&&(r=escape(r));"function"===typeof a.onCellData&&(r=a.onCellData(g,e,k,r))}return r}function Ca(b,a,c){return a+"-"+c.toLowerCase()} function Z(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 ra(b){var a=M(b,"text-align"),k=M(b,"font-weight"),r=M(b,"font-style"),g="";"start"==a&&(a="rtl"==M(b,"direction")?"right":"left");700<=k&&(g="bold");"italic"==r&&(g+=r);""===g&&(g="normal");a={style:{align:a,bcolor:Z(M(b,"background-color"),[255,255,255]),color:Z(M(b,"color"),[0,0,0]),fstyle:g},colspan:parseInt(c(b).attr("colspan"))||0,rowspan:parseInt(c(b).attr("rowspan"))|| 0};null!==b&&(b=b.getBoundingClientRect(),a.rect={width:b.width,height:b.height});return a}function M(b,a){try{return window.getComputedStyle?(a=a.replace(/([a-z])([A-Z])/,Ca),window.getComputedStyle(b,null).getPropertyValue(a)):b.currentStyle?b.currentStyle[a]:b.style[a]}catch(k){}return""}function aa(b,a,c){a=M(b,a).match(/\d+/);if(null!==a){a=a[0];b=b.parentElement;var e=document.createElement("div");e.style.overflow="hidden";e.style.visibility="hidden";b.appendChild(e);e.style.width=100+c;c=100/ e.offsetWidth;b.removeChild(e);return a*c}return 0}function fa(){if(!(this instanceof fa))return new fa;this.SheetNames=[];this.Sheets={}}function sa(b){for(var a=new ArrayBuffer(b.length),c=new Uint8Array(a),d=0;d!=b.length;++d)c[d]=b.charCodeAt(d)&255;return a}function Da(b){for(var a={},c={s:{c:1E7,r:1E7},e:{c:0,r:0}},d=0;d!=b.length;++d)for(var g=0;g!=b[d].length;++g){c.s.r>d&&(c.s.r=d);c.s.c>g&&(c.s.c=g);c.e.rc.s.c&&(a["!ref"]=XLSX.utils.encode_range(c));return a}function oa(b){var a=0,c;if(0===b.length)return a;var d=0;for(c=b.length;dh?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(;d>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",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,ca=null,p=[],t=[],l=0,m="",Q=[],G=[], K=[],R=!1;c.extend(!0,a,f);Q=O(v);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var I="",U=0;G=[];l=0;var ha=function(b,e,k){b.each(function(){m="";B(this,e,l,k+b.length,function(b,c,e){var g=m,h="";if(null!==b)if(b=z(b,c,e),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&b.toLocaleString(),h=ba(c,"\t"," ");else if(b instanceof Date)h=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(h=ba(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=h.indexOf(a.csvSeparator)||/[\r\n ]/g.test(h))h= a.csvEnclosure+h+a.csvEnclosure;m=g+(h+("tsv"==a.type?"\t":a.csvSeparator))});m=c.trim(m).substring(0,m.length-1);0"+z(a,c,d)+""});l++});J+="";var ta=1;t=u(c(v));c(t).each(function(){var a=1;m="";B(this,"td,th",l,p.length+t.length,function(b,c,d){m+=""+z(b,c,d)+"";a++});0"!=m&&(J+=''+m+"",ta++);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 ja=[],F=[];c(v).filter(function(){return P(c(this))}).each(function(){function b(a,b,e){var g=[];c(a).each(function(){var b=0,h=0;m="";B(this,"td,th",l,e+a.length,function(a,e,d){if(null!==a){var k="";e=z(a,e,d);d="String";if(!1!==jQuery.isNumeric(e))d= "Number";else{var f=Ba(e);!1!==f&&(e=f,d="Number",k+=' ss:StyleID="pct1"')}"Number"!==d&&(e=e.replace(/\n/g,"
"));f=parseInt(a.getAttribute("colspan"));a=parseInt(a.getAttribute("rowspan"));g.forEach(function(a){if(l>=a.s.r&&l<=a.e.r&&h>=a.s.c&&h<=a.e.c)for(var c=0;c<=a.e.c-a.s.c;++c)h++,b++});if(a||f)a=a||1,f=f||1,g.push({s:{r:l,c:h},e:{r:l+a-1,c:h+f-1}});1'+c("
").text(e).html()+"\r";h++}});0\r'+m+"\r");l++});return a.length}var e=c(this),d="";"string"===typeof a.worksheetName&&a.worksheetName.length?d=a.worksheetName+" "+(F.length+1):"undefined"!==typeof a.worksheetName[F.length]&&(d=a.worksheetName[F.length]);d.length||(d=e.find("caption").text()||"");d.length||(d="Table "+(F.length+1));d=d.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31).trim(); F.push(c("
").text(d).html());!1===a.exportHiddenCells&&(K=e.find("tr, th, td").filter(":hidden"),R=0\r";d=0;d+=b(e.find("thead").first().find(a.theadSelector),"th,td",d);b(u(e),"td,th",d);E+="\r";ja.push(E);!0===a.consoleLog&&console.log(E)});f={};for(var y={},n,N,T=0,Y=F.length;T\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'+ja[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";n='xmlns:x="urn:schemas-microsoft-com:office:'+f+'"';var E="",V="";c(v).filter(function(){return P(c(this))}).each(function(){var b=c(this);""===V&&(V=a.worksheetName||b.find("caption").text()||"Table",V=V.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31).trim()); !1===a.exportHiddenCells&&(K=b.find("tr, th, td").filter(":hidden"),R=0";p=b.find("thead").first().find(a.theadSelector);p.each(function(){m="";B(this,"th,td",l,p.length,function(b,d,f){if(null!==b){var e="";m+=""}});0"+m+"");l++});E+="";t=u(b);c(t).each(function(){var b=c(this);m="";B(this,"td,th",l,p.length+t.length,function(e,d,g){if(null!==e){var h=z(e,d,g),k="",f=c(e).data("tableexport-msonumberformat");"undefined"==typeof f&&"function"===typeof a.onMsoNumberFormat&&(f=a.onMsoNumberFormat(e,d,g));"undefined"!=typeof f&&""!==f&&(k="style=\"mso-number-format:'"+ f+"'");for(var l in a.excelstyles)a.excelstyles.hasOwnProperty(l)&&(f=c(e).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));m+=""));m+=">"+h+""}});0"+ m+"");l++});a.displayTableName&&(E+=""+z(c("

"+a.tableName+"

"))+"");E+="";!0===a.consoleLog&&console.log(E)});n=''+('')+"";"excel"===f&&(n+="\x3c!--[if gte mso 9]>",n+="",n+="",n+="",n+="", n+="",n+=V,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-"+f+";base64,",n)}}else if("xlsx"==a.type){var ua=[],ka=[];l=0;t=c(v).find("thead").first().find(a.theadSelector);t.push.apply(t,u(c(v)));c(t).each(function(){var b=[];B(this,"th,td",l,t.length,function(c,d,f){if("undefined"!==typeof c&&null!==c){f=z(c,d,f);d=parseInt(c.getAttribute("colspan"));c=parseInt(c.getAttribute("rowspan"));ka.forEach(function(a){if(l>=a.s.r&&l<=a.e.r&&b.length>= a.s.c&&b.length<=a.e.c)for(var c=0;c<=a.e.c-a.s.c;++c)b.push(null)});if(c||d)d=d||1,ka.push({s:{r:l,c:b.length},e:{r:l+(c||1)-1,c:b.length+d-1}});"function"!==typeof a.onCellData&&""!==f&&f==+f&&(f=+f);b.push(""!==f?f:null);if(d)for(c=0;cxa){a>W.a0[0]&&(da="a0",X="l");for(var d in W)W.hasOwnProperty(d)&&W[d][1]>a&&(da=d,X="l",W[d][0]>a&&(X="p"));xa=a}}});a.jspdf.format=""===da?"a4":da;a.jspdf.orientation=""===X?"w":X}if(null==d.doc&&(d.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format), "function"===typeof a.jspdf.onDocCreated))a.jspdf.onDocCreated(d.doc);!0===d.outputImages&&(d.images={});"undefined"!=typeof d.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"),R=0a.styles.rowHeight&&(a.styles.rowHeight=f)}"undefined"!=typeof g.style&&!0!==g.style.hidden&&(a.styles.halign=g.style.align,"inherit"===e.styles.fillColor&&(a.styles.fillColor=g.style.bcolor), "inherit"===e.styles.textColor&&(a.styles.textColor=g.style.color),"inherit"===e.styles.fontStyle&&(a.styles.fontStyle=g.style.fstyle))}});"function"!==typeof e.createdCell&&(e.createdCell=function(a,b){b=d.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"===e.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===e.styles.textColor&&(a.styles.textColor=b.style.color),"inherit"=== e.styles.fontStyle&&(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof e.drawHeaderCell&&(e.drawHeaderCell=function(a,b){var c=d.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?ma(a,b,c):!1});"function"!==typeof e.drawCell&&(e.drawCell=function(a,b){var c=d.rowoptions[b.row.index+":"+b.column.dataKey];if(ma(a,b,c))if(d.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle),"undefined"!=typeof c&&"undefined"!=typeof c.kids&&0d.dh||"undefined"==typeof d.dh)d.dh=b;d.dw=a.width/c.rect.width;b=a.textPos.y;pa(a,c.kids,d);a.textPos.y=b;qa(a,c.kids,d)}else qa(a,{},d);return!1});d.headerrows=[];p=c(this).find("thead").find(a.theadSelector);p.each(function(){b=0;d.headerrows[l]=[];B(this,"th,td",l,p.length,function(a,c,e){var f=ra(a);f.title=z(a,c,e);f.key=b++;f.rowIndex=l;d.headerrows[l].push(f)});l++});if(0