@bookipi/htmlgenerator 1.1.34-alpha2 → 1.1.35-alpha1

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.
package/dist/index.js CHANGED
@@ -2998,10 +2998,16 @@ var en = (_deposit_due$terms$pr = {
2998
2998
  details_line_2: function details_line_2(x) {
2999
2999
  return "This offer is valid from the date of issue and will expire at the close of business (" + x + "). Acceptance will be in the form of accepting and signing this proposal.";
3000
3000
  },
3001
+ details_line_3: function details_line_3(x, y, z) {
3002
+ return x + " (" + y + "). " + z;
3003
+ },
3004
+ details_line_3_1: 'This offer is valid from the date of issue and will expire at the close of business',
3005
+ details_line_3_2: 'Acceptance will be in the form of accepting and signing this proposal.',
3006
+ details_line_4: "Please accept this proposal and terms of service. This creates a legally binding contract between us. At any time if you have any questions please contact us on the details above. These terms will be effective throughout the period of our engagement and may only be changed by the Parties' agreement in writing.",
3001
3007
  supplier_details: "Supplier Details",
3002
3008
  customer_details: "Customer Details",
3003
3009
  effective_date: "Dated:"
3004
- }, _deposit_due$terms$pr["start_date"] = "Start Date:", _deposit_due$terms$pr["end_date"] = "End Date:", _deposit_due$terms$pr.supplier_empty = "No supplier added yet.", _deposit_due$terms$pr.customer_empty = "No customer added yet.", _deposit_due$terms$pr.details_line_3 = "Please accept this proposal and terms of service. This creates a legally binding contract between us. At any time if you have any questions please contact us on the details above. These terms will be effective throughout the period of our engagement and may only be changed by the Parties' agreement in writing.", _deposit_due$terms$pr.kind_regards = "Kind regards,", _deposit_due$terms$pr.services_title = "Billing Schedule", _deposit_due$terms$pr["total"] = "Total:", _deposit_due$terms$pr.items_empty = "No services added yet.", _deposit_due$terms$pr.agreement_title = "Terms and Conditions", _deposit_due$terms$pr["signature"] = "Signature", _deposit_due$terms$pr.proposal_id = "Proposal ID:", _deposit_due$terms$pr.client = "Client:", _deposit_due$terms$pr.email_addresses = "Email address:", _deposit_due$terms$pr.ip = "IP:", _deposit_due$terms$pr.time = "Time:", _deposit_due$terms$pr);
3010
+ }, _deposit_due$terms$pr["start_date"] = "Start Date:", _deposit_due$terms$pr["end_date"] = "End Date:", _deposit_due$terms$pr.supplier_empty = "No supplier added yet.", _deposit_due$terms$pr.customer_empty = "No customer added yet.", _deposit_due$terms$pr.kind_regards = "Kind regards,", _deposit_due$terms$pr.services_title = "Billing Schedule", _deposit_due$terms$pr["total"] = "Total:", _deposit_due$terms$pr.items_empty = "No services added yet.", _deposit_due$terms$pr.agreement_title = "Terms and Conditions", _deposit_due$terms$pr["signature"] = "Signature", _deposit_due$terms$pr.proposal_id = "Proposal ID:", _deposit_due$terms$pr.client = "Client:", _deposit_due$terms$pr.email_addresses = "Email address:", _deposit_due$terms$pr.ip = "IP:", _deposit_due$terms$pr.time = "Time:", _deposit_due$terms$pr);
3005
3011
 
3006
3012
  function _extends() {
3007
3013
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -11209,7 +11215,8 @@ var language = {
11209
11215
  var contractHtml = (function (props) {
11210
11216
  var proposal = props.proposal,
11211
11217
  realTimeCompany = props.company,
11212
- contractor = props.contractor;
11218
+ contractor = props.contractor,
11219
+ t = props.t;
11213
11220
  var lang = language[(props === null || props === void 0 ? void 0 : props.lang) || "en"];
11214
11221
  var customer = (proposal === null || proposal === void 0 ? void 0 : proposal.customer) || {};
11215
11222
  var frozenCompany = proposal === null || proposal === void 0 ? void 0 : proposal.company;
@@ -11229,16 +11236,16 @@ var contractHtml = (function (props) {
11229
11236
  };
11230
11237
  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>";
11231
11238
  var sectionHeader = "<section>";
11232
- sectionHeader += "<h2 class=\"section-title contact-title\">" + ((lang === null || lang === void 0 ? void 0 : lang.service_agreement) || "") + "</h2>";
11239
+ 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>";
11233
11240
  sectionHeader += "<hr />";
11234
11241
  sectionHeader += "</section>";
11235
11242
  var sectionUserInfo = "<section>";
11236
11243
  sectionUserInfo += "<h5 class=\"section-title proposal-title\" style=\"word-break: break-all\">" + ((proposal === null || proposal === void 0 ? void 0 : proposal.title) || "") + "</h5>";
11237
- sectionUserInfo += "<span>" + ((lang === null || lang === void 0 ? void 0 : lang.details_line_1) || "") + "</span>";
11244
+ 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>";
11238
11245
  sectionUserInfo += "<br />";
11239
- sectionUserInfo += "<span>" + (lang === null || lang === void 0 ? void 0 : lang.details_line_2(proposal !== null && proposal !== void 0 && proposal.expirationDate ? formatDate(proposal.expirationDate, company || {}) : formatDate(new Date(), company || {}))) + "</span>";
11246
+ 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 || {}) : formatDate(new Date(), company || {}), 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>";
11240
11247
  sectionUserInfo += '<table class="table-details"><tbody><tr><td>';
11241
- sectionUserInfo += "<b>" + ((lang === null || lang === void 0 ? void 0 : lang.supplier_details) || "") + "</b>";
11248
+ sectionUserInfo += "<b>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.supplier_details) : lang === null || lang === void 0 ? void 0 : lang.supplier_details) || "") + "</b>";
11242
11249
  if (Object.keys(company || {}).length > 0) {
11243
11250
  if (company !== null && company !== void 0 && company.name) {
11244
11251
  sectionUserInfo += "<div><b>" + company.name + "</b></div>";
@@ -11254,10 +11261,10 @@ var contractHtml = (function (props) {
11254
11261
  }
11255
11262
  } else {
11256
11263
  sectionUserInfo += "<br />";
11257
- sectionUserInfo += "<span>" + ((lang === null || lang === void 0 ? void 0 : lang.supplier_empty) || "") + "</span>";
11264
+ sectionUserInfo += "<span>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.supplier_empty) : lang === null || lang === void 0 ? void 0 : lang.supplier_empty) || "") + "</span>";
11258
11265
  }
11259
11266
  sectionUserInfo += "</td><td>";
11260
- sectionUserInfo += "<b>" + (lang === null || lang === void 0 ? void 0 : lang.customer_details) + "</b>";
11267
+ sectionUserInfo += "<b>" + (t ? t(lang === null || lang === void 0 ? void 0 : lang.customer_details) : lang === null || lang === void 0 ? void 0 : lang.customer_details) + "</b>";
11261
11268
  if (Object.keys(customer || {}).length > 0) {
11262
11269
  if (customer !== null && customer !== void 0 && customer.companyName) {
11263
11270
  sectionUserInfo += "<div><b>" + customer.companyName + "</b></div>";
@@ -11273,20 +11280,20 @@ var contractHtml = (function (props) {
11273
11280
  }
11274
11281
  } else {
11275
11282
  sectionUserInfo += "<br />";
11276
- sectionUserInfo += "<span>" + ((lang === null || lang === void 0 ? void 0 : lang.customer_empty) || "") + "</span>";
11283
+ sectionUserInfo += "<span>" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.customer_empty) : lang === null || lang === void 0 ? void 0 : lang.customer_empty) || "") + "</span>";
11277
11284
  }
11278
11285
  sectionUserInfo += "</td></tr></tbody></table>";
11279
- sectionUserInfo += "<p class=\"agreement-date\"><b>" + ((lang === null || lang === void 0 ? void 0 : lang.effective_date) || "") + "</b> " + (proposal !== null && proposal !== void 0 && proposal.effectiveDate ? formatDate(proposal.effectiveDate, company || {}) : "") + "</p>";
11280
- sectionUserInfo += "<p class=\"agreement-date\"><b>" + ((lang === null || lang === void 0 ? void 0 : lang.start_date) || "") + "</b> " + (proposal !== null && proposal !== void 0 && proposal.startDate ? formatDate(proposal.startDate, company || {}) : "") + "</p>";
11286
+ 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 || {}) : "") + "</p>";
11287
+ 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 || {}) : "") + "</p>";
11281
11288
  sectionUserInfo += "<p class=\"agreement-date\"><b>" + ((lang === null || lang === void 0 ? void 0 : lang.end_date) || "") + "</b> " + endDate(proposal, company || {}) + "</p>";
11282
11289
  sectionUserInfo += "<div style=\"margin: 6px 0\">";
11283
- sectionUserInfo += "<span>" + ((lang === null || lang === void 0 ? void 0 : lang.details_line_3) || "") + "</span><br />";
11290
+ 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 />";
11284
11291
  sectionUserInfo += "</div>";
11285
- sectionUserInfo += "<p style=\"margin: 6px 0\">" + ((lang === null || lang === void 0 ? void 0 : lang.kind_regards) || "") + "</p>";
11292
+ 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>";
11286
11293
  sectionUserInfo += "<b>" + ((contractor === null || contractor === void 0 ? void 0 : contractor.firstName) || "") + " " + ((contractor === null || contractor === void 0 ? void 0 : contractor.lastName) || "") + "</b><br />";
11287
11294
  sectionUserInfo += "</section>";
11288
11295
  var sectionServices = "<section>";
11289
- sectionServices += "<h5 class=\"section-title\">" + ((lang === null || lang === void 0 ? void 0 : lang.services_title) || "") + "</h5>";
11296
+ 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>";
11290
11297
  sectionServices += "<hr />";
11291
11298
  sectionServices += '<table class="table-service"><tbody>';
11292
11299
  if (items && items.length > 0) {
@@ -11319,12 +11326,12 @@ var contractHtml = (function (props) {
11319
11326
  sectionServices += "</td></tr>";
11320
11327
  });
11321
11328
  } else {
11322
- sectionServices += '<tr style="border:none;"><td style="border: unset;">' + ((lang === null || lang === void 0 ? void 0 : lang.items_empty) || "") + "</td></tr>";
11329
+ 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>";
11323
11330
  }
11324
11331
  sectionServices += "</tbody></table>";
11325
11332
  sectionServices += "</section>";
11326
11333
  var sectionAgreement = "<section>";
11327
- sectionAgreement += "<h5 class=\"section-title\">" + ((lang === null || lang === void 0 ? void 0 : lang.agreement_title) || "") + "</h5>";
11334
+ sectionAgreement += "<h5 class=\"section-title\">" + ((t ? t(lang === null || lang === void 0 ? void 0 : lang.agreement_title) : lang === null || lang === void 0 ? void 0 : lang.agreement_title) || "") + "</h5>";
11328
11335
  sectionAgreement += "<hr />";
11329
11336
  sectionAgreement += '<table class="table-agreement"><tbody>';
11330
11337
  if (sectionsDefine && sectionsDefine.length > 0) {
@@ -11418,23 +11425,13 @@ var subscriptionInvoiceHtml = (function (_ref) {
11418
11425
  var productItems = (_invoiceItems$filter = invoiceItems.filter(function (item) {
11419
11426
  return item.type === 'product';
11420
11427
  })) != null ? _invoiceItems$filter : [];
11421
- var subtotalItem = invoiceItems.find(function (item) {
11422
- return item.type === 'subtotal';
11423
- });
11424
11428
  var taxItem = invoiceItems.find(function (item) {
11425
11429
  return item.type === 'tax';
11426
11430
  });
11427
- var discountItem = invoiceItems.find(function (item) {
11428
- return item.type === 'discount';
11429
- });
11430
- var renderItem = function renderItem(item, type) {
11431
- var isDiscount = type === 'discount';
11432
- return "\n <div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + (isDiscount ? item.name : item.description || item.name) + "</div>\n " + (isDiscount ? "<div class=\"invoice-subtitle4\">" + item.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 ";
11431
+ var renderItem = function renderItem(item) {
11432
+ return "\n <div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + item.description + "</div>\n </div>\n <div style=\"font-size: 16px;\">\n " + formatPrice(item.total, currency) + "\n </div>\n </div>\n " + (taxItem ? "<div class=\"invoice-tax\">\n <div class=\"invoice-subtitle3\">" + taxItem.description + "</div>\n <div class=\"invoice-subtitle3\">" + formatPrice(taxItem.total, currency) + "</div>\n </div>" : '') + "\n </div>\n ";
11433
11433
  };
11434
- var hasDiscount = discountItem && (discountItem === null || discountItem === void 0 ? void 0 : discountItem.total) > 0;
11435
- var hasTax = taxItem && (taxItem === null || taxItem === void 0 ? void 0 : taxItem.total) > 0;
11436
- var hasSubtotal = subtotalItem && (subtotalItem === null || subtotalItem === void 0 ? void 0 : subtotalItem.total) > 0;
11437
- 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\">Invoice #" + invoiceNumber + "</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\">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\">Bill to</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\">Item</div>\n <div class=\"invoice-subtitle3\">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;\">Total charged</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 ";
11434
+ 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-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 20px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n margin-bottom: 8px;\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 }\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\">Invoice #" + invoiceNumber + "</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\">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\">Bill to</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\">Item</div>\n <div class=\"invoice-subtitle3\">Amount</div>\n </div>\n <div class=\"invoice-order-item-container\">\n " + productItems.map(renderItem) + "\n <div class=\"invoice-payment\">\n <div class=\"invoice-bold\" style=\"font-size: 16px;\">Total charged</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 ";
11438
11435
  return {
11439
11436
  html: html
11440
11437
  };