Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jspdf-autotable

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jspdf-autotable - npm Package Compare versions

Comparing version 3.0.6 to 3.0.7

4

dist/jspdf.plugin.autotable.min.js
/*!
*
* jsPDF AutoTable plugin v3.0.6
* jsPDF AutoTable plugin v3.0.7
*

@@ -12,3 +12,3 @@ * Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable

*/
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jspdf"));else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var o="object"==typeof exports?e(require("jspdf")):e(t.jsPDF);for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(window,function(o){return function(o){var n={};function r(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return o[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=o,r.c=n,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,o,e){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n,r=null,a=null;o.globalDefaults={},o.documentDefaults={},o.default=function(){return a},o.getGlobalOptions=function(){return o.globalDefaults},o.getDocumentOptions=function(){return o.documentDefaults};var l=function(){function t(t){this.doc=t}return t.prototype.pageHeight=function(){return this.pageSize().height},t.prototype.pageWidth=function(){return this.pageSize().width},t.prototype.pageSize=function(){var t=this.doc.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},t.prototype.scaleFactor=function(){return this.doc.internal.scaleFactor},t.prototype.pageNumber=function(){return this.doc.internal.getCurrentPageInfo().pageNumber},t}();o.setupState=function(t){n=a,a=new l(t),t!==r&&(r=t,o.documentDefaults={})},o.resetState=function(){a=n},o.setDefaults=function(t,e){void 0===e&&(e=null),e?(o.documentDefaults=t||{},r=e):o.globalDefaults=t||{}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),i=o(0),r=o(3);function s(t,e){var o=e.fontSize/i.default().scaleFactor();l(e),t=Array.isArray(t)?t:[t];var n=0;t.forEach(function(t){var e=i.default().doc.getStringUnitWidth(t);n<e&&(n=e)});var r=1e4*i.default().scaleFactor();return(n=Math.floor(n*r)/r)*o}function a(t){var e=0<t.lineWidth,o=t.fillColor||0===t.fillColor;return e&&o?"DF":e?"S":!!o&&"F"}function l(n){var t=i.default().doc,r={fillColor:t.setFillColor,textColor:t.setTextColor,fontStyle:t.setFontStyle,lineColor:t.setDrawColor,lineWidth:t.setLineWidth,font:t.setFont,fontSize:t.setFontSize};Object.keys(r).forEach(function(t){var e=n[t],o=r[t];void 0!==e&&(Array.isArray(e)?o.apply(this,e):o(e))})}e.getStringWidth=s,e.ellipsize=function o(t,n,r,a){if(void 0===a&&(a="..."),Array.isArray(t)){var l=[];return t.forEach(function(t,e){l[e]=o(t,n,r,a)}),l}var e=1e4*i.default().scaleFactor();if((n=Math.ceil(n*e)/e)>=s(t,r))return t;for(;n<s(t+a,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+a},e.addTableBorder=function(){var t=i.default().table,e={lineWidth:t.settings.tableLineWidth,lineColor:t.settings.tableLineColor};l(e);var o=a(e);o&&i.default().doc.rect(t.pageStartX,t.pageStartY,t.width,t.cursor.y-t.pageStartY,o)},e.getFillStyle=a,e.applyUserStyles=function(){l(i.default().table.userStyles)},e.applyStyles=l,e.marginOrPadding=function(t,e){var o={};if(Array.isArray(t))4<=t.length?o={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?o={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?o={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var n=0,r=["top","right","bottom","left"];n<r.length;n++){var a=r[n];o[a]=t[a]||0===t[a]?t[a]:e}}return"number"==typeof t&&(o={top:t,right:t,bottom:t,left:t}),o},e.styles=function(t){return t=Array.isArray(t)?t:[t],r.assign.apply(void 0,[n.defaultStyles()].concat(t))}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FONT_ROW_RATIO=1.15;var n=o(0);e.defaultConfig=function(){return{html:null,head:null,body:null,foot:null,includeHiddenHtml:!1,startY:null,margin:40/n.default().scaleFactor(),pageBreak:"auto",rowPageBreak:"auto",tableWidth:"auto",showHead:"everyPage",showFoot:"everyPage",tableLineWidth:0,tableLineColor:200,tableId:null,theme:"striped",useCss:!1,styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{},didParseCell:function(t){},willDrawCell:function(t){},didDrawCell:function(t){},didDrawPage:function(t){}}},e.defaultStyles=function(){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/n.default().scaleFactor(),lineColor:200,lineWidth:0/n.default().scaleFactor(),cellWidth:"auto",minCellHeight:0}},e.getTheme=function(t){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[t]}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l])}return n}},function(t,e){t.exports=o},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(6),r=o(7),a=o(8),l=o(0);o(15);var i=o(1),s=o(4);s.API.autoTable=function(){l.setupState(this);var t=a.parseInput(arguments);return r.calculateWidths(t),n.drawTable(t),t.finalY=t.cursor.y,this.previousAutoTable=t,this.lastAutoTable=t,this.autoTable.previous=t,i.applyUserStyles(),l.resetState(),this},s.API.lastAutoTable=!1,s.API.previousAutoTable=!1,s.API.autoTable.previous=!1,s.API.autoTableSetDefaults=function(t){return l.setDefaults(t,this),this},s.autoTableSetDefaults=function(t,e){return l.setDefaults(t,e),this},s.API.autoTableHtmlToJson=function(r,a){if(console.error("Use of deprecated function: autoTableHtmlToJson. Use html option instead."),a=a||!1,!(r&&r instanceof HTMLTableElement))return console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson"),null;for(var l={},i=[],t=r.rows[0],e=0;e<t.cells.length;e++){var o=t.cells[e],n=window.getComputedStyle(o);(a||"none"!==n.display)&&(l[e]=o)}var s=function(t){var o=r.rows[t],e=window.getComputedStyle(o);if(a||"none"!==e.display){var n=[];Object.keys(l).forEach(function(t){var e=o.cells[t];n.push(e)}),i.push(n)}};for(e=1;e<r.rows.length;e++)s(e);return{columns:Object.keys(l).map(function(t){return l[t]}),rows:i,data:i}},s.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.previousAutoTable.finalY instead.");var t=this.previousAutoTable;return t.cursor&&"number"==typeof t.cursor.y?t.cursor.y:0},s.API.autoTableAddPageContent=function(t){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),s.API.autoTable.globalDefaults||(s.API.autoTable.globalDefaults={}),s.API.autoTable.globalDefaults.addPageContent=t,this},s.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var P=o(2),i=o(1),C=o(0);function x(t){var e=C.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x,e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var o=0,n=e.columns;o<n.length;o++){var r=n[o],a=t.cells[r.dataKey];if(a)if(i.applyStyles(a.styles),a.x=e.cursor.x,a.y=t.y,"top"===a.styles.valign?a.textPos.y=e.cursor.y+a.padding("top"):"bottom"===a.styles.valign?a.textPos.y=e.cursor.y+a.height-a.padding("bottom"):a.textPos.y=e.cursor.y+a.height/2,"right"===a.styles.halign?a.textPos.x=a.x+a.width-a.padding("right"):"center"===a.styles.halign?a.textPos.x=a.x+a.width/2:a.textPos.x=a.x+a.padding("left"),!1!==e.callCellHooks(e.cellHooks.willDrawCell,a,t,r)){var l=i.getFillStyle(a.styles);l&&C.default().doc.rect(a.x,e.cursor.y,a.width,a.height,l),C.default().doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign,maxWidth:a.width-a.padding("left")-a.padding("right")}),e.callCellHooks(e.cellHooks.didDrawCell,a,t,r),e.cursor.x+=r.width}else e.cursor.x+=r.width;else e.cursor.x+=r.width}e.cursor.y+=t.height}function W(t){var e=C.default().table,o=e.margin("bottom"),n=e.settings.showFoot;return!0!==n&&"everyPage"!==n&&"lastPage"!==n||(o+=e.footHeight),t+e.cursor.y+o<C.default().pageHeight()}function H(){var t=C.default().table;i.applyUserStyles(),!0!==t.settings.showFoot&&"everyPage"!==t.settings.showFoot||t.foot.forEach(function(t){return x(t)}),t.finalY=t.cursor.y,t.callEndPageHooks(),i.addTableBorder(),n(C.default().doc),t.pageNumber++,t.cursor={x:t.margin("left"),y:t.margin("top")},t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,!0!==t.settings.showHead&&"everyPage"!==t.settings.showHead||t.head.forEach(function(t){return x(t)})}function n(t){var e=C.default().pageNumber();t.setPage(e+1),C.default().pageNumber()===e&&t.addPage()}e.drawTable=function(t){var e=t.settings;t.cursor={x:t.margin("left"),y:null==e.startY?t.margin("top"):e.startY};var o=e.startY+t.margin("bottom")+t.headHeight+t.footHeight;"avoid"===e.pageBreak&&(o+=t.height),("always"===e.pageBreak||null!=e.startY&&!1!==e.startY&&o>C.default().pageHeight())&&(n(C.default().doc),t.cursor.y=t.margin("top")),t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,t.startPageNumber=C.default().pageNumber(),i.applyUserStyles(),!0!==e.showHead&&"firstPage"!==e.showHead&&"everyPage"!==e.showHead||t.head.forEach(function(t){return x(t)}),i.applyUserStyles(),t.body.forEach(function(t){!function t(e){var o,n,r,a,l=0,i={},s=C.default().table;if(!W(e.maxCellHeight))if(e.maxCellLineCount<=1||"avoid"===s.settings.rowPageBreak&&(o=e,n=C.default().table,r=C.default().pageHeight(),a=r-n.margin("top")-n.margin("bottom"),!(o.maxCellHeight>a)))H();else{e.spansMultiplePages=!0;for(var d=0,u=0;u<s.columns.length;u++){var c=s.columns[u],f=e.cells[c.dataKey];if(f){var h=f.styles.fontSize/C.default().scaleFactor()*P.FONT_ROW_RATIO,g=f.padding("vertical"),p=C.default().pageHeight(),y=p-s.cursor.y-s.margin("bottom"),m=Math.floor((y-g)/h);if(Array.isArray(f.text)&&f.text.length>m){var b=f.text.splice(m,f.text.length);i[c.dataKey]=b;var v=f.text.length*h+g;d<v&&(d=v);var w=b.length*h+g;l<w&&(l=w)}}}for(var u=0;u<s.columns.length;u++){var c=s.columns[u],f=e.cells[c.dataKey];f.height=d}e.height=d,e.maxCellHeight=0}if(x(e),0<Object.keys(i).length){for(var u=0;u<s.columns.length;u++){var S=s.columns[u],f=e.cells[S.dataKey];f.height=l,f&&(f.text=i[S.dataKey]||"")}H(),e.pageNumber++,e.height=l,t(e)}}(t)}),i.applyUserStyles(),!0!==e.showFoot&&"lastPage"!==e.showFoot&&"everyPage"!==e.showFoot||t.foot.forEach(function(t){return x(t)}),i.addTableBorder(),t.callEndPageHooks()},e.addPage=H},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var c=o(2),f=o(1),h=o(0);e.calculateWidths=function(t){10/h.default().scaleFactor()*t.columns.length>t.width?console.error("Columns could not fit on page"):t.minWidth>t.width&&console.error("Column widths to wide and can't fit page"),function t(e,o,n){for(var r=0;r<e.length;r++){var a=e[r],l=a.wrappedWidth/n,i=o*l,s=a.wrappedWidth+i;if(!(s>=a.minWidth)){a.width=a.minWidth+1/h.default().scaleFactor(),n-=a.wrappedWidth,e.splice(r,1),t(e,o,n);break}a.width=s}}(t.columns.slice(0),t.width-t.wrappedWidth,t.wrappedWidth),function(t){for(var e=t.allRows(),o=0;o<e.length;o++)for(var n=e[o],r=null,a=0,l=0,i=0;i<t.columns.length;i++){var s=t.columns[i],d=null;if(1<(l-=1)&&t.columns[i+1])a+=s.width,delete n.cells[s.dataKey];else{if(r)d=r,delete n.cells[s.dataKey],r=null;else{if(!(d=n.cells[s.dataKey]))continue;if(l=d.colSpan,a=0,1<d.colSpan){r=d,a+=s.width;continue}}d.width=s.width+a}}}(t),function(t){for(var e=0,o=t.allRows();e<o.length;e++)for(var n=o[e],r=0,a=t.columns;r<a.length;r++){var l=a[r],i=n.cells[l.dataKey];if(i){f.applyStyles(i.styles);var s=i.width-i.padding("horizontal");"linebreak"===i.styles.overflow?i.text=h.default().doc.splitTextToSize(i.text,s+1/(h.default().scaleFactor()||1),{fontSize:i.styles.fontSize}):"ellipsize"===i.styles.overflow?i.text=f.ellipsize(i.text,s,i.styles):"hidden"===i.styles.overflow?i.text=f.ellipsize(i.text,s,i.styles,""):"function"==typeof i.styles.overflow&&(i.text=i.styles.overflow(i.text,s));var d=Array.isArray(i.text)?i.text.length:1;d=i.rowSpan<=1?d:1;var u=i.styles.fontSize/h.default().scaleFactor()*c.FONT_ROW_RATIO;i.contentHeight=d*u+i.padding("vertical"),i.styles.minCellHeight>i.contentHeight&&(i.contentHeight=i.styles.minCellHeight),i.contentHeight>n.height&&(n.height=i.contentHeight,n.maxCellHeight=i.contentHeight,n.maxCellLineCount=d)}}}(t),function(t){for(var e={},o=1,n=t.allRows(),r=0;r<n.length;r++){for(var a=n[r],l=0,i=t.columns;l<i.length;l++){var s=i[l],d=e[s.dataKey];if(1<o)o--,delete a.cells[s.dataKey];else if(d)d.cell.height+=a.height,d.cell.height>a.maxCellHeight&&(d.row.maxCellHeight=d.cell.height,d.row.maxCellLineCount=Array.isArray(d.cell.text)?d.cell.text.length:1),o=d.cell.colSpan,delete a.cells[s.dataKey],d.left--,d.left<=1&&delete e[s.dataKey];else{var u=a.cells[s.dataKey];if(!u)continue;if(u.height=a.height,1<u.rowSpan){var c=n.length-r,f=u.rowSpan>c?c:u.rowSpan;e[s.dataKey]={cell:u,left:f,row:a}}}}"head"===a.section&&(t.headHeight+=a.maxCellHeight),"foot"===a.section&&(t.footHeight+=a.maxCellHeight),t.height+=a.height}}(t)}},function(t,e,o){"use strict";var m=this&&this.__assign||function(){return(m=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var P=o(9),C=o(2),b=o(12),x=o(3),v=o(1),W=o(0),w=o(14);e.parseInput=function(t){var e=function(t){if(1===t.length)return t[0];var e=t[2]||{};return e.body=t[1],e.columns=t[0],e.columns.forEach(function(t){null==t.header&&(t.header=t.title)}),e}(t),o=[W.getGlobalOptions(),W.getDocumentOptions(),e];w.default(o);var n=new P.Table;(W.default().table=n).id=e.tableId;var r=W.default().doc;n.userStyles={textColor:r.getTextColor?r.getTextColor():0,fontSize:r.internal.getFontSize(),fontStyle:r.internal.getFont().fontStyle,font:r.internal.getFont().fontName};for(var a=function(e){var t=o.map(function(t){return t[e]||{}});n.styles[e]=x.assign.apply(void 0,[{}].concat(t))},l=0,i=Object.keys(n.styles);l<i.length;l++)a(i[l]);for(var s=0,d=o;s<d.length;s++)for(var u=d[s],c=0,f=Object.keys(n.cellHooks);c<f.length;c++){var h=f[c];u&&"function"==typeof u[h]&&(n.cellHooks[h].push(u[h]),delete u[h])}n.settings=x.assign.apply(void 0,[{},C.defaultConfig()].concat(o)),n.settings.margin=v.marginOrPadding(n.settings.margin,C.defaultConfig().margin),"auto"===n.settings.theme&&(n.settings.theme=n.settings.useCss?"plain":"striped"),!1===n.settings.startY&&delete n.settings.startY;var g=W.default().doc.previousAutoTable,p=g&&g.startPageNumber+g.pageNumber-1===W.default().pageNumber();null==n.settings.startY&&p&&(n.settings.startY=g.finalY+20/W.default().scaleFactor());var y={};return n.settings.html&&(y=b.parseHtml(n.settings.html,n.settings.includeHiddenHtml,n.settings.useCss)||{}),n.settings.head=y.head||n.settings.head||[],n.settings.body=y.body||n.settings.body||[],n.settings.foot=y.foot||n.settings.foot||[],function(S){var e=S.settings;S.columns=function(t){if(t.columns)return t.columns.map(function(t,e){var o=t.dataKey||t.key||e,n=null!=t?t:e;return new P.Column(o,n,e)});var e=m({},t.head[0],t.body[0],t.foot[0]);delete e._element;var o=Object.keys(e);return o.map(function(t){return new P.Column(t,t,t)})}(e);for(var t=function(v){var w={},t=e[v];if(0===t.length&&e.columns){var n={};S.columns.forEach(function(t){var e=t.raw;if("head"===v){var o="object"==typeof e?e.header:e;o&&(n[t.dataKey]=o)}else"foot"===v&&e.footer&&(n[t.dataKey]=e.footer)}),Object.keys(n).length&&t.push(n)}t.forEach(function(t,e){var o=new P.Row(t,e,v);S[v].push(o);for(var n,r,a,l,i,s,d,u,c=0,f=0,h=0,g=S.columns;h<g.length;h++){var p=g[h];if(null==w[p.dataKey]||0===w[p.dataKey].left)if(0===f){var y=void 0;y=Array.isArray(t)?t[p.dataKey-c]:t[p.dataKey];var m=(n=v,r=p.dataKey,a=e,d=s=void 0,l=W.default().table,i=C.getTheme(l.settings.theme),s=[i.table,i[n],l.styles.styles,l.styles[n+"Styles"]],d="body"===n&&l.styles.columnStyles[r]||{},u="body"===n&&a%2==0?x.assign({},i.alternateRow,l.styles.alternateRowStyles):{},x.assign.apply(void 0,[C.defaultStyles()].concat(s.concat([u,d])))),b=new P.Cell(y,m,v);o.cells[p.dataKey]=b,S.callCellHooks(S.cellHooks.didParseCell,b,o,p),f=b.colSpan-1,w[p.dataKey]={left:b.rowSpan-1,times:f}}else f--,c++;else w[p.dataKey].left--,f=w[p.dataKey].times}})},o=0,n=["head","body","foot"];o<n.length;o++){var r=n[o];t(r)}S.allRows().forEach(function(t){for(var e=0,o=S.columns;e<o.length;e++){var n=o[e],r=t.cells[n.dataKey];r&&1===r.colSpan&&(r.wrappedWidth>n.wrappedWidth&&(n.wrappedWidth=r.wrappedWidth),r.minWidth>n.minWidth&&(n.minWidth=r.minWidth))}})}(n),n.minWidth=n.columns.reduce(function(t,e){return t+e.minWidth},0),n.wrappedWidth=n.columns.reduce(function(t,e){return t+e.wrappedWidth},0),"number"==typeof n.settings.tableWidth?n.width=n.settings.tableWidth:"wrap"===n.settings.tableWidth?n.width=n.wrappedWidth:n.width=W.default().pageWidth()-n.margin("left")-n.margin("right"),n}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),i=o(0),l=o(10),s=o(1),d=o(11),r=function(){this.willParseCell=[],this.didParseCell=[],this.willDrawCell=[],this.didDrawCell=[],this.didDrawPage=[]},a=function(){function t(){this.columns=[],this.head=[],this.body=[],this.foot=[],this.height=0,this.width=0,this.preferredWidth=0,this.wrappedWidth=0,this.minWidth=0,this.headHeight=0,this.footHeight=0,this.startPageNumber=1,this.pageNumber=1,this.styles={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},this.cellHooks=new r}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(t,e,o,n){for(var r=0,a=t;r<a.length;r++){if(!1===(0,a[r])(new l.CellHookData(e,o,n)))return!1}return!0},t.prototype.callEndPageHooks=function(){s.applyUserStyles();for(var t=0,e=this.cellHooks.didDrawPage;t<e.length;t++){(0,e[t])(new l.HookData)}},t.prototype.margin=function(t){return s.marginOrPadding(this.settings.margin,n.defaultConfig().margin)[t]},t}();e.Table=a;var u=function(){function t(t,e,o){this.cells={},this.height=0,this.maxCellLineCount=1,this.maxCellHeight=0,this.pageNumber=1,this.spansMultiplePages=!1,(this.raw=t)._element&&(this.raw=t._element),this.index=e,this.section=o}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),t}();e.Row=u;var c=function(){function t(t,e,o){this.contentWidth=0,this.wrappedWidth=0,this.minWidth=0,this.textPos={},this.height=0,this.width=0,this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=d(e,t&&t.styles||{}),this.section=o;var n="",r=t&&void 0!==t.content?t.content:t;r=null!=r&&null!=r.dataKey?r.title:r;var a="object"==typeof window&&window.HTMLElement&&r instanceof window.HTMLElement;this.raw=a?r:t,n=r&&a?(r.innerText||"").replace(/' '+/g," ").trim():null!=r?""+r:"";if(this.text=n.split(/\r\n|\r|\n/g),this.contentWidth=this.padding("horizontal")+s.getStringWidth(this.text,this.styles),"number"==typeof this.styles.cellWidth)this.minWidth=this.styles.cellWidth,this.wrappedWidth=this.styles.cellWidth;else if("wrap"===this.styles.cellWidth)this.minWidth=this.contentWidth,this.wrappedWidth=this.contentWidth;else{var l=10/i.default().scaleFactor();this.minWidth=this.styles.minCellWidth||l,this.wrappedWidth=this.contentWidth,this.minWidth>this.wrappedWidth&&(this.wrappedWidth=this.minWidth)}}return t.prototype.padding=function(t){var e=s.marginOrPadding(this.styles.cellPadding,s.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}();e.Cell=c;var f=function(t,e,o){this.preferredWidth=0,this.minWidth=0,this.wrappedWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=o};e.Column=f},function(t,e,o){"use strict";var n,a=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var r=o(0),l=function(){function t(){var t=r.default().table;this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=r.default().doc}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),t}(),i=function(r){function t(t,e,o){var n=r.call(this)||this;return n.cell=t,n.row=e,n.column=o,n.section=e.section,n}return a(t,r),t}(e.HookData=l);e.CellHookData=i},function(t,e,o){"use strict";
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jspdf"));else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var o="object"==typeof exports?e(require("jspdf")):e(t.jsPDF);for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(window,function(o){return function(o){var n={};function r(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return o[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=o,r.c=n,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,o,e){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n,r=null,a=null;o.globalDefaults={},o.documentDefaults={},o.default=function(){return a},o.getGlobalOptions=function(){return o.globalDefaults},o.getDocumentOptions=function(){return o.documentDefaults};var l=function(){function t(t){this.doc=t}return t.prototype.pageHeight=function(){return this.pageSize().height},t.prototype.pageWidth=function(){return this.pageSize().width},t.prototype.pageSize=function(){var t=this.doc.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},t.prototype.scaleFactor=function(){return this.doc.internal.scaleFactor},t.prototype.pageNumber=function(){return this.doc.internal.getCurrentPageInfo().pageNumber},t}();o.setupState=function(t){n=a,a=new l(t),t!==r&&(r=t,o.documentDefaults={})},o.resetState=function(){a=n},o.setDefaults=function(t,e){void 0===e&&(e=null),e?(o.documentDefaults=t||{},r=e):o.globalDefaults=t||{}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),i=o(0),r=o(3);function s(t,e){var o=e.fontSize/i.default().scaleFactor();l(e),t=Array.isArray(t)?t:[t];var n=0;t.forEach(function(t){var e=i.default().doc.getStringUnitWidth(t);n<e&&(n=e)});var r=1e4*i.default().scaleFactor();return(n=Math.floor(n*r)/r)*o}function a(t){var e=0<t.lineWidth,o=t.fillColor||0===t.fillColor;return e&&o?"DF":e?"S":!!o&&"F"}function l(n){var t=i.default().doc,r={fillColor:t.setFillColor,textColor:t.setTextColor,fontStyle:t.setFontStyle,lineColor:t.setDrawColor,lineWidth:t.setLineWidth,font:t.setFont,fontSize:t.setFontSize};Object.keys(r).forEach(function(t){var e=n[t],o=r[t];void 0!==e&&(Array.isArray(e)?o.apply(this,e):o(e))})}e.getStringWidth=s,e.ellipsize=function o(t,n,r,a){if(void 0===a&&(a="..."),Array.isArray(t)){var l=[];return t.forEach(function(t,e){l[e]=o(t,n,r,a)}),l}var e=1e4*i.default().scaleFactor();if((n=Math.ceil(n*e)/e)>=s(t,r))return t;for(;n<s(t+a,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+a},e.addTableBorder=function(){var t=i.default().table,e={lineWidth:t.settings.tableLineWidth,lineColor:t.settings.tableLineColor};l(e);var o=a(e);o&&i.default().doc.rect(t.pageStartX,t.pageStartY,t.width,t.cursor.y-t.pageStartY,o)},e.getFillStyle=a,e.applyUserStyles=function(){l(i.default().table.userStyles)},e.applyStyles=l,e.marginOrPadding=function(t,e){var o={};if(Array.isArray(t))4<=t.length?o={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?o={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?o={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var n=0,r=["top","right","bottom","left"];n<r.length;n++){var a=r[n];o[a]=t[a]||0===t[a]?t[a]:e}}return"number"==typeof t&&(o={top:t,right:t,bottom:t,left:t}),o},e.styles=function(t){return t=Array.isArray(t)?t:[t],r.assign.apply(void 0,[n.defaultStyles()].concat(t))}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FONT_ROW_RATIO=1.15;var n=o(0);e.defaultConfig=function(){return{html:null,head:null,body:null,foot:null,includeHiddenHtml:!1,startY:null,margin:40/n.default().scaleFactor(),pageBreak:"auto",rowPageBreak:"auto",tableWidth:"auto",showHead:"everyPage",showFoot:"everyPage",tableLineWidth:0,tableLineColor:200,tableId:null,theme:"striped",useCss:!1,styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{},didParseCell:function(t){},willDrawCell:function(t){},didDrawCell:function(t){},didDrawPage:function(t){}}},e.defaultStyles=function(){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/n.default().scaleFactor(),lineColor:200,lineWidth:0/n.default().scaleFactor(),cellWidth:"auto",minCellHeight:0}},e.getTheme=function(t){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[t]}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l])}return n}},function(t,e){t.exports=o},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(6),r=o(7),a=o(8),l=o(0);o(15);var i=o(1),s=o(4);s.API.autoTable=function(){l.setupState(this);var t=a.parseInput(arguments);return r.calculateWidths(t),n.drawTable(t),t.finalY=t.cursor.y,this.previousAutoTable=t,this.lastAutoTable=t,this.autoTable.previous=t,i.applyUserStyles(),l.resetState(),this},s.API.lastAutoTable=!1,s.API.previousAutoTable=!1,s.API.autoTable.previous=!1,s.API.autoTableSetDefaults=function(t){return l.setDefaults(t,this),this},s.autoTableSetDefaults=function(t,e){return l.setDefaults(t,e),this},s.API.autoTableHtmlToJson=function(r,a){if(console.error("Use of deprecated function: autoTableHtmlToJson. Use html option instead."),a=a||!1,!(r&&r instanceof HTMLTableElement))return console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson"),null;for(var l={},i=[],t=r.rows[0],e=0;e<t.cells.length;e++){var o=t.cells[e],n=window.getComputedStyle(o);(a||"none"!==n.display)&&(l[e]=o)}var s=function(t){var o=r.rows[t],e=window.getComputedStyle(o);if(a||"none"!==e.display){var n=[];Object.keys(l).forEach(function(t){var e=o.cells[t];n.push(e)}),i.push(n)}};for(e=1;e<r.rows.length;e++)s(e);return{columns:Object.keys(l).map(function(t){return l[t]}),rows:i,data:i}},s.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.previousAutoTable.finalY instead.");var t=this.previousAutoTable;return t.cursor&&"number"==typeof t.cursor.y?t.cursor.y:0},s.API.autoTableAddPageContent=function(t){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),s.API.autoTable.globalDefaults||(s.API.autoTable.globalDefaults={}),s.API.autoTable.globalDefaults.addPageContent=t,this},s.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var C=o(2),i=o(1),x=o(0);function W(t){var e=x.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x,e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var o=0,n=e.columns;o<n.length;o++){var r=n[o],a=t.cells[r.dataKey];if(a)if(i.applyStyles(a.styles),a.x=e.cursor.x,a.y=t.y,"top"===a.styles.valign?a.textPos.y=e.cursor.y+a.padding("top"):"bottom"===a.styles.valign?a.textPos.y=e.cursor.y+a.height-a.padding("bottom"):a.textPos.y=e.cursor.y+a.height/2,"right"===a.styles.halign?a.textPos.x=a.x+a.width-a.padding("right"):"center"===a.styles.halign?a.textPos.x=a.x+a.width/2:a.textPos.x=a.x+a.padding("left"),!1!==e.callCellHooks(e.cellHooks.willDrawCell,a,t,r)){var l=i.getFillStyle(a.styles);l&&x.default().doc.rect(a.x,e.cursor.y,a.width,a.height,l),x.default().doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign,maxWidth:a.width-a.padding("left")-a.padding("right")}),e.callCellHooks(e.cellHooks.didDrawCell,a,t,r),e.cursor.x+=r.width}else e.cursor.x+=r.width;else e.cursor.x+=r.width}e.cursor.y+=t.height}function H(t,e){var o=x.default().table,n=o.margin("bottom"),r=o.settings.showFoot;return(!0===r||"everyPage"===r||"lastPage"===r&&e)&&(n+=o.footHeight),t+o.cursor.y+n<x.default().pageHeight()}function O(){var t=x.default().table;i.applyUserStyles(),!0!==t.settings.showFoot&&"everyPage"!==t.settings.showFoot||t.foot.forEach(function(t){return W(t)}),t.finalY=t.cursor.y,t.callEndPageHooks(),i.addTableBorder(),n(x.default().doc),t.pageNumber++,t.cursor={x:t.margin("left"),y:t.margin("top")},t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,!0!==t.settings.showHead&&"everyPage"!==t.settings.showHead||t.head.forEach(function(t){return W(t)})}function n(t){var e=x.default().pageNumber();t.setPage(e+1),x.default().pageNumber()===e&&t.addPage()}e.drawTable=function(o){var t=o.settings;o.cursor={x:o.margin("left"),y:null==t.startY?o.margin("top"):t.startY};var e=t.startY+o.margin("bottom")+o.headHeight+o.footHeight;"avoid"===t.pageBreak&&(e+=o.height),("always"===t.pageBreak||null!=t.startY&&!1!==t.startY&&e>x.default().pageHeight())&&(n(x.default().doc),o.cursor.y=o.margin("top")),o.pageStartX=o.cursor.x,o.pageStartY=o.cursor.y,o.startPageNumber=x.default().pageNumber(),i.applyUserStyles(),!0!==t.showHead&&"firstPage"!==t.showHead&&"everyPage"!==t.showHead||o.head.forEach(function(t){return W(t)}),i.applyUserStyles(),o.body.forEach(function(t,e){!function t(e,o){var n,r,a,l,i=0,s={},d=x.default().table;if(!H(e.maxCellHeight,o))if(e.maxCellLineCount<=1||"avoid"===d.settings.rowPageBreak&&(n=e,r=x.default().table,a=x.default().pageHeight(),l=a-r.margin("top")-r.margin("bottom"),!(n.maxCellHeight>l)))O();else{e.spansMultiplePages=!0;for(var u=0,c=0;c<d.columns.length;c++){var f=d.columns[c],h=e.cells[f.dataKey];if(h){var g=h.styles.fontSize/x.default().scaleFactor()*C.FONT_ROW_RATIO,p=h.padding("vertical"),y=x.default().pageHeight(),b=y-d.cursor.y-d.margin("bottom"),m=Math.floor((b-p)/g);if(Array.isArray(h.text)&&h.text.length>m){var v=h.text.splice(m,h.text.length);s[f.dataKey]=v;var w=h.text.length*g+p;u<w&&(u=w);var S=v.length*g+p;i<S&&(i=S)}}}for(var c=0;c<d.columns.length;c++){var f=d.columns[c],h=e.cells[f.dataKey];h.height=u}e.height=u,e.maxCellHeight=0}if(W(e),0<Object.keys(s).length){for(var c=0;c<d.columns.length;c++){var P=d.columns[c],h=e.cells[P.dataKey];h.height=i,h&&(h.text=s[P.dataKey]||"")}O(),e.pageNumber++,e.height=i,t(e,o)}}(t,e===o.body.length-1)}),i.applyUserStyles(),!0!==t.showFoot&&"lastPage"!==t.showFoot&&"everyPage"!==t.showFoot||o.foot.forEach(function(t){return W(t)}),i.addTableBorder(),o.callEndPageHooks()},e.addPage=O},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var c=o(2),f=o(1),h=o(0);e.calculateWidths=function(t){10/h.default().scaleFactor()*t.columns.length>t.width?console.error("Columns could not fit on page"):t.minWidth>t.width&&console.error("Column widths to wide and can't fit page"),function t(e,o,n){for(var r=0;r<e.length;r++){var a=e[r],l=a.wrappedWidth/n,i=o*l,s=a.wrappedWidth+i;if(!(s>=a.minWidth)){a.width=a.minWidth+1/h.default().scaleFactor(),n-=a.wrappedWidth,e.splice(r,1),t(e,o,n);break}a.width=s}}(t.columns.slice(0),t.width-t.wrappedWidth,t.wrappedWidth),function(t){for(var e=t.allRows(),o=0;o<e.length;o++)for(var n=e[o],r=null,a=0,l=0,i=0;i<t.columns.length;i++){var s=t.columns[i],d=null;if(1<(l-=1)&&t.columns[i+1])a+=s.width,delete n.cells[s.dataKey];else{if(r)d=r,delete n.cells[s.dataKey],r=null;else{if(!(d=n.cells[s.dataKey]))continue;if(l=d.colSpan,a=0,1<d.colSpan){r=d,a+=s.width;continue}}d.width=s.width+a}}}(t),function(t){for(var e=0,o=t.allRows();e<o.length;e++)for(var n=o[e],r=0,a=t.columns;r<a.length;r++){var l=a[r],i=n.cells[l.dataKey];if(i){f.applyStyles(i.styles);var s=i.width-i.padding("horizontal");"linebreak"===i.styles.overflow?i.text=h.default().doc.splitTextToSize(i.text,s+1/(h.default().scaleFactor()||1),{fontSize:i.styles.fontSize}):"ellipsize"===i.styles.overflow?i.text=f.ellipsize(i.text,s,i.styles):"hidden"===i.styles.overflow?i.text=f.ellipsize(i.text,s,i.styles,""):"function"==typeof i.styles.overflow&&(i.text=i.styles.overflow(i.text,s));var d=Array.isArray(i.text)?i.text.length:1;d=i.rowSpan<=1?d:1;var u=i.styles.fontSize/h.default().scaleFactor()*c.FONT_ROW_RATIO;i.contentHeight=d*u+i.padding("vertical"),i.styles.minCellHeight>i.contentHeight&&(i.contentHeight=i.styles.minCellHeight),i.contentHeight>n.height&&(n.height=i.contentHeight,n.maxCellHeight=i.contentHeight,n.maxCellLineCount=d)}}}(t),function(t){for(var e={},o=1,n=t.allRows(),r=0;r<n.length;r++){for(var a=n[r],l=0,i=t.columns;l<i.length;l++){var s=i[l],d=e[s.dataKey];if(1<o)o--,delete a.cells[s.dataKey];else if(d)d.cell.height+=a.height,d.cell.height>a.maxCellHeight&&(d.row.maxCellHeight=d.cell.height,d.row.maxCellLineCount=Array.isArray(d.cell.text)?d.cell.text.length:1),o=d.cell.colSpan,delete a.cells[s.dataKey],d.left--,d.left<=1&&delete e[s.dataKey];else{var u=a.cells[s.dataKey];if(!u)continue;if(u.height=a.height,1<u.rowSpan){var c=n.length-r,f=u.rowSpan>c?c:u.rowSpan;e[s.dataKey]={cell:u,left:f,row:a}}}}"head"===a.section&&(t.headHeight+=a.maxCellHeight),"foot"===a.section&&(t.footHeight+=a.maxCellHeight),t.height+=a.height}}(t)}},function(t,e,o){"use strict";var b=this&&this.__assign||function(){return(b=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var P=o(9),C=o(2),m=o(12),x=o(3),v=o(1),W=o(0),w=o(14);e.parseInput=function(t){var e=function(t){if(1===t.length)return t[0];var e=t[2]||{};return e.body=t[1],e.columns=t[0],e.columns.forEach(function(t){null==t.header&&(t.header=t.title)}),e}(t),o=[W.getGlobalOptions(),W.getDocumentOptions(),e];w.default(o);var n=new P.Table;(W.default().table=n).id=e.tableId;var r=W.default().doc;n.userStyles={textColor:r.getTextColor?r.getTextColor():0,fontSize:r.internal.getFontSize(),fontStyle:r.internal.getFont().fontStyle,font:r.internal.getFont().fontName};for(var a=function(e){var t=o.map(function(t){return t[e]||{}});n.styles[e]=x.assign.apply(void 0,[{}].concat(t))},l=0,i=Object.keys(n.styles);l<i.length;l++)a(i[l]);for(var s=0,d=o;s<d.length;s++)for(var u=d[s],c=0,f=Object.keys(n.cellHooks);c<f.length;c++){var h=f[c];u&&"function"==typeof u[h]&&(n.cellHooks[h].push(u[h]),delete u[h])}n.settings=x.assign.apply(void 0,[{},C.defaultConfig()].concat(o)),n.settings.margin=v.marginOrPadding(n.settings.margin,C.defaultConfig().margin),"auto"===n.settings.theme&&(n.settings.theme=n.settings.useCss?"plain":"striped"),!1===n.settings.startY&&delete n.settings.startY;var g=W.default().doc.previousAutoTable,p=g&&g.startPageNumber+g.pageNumber-1===W.default().pageNumber();null==n.settings.startY&&p&&(n.settings.startY=g.finalY+20/W.default().scaleFactor());var y={};return n.settings.html&&(y=m.parseHtml(n.settings.html,n.settings.includeHiddenHtml,n.settings.useCss)||{}),n.settings.head=y.head||n.settings.head||[],n.settings.body=y.body||n.settings.body||[],n.settings.foot=y.foot||n.settings.foot||[],function(S){var e=S.settings;S.columns=function(t){if(t.columns)return t.columns.map(function(t,e){var o=t.dataKey||t.key||e,n=null!=t?t:e;return new P.Column(o,n,e)});var e=b({},t.head[0],t.body[0],t.foot[0]);delete e._element;var o=Object.keys(e);return o.map(function(t){return new P.Column(t,t,t)})}(e);for(var t=function(v){var w={},t=e[v];if(0===t.length&&e.columns){var n={};S.columns.forEach(function(t){var e=t.raw;if("head"===v){var o="object"==typeof e?e.header:e;o&&(n[t.dataKey]=o)}else"foot"===v&&e.footer&&(n[t.dataKey]=e.footer)}),Object.keys(n).length&&t.push(n)}t.forEach(function(t,e){var o=new P.Row(t,e,v);S[v].push(o);for(var n,r,a,l,i,s,d,u,c=0,f=0,h=0,g=S.columns;h<g.length;h++){var p=g[h];if(null==w[p.dataKey]||0===w[p.dataKey].left)if(0===f){var y=void 0;y=Array.isArray(t)?t[p.dataKey-c]:t[p.dataKey];var b=(n=v,r=p.dataKey,a=e,d=s=void 0,l=W.default().table,i=C.getTheme(l.settings.theme),s=[i.table,i[n],l.styles.styles,l.styles[n+"Styles"]],d="body"===n&&l.styles.columnStyles[r]||{},u="body"===n&&a%2==0?x.assign({},i.alternateRow,l.styles.alternateRowStyles):{},x.assign.apply(void 0,[C.defaultStyles()].concat(s.concat([u,d])))),m=new P.Cell(y,b,v);o.cells[p.dataKey]=m,S.callCellHooks(S.cellHooks.didParseCell,m,o,p),f=m.colSpan-1,w[p.dataKey]={left:m.rowSpan-1,times:f}}else f--,c++;else w[p.dataKey].left--,f=w[p.dataKey].times}})},o=0,n=["head","body","foot"];o<n.length;o++){var r=n[o];t(r)}S.allRows().forEach(function(t){for(var e=0,o=S.columns;e<o.length;e++){var n=o[e],r=t.cells[n.dataKey];r&&1===r.colSpan&&(r.wrappedWidth>n.wrappedWidth&&(n.wrappedWidth=r.wrappedWidth),r.minWidth>n.minWidth&&(n.minWidth=r.minWidth))}})}(n),n.minWidth=n.columns.reduce(function(t,e){return t+e.minWidth},0),n.wrappedWidth=n.columns.reduce(function(t,e){return t+e.wrappedWidth},0),"number"==typeof n.settings.tableWidth?n.width=n.settings.tableWidth:"wrap"===n.settings.tableWidth?n.width=n.wrappedWidth:n.width=W.default().pageWidth()-n.margin("left")-n.margin("right"),n}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),i=o(0),l=o(10),s=o(1),d=o(11),r=function(){this.willParseCell=[],this.didParseCell=[],this.willDrawCell=[],this.didDrawCell=[],this.didDrawPage=[]},a=function(){function t(){this.columns=[],this.head=[],this.body=[],this.foot=[],this.height=0,this.width=0,this.preferredWidth=0,this.wrappedWidth=0,this.minWidth=0,this.headHeight=0,this.footHeight=0,this.startPageNumber=1,this.pageNumber=1,this.styles={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},this.cellHooks=new r}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(t,e,o,n){for(var r=0,a=t;r<a.length;r++){if(!1===(0,a[r])(new l.CellHookData(e,o,n)))return!1}return!0},t.prototype.callEndPageHooks=function(){s.applyUserStyles();for(var t=0,e=this.cellHooks.didDrawPage;t<e.length;t++){(0,e[t])(new l.HookData)}},t.prototype.margin=function(t){return s.marginOrPadding(this.settings.margin,n.defaultConfig().margin)[t]},t}();e.Table=a;var u=function(){function t(t,e,o){this.cells={},this.height=0,this.maxCellLineCount=1,this.maxCellHeight=0,this.pageNumber=1,this.spansMultiplePages=!1,(this.raw=t)._element&&(this.raw=t._element),this.index=e,this.section=o}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),t}();e.Row=u;var c=function(){function t(t,e,o){this.contentWidth=0,this.wrappedWidth=0,this.minWidth=0,this.textPos={},this.height=0,this.width=0,this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=d(e,t&&t.styles||{}),this.section=o;var n="",r=t&&void 0!==t.content?t.content:t;r=null!=r&&null!=r.dataKey?r.title:r;var a="object"==typeof window&&window.HTMLElement&&r instanceof window.HTMLElement;this.raw=a?r:t,n=r&&a?(r.innerText||"").replace(/' '+/g," ").trim():null!=r?""+r:"";if(this.text=n.split(/\r\n|\r|\n/g),this.contentWidth=this.padding("horizontal")+s.getStringWidth(this.text,this.styles),"number"==typeof this.styles.cellWidth)this.minWidth=this.styles.cellWidth,this.wrappedWidth=this.styles.cellWidth;else if("wrap"===this.styles.cellWidth)this.minWidth=this.contentWidth,this.wrappedWidth=this.contentWidth;else{var l=10/i.default().scaleFactor();this.minWidth=this.styles.minCellWidth||l,this.wrappedWidth=this.contentWidth,this.minWidth>this.wrappedWidth&&(this.wrappedWidth=this.minWidth)}}return t.prototype.padding=function(t){var e=s.marginOrPadding(this.styles.cellPadding,s.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}();e.Cell=c;var f=function(t,e,o){this.preferredWidth=0,this.minWidth=0,this.wrappedWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=o};e.Column=f},function(t,e,o){"use strict";var n,a=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var r=o(0),l=function(){function t(){var t=r.default().table;this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=r.default().doc}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),t}(),i=function(r){function t(t,e,o){var n=r.call(this)||this;return n.cell=t,n.row=e,n.column=o,n.section=e.section,n}return a(t,r),t}(e.HookData=l);e.CellHookData=i},function(t,e,o){"use strict";
/*

@@ -15,0 +15,0 @@ object-assign

{
"name": "jspdf-autotable",
"version": "3.0.6",
"version": "3.0.7",
"description": "Generate pdf tables with javascript (jsPDF plugin)",

@@ -5,0 +5,0 @@ "main": "dist/jspdf.plugin.autotable.js",

@@ -31,4 +31,4 @@ import {FONT_ROW_RATIO} from './config';

applyUserStyles();
table.body.forEach(function(row) {
printFullRow(row);
table.body.forEach(function(row, index) {
printFullRow(row, index === table.body.length - 1);
});

@@ -45,3 +45,3 @@ applyUserStyles();

function printFullRow(row: Row) {
function printFullRow(row: Row, isLastRow) {
let remainingRowHeight = 0;

@@ -52,3 +52,3 @@ let remainingTexts = {};

if (!canFitOnPage(row.maxCellHeight)) {
if (!canFitOnPage(row.maxCellHeight, isLastRow)) {
if (row.maxCellLineCount <= 1 || (table.settings.rowPageBreak === 'avoid' && !rowHeightGreaterThanMaxTableHeight(row))) {

@@ -122,3 +122,3 @@ addPage();

row.height = remainingRowHeight;
printFullRow(row);
printFullRow(row, isLastRow);
}

@@ -195,7 +195,7 @@ }

function canFitOnPage(rowHeight) {
function canFitOnPage(rowHeight, isLastRow) {
let table = state().table;
let bottomContentHeight = table.margin('bottom');
let showFoot = table.settings.showFoot;
if (showFoot === true || showFoot === 'everyPage' || showFoot === 'lastPage') {
if (showFoot === true || showFoot === 'everyPage' || (showFoot === 'lastPage' && isLastRow)) {
bottomContentHeight += table.footHeight;

@@ -202,0 +202,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc