@bookipi/htmlgenerator 1.1.46-alpha7 → 1.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12658,7 +12658,6 @@ var language = {
12658
12658
  en: en
12659
12659
  };
12660
12660
  var contractHtml = (function (props) {
12661
- var _proposal$termTypes;
12662
12661
  var proposal = props.proposal,
12663
12662
  realTimeCompany = props.company,
12664
12663
  contractor = props.contractor,
@@ -12671,7 +12670,6 @@ var contractHtml = (function (props) {
12671
12670
  var items = ((proposal === null || proposal === void 0 ? void 0 : proposal.serviceItems) || []).filter(function (item) {
12672
12671
  return !!(item !== null && item !== void 0 && item.name);
12673
12672
  });
12674
- var headerTerm = (proposal === null || proposal === void 0 ? void 0 : (_proposal$termTypes = proposal.termTypes) === null || _proposal$termTypes === void 0 ? void 0 : _proposal$termTypes[0]) || null;
12675
12673
  var sections = ((proposal === null || proposal === void 0 ? void 0 : proposal.termsAndConditions) || []).filter(function (item) {
12676
12674
  return !(item !== null && item !== void 0 && item.isTermHidden);
12677
12675
  });
@@ -12683,15 +12681,13 @@ var contractHtml = (function (props) {
12683
12681
  customerName: (customer === null || customer === void 0 ? void 0 : customer.companyName) || "Customer Name",
12684
12682
  companyName: (company === null || company === void 0 ? void 0 : company.name) || " Supplier Name"
12685
12683
  };
12686
- var styles = "<style>\n .pageBreak {\n page-break-inside: avoid;\n }\n #proposal-generator {\n background-color: #ffffff;\n max-width: 21cm;\n padding: 8px;\n }\n #proposal-generator hr {\n display: block;\n height: 1px;\n background: transparent;\n width: 100%;\n border: none;\n border-top: solid 2px #f0f3fb;\n margin: 16px 0;\n }\n #proposal-generator span, p, b {\n line-height: 1.5;\n }\n #proposal-generator b {\n font-size: 16px;\n font-weight: 700;\n }\n #proposal-generator table {\n width: 100%;\n }\n #proposal-generator section:not(:first-child) {\n margin-top: 40px;\n }\n #proposal-generator .section-title {\n font-size: 18px;\n font-weight: 700;\n color: #263238;\n }\n #proposal-generator .proposal-title {\n margin-bottom: 16px;\n work-break:break-all\n }\n #proposal-generator .contact-title {\n font-size: 24px;\n }\n #proposal-generator .table-details {\n margin: 16px 0;\n }\n #proposal-generator .table-details tr td {\n width: 50%;\n vertical-align: top;\n word-break: break-word;\n page-break-inside: avoid;\n }\n #proposal-generator .agreement-date {\n margin-bottom: 16px;\n }\n #proposal-generator .table-service {\n border-collapse: collapse;\n }\n #proposal-generator .table-service tr {\n padding-top: 10px;\n padding-bottom: 10px;\n border-bottom: 1px solid rgb(221, 221, 221);\n }\n #proposal-generator .table-service tr td {\n width: 50%;\n padding: 8px;\n vertical-align: top;\n word-break: break-word;\n page-break-inside: avoid;\n }\n #proposal-generator .table-agreement tr td {\n padding-top: 24px;\n page-break-inside: avoid;\n }\n #proposal-generator .table-agreement tr:first-child td {\n padding-top: 0;\n }\n @print {\n #proposal-generator {\n padding: 0;\n }\n }\n @media only screen and (max-width: 480px) {\n #proposal-generator{\n background-color: #ffffff;\n max-width: 21cm;\n padding: 20px;\n }\n #proposal-generator .table-details tr td {\n width: 100%;\n display: block;\n margin:10px 0px;\n }\n }\n @font-face {\n font-family: 'journal';\n src: local('journal'), url(data:font/ttf;base64," + fontJournal + ") format('truetype');\n }\n \n .signature {\n font-family: 'journal', sans-serif;\n font-size: 40px;\n font-weight: 600;\n color: #595959;\n }\n </style>";
12687
- var isProposalAI = !!headerTerm;
12684
+ var styles = "<style>\n .pageBreak {\n page-break-inside: avoid;\n }\n #proposal-generator {\n background-color: #ffffff;\n max-width: 21cm;\n padding: 8px;\n }\n #proposal-generator hr {\n display: block;\n height: 1px;\n background: transparent;\n width: 100%;\n border: none;\n border-top: solid 2px #f0f3fb;\n margin: 16px 0;\n }\n #proposal-generator span, p, b {\n line-height: 1.5;\n }\n #proposal-generator b {\n font-size: 16px;\n font-weight: 700;\n }\n #proposal-generator table {\n width: 100%;\n }\n #proposal-generator section:not(:first-child) {\n margin-top: 40px;\n }\n #proposal-generator .section-title {\n font-size: 18px;\n font-weight: 700;\n color: #263238;\n }\n #proposal-generator .proposal-title {\n margin-bottom: 16px;\n work-break:break-all\n }\n #proposal-generator .contact-title {\n font-size: 24px;\n }\n #proposal-generator .table-details {\n margin: 16px 0;\n }\n #proposal-generator .table-details tr td {\n width: 50%;\n vertical-align: top;\n word-break: break-word;\n page-break-inside: avoid;\n }\n #proposal-generator .agreement-date {\n margin-bottom: 16px;\n }\n #proposal-generator .table-service {\n border-collapse: collapse;\n }\n #proposal-generator .table-service tr {\n padding-top: 10px;\n padding-bottom: 10px;\n border-bottom: 1px solid rgb(221, 221, 221);\n }\n #proposal-generator .table-service tr td {\n width: 50%;\n padding: 8px;\n vertical-align: top;\n word-break: break-word;\n page-break-inside: avoid;\n }\n #proposal-generator .table-agreement tr td {\n padding-top: 24px;\n page-break-inside: avoid;\n }\n @print {\n #proposal-generator {\n padding: 0;\n }\n }\n @media only screen and (max-width: 480px) {\n #proposal-generator{\n background-color: #ffffff;\n max-width: 21cm;\n padding: 20px;\n }\n #proposal-generator .table-details tr td {\n width: 100%;\n display: block;\n margin:10px 0px;\n }\n }\n @font-face {\n font-family: 'journal';\n src: local('journal'), url(data:font/ttf;base64," + fontJournal + ") format('truetype');\n }\n \n .signature {\n font-family: 'journal', sans-serif;\n font-size: 40px;\n font-weight: 600;\n color: #595959;\n }\n </style>";
12688
12685
  var sectionHeader = "<section>";
12689
- var headerTitle = (t ? t(lang === null || lang === void 0 ? void 0 : lang.service_agreement) : lang === null || lang === void 0 ? void 0 : lang.service_agreement) || "";
12690
- sectionHeader += "<h2 class=\"section-title contact-title\">" + (isProposalAI ? headerTerm.termHeading : headerTitle) + "</h2>";
12686
+ sectionHeader += "<h2 class=\"section-title contact-title\">" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.service_agreement) : lang === null || lang === void 0 ? void 0 : lang.service_agreement) || "") + "</h2>";
12691
12687
  sectionHeader += "<hr />";
12692
12688
  sectionHeader += "</section>";
12693
- var sectionUserInfo = isProposalAI ? "<div>" : "<section>";
12694
- sectionUserInfo += isProposalAI ? "<span>" + headerTerm.termContent + "</span><br/>" : "<h5 class=\"section-title proposal-title\" style=\"word-break: break-all\">" + ((proposal === null || proposal === void 0 ? void 0 : proposal.title) || "") + "</h5>";
12689
+ var sectionUserInfo = "<section>";
12690
+ sectionUserInfo += "<h5 class=\"section-title proposal-title\" style=\"word-break: break-all\">" + ((proposal === null || proposal === void 0 ? void 0 : proposal.title) || "") + "</h5>";
12695
12691
  sectionUserInfo += "<span>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.details_line_1) : lang === null || lang === void 0 ? void 0 : lang.details_line_1) || "") + "</span>";
12696
12692
  sectionUserInfo += "<br />";
12697
12693
  sectionUserInfo += "<span>" + (lang === null || lang === void 0 ? void 0 : lang.details_line_3(t ? t(lang === null || lang === void 0 ? void 0 : lang.details_line_3_1) : lang === null || lang === void 0 ? void 0 : lang.details_line_3_1, proposal !== null && proposal !== void 0 && proposal.expirationDate ? formatDate(proposal.expirationDate, company || {}, "", momentLocale) : formatDate(new Date(), company || {}, "", momentLocale), t ? t(lang === null || lang === void 0 ? void 0 : lang.details_line_3_2) : lang === null || lang === void 0 ? void 0 : lang.details_line_3_2)) + "</span>";
@@ -12737,14 +12733,12 @@ var contractHtml = (function (props) {
12737
12733
  sectionUserInfo += "<p class=\"agreement-date\"><b>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.effective_date) : lang === null || lang === void 0 ? void 0 : lang.effective_date) || "") + ":</b> " + (proposal !== null && proposal !== void 0 && proposal.effectiveDate ? formatDate(proposal.effectiveDate, company || {}, "", momentLocale) : "") + "</p>";
12738
12734
  sectionUserInfo += "<p class=\"agreement-date\"><b>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.start_date) : lang === null || lang === void 0 ? void 0 : lang.start_date) || "") + ":</b> " + (proposal !== null && proposal !== void 0 && proposal.startDate ? formatDate(proposal.startDate, company || {}, "", momentLocale) : "") + "</p>";
12739
12735
  sectionUserInfo += "<p class=\"agreement-date\"><b>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.end_date) : lang === null || lang === void 0 ? void 0 : lang.end_date) || "") + ":</b> " + endDate(proposal, company || {}, momentLocale) + "</p>";
12740
- if (!isProposalAI) {
12741
- sectionUserInfo += "<div style=\"margin: 6px 0\">";
12742
- sectionUserInfo += "<span>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.details_line_4) : lang === null || lang === void 0 ? void 0 : lang.details_line_4) || "") + "</span><br />";
12743
- sectionUserInfo += "</div>";
12744
- sectionUserInfo += "<p style=\"margin: 6px 0\">" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.kind_regards) : lang === null || lang === void 0 ? void 0 : lang.kind_regards) || "") + ",</p>";
12745
- sectionUserInfo += "<b>" + ((contractor === null || contractor === void 0 ? void 0 : contractor.firstName) || "") + " " + ((contractor === null || contractor === void 0 ? void 0 : contractor.lastName) || "") + "</b><br />";
12746
- }
12747
- sectionUserInfo += isProposalAI ? "</div>" : "</section>";
12736
+ sectionUserInfo += "<div style=\"margin: 6px 0\">";
12737
+ sectionUserInfo += "<span>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.details_line_4) : lang === null || lang === void 0 ? void 0 : lang.details_line_4) || "") + "</span><br />";
12738
+ sectionUserInfo += "</div>";
12739
+ sectionUserInfo += "<p style=\"margin: 6px 0\">" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.kind_regards) : lang === null || lang === void 0 ? void 0 : lang.kind_regards) || "") + ",</p>";
12740
+ sectionUserInfo += "<b>" + ((contractor === null || contractor === void 0 ? void 0 : contractor.firstName) || "") + " " + ((contractor === null || contractor === void 0 ? void 0 : contractor.lastName) || "") + "</b><br />";
12741
+ sectionUserInfo += "</section>";
12748
12742
  var sectionServices = "<section>";
12749
12743
  sectionServices += "<h5 class=\"section-title\">" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.services_title) : lang === null || lang === void 0 ? void 0 : lang.services_title) || "") + "</h5>";
12750
12744
  sectionServices += "<hr />";
@@ -12753,7 +12747,7 @@ var contractHtml = (function (props) {
12753
12747
  items.forEach(function (it) {
12754
12748
  var taxTitle = t ? getTaxTitle(it, true).replace('including', t('including')).replace('excluding', t('excluding')).replace('Add Tax', t('Add Tax')) : getTaxTitle(it, true);
12755
12749
  sectionServices += "<tr><td>";
12756
- if (it.billingType !== "none" || isProposalAI) {
12750
+ if (it.billingType !== "none") {
12757
12751
  sectionServices += "<b>" + FormatCurrency$5(((it === null || it === void 0 ? void 0 : it.price) || 0) * ((it === null || it === void 0 ? void 0 : it.quantity) || 0), (company === null || company === void 0 ? void 0 : company.currency) || "USD", (company === null || company === void 0 ? void 0 : company.language) || "en", (company === null || company === void 0 ? void 0 : company.currencyFormat) || "") + "</b>";
12758
12752
  sectionServices += " " + taxTitle;
12759
12753
  sectionServices += "</br>";
@@ -12774,11 +12768,9 @@ var contractHtml = (function (props) {
12774
12768
  sectionServices += "" + (it === null || it === void 0 ? void 0 : (_it$description = it.description) === null || _it$description === void 0 ? void 0 : _it$description.replace(/(?:\r\n|\r|\n)/g, "<br />"));
12775
12769
  sectionServices += "</div>";
12776
12770
  }
12777
- if (!isProposalAI) {
12778
- sectionServices += '</td><td align="right">';
12779
- sectionServices += "<p>" + (getBilling(it, proposal, company, t) + "</p>");
12780
- sectionServices += "</td></tr>";
12781
- }
12771
+ sectionServices += '</td><td align="right">';
12772
+ sectionServices += "<p>" + (getBilling(it, proposal, company, t) + "</p>");
12773
+ sectionServices += "</td></tr>";
12782
12774
  });
12783
12775
  } else {
12784
12776
  sectionServices += '<tr style="border:none;"><td style="border: unset;">' + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.items_empty) : lang === null || lang === void 0 ? void 0 : lang.items_empty) || "") + "</td></tr>";
@@ -12843,6 +12835,7 @@ var contractHtml = (function (props) {
12843
12835
  });
12844
12836
 
12845
12837
  var subscriptionInvoiceHtml = (function (_ref) {
12838
+ var _invoiceItems$filter;
12846
12839
  var vendor = _ref.vendor,
12847
12840
  invoice = _ref.invoice,
12848
12841
  customer = _ref.customer,
@@ -12851,9 +12844,7 @@ var subscriptionInvoiceHtml = (function (_ref) {
12851
12844
  t = _ref.t;
12852
12845
  var _ref2 = vendor != null ? vendor : {},
12853
12846
  vendorName = _ref2.name,
12854
- logoUrl = _ref2.logoUrl,
12855
- businessNumber = _ref2.businessNumber,
12856
- address = _ref2.address;
12847
+ logoUrl = _ref2.logoUrl;
12857
12848
  var _ref3 = invoice != null ? invoice : {},
12858
12849
  invoiceNumber = _ref3.no,
12859
12850
  total = _ref3.total,
@@ -12889,68 +12880,31 @@ var subscriptionInvoiceHtml = (function (_ref) {
12889
12880
  amount: t ? t('Amount') : 'Amount',
12890
12881
  totalCharged: t ? t('Total charged') : 'Total charged'
12891
12882
  };
12892
- var productItems = invoiceItems.filter(function (item) {
12883
+ var productItems = (_invoiceItems$filter = invoiceItems.filter(function (item) {
12893
12884
  return item.type === 'product';
12894
- });
12885
+ })) != null ? _invoiceItems$filter : [];
12895
12886
  var subtotalItem = invoiceItems.find(function (item) {
12896
12887
  return item.type === 'subtotal';
12897
12888
  });
12898
12889
  var taxItem = invoiceItems.find(function (item) {
12899
12890
  return item.type === 'tax';
12900
12891
  });
12901
- var discountItems = invoiceItems.filter(function (item) {
12892
+ var discountItem = invoiceItems.find(function (item) {
12902
12893
  return item.type === 'discount';
12903
12894
  });
12904
- if (discountItems.length === 0) {
12905
- discountItems = productItems.map(function (item) {
12906
- return item.discount > 0 ? {
12907
- type: 'discount',
12908
- name: 'Previous subscription discount',
12909
- total: item.discount
12910
- } : null;
12911
- });
12912
- }
12913
- var renderDiscount = function renderDiscount(discountItem) {
12914
- if (!discountItem) {
12915
- return '';
12916
- }
12917
- return "<div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + discountItem.name + "</div>\n </div>\n <div style=\"font-size:16px;color:#C81E1E;\">\n -" + formatPrice(discountItem.total, currency) + "\n </div>\n </div>\n </div>";
12918
- };
12919
- var renderItem = function renderItem(item, type, index) {
12920
- if (index === void 0) {
12921
- index = 0;
12922
- }
12923
- var title = item.description || item.name;
12895
+ var renderItem = function renderItem(item, type) {
12896
+ var title = isDiscount ? item.name : item.description || item.name;
12924
12897
  var itemLang = {
12925
12898
  title: t ? t(title) : title,
12926
12899
  description: t ? t(item.description) : item.description
12927
12900
  };
12928
- var discountItem = type === 'product' ? discountItems[index] : null;
12929
- return "\n <div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + itemLang.title + "</div>\n </div>\n <div style=\"font-size:16px;color:inherit;\">\n " + formatPrice(item.total, currency) + "\n </div>\n </div>\n </div>\n " + renderDiscount(discountItem) + "\n ";
12930
- };
12931
- var renderItems = function renderItems(items, type) {
12932
- var rendered = '';
12933
- items.forEach(function (item, index) {
12934
- rendered += renderItem(item, type, index);
12935
- });
12936
- return rendered;
12901
+ var isDiscount = type === 'discount';
12902
+ return "\n <div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + itemLang.title + "</div>\n " + (isDiscount ? "<div class=\"invoice-subtitle4\">" + itemLang.description + "</div>" : '') + "\n </div>\n <div style=\"font-size:16px;color:" + (isDiscount ? '#C81E1E' : 'inherit') + ";\">\n " + (isDiscount ? '-' : '') + formatPrice(item.total, currency) + "\n </div>\n </div>\n </div>\n ";
12937
12903
  };
12938
- var renderAddressItems = function renderAddressItems(addressItems) {
12939
- if (addressItems === void 0) {
12940
- addressItems = [];
12941
- }
12942
- return addressItems.filter(function (item) {
12943
- return !!item;
12944
- }).join(', ');
12945
- };
12946
- var hasDiscount = discountItems.some(function (item) {
12947
- return item.total > 0;
12948
- });
12904
+ var hasDiscount = discountItem && (discountItem === null || discountItem === void 0 ? void 0 : discountItem.total) > 0;
12949
12905
  var hasTax = taxItem && (taxItem === null || taxItem === void 0 ? void 0 : taxItem.total) > 0;
12950
12906
  var hasSubtotal = subtotalItem && (subtotalItem === null || subtotalItem === void 0 ? void 0 : subtotalItem.total) > 0;
12951
- var hasAddressLine = (address === null || address === void 0 ? void 0 : address.address1) || (address === null || address === void 0 ? void 0 : address.address2) || (address === null || address === void 0 ? void 0 : address.address3);
12952
- var hasAddress = (address === null || address === void 0 ? void 0 : address.city) || (address === null || address === void 0 ? void 0 : address.zip) || (address === null || address === void 0 ? void 0 : address.country);
12953
- var html = "\n " + (includeHtmlWrapper ? '<!DOCTYPE html>\n<html>\n<head>\n<meta charset="utf-8">\n<title>Invoice</title>' : "") + "\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;900&family=Lato:wght@400;700&display=swap');\n .bookipay-invoice {\n width: 100%;\n max-width: 600px;\n background-color: white;\n display:flex;\n border-radius: 16px;\n flex-direction: column;\n overflow: hidden;\n font-family: 'Inter', sans-serif;\n line-height: 1.2;\n color: black;\n font-size: 16px;\n }\n .invoice-content {\n padding: 40px 30px;\n }\n .invoice-header {\n display: flex;\n padding: 10px;\n margin-bottom: 40px;\n justify-content: space-between;\n }\n .invoice-footer {\n padding: 30px 38px 40px;\n background-color: rgb(245, 246, 250);\n }\n .invoice-footer p {\n display: block;\n margin: 0;\n }\n .invoice-footer-logo {\n height: 20px;\n margin-bottom: 12px;\n }\n .invoice-logo {\n object-fit: contain;\n max-height: 52px;\n width: auto;\n height: auto;\n }\n .invoice-body {\n color: color: rgb(15, 23, 42);\n font-size: 16px;\n }\n .invoice-company {\n text-align: right;\n }\n .invoice-spacing {\n margin-bottom: 4px;\n }\n .invoice-semi-bold {\n color: rgb(15, 23, 42);\n font-weight: 600;\n font-size: 16px;\n }\n .invoice-bold {\n font-family: 'Lato', sans-serif;\n color: black;\n font-weight: 700;\n font-size: 20px;\n }\n .invoice-subtitle {\n color: rgba(0, 0, 0, 0.6);\n font-size: 14px;\n }\n .invoice-subtitle2 {\n color: rgb(147, 154, 172);\n font-size: 14px;\n }\n .invoice-subtitle3 {\n color: rgb(100, 116, 139);\n font-size: 14px;\n }\n .invoice-subtitle4 {\n font-size: 10px;\n }\n .invoice-summary {\n background-color: rgb(245, 246, 250);\n padding: 32px 24px;\n border-radius: 16px;\n margin-bottom: 40px;\n }\n .invoice-summary-total {\n display: flex;\n margin-top: 24px;\n flex-direction: column;\n }\n .invoice-summary-customer {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n text-align: left;\n }\n .invoice-customer-email {\n margin-left: 8px;\n }\n .invoice-order-header {\n padding: 8px 0;\n margin-bottom: 8px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n display: flex;\n justify-content: space-between;\n }\n .invoice-order-container {\n display: flex;\n justify-content: space-between;\n }\n .invoice-order-item {\n padding: 12px 0px 5px;\n }\n .invoice-order-details {\n display: flex;\n justify-content: space-between;\n }\n .invoice-tax {\n display: flex;\n justify-content:space-between;\n margin-top: 8px;\n }\n .invoice-payment {\n display: flex;\n padding: 12px 0px 16px;\n justify-content: space-between;\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n margin-top: 15px;\n }\n .invoice-card {\n display: flex;\n }\n .invoice-card img {\n height: 18px;\n margin-right: 6px;\n }\n .invoice-bill-to {\n display: none;\n }\n @media (max-width: 600px) {\n .bookipay-invoice {\n border-radius: 0;\n }\n }\n @media (max-width: 799px) {\n .invoice-header {\n flex-direction: column;\n padding: 10px 0;\n }\n .invoice-company {\n text-align: left;\n }\n .invoice-logo {\n max-width: 100px;\n margin-bottom: 16px;\n }\n .invoice-header, .invoice-summary {\n margin-bottom: 20px;\n }\n .invoice-summary {\n margin-left: -30px;\n margin-right: -30px;\n border-radius: 0;\n padding: 32px 30px;\n }\n .invoice-content {\n padding: 20px 30px;\n }\n .invoice-bill-to {\n display: flex;\n }\n }\n @media (max-width: 399px) {\n .footer-actions {\n flex-direction: column;\n }\n .footer-action {\n margin-bottom: 12px;\n }\n footer {\n margin: 30px 0;\n }\n footer p {\n margin-top: 0;\n }\n }\n @media print {\n * {\n color-adjust: exact;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n .invoice-footer {\n width: 100%;\n max-width: 100%;\n margin: 0;\n }\n .bookipay-invoice {\n max-width: 100%;\n }\n @page { margin: 0; }\n body { margin: 1.6cm; }\n }\n </style>\n <div class=\"bookipay-invoice\">\n <div class=\"invoice-content\">\n <div class=\"invoice-header\">\n <img class=\"invoice-logo\" src=\"" + vendorLogoUrl + "\" />\n <div class=\"invoice-company\">\n <div class=\"invoice-company-name invoice-semi-bold invoice-spacing\">" + vendorName + "</div>\n <div class=\"invoice-number invoice-subtitle invoice-spacing\">" + defaultLang.invoiceNo + "</div>\n <div class=\"invoice-date invoice-subtitle invoice-spacing\">" + date + "</div>\n </div>\n </div>\n <div class=\"invoice-summary\">\n <div class=\"invoice-summary-customer\">\n <div>\n <div class=\"invoice-bold invoice-spacing\">" + companyName + "</div>\n " + (businessNumber ? "<div class=\"invoice-subtitle2\">" + businessNumber + "</div>" : '') + "\n " + (hasAddressLine ? "<div class=\"invoice-subtitle2\">" + renderAddressItems([address.address1, address.address2, address.address3]) + "</div>" : '') + "\n " + (hasAddress ? "<div class=\"invoice-subtitle2\">" + renderAddressItems([address.city, address.zip, address.country]) + "</div>" : '') + "\n </div>\n <div class=\"invoice-customer-email invoice-subtitle2\">" + email + "</div>\n </div>\n <div class=\"invoice-summary-total\">\n <div class=\"invoice-subtitle3 invoice-spacing\">" + defaultLang.total + "</div>\n <div class=\"invoice-summary-total-value invoice-bold invoice-spacing\">" + formatPrice(total, currency) + "</div>\n </div>\n </div>\n <div class=\"invoice-order\">\n <div class=\"invoice-order-header\">\n <div class=\"invoice-subtitle3\">" + defaultLang.item + "</div>\n <div class=\"invoice-subtitle3\">" + defaultLang.amount + "</div>\n </div>\n <div class=\"invoice-order-item-container\">\n " + renderItems(productItems, 'product') + "\n " + (hasDiscount && hasTax && hasSubtotal ? renderItem(subtotalItem, 'subtotal') : '') + "\n " + (hasTax ? renderItem(taxItem, 'tax') : '') + "\n <div class=\"invoice-payment\">\n <div class=\"invoice-bold\" style=\"font-size: 16px;\">" + defaultLang.totalCharged + "</div>\n <div class=\"invoice-body3\">\n <div class=\"invoice-bold invoice-spacing\" style=\"font-size: 18px;text-align: right;\">" + formatPrice(amountPaid, currency) + "</div>\n <div class=\"invoice-card\">\n <img src=" + cardLogo + " alt=" + cardBrand + " />\n <div class=\"invoice-semi-bold\" style=\"font-weight: 400;\">" + (cardBrand.charAt(0).toUpperCase() + cardBrand.slice(1)) + " \u2022\u2022\u2022\u2022 " + cardNumber + "</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"invoice-footer invoice-subtitle2\" style=\"font-size: 12px;\">\n <img class=\"invoice-footer-logo\" src=\"" + vendorLogoUrl + "\" />\n <!-- TODO: Dynamic company info -->\n <p>\xA92023 Bookipi Pty Ltd.</p>\n <p>9 George St, North Strathfield NSW 2137, Australia</p>\n <p>ABN: 91617668185</p>\n </div>\n </div>\n " + (includeHtmlWrapper ? "</body></html>" : "") + "\n ";
12907
+ var html = "\n " + (includeHtmlWrapper ? '<!DOCTYPE html>\n<html>\n<head>\n<meta charset="utf-8">\n<title>Invoice</title>' : "") + "\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;900&family=Lato:wght@400;700&display=swap');\n .bookipay-invoice {\n width: 100%;\n max-width: 600px;\n background-color: white;\n display:flex;\n border-radius: 16px;\n flex-direction: column;\n overflow: hidden;\n font-family: 'Inter', sans-serif;\n line-height: 1.2;\n color: black;\n font-size: 16px;\n }\n .invoice-content {\n padding: 40px 30px;\n }\n .invoice-header {\n display: flex;\n padding: 10px;\n margin-bottom: 40px;\n justify-content: space-between;\n }\n .invoice-footer {\n padding: 30px 38px 40px;\n background-color: rgb(245, 246, 250);\n }\n .invoice-footer p {\n display: block;\n margin: 0;\n }\n .invoice-footer-logo {\n height: 20px;\n margin-bottom: 12px;\n }\n .invoice-logo {\n object-fit: contain;\n max-height: 52px;\n width: auto;\n height: auto;\n }\n .invoice-body {\n color: color: rgb(15, 23, 42);\n font-size: 16px;\n }\n .invoice-company {\n text-align: right;\n }\n .invoice-spacing {\n margin-bottom: 4px;\n }\n .invoice-semi-bold {\n color: rgb(15, 23, 42);\n font-weight: 600;\n font-size: 16px;\n }\n .invoice-bold {\n font-family: 'Lato', sans-serif;\n color: black;\n font-weight: 700;\n font-size: 20px;\n }\n .invoice-subtitle {\n color: rgba(0, 0, 0, 0.6);\n font-size: 14px;\n }\n .invoice-subtitle2 {\n color: rgb(147, 154, 172);\n font-size: 14px;\n }\n .invoice-subtitle3 {\n color: rgb(100, 116, 139);\n font-size: 14px;\n }\n .invoice-subtitle4 {\n font-size: 10px;\n }\n .invoice-summary {\n background-color: rgb(245, 246, 250);\n padding: 32px 24px;\n border-radius: 16px;\n margin-bottom: 40px;\n }\n .invoice-summary-total {\n display: flex;\n margin-bottom: 16px;\n justify-content: space-between;\n }\n .invoice-summary-customer {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n text-align: right;\n }\n .invoice-order-header {\n padding: 8px 0;\n margin-bottom: 8px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n display: flex;\n justify-content: space-between;\n }\n .invoice-order-container {\n display: flex;\n justify-content: space-between;\n }\n .invoice-order-item {\n padding: 12px 0px 5px;\n }\n .invoice-order-details {\n display: flex;\n justify-content: space-between;\n }\n .invoice-tax {\n display: flex;\n justify-content:space-between;\n margin-top: 8px;\n }\n .invoice-payment {\n display: flex;\n padding: 12px 0px 16px;\n justify-content: space-between;\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n margin-top: 15px;\n }\n .invoice-card {\n display: flex;\n }\n .invoice-card img {\n height: 18px;\n margin-right: 6px;\n }\n .invoice-bill-to {\n display: none;\n }\n @media (max-width: 600px) {\n .bookipay-invoice {\n border-radius: 0;\n }\n }\n @media (max-width: 799px) {\n .invoice-header {\n flex-direction: column;\n padding: 10px 0;\n }\n .invoice-company {\n text-align: left;\n }\n .invoice-logo {\n max-width: 100px;\n margin-bottom: 16px;\n }\n .invoice-header, .invoice-summary {\n margin-bottom: 20px;\n }\n .invoice-summary {\n margin-left: -30px;\n margin-right: -30px;\n border-radius: 0;\n padding: 32px 30px;\n }\n .invoice-content {\n padding: 20px 30px;\n }\n .invoice-bill-to {\n display: flex;\n }\n }\n @media (max-width: 399px) {\n .footer-actions {\n flex-direction: column;\n }\n .footer-action {\n margin-bottom: 12px;\n }\n footer {\n margin: 30px 0;\n }\n footer p {\n margin-top: 0;\n }\n }\n @media print {\n * {\n color-adjust: exact;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n .invoice-footer {\n width: 100%;\n max-width: 100%;\n margin: 0;\n }\n .bookipay-invoice {\n max-width: 100%;\n }\n @page { margin: 0; }\n body { margin: 1.6cm; }\n }\n </style>\n <div class=\"bookipay-invoice\">\n <div class=\"invoice-content\">\n <div class=\"invoice-header\">\n <img class=\"invoice-logo\" src=\"" + vendorLogoUrl + "\" />\n <div class=\"invoice-company\">\n <div class=\"invoice-company-name invoice-semi-bold invoice-spacing\">" + vendorName + "</div>\n <div class=\"invoice-number invoice-subtitle invoice-spacing\">" + defaultLang.invoiceNo + "</div>\n <div class=\"invoice-date invoice-subtitle invoice-spacing\">" + date + "</div>\n </div>\n </div>\n <div class=\"invoice-summary\">\n <div class=\"invoice-summary-total\">\n <div class=\"invoice-summary-total-title invoice-semi-bold invoice-spacing\">" + defaultLang.total + "</div>\n <div class=\"invoice-summary-total-value invoice-bold invoice-spacing\">" + formatPrice(total, currency) + "</div>\n </div>\n <div class=\"invoice-summary-customer\">\n <div><div class=\"invoice-bill-to invoice-semi-bold invoice-spacing\">" + defaultLang.billTo + "</div></div>\n <div>\n <div class=\"invoice-bold invoice-spacing\">" + companyName + "</div>\n <div class=\"invoice-customer-email invoice-subtitle2\">" + email + "</div>\n </div>\n </div>\n </div>\n <div class=\"invoice-order\">\n <div class=\"invoice-order-header\">\n <div class=\"invoice-subtitle3\">" + defaultLang.item + "</div>\n <div class=\"invoice-subtitle3\">" + defaultLang.amount + "</div>\n </div>\n <div class=\"invoice-order-item-container\">\n " + productItems.map(renderItem) + "\n " + (hasDiscount ? renderItem(discountItem, 'discount') : '') + "\n " + (hasDiscount && hasTax && hasSubtotal ? renderItem(subtotalItem, 'subtotal') : '') + "\n " + (hasTax ? renderItem(taxItem, 'tax') : '') + "\n <div class=\"invoice-payment\">\n <div class=\"invoice-bold\" style=\"font-size: 16px;\">" + defaultLang.totalCharged + "</div>\n <div class=\"invoice-body3\">\n <div class=\"invoice-bold invoice-spacing\" style=\"font-size: 18px;text-align: right;\">" + formatPrice(amountPaid, currency) + "</div>\n <div class=\"invoice-card\">\n <img src=" + cardLogo + " alt=" + cardBrand + " />\n <div class=\"invoice-semi-bold\" style=\"font-weight: 400;\">" + (cardBrand.charAt(0).toUpperCase() + cardBrand.slice(1)) + " \u2022\u2022\u2022\u2022 " + cardNumber + "</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"invoice-footer invoice-subtitle2\" style=\"font-size: 12px;\">\n <img class=\"invoice-footer-logo\" src=\"" + vendorLogoUrl + "\" />\n <!-- TODO: Dynamic company info -->\n <p>\xA92023 Bookipi Pty Ltd.</p>\n <p>9 George St, North Strathfield NSW 2137, Australia</p>\n <p>ABN: 91617668185</p>\n </div>\n </div>\n " + (includeHtmlWrapper ? "</body></html>" : "") + "\n ";
12954
12908
  return {
12955
12909
  html: html
12956
12910
  };