UNPKG

knoxui-react

Version:

KnoxUI is a corporate-focused React component library.

26 lines 73.6 kB
"use strict";var e=require("react"),t=require("xlsx"),n=require("jspdf");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=r(e),a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function l(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function i(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s={xs:"px-2 py-0.5 text-xs",sm:"px-3 py-1 text-sm",md:"px-4 py-1.5 text-base",lg:"px-5 py-2 text-lg",xl:"px-6 py-2.5 text-xl"},c={primary:"bg-primary border-primary hover:bg-primary/50 text-white",secondary:"bg-secondary border-secondary hover:bg-secondary-600 text-white",success:"bg-success border-success hover:bg-success-600 text-white",warning:"bg-warning border-warning hover:bg-warning-600 text-white",error:"bg-error border-error hover:bg-error-600 text-white",ghost:"bg-ghost border-ghost hover:bg-gray-100 text-gray-800 dark:text-gray-100 dark:hover:bg-gray-800/50"},u={ripple:"overflow-hidden relative",push:"transform active:scale-90 transition-transform",none:""},d=function(t){var n=t.children,r=t.size,o=void 0===r?"md":r,i=t.variant,d=void 0===i?"primary":i,f=t.clickEffect,h=void 0===f?"ripple":f,p=t.isLoading,m=void 0!==p&&p,g=t.className,y=void 0===g?"":g,b=t.disabled,v=void 0!==b&&b,w=t.onClick,x=l(t,["children","size","variant","clickEffect","isLoading","className","disabled","onClick"]),S="font-semibold rounded-md transition-colors duration-400 h-min select-none border duration-200 transition-all hover:shadow-lg ".concat("ghost"!==d?"focus:shadow-lg":""," ").concat(v&&"opacity-90 cursor-not-allowed"," ").concat(y),E=s[o],C=c[d],k=u[h],P="".concat(S," ").concat(E," ").concat(C," ").concat(k," ").concat(m?"opacity-90 cursor-progress":"");return e.createElement("button",a({className:P,onClick:function(e){if("ripple"===h&&!m&&!v){var t=e.currentTarget,n=document.createElement("span");n.className="absolute bg-white opacity-25 rounded-full animate-ripple";var r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),a=e.clientX-r.left-o/2,l=e.clientY-r.top-o/2;n.style.width=n.style.height="".concat(o,"px"),n.style.left="".concat(a,"px"),n.style.top="".concat(l,"px"),t.appendChild(n),setTimeout((function(){n.remove()}),600)}!w||m||v||w(e)},disabled:v||m},x),m?e.createElement("span",{className:"flex items-center justify-center"},e.createElement("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.createElement("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),"Loading..."):n)},f={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 pl-2 text-base",lg:"p-2 pl-2.5 text-lg",xl:"p-3 pl-4 text-xl"},h={primary:"border-primary outline-primary accent-primary",secondary:"border-secondary outline-secondary accent-secondary",success:"border-success outline-success accent-success",warning:"border-warning outline-warning accent-warning",error:"border-error outline-error accent-error",ghost:"focus:outline-none"},p={primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",error:"bg-error",ghost:"bg-base-300"},m="w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300 flex items-center",g=function(t){var n=t.checked,r=void 0!==n&&n,o=t.size,i=void 0===o?"md":o,s=t.variant,c=void 0===s?"primary":s,u=t.label,d=t.onChange,g=t.className,y=void 0===g?"":g,b=t.wrapperClass,v=void 0===b?"":b,w=t.sx,x=t.isButton,S=void 0!==x&&x,E=l(t,["checked","size","variant","label","onChange","className","wrapperClass","sx","isButton"]),C=function(e){d&&d(e)},k=h[c];return S?e.createElement("label",{className:"".concat(m," ").concat(f[i]," ").concat(k," ").concat(r&&"ghost"!==c?p[c]:"!bg-transparent"," ").concat(y," cursor-pointer"),style:w},e.createElement("input",a({type:"radio",checked:r,onChange:C,className:"sr-only"},E)),e.createElement("span",{className:"w-full text-center ".concat(r&&"ghost"!==c?"text-white":"")},u)):u?e.createElement("div",{className:v,style:w},e.createElement("label",{className:"".concat(m," ").concat(f[i]," ").concat(r&&"ghost"!==c?p[c]:"")},e.createElement("input",a({type:"radio",checked:r,onChange:C,className:"".concat(k," ").concat(y," ").concat(r&&"ghost"!==c?p[c]:"")},E)),e.createElement("span",{className:"ml-2 ".concat(r?"text-white":"")},u))):e.createElement("input",a({type:"radio",className:"".concat(k," ").concat(y," ").concat(r&&"ghost"!==c?p[c]:""),checked:r,onChange:C,style:w},E))},y={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 text-base",lg:"p-2 text-lg",xl:"p-3 text-xl"},b={primary:"border-primary outline-primary accent-primary",secondary:"border-secondary outline-secondary accent-secondary",success:"border-success outline-success accent-success",warning:"border-warning outline-warning accent-warning",error:"border-error outline-error accent-error",ghost:"border-ghost focus:border-base-300 outline-none"},v={xs:"h-3 w-3 text-xs",sm:"h-4 w-4 text-sm",md:"h-5 w-5 text-base",lg:"h-6 w-6 text-lg",xl:"h-7 w-7 text-xl"},w={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 text-base",lg:"p-2 text-lg",xl:"p-3 text-xl"},x={primary:"border-primary outline-primary",secondary:"border-secondary outline-secondary",success:"border-success outline-success",warning:"border-warning outline-warning",error:"border-error outline-error",ghost:"border-ghost focus:border-base-300 outline-none"},S=function(t){var n=t.label,r=t.size,o=void 0===r?"md":r,i=t.variant,s=void 0===i?"primary":i,c=t.type,u=void 0===c?"text":c,d=t.required,f=t.className,h=void 0===f?"":f,p=t.wrapperClass,m=void 0===p?"":p,g=t.labelClass,y=void 0===g?"":g,b=t.labelTextClass,v=void 0===b?"":b,S=t.sx,E=l(t,["label","size","variant","type","required","className","wrapperClass","labelClass","labelTextClass","sx"]);return e.createElement("div",{className:m,style:S},e.createElement("label",{className:"flex flex-col items-start ".concat(y)},n&&e.createElement("span",{className:"text-sm px-0.5 ".concat(v)},n," ",d&&e.createElement("span",{className:"text-error"},"*")),e.createElement("input",a({type:u,className:"".concat("w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300"," ").concat(w[o]," ").concat(x[s]," ").concat(h),required:d},E))))},E={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 text-base",lg:"p-2 text-lg",xl:"p-3 text-xl"},C={primary:"border-primary outline-primary",secondary:"border-secondary outline-secondary",success:"border-success outline-success",warning:"border-warning outline-warning",error:"border-error outline-error",ghost:"border-ghost focus:border-base-300 outline-none"},k={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"},P={primary:"border-primary focus:border-primary",secondary:"border-secondary focus:border-secondary",success:"border-success focus:border-success",warning:"border-warning focus:border-warning",error:"border-error focus:border-error",ghost:"border-ghost focus:border-base-300"}; /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const D=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim() /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */;var N={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}; /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W=e.forwardRef((({color:t="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:i,...s},c)=>e.createElement("svg",{ref:c,...N,width:n,height:n,stroke:t,strokeWidth:o?24*Number(r)/Number(n):r,className:D("lucide",a),...s},[...i.map((([t,n])=>e.createElement(t,n))),...Array.isArray(l)?l:[l]]))),T=(t,n)=>{const r=e.forwardRef((({className:r,...o},a)=>{return e.createElement(W,{ref:a,iconNode:n,className:D(`lucide-${l=t,l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o});var l}));return r.displayName=`${t}`,r},H=T("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),j=T("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),F=T("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]),_=T("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]),z=T("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]); /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var O,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};"undefined"!=typeof globalThis?globalThis:void 0!==A||("undefined"!=typeof window?window:"undefined"!=typeof self&&self),O=function(e){return function(){var t={172:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellHookData=t.HookData=void 0;var o=function(e,t,n){this.table=t,this.pageNumber=t.pageNumber,this.pageCount=this.pageNumber,this.settings=t.settings,this.cursor=n,this.doc=e.getDocument()};t.HookData=o;var a=function(e){function t(t,n,r,o,a,l){var i=e.call(this,t,n,l)||this;return i.cell=r,i.row=o,i.column=a,i.section=o.section,i}return r(t,e),t}(o);t.CellHookData=a},340:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(136),a=n(744),l=n(776),i=n(664),s=n(972);t.default=function(e){e.API.autoTable=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];1===t.length?e=t[0]:(console.error("Use of deprecated autoTable initiation"),(e=t[2]||{}).columns=t[0],e.body=t[1]);var r=(0,l.parseInput)(this,e),o=(0,s.createTable)(this,r);return(0,i.drawTable)(this,o),this},e.API.lastAutoTable=!1,e.API.previousAutoTable=!1,e.API.autoTable.previous=!1,e.API.autoTableText=function(e,t,n,r){(0,o.default)(e,t,n,r,this)},e.API.autoTableSetDefaults=function(e){return a.DocHandler.setDefaults(e,this),this},e.autoTableSetDefaults=function(e,t){a.DocHandler.setDefaults(e,t)},e.API.autoTableHtmlToJson=function(e,t){var n;if(void 0===t&&(t=!1),"undefined"==typeof window)return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var o=new a.DocHandler(this),l=(0,r.parseHtml)(o,e,window,t,!1),i=l.head,s=l.body;return{columns:(null===(n=i[0])||void 0===n?void 0:n.map((function(e){return e.content})))||[],rows:s,data:s}},e.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.lastAutoTable.finalY instead.");var e=this.lastAutoTable;return e&&e.finalY?e.finalY:0},e.API.autoTableAddPageContent=function(t){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),e.API.autoTable.globalDefaults||(e.API.autoTable.globalDefaults={}),e.API.autoTable.globalDefaults.addPageContent=t,this},e.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}}},136:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,o){r=r||{};var a=o.internal.scaleFactor,l=o.internal.getFontSize()/a,i=l*(o.getLineHeightFactor?o.getLineHeightFactor():1.15),s="",c=1;if("middle"!==r.valign&&"bottom"!==r.valign&&"center"!==r.halign&&"right"!==r.halign||(c=(s="string"==typeof e?e.split(/\r\n|\r|\n/g):e).length||1),n+=l*(2-1.15),"middle"===r.valign?n-=c/2*i:"bottom"===r.valign&&(n-=c*i),"center"===r.halign||"right"===r.halign){var u=l;if("center"===r.halign&&(u*=.5),s&&c>=1){for(var d=0;d<s.length;d++)o.text(s[d],t-o.getStringUnitWidth(s[d])*u,n),n+=i;return o}t-=o.getStringUnitWidth(e)*u}return"justify"===r.halign?o.text(e,t,n,{maxWidth:r.maxWidth||100,align:"justify"}):o.text(e,t,n),o}},420:function(e,t){function n(e,t){var n=e>0,r=t||0===t;return n&&r?"DF":n?"S":r?"F":null}function r(e,t){var n,r,o,a;if(e=e||t,Array.isArray(e)){if(e.length>=4)return{top:e[0],right:e[1],bottom:e[2],left:e[3]};if(3===e.length)return{top:e[0],right:e[1],bottom:e[2],left:e[1]};if(2===e.length)return{top:e[0],right:e[1],bottom:e[0],left:e[1]};e=1===e.length?e[0]:t}return"object"==typeof e?("number"==typeof e.vertical&&(e.top=e.vertical,e.bottom=e.vertical),"number"==typeof e.horizontal&&(e.right=e.horizontal,e.left=e.horizontal),{left:null!==(n=e.left)&&void 0!==n?n:t,top:null!==(r=e.top)&&void 0!==r?r:t,right:null!==(o=e.right)&&void 0!==o?o:t,bottom:null!==(a=e.bottom)&&void 0!==a?a:t}):("number"!=typeof e&&(e=t),{top:e,right:e,bottom:e,left:e})}Object.defineProperty(t,"__esModule",{value:!0}),t.getPageAvailableWidth=t.parseSpacing=t.getFillStyle=t.addTableBorder=t.getStringWidth=void 0,t.getStringWidth=function(e,t,n){return n.applyStyles(t,!0),(Array.isArray(e)?e:[e]).map((function(e){return n.getTextWidth(e)})).reduce((function(e,t){return Math.max(e,t)}),0)},t.addTableBorder=function(e,t,r,o){var a=t.settings.tableLineWidth,l=t.settings.tableLineColor;e.applyStyles({lineWidth:a,lineColor:l});var i=n(a,!1);i&&e.rect(r.x,r.y,t.getWidth(e.pageSize().width),o.y-r.y,i)},t.getFillStyle=n,t.parseSpacing=r,t.getPageAvailableWidth=function(e,t){var n=r(t.settings.margin,0);return e.pageSize().width-(n.left+n.right)}},796:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.getTheme=t.defaultStyles=t.HtmlRowInput=void 0;var o=function(e){function t(t){var n=e.call(this)||this;return n._element=t,n}return r(t,e),t}(Array);t.HtmlRowInput=o,t.defaultStyles=function(e){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}},t.getTheme=function(e){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"}}}[e]}},903:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCss=void 0;var r=n(420);function o(e,t){var n=a(e,t);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var o=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])];return 0===parseInt(r[4])||isNaN(o[0])||isNaN(o[1])||isNaN(o[2])?null:o}function a(e,t){var n=t(e);return"rgba(0, 0, 0, 0)"===n||"transparent"===n||"initial"===n||"inherit"===n?null==e.parentElement?null:a(e.parentElement,t):n}t.parseCss=function(e,t,n,a,l){var i={},s=96/72,c=o(t,(function(e){return l.getComputedStyle(e).backgroundColor}));null!=c&&(i.fillColor=c);var u=o(t,(function(e){return l.getComputedStyle(e).color}));null!=u&&(i.textColor=u);var d=function(e,t){var n=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],o=96/(72/t),a=(parseInt(e.lineHeight)-parseInt(e.fontSize))/t/2,l=n.map((function(e){return parseInt(e||"0")/o})),i=(0,r.parseSpacing)(l,0);return a>i.top&&(i.top=a),a>i.bottom&&(i.bottom=a),i}(a,n);d&&(i.cellPadding=d);var f="borderTopColor",h=s*n,p=a.borderTopWidth;if(a.borderBottomWidth===p&&a.borderRightWidth===p&&a.borderLeftWidth===p){var m=(parseFloat(p)||0)/h;m&&(i.lineWidth=m)}else i.lineWidth={top:(parseFloat(a.borderTopWidth)||0)/h,right:(parseFloat(a.borderRightWidth)||0)/h,bottom:(parseFloat(a.borderBottomWidth)||0)/h,left:(parseFloat(a.borderLeftWidth)||0)/h},i.lineWidth.top||(i.lineWidth.right?f="borderRightColor":i.lineWidth.bottom?f="borderBottomColor":i.lineWidth.left&&(f="borderLeftColor"));var g=o(t,(function(e){return l.getComputedStyle(e)[f]}));null!=g&&(i.lineColor=g);var y=["left","right","center","justify"];-1!==y.indexOf(a.textAlign)&&(i.halign=a.textAlign),-1!==(y=["middle","bottom","top"]).indexOf(a.verticalAlign)&&(i.valign=a.verticalAlign);var b=parseInt(a.fontSize||"");isNaN(b)||(i.fontSize=b/s);var v=function(e){var t="";return("bold"===e.fontWeight||"bolder"===e.fontWeight||parseInt(e.fontWeight)>=700)&&(t="bold"),"italic"!==e.fontStyle&&"oblique"!==e.fontStyle||(t+="italic"),t}(a);v&&(i.fontStyle=v);var w=(a.fontFamily||"").toLowerCase();return-1!==e.indexOf(w)&&(i.font=w),i}},744:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DocHandler=void 0;var n={},r=function(){function e(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(e,t){void 0===t&&(t=null),t?t.__autoTableDocumentDefaults=e:n=e},e.unifyColor=function(e){return Array.isArray(e)?e:"number"==typeof e?[e,e,e]:"string"==typeof e?[e]:null},e.prototype.applyStyles=function(t,n){var r,o,a;void 0===n&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var l=this.jsPDFDocument.internal.getFont(),i=l.fontStyle,s=l.fontName;if(t.font&&(s=t.font),t.fontStyle){i=t.fontStyle;var c=this.getFontList()[s];c&&-1===c.indexOf(i)&&(this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(c[0]),i=c[0])}if(this.jsPDFDocument.setFont(s,i),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var u=e.unifyColor(t.fillColor);u&&(r=this.jsPDFDocument).setFillColor.apply(r,u),(u=e.unifyColor(t.textColor))&&(o=this.jsPDFDocument).setTextColor.apply(o,u),(u=e.unifyColor(t.lineColor))&&(a=this.jsPDFDocument).setDrawColor.apply(a,u),"number"==typeof t.lineWidth&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(e,t,n){return this.jsPDFDocument.splitTextToSize(e,t,n)},e.prototype.rect=function(e,t,n,r,o){return this.jsPDFDocument.rect(e,t,n,r,o)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return n||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return null==e.width&&(e={width:e.getWidth(),height:e.getHeight()}),e},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}();t.DocHandler=r},4:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseHtml=void 0;var r=n(903),o=n(796);function a(e,t,n,a,i,s){for(var c=new o.HtmlRowInput(a),u=0;u<a.cells.length;u++){var d=a.cells[u],f=n.getComputedStyle(d);if(i||"none"!==f.display){var h=void 0;s&&(h=(0,r.parseCss)(e,d,t,f,n)),c.push({rowSpan:d.rowSpan,colSpan:d.colSpan,styles:h,_element:d,content:l(d)})}}var p=n.getComputedStyle(a);if(c.length>0&&(i||"none"!==p.display))return c}function l(e){var t=e.cloneNode(!0);return t.innerHTML=t.innerHTML.replace(/\n/g,"").replace(/ +/g," "),t.innerHTML=t.innerHTML.split(/<br.*?>/).map((function(e){return e.trim()})).join("\n"),t.innerText||t.textContent||""}t.parseHtml=function(e,t,n,r,o){var l,i,s;void 0===r&&(r=!1),void 0===o&&(o=!1),s="string"==typeof t?n.document.querySelector(t):t;var c=Object.keys(e.getFontList()),u=e.scaleFactor(),d=[],f=[],h=[];if(!s)return console.error("Html table could not be found with input: ",t),{head:d,body:f,foot:h};for(var p=0;p<s.rows.length;p++){var m=s.rows[p],g=null===(i=null===(l=null==m?void 0:m.parentElement)||void 0===l?void 0:l.tagName)||void 0===i?void 0:i.toLowerCase(),y=a(c,u,n,m,r,o);y&&("thead"===g?d.push(y):"tfoot"===g?h.push(y):f.push(y))}return{head:d,body:f,foot:h}}},776:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseInput=void 0;var r=n(4),o=n(356),a=n(420),l=n(744),i=n(792);t.parseInput=function(e,t){var n=new l.DocHandler(e),s=n.getDocumentOptions(),c=n.getGlobalOptions();(0,i.default)(n,c,s,t);var u,d=(0,o.assign)({},c,s,t);"undefined"!=typeof window&&(u=window);var f=function(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},a=function(a){if("columnStyles"===a){var l=e[a],i=t[a],s=n[a];r.columnStyles=(0,o.assign)({},l,i,s)}else{var c=[e,t,n].map((function(e){return e[a]||{}}));r[a]=(0,o.assign)({},c[0],c[1],c[2])}},l=0,i=Object.keys(r);l<i.length;l++)a(i[l]);return r}(c,s,t),h=function(e,t,n){for(var r={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},o=0,a=[e,t,n];o<a.length;o++){var l=a[o];l.didParseCell&&r.didParseCell.push(l.didParseCell),l.willDrawCell&&r.willDrawCell.push(l.willDrawCell),l.didDrawCell&&r.didDrawCell.push(l.didDrawCell),l.willDrawPage&&r.willDrawPage.push(l.willDrawPage),l.didDrawPage&&r.didDrawPage.push(l.didDrawPage)}return r}(c,s,t),p=function(e,t){var n,r,o,l,i,s,c,u,d,f,h,p,m,g,y=(0,a.parseSpacing)(t.margin,40/e.scaleFactor()),b=null!==(n=function(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),o=e.pageNumber(),a=!1;return n&&n.startPageNumber&&(a=n.startPageNumber+n.pageNumber-1===o),"number"==typeof t?t:null!=t&&!1!==t||!a||null==(null==n?void 0:n.finalY)?null:n.finalY+20/r}(e,t.startY))&&void 0!==n?n:y.top;m=!0===t.showFoot?"everyPage":!1===t.showFoot?"never":null!==(r=t.showFoot)&&void 0!==r?r:"everyPage",g=!0===t.showHead?"everyPage":!1===t.showHead?"never":null!==(o=t.showHead)&&void 0!==o?o:"everyPage";var v=null!==(l=t.useCss)&&void 0!==l&&l,w=t.theme||(v?"plain":"striped"),x=!!t.horizontalPageBreak,S=null!==(i=t.horizontalPageBreakRepeat)&&void 0!==i?i:null;return{includeHiddenHtml:null!==(s=t.includeHiddenHtml)&&void 0!==s&&s,useCss:v,theme:w,startY:b,margin:y,pageBreak:null!==(c=t.pageBreak)&&void 0!==c?c:"auto",rowPageBreak:null!==(u=t.rowPageBreak)&&void 0!==u?u:"auto",tableWidth:null!==(d=t.tableWidth)&&void 0!==d?d:"auto",showHead:g,showFoot:m,tableLineWidth:null!==(f=t.tableLineWidth)&&void 0!==f?f:0,tableLineColor:null!==(h=t.tableLineColor)&&void 0!==h?h:200,horizontalPageBreak:x,horizontalPageBreakRepeat:S,horizontalPageBreakBehaviour:null!==(p=t.horizontalPageBreakBehaviour)&&void 0!==p?p:"afterAllRows"}}(n,d),m=function(e,t,n){var o=t.head||[],a=t.body||[],l=t.foot||[];if(t.html){var i=t.includeHiddenHtml;if(n){var s=(0,r.parseHtml)(e,t.html,n,i,t.useCss)||{};o=s.head||o,a=s.body||o,l=s.foot||o}else console.error("Cannot parse html in non browser environment")}var c=t.columns||function(e,t,n){var r=e[0]||t[0]||n[0]||[],o=[];return Object.keys(r).filter((function(e){return"_element"!==e})).forEach((function(e){var t,n=1;"object"!=typeof(t=Array.isArray(r)?r[parseInt(e)]:r[e])||Array.isArray(t)||(n=(null==t?void 0:t.colSpan)||1);for(var a=0;a<n;a++){var l={dataKey:Array.isArray(r)?o.length:e+(a>0?"_".concat(a):"")};o.push(l)}})),o}(o,a,l);return{columns:c,head:o,body:a,foot:l}}(n,d,u);return{id:t.tableId,content:m,hooks:h,styles:f,settings:p}}},792:function(e,t){function n(e){e.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),e.minCellHeight||(e.minCellHeight=e.rowHeight)):e.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),e.cellWidth||(e.cellWidth=e.columnWidth))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,o){for(var a=function(t){t&&"object"!=typeof t&&console.error("The options parameter should be of type object, is: "+typeof t),void 0!==t.extendWidth&&(t.tableWidth=t.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==t.margins&&(void 0===t.margin&&(t.margin=t.margins),console.error("Use of deprecated option: margins, use margin instead.")),t.startY&&"number"!=typeof t.startY&&(console.error("Invalid value for startY option",t.startY),delete t.startY),!t.didDrawPage&&(t.afterPageContent||t.beforePageContent||t.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),t.didDrawPage=function(n){e.applyStyles(e.userStyles),t.beforePageContent&&t.beforePageContent(n),e.applyStyles(e.userStyles),t.afterPageContent&&t.afterPageContent(n),e.applyStyles(e.userStyles),t.afterPageAdd&&n.pageNumber>1&&n.afterPageAdd(n),e.applyStyles(e.userStyles)}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach((function(e){t[e]&&console.error('The "'.concat(e,'" hook has changed in version 3.0, check the changelog for how to migrate.'))})),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach((function(e){var n=e[0],r=e[1];t[r]&&(console.error("Use of deprecated option ".concat(r,". Use ").concat(n," instead")),t[n]=t[r])})),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach((function(e){var n="string"==typeof e?e:e[0],r="string"==typeof e?e:e[1];void 0!==t[n]&&(void 0===t.styles[r]&&(t.styles[r]=t[n]),console.error("Use of deprecated option: "+n+", use the style "+r+" instead."))}));for(var r=0,o=["styles","bodyStyles","headStyles","footStyles"];r<o.length;r++)n(t[o[r]]||{});for(var a=t.columnStyles||{},l=0,i=Object.keys(a);l<i.length;l++)n(a[i[l]]||{})},l=0,i=[t,r,o];l<i.length;l++)a(i[l])}},260:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Column=t.Cell=t.Row=t.Table=void 0;var r=n(796),o=n(172),a=n(420),l=function(){function e(e,t){this.pageNumber=1,this.pageCount=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=t.columns,this.head=t.head,this.body=t.body,this.foot=t.foot}return e.prototype.getHeadHeight=function(e){return this.head.reduce((function(t,n){return t+n.getMaxCellHeight(e)}),0)},e.prototype.getFootHeight=function(e){return this.foot.reduce((function(t,n){return t+n.getMaxCellHeight(e)}),0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(e,t,n,r,a,l){for(var i=0,s=t;i<s.length;i++){var c=!1===(0,s[i])(new o.CellHookData(e,this,n,r,a,l));if(n.text=Array.isArray(n.text)?n.text:[n.text],c)return!1}return!0},e.prototype.callEndPageHooks=function(e,t){e.applyStyles(e.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++)(0,r[n])(new o.HookData(e,this,t))},e.prototype.callWillDrawPageHooks=function(e,t){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++)(0,r[n])(new o.HookData(e,this,t))},e.prototype.getWidth=function(e){if("number"==typeof this.settings.tableWidth)return this.settings.tableWidth;if("wrap"===this.settings.tableWidth)return this.columns.reduce((function(e,t){return e+t.wrappedWidth}),0);var t=this.settings.margin;return e-t.left-t.right},e}();t.Table=l;var i=function(){function e(e,t,n,o,a){void 0===a&&(a=!1),this.height=0,this.raw=e,e instanceof r.HtmlRowInput&&(this.raw=e._element,this.element=e._element),this.index=t,this.section=n,this.cells=o,this.spansMultiplePages=a}return e.prototype.getMaxCellHeight=function(e){var t=this;return e.reduce((function(e,n){var r;return Math.max(e,(null===(r=t.cells[n.index])||void 0===r?void 0:r.height)||0)}),0)},e.prototype.hasRowSpan=function(e){var t=this;return e.filter((function(e){var n=t.cells[e.index];return!!n&&n.rowSpan>1})).length>0},e.prototype.canEntireRowFit=function(e,t){return this.getMaxCellHeight(t)<=e},e.prototype.getMinimumRowHeight=function(e,t){var n=this;return e.reduce((function(e,r){var o=n.cells[r.index];if(!o)return 0;var a=t.getLineHeight(o.styles.fontSize),l=o.padding("vertical")+a;return l>e?l:e}),0)},e}();t.Row=i;var s=function(){function e(e,t,n){var r,o;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=t,this.section=n,this.raw=e;var a=e;null==e||"object"!=typeof e||Array.isArray(e)?(this.rowSpan=1,this.colSpan=1):(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,a=null!==(o=null!==(r=e.content)&&void 0!==r?r:e.title)&&void 0!==o?o:e,e._element&&(this.raw=e._element));var l=null!=a?""+a:"";this.text=l.split(/\r\n|\r|\n/g)}return e.prototype.getTextPos=function(){var e,t;if("top"===this.styles.valign)e=this.y+this.padding("top");else if("bottom"===this.styles.valign)e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}if("right"===this.styles.halign)t=this.x+this.width-this.padding("right");else if("center"===this.styles.halign){var r=this.width-this.padding("horizontal");t=this.x+r/2+this.padding("left")}else t=this.x+this.padding("left");return{x:t,y:e}},e.prototype.getContentHeight=function(e,t){void 0===t&&(t=1.15);var n=(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/e*t)+this.padding("vertical");return Math.max(n,this.styles.minCellHeight)},e.prototype.padding=function(e){var t=(0,a.parseSpacing)(this.styles.cellPadding,0);return"vertical"===e?t.top+t.bottom:"horizontal"===e?t.left+t.right:t[e]},e}();t.Cell=s;var c=function(){function e(e,t,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=t,this.index=n}return e.prototype.getMaxCustomCellWidth=function(e){for(var t=0,n=0,r=e.allRows();n<r.length;n++){var o=r[n].cells[this.index];o&&"number"==typeof o.styles.cellWidth&&(t=Math.max(t,o.styles.cellWidth))}return t},e}();t.Column=c},356:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.assign=void 0,t.assign=function(e,t,n,r,o){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(e),l=1;l<arguments.length;l++){var i=arguments[l];if(null!=i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(a[s]=i[s])}return a}},972:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=void 0;var r=n(744),o=n(260),a=n(324),l=n(796),i=n(356);function s(e,t,n,r,a,l){var i={};return t.map((function(t,s){for(var c=0,d={},f=0,h=0,p=0,m=n;p<m.length;p++){var g=m[p];if(null==i[g.index]||0===i[g.index].left)if(0===h){var y=void 0,b={};"object"!=typeof(y=Array.isArray(t)?t[g.index-f-c]:t[g.dataKey])||Array.isArray(y)||(b=(null==y?void 0:y.styles)||{});var v=u(e,g,s,a,r,l,b),w=new o.Cell(y,v,e);d[g.dataKey]=w,d[g.index]=w,h=w.colSpan-1,i[g.index]={left:w.rowSpan-1,times:h}}else h--,f++;else i[g.index].left--,h=i[g.index].times,c++}return new o.Row(t,s,e,d)}))}function c(e,t){var n={};return e.forEach((function(e){if(null!=e.raw){var r=function(e,t){if("head"===e){if("object"==typeof t)return t.header||t.title||null;if("string"==typeof t||"number"==typeof t)return t}else if("foot"===e&&"object"==typeof t)return t.footer;return null}(t,e.raw);null!=r&&(n[e.dataKey]=r)}})),Object.keys(n).length>0?n:null}function u(e,t,n,r,o,a,s){var c,u=(0,l.getTheme)(r);"head"===e?c=o.headStyles:"body"===e?c=o.bodyStyles:"foot"===e&&(c=o.footStyles);var d=(0,i.assign)({},u.table,u[e],o.styles,c),f=o.columnStyles[t.dataKey]||o.columnStyles[t.index]||{},h="body"===e?f:{},p="body"===e&&n%2==0?(0,i.assign)({},u.alternateRow,o.alternateRowStyles):{},m=(0,l.defaultStyles)(a),g=(0,i.assign)({},m,d,p,h);return(0,i.assign)(g,s)}t.createTable=function(e,t){var n=new r.DocHandler(e),l=function(e,t){var n,r=e.content,a=function(e){return e.map((function(e,t){var n,r,a;return a="object"==typeof e&&null!==(r=null!==(n=e.dataKey)&&void 0!==n?n:e.key)&&void 0!==r?r:t,new o.Column(a,e,t)}))}(r.columns);0===r.head.length&&(n=c(a,"head"))&&r.head.push(n),0===r.foot.length&&(n=c(a,"foot"))&&r.foot.push(n);var l=e.settings.theme,i=e.styles;return{columns:a,head:s("head",r.head,a,i,l,t),body:s("body",r.body,a,i,l,t),foot:s("foot",r.foot,a,i,l,t)}}(t,n.scaleFactor()),i=new o.Table(t,l);return(0,a.calculateWidths)(n,i),n.applyStyles(n.userStyles),i}},664:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addPage=t.drawTable=void 0;var r=n(420),o=n(260),a=n(744),l=n(356),i=n(136),s=n(224);function c(e,t,n,r){var o=t.settings;e.applyStyles(e.userStyles),"firstPage"!==o.showHead&&"everyPage"!==o.showHead||t.head.forEach((function(o){return p(e,t,o,n,r)}))}function u(e,t,n,r,o,a){e.applyStyles(e.userStyles),a=null!=a?a:t.body.length;var l=Math.min(n+a,t.body.length),i=-1;return t.body.slice(n,l).forEach((function(a,l){var s=n+l===t.body.length-1,c=g(e,t,s,r);a.canEntireRowFit(c,o)&&(p(e,t,a,r,o),i=n+l)})),i}function d(e,t,n,r){var o=t.settings;e.applyStyles(e.userStyles),"lastPage"!==o.showFoot&&"everyPage"!==o.showFoot||t.foot.forEach((function(o){return p(e,t,o,n,r)}))}function f(e,t,n){var r=n.getLineHeight(e.styles.fontSize),o=e.padding("vertical"),a=Math.floor((t-o)/r);return Math.max(0,a)}function h(e,t,n,r,a,i,s){var c=g(e,t,r,i);if(n.canEntireRowFit(c,s))p(e,t,n,i,s);else if(function(e,t,n,r){var o=e.pageSize().height,a=r.settings.margin,l=o-(a.top+a.bottom);"body"===t.section&&(l-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var i=t.getMinimumRowHeight(r.columns,e),s=i<n;if(i>l)return console.error("Will not be able to print row ".concat(t.index," correctly since it's minimum height is larger than page height")),!0;if(!s)return!1;var c=t.hasRowSpan(r.columns);return t.getMaxCellHeight(r.columns)>l?(c&&console.error("The content of row ".concat(t.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!c&&"avoid"!==r.settings.rowPageBreak}(e,n,c,t)){var u=function(e,t,n,r){var a={};e.spansMultiplePages=!0,e.height=0;for(var i=0,s=0,c=n.columns;s<c.length;s++){var u=c[s];if(v=e.cells[u.index]){Array.isArray(v.text)||(v.text=[v.text]);var d=new o.Cell(v.raw,v.styles,v.section);(d=(0,l.assign)(d,v)).text=[];var h=f(v,t,r);v.text.length>h&&(d.text=v.text.splice(h,v.text.length));var p=r.scaleFactor(),m=r.getLineHeightFactor();v.contentHeight=v.getContentHeight(p,m),v.contentHeight>=t&&(v.contentHeight=t,d.styles.minCellHeight-=t),v.contentHeight>e.height&&(e.height=v.contentHeight),d.contentHeight=d.getContentHeight(p,m),d.contentHeight>i&&(i=d.contentHeight),a[u.index]=d}}var g=new o.Row(e.raw,-1,e.section,a,!0);g.height=i;for(var y=0,b=n.columns;y<b.length;y++){var v;u=b[y],(d=g.cells[u.index])&&(d.height=g.height),(v=e.cells[u.index])&&(v.height=e.height)}return g}(n,c,t,e);p(e,t,n,i,s),y(e,t,a,i,s),h(e,t,u,r,a,i,s)}else y(e,t,a,i,s),h(e,t,n,r,a,i,s)}function p(e,t,n,r,o){r.x=t.settings.margin.left;for(var a=0,l=o;a<l.length;a++){var s=l[a],c=n.cells[s.index];if(c)if(e.applyStyles(c.styles),c.x=r.x,c.y=r.y,!1!==t.callCellHooks(e,t.hooks.willDrawCell,c,n,s,r)){m(e,c,r);var u=c.getTextPos();(0,i.default)(c.text,u.x,u.y,{halign:c.styles.halign,valign:c.styles.valign,maxWidth:Math.ceil(c.width-c.padding("left")-c.padding("right"))},e.getDocument()),t.callCellHooks(e,t.hooks.didDrawCell,c,n,s,r),r.x+=s.width}else r.x+=s.width;else r.x+=s.width}r.y+=n.height}function m(e,t,n){var o=t.styles;if(e.getDocument().setFillColor(e.getDocument().getFillColor()),"number"==typeof o.lineWidth){var a=(0,r.getFillStyle)(o.lineWidth,o.fillColor);a&&e.rect(t.x,n.y,t.width,t.height,a)}else"object"==typeof o.lineWidth&&(o.fillColor&&e.rect(t.x,n.y,t.width,t.height,"F"),function(e,t,n,r){var o,a,l,i;function s(t,n,r,o,a){e.getDocument().setLineWidth(t),e.getDocument().line(n,r,o,a,"S")}r.top&&(o=n.x,a=n.y,l=n.x+t.width,i=n.y,r.right&&(l+=.5*r.right),r.left&&(o-=.5*r.left),s(r.top,o,a,l,i)),r.bottom&&(o=n.x,a=n.y+t.height,l=n.x+t.width,i=n.y+t.height,r.right&&(l+=.5*r.right),r.left&&(o-=.5*r.left),s(r.bottom,o,a,l,i)),r.left&&(o=n.x,a=n.y,l=n.x,i=n.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(i+=.5*r.bottom),s(r.left,o,a,l,i)),r.right&&(o=n.x+t.width,a=n.y,l=n.x+t.width,i=n.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(i+=.5*r.bottom),s(r.right,o,a,l,i))}(e,t,n,o.lineWidth))}function g(e,t,n,r){var o=t.settings.margin.bottom,a=t.settings.showFoot;return("everyPage"===a||"lastPage"===a&&n)&&(o+=t.getFootHeight(t.columns)),e.pageSize().height-r.y-o}function y(e,t,n,o,a,l){void 0===a&&(a=[]),void 0===l&&(l=!1),e.applyStyles(e.userStyles),"everyPage"!==t.settings.showFoot||l||t.foot.forEach((function(n){return p(e,t,n,o,a)})),t.callEndPageHooks(e,o);var i=t.settings.margin;(0,r.addTableBorder)(e,t,n,o),b(e),t.pageNumber++,t.pageCount++,o.x=i.left,o.y=i.top,n.y=i.top,t.callWillDrawPageHooks(e,o),"everyPage"===t.settings.showHead&&(t.head.forEach((function(n){return p(e,t,n,o,a)})),e.applyStyles(e.userStyles))}function b(e){var t=e.pageNumber();return e.setPage(t+1),e.pageNumber()===t&&(e.addPage(),!0)}t.drawTable=function(e,t){var n=t.settings,o=n.startY,i=n.margin,f={x:i.left,y:o},m=t.getHeadHeight(t.columns)+t.getFootHeight(t.columns),g=o+i.bottom+m;"avoid"===n.pageBreak&&(g+=t.body.reduce((function(e,t){return e+t.height}),0));var v=new a.DocHandler(e);("always"===n.pageBreak||null!=n.startY&&g>v.pageSize().height)&&(b(v),f.y=i.top),t.callWillDrawPageHooks(v,f);var w=(0,l.assign)({},f);t.startPageNumber=v.pageNumber(),n.horizontalPageBreak?function(e,t,n,r){var o=(0,s.calculateAllColumnsCanFitInPage)(e,t),a=t.settings;if("afterAllRows"===a.horizontalPageBreakBehaviour)o.forEach((function(o,a){e.applyStyles(e.userStyles),a>0?y(e,t,n,r,o.columns,!0):c(e,t,r,o.columns),function(e,t,n,r,o){e.applyStyles(e.userStyles),t.body.forEach((function(a,l){var i=l===t.body.length-1;h(e,t,a,i,n,r,o)}))}(e,t,n,r,o.columns),d(e,t,r,o.columns)}));else for(var l=-1,i=o[0],f=function(){var a=l;if(i){e.applyStyles(e.userStyles);var s=i.columns;l>=0?y(e,t,n,r,s,!0):c(e,t,r,s),a=u(e,t,l+1,r,s),d(e,t,r,s)}var f=a-l;o.slice(1).forEach((function(o){e.applyStyles(e.userStyles),y(e,t,n,r,o.columns,!0),u(e,t,l+1,r,o.columns,f),d(e,t,r,o.columns)})),l=a};l<t.body.length-1;)f()}(v,t,w,f):(v.applyStyles(v.userStyles),"firstPage"!==n.showHead&&"everyPage"!==n.showHead||t.head.forEach((function(e){return p(v,t,e,f,t.columns)})),v.applyStyles(v.userStyles),t.body.forEach((function(e,n){var r=n===t.body.length-1;h(v,t,e,r,w,f,t.columns)})),v.applyStyles(v.userStyles),"lastPage"!==n.showFoot&&"everyPage"!==n.showFoot||t.foot.forEach((function(e){return p(v,t,e,f,t.columns)}))),(0,r.addTableBorder)(v,t,w,f),t.callEndPageHooks(v,f),t.finalY=f.y,e.lastAutoTable=t,e.previousAutoTable=t,e.autoTable&&(e.autoTable.previous=t),v.applyStyles(v.userStyles)},t.addPage=y},224:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateAllColumnsCanFitInPage=void 0;var r=n(420);function o(e,t,n){var o;void 0===n&&(n={});var a=(0,r.getPageAvailableWidth)(e,t),l=new Map,i=[],s=[],c=[];t.settings.horizontalPageBreakRepeat,Array.isArray(t.settings.horizontalPageBreakRepeat)?c=t.settings.horizontalPageBreakRepeat:"string"!=typeof t.settings.horizontalPageBreakRepeat&&"number"!=typeof t.settings.horizontalPageBreakRepeat||(c=[t.settings.horizontalPageBreakRepeat]),c.forEach((function(e){var n=t.columns.find((function(t){return t.dataKey===e||t.index===e}));n&&!l.has(n.index)&&(l.set(n.index,!0),i.push(n.index),s.push(t.columns[n.index]),a-=n.wrappedWidth)}));for(var u=!0,d=null!==(o=null==n?void 0:n.start)&&void 0!==o?o:0;d<t.columns.length;)if(l.has(d))d++;else{var f=t.columns[d].wrappedWidth;if(!(u||a>=f))break;u=!1,i.push(d),s.push(t.columns[d]),a-=f,d++}return{colIndexes:i,columns:s,lastIndex:d-1}}t.calculateAllColumnsCanFitInPage=function(e,t){for(var n=[],r=0;r<t.columns.length;r++){var a=o(e,t,{start:r});a.columns.length&&(n.push(a),r=a.lastIndex)}return n}},324:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ellipsize=t.resizeColumns=t.calculateWidths=void 0;var r=n(420);function o(e,t,n){for(var r=t,a=e.reduce((function(e,t){return e+t.wrappedWidth}),0),l=0;l<e.length;l++){var i=e[l],s=r*(i.wrappedWidth/a),c=i.width+s,u=n(i),d=c<u?u:c;t-=d-i.width,i.width=d}if(t=Math.round(1e10*t)/1e10){var f=e.filter((function(e){return!(t<0)||e.width>n(e)}));f.length&&(t=o(f,t,n))}return t}function a(e,t,n,o,a){return e.map((function(e){return function(e,t,n,o,a){var l=1e4*o.scaleFactor();if((t=Math.ceil(t*l)/l)>=(0,r.getStringWidth)(e,n,o))return e;for(;t<(0,r.getStringWidth)(e+a,n,o)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+a}(e,t,n,o,a)}))}t.calculateWidths=function(e,t){!function(e,t){var n=e.scaleFactor(),o=t.settings.horizontalPageBreak,a=(0,r.getPageAvailableWidth)(e,t);t.allRows().forEach((function(l){for(var i=0,s=t.columns;i<s.length;i++){var c=s[i],u=l.cells[c.index];if(u){var d=t.hooks.didParseCell;t.callCellHooks(e,d,u,l,c,null);var f=u.padding("horizontal");u.contentWidth=(0,r.getStringWidth)(u.text,u.styles,e)+f;var h=(0,r.getStringWidth)(u.text.join(" ").split(/[^\S\u00A0]+/),u.styles,e);if(u.minReadableWidth=h+u.padding("horizontal"),"number"==typeof u.styles.cellWidth)u.minWidth=u.styles.cellWidth,u.wrappedWidth=u.styles.cellWidth;else if("wrap"===u.styles.cellWidth||!0===o)u.contentWidth>a?(u.minWidth=a,u.wrappedWidth=a):(u.minWidth=u.contentWidth,u.wrappedWidth=u.contentWidth);else{var p=10/n;u.minWidth=u.styles.minCellWidth||p,u.wrappedWidth=u.contentWidth,u.minWidth>u.wrappedWidth&&(u.wrappedWidth=u.minWidth)}}}})),t.allRows().forEach((function(e){for(var n=0,r=t.columns;n<r.length;n++){var o=r[n],a=e.cells[o.index];if(a&&1===a.colSpan)o.wrappedWidth=Math.max(o.wrappedWidth,a.wrappedWidth),o.minWidth=Math.max(o.minWidth,a.minWidth),o.minReadableWidth=Math.max(o.minReadableWidth,a.minReadableWidth);else{var l=t.styles.columnStyles[o.dataKey]||t.styles.columnStyles[o.index]||{},i=l.cellWidth||l.minCellWidth;i&&"number"==typeof i&&(o.minWidth=i,o.wrappedWidth=i)}a&&(a.colSpan>1&&!o.minWidth&&(o.minWidth=a.minWidth),a.colSpan>1&&!o.wrappedWidth&&(o.wrappedWidth=a.minWidth))}}))}(e,t);var n=[],l=0;t.columns.forEach((function(e){var r=e.getMaxCustomCellWidth(t);r?e.width=r:(e.width=e.wrappedWidth,n.push(e)),l+=e.width}));var i=t.getWidth(e.pageSize().width)-l;i&&(i=o(n,i,(function(e){return Math.max(e.minReadableWidth,e.minWidth)}))),i&&(i=o(n,i,(function(e){return e.minWidth}))),i=Math.abs(i),!t.settings.horizontalPageBreak&&i>.1/e.scaleFactor()&&(i=i<1?i:Math.round(i),console.warn("Of the table content, ".concat(i," units width could not fit page"))),function(e){for(var t=e.allRows(),n=0;n<t.length;n++)for(var r=t[n],o=null,a=0,l=0,i=0;i<e.columns.length;i++){var s=e.columns[i];if((l-=1)>1&&e.columns[i+1])a+=s.width,delete r.cells[s.index];else if(o){var c=o;delete r.cells[s.index],o=null,c.width=s.width+a}else{if(!(c=r.cells[s.index]))continue;if(l=c.colSpan,a=0,c.colSpan>1){o=c,a+=s.width;continue}c.width=s.width+a}}}(t),function(e,t){for(var n={count:0,height:0},r=0,o=e.allRows();r<o.length;r++){for(var l=o[r],i=0,s=e.columns;i<s.length;i++){var c=s[i],u=l.cells[c.index];if(u){t.applyStyles(u.styles,!0);var d=u.width-u.padding("horizontal");if("linebreak"===u.styles.overflow)u.text=t.splitTextToSize(u.text,d+1/t.scaleFactor(),{fontSize:u.styles.fontSize});else if("ellipsize"===u.styles.overflow)u.text=a(u.text,d,u.styles,t,"...");else if("hidden"===u.styles.overflow)u.text=a(u.text,d,u.styles,t,"");else if("function"==typeof u.styles.overflow){var f=u.styles.overflow(u.text,d);u.text="string"==typeof f?[f]:f}u.contentHeight=u.getContentHeight(t.scaleFactor(),t.getLineHeightFactor());var h=u.contentHeight/u.rowSpan;u.rowSpan>1&&n.count*n.height<h*u.rowSpan?n={height:h,count:u.rowSpan}:n&&n.count>0&&n.height>h&&(h=n.height),h>l.height&&(l.height=h)}}n.count--}}(t,e),function(e){for(var t={},n=1,r=e.allRows(),o=0;o<r.length;o++)for(var a=r[o],l=0,i=e.columns;l<i.length;l++){var s=i[l],c=t[s.index];if(n>1)n--,delete a.cells[s.index];else if(c)c.cell.height+=a.height,n=c.cell.colSpan,delete a.cells[s.index],c.left--,c.left<=1&&delete t[s.index];else{var u=a.cells[s.index];if(!u)continue;if(u.height=a.height,u.rowSpan>1){var d=r.length-o,f=u.rowSpan>d?d:u.rowSpan;t[s.index]={cell:u,left:f,row:a}}}}}(t)},t.resizeColumns=o,t.ellipsize=a},964:function(t){if(void 0===e){var n=new Error("Cannot find module 'undefined'");throw n.code="MODULE_NOT_FOUND",n}t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}var o={};return function(){var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.Cell=e.Column=e.Row=e.Table=e.CellHookData=e.__drawTable=e.__createTable=e.applyPlugin=void 0;var t=r(340),n=r(776),a=r(664),l=r(972),i=r(260);Object.defineProperty(e,"Table",{enumerable:!0,get:function(){return i.Table}});var s=r(172);Object.defineProperty(e,"CellHookData",{enumerable:!0,get:function(){return s.CellHookData}});var c=r(260);function u(e){(0,t.default)(e)}Object.defineProperty(e,"Cell",{enumerable:!0,get:function(){return c.Cell}}),Object.defineProperty(e,"Column",{enumerable:!0,get:function(){return c.Column}}),Object.defineProperty(e,"Row",{enumerable:!0,get:function(){return c.Row}}),e.applyPlugin=u,e.__createTable=function(e,t){var r=(0,n.parseInput)(e,t);return(0,l.createTable)(e,r)},e.__drawTable=function(e,t){(0,a.drawTable)(e,t)};try{var d=r(964);d.jsPDF&&(d=d.jsPDF),u(d)}catch(e){}e.default=function(e,t){var r=(0,n.parseInput)(e,t),o=(0,l.createTable)(e,r);(0,a.drawTable)(e,o)}}(),o}()},O(function(){try{return require("jspdf")}catch(e){}}());var M={xs:"text-xs [&>_tbody>*_td]:p-0.5 [&>_tbody>*_th]:p-0.5",sm:"text-sm [&>_tbody>*_td]:p-1 [&>_tbody>*_th]:p-1 ",md:"text-base [&>_tbody>*_td]:p-1.5 [&>_tbody>*_th]:p-1.5",lg:"text-lg [&>_tbody>*_td]:p-2 [&>_tbody>*_th]:p-2 ",xl:"text-xl [&>_tbody>*_td]:p-2.5 [&>_tbody>*_th]:p-2.5"},L=o.createContext(void 0),R={xs:"px-2 py-1 text-xs",sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-5 py-2.5 text-lg",xl:"px-6 py-3 text-xl"},I={primary:"bg-primary text-white hover:bg-primary-600",secondary:"bg-secondary text-white hover:bg-secondary-600",success:"bg-success text-white hover:bg-success-600",warning:"bg-warning text-white hover:bg-warning-600",error:"bg-error text-white hover:bg-error-600",ghost:"bg-transparent text-gray-800 hover:bg-gray-100"},B=function(t){var n=t.item,r=t.depth,o=t.onItemClick,a=e.useState(!1),l=a[0],i=a[1],s=n.children&&n.children.length>0;return e.createElement(e.Fragment,null,e.createElement("li",null,e.createElement("a",{href:n.href||"#",className:"flex items-center px-4 py-2 hover:bg-gray-100 ".concat(r>0?"pl-8":""),onClick:function(e){s?(e.preventDefault(),i(!l)):o()}},n.icon&&e.createElement("span",{className:"mr-2"},n.icon),e.createElement("span",null,n.label),s&&e.createElement("svg",{className:"ml-auto h-4 w-4 tra