@loczer/storefront-sdk 0.191.0 → 0.193.0

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.
Files changed (65) hide show
  1. package/dist/StorefrontProvider.d.ts +9 -0
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-IYOeC3N7.js → Product.shared-cjcvMCMa.js} +4 -2
  4. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-zsUj5_3O.js → base-asset-CsOe0vXi.js} +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-TzCge_mR.js → base-booking-Sjsqh31e.js} +28 -23
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-DvFFzAcg.js → base-product-C_ATjuc6.js} +1 -1
  7. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-B0HpcFe5.js → cart-inputs-D1_Wmkca.js} +11 -0
  8. package/dist/chunks/pkg/booking-engine/dist/schemas/insurance-B01h642r.js +67 -0
  9. package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +14 -0
  10. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts +10 -0
  11. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -0
  12. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +104 -0
  13. package/dist/components/ContractSaleDocument/Invoice.d.ts +2 -2
  14. package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
  15. package/dist/components/ContractSaleDocument/Invoice.js +157 -110
  16. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  17. package/dist/components/ContractSaleDocument/InvoiceDetails.js +132 -155
  18. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +0 -2
  19. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -1
  20. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.js +32 -37
  21. package/dist/i18n/en.d.ts +15 -0
  22. package/dist/i18n/en.d.ts.map +1 -1
  23. package/dist/i18n/en.js +15 -0
  24. package/dist/i18n/fr.d.ts +15 -0
  25. package/dist/i18n/fr.d.ts.map +1 -1
  26. package/dist/i18n/fr.js +15 -0
  27. package/dist/index.d.ts +314 -12
  28. package/dist/index.js +66 -65
  29. package/dist/lib/booking.js +2 -2
  30. package/dist/lib/checkoutSubmit.d.ts +8 -2
  31. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  32. package/dist/lib/checkoutSubmit.js +13 -4
  33. package/dist/lib/checkoutVerifyCoupon.d.ts +3 -0
  34. package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
  35. package/dist/lib/checkoutVerifyCoupon.js +4 -1
  36. package/dist/lib/contractSaleDocument.d.ts +48 -3
  37. package/dist/lib/contractSaleDocument.d.ts.map +1 -1
  38. package/dist/lib/contractSaleDocument.js +36 -18
  39. package/dist/lib/contractSaleDocumentApi.d.ts +60 -6
  40. package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
  41. package/dist/lib/contractSaleDocumentApi.js +41 -37
  42. package/dist/lib/storefrontProducts.d.ts +3 -0
  43. package/dist/lib/storefrontProducts.d.ts.map +1 -1
  44. package/dist/lib/storefrontProducts.js +2 -1
  45. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  46. package/dist/pages/CheckoutPage.js +264 -237
  47. package/dist/pages/ContractSaleDocumentPage.d.ts +23 -9
  48. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  49. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  50. package/dist/pages/checkout/components/CheckoutDetailsCard.js +17 -3
  51. package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts +12 -0
  52. package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts.map +1 -0
  53. package/dist/pages/checkout/components/CheckoutInsuranceCard.js +53 -0
  54. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +2 -1
  55. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -1
  56. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +47 -30
  57. package/dist/pages/checkout/types.d.ts +2 -1
  58. package/dist/pages/checkout/types.d.ts.map +1 -1
  59. package/dist/pages/checkout/types.js +2 -1
  60. package/dist/storefront.css +1 -1
  61. package/dist/storefrontSchemas.d.ts +6 -0
  62. package/dist/storefrontSchemas.d.ts.map +1 -1
  63. package/dist/storefrontSchemas.js +5 -2
  64. package/package.json +1 -1
  65. package/dist/chunks/pkg/booking-engine/dist/schemas-BNUzqsci.js +0 -13
@@ -1,5 +1,6 @@
1
1
  import { formatContractSaleDocumentLabel as e, formatContractSaleDocumentLegalLabel as t } from "./language.js";
2
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { DocumentAcceptanceSection as n } from "./DocumentAcceptanceSection.js";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
4
  import { useTranslation as a } from "react-i18next";
4
5
  //#region src/components/ContractSaleDocument/InvoiceDetails.tsx
5
6
  function o(e) {
@@ -17,9 +18,25 @@ function s(e, t, n) {
17
18
  return `${e.toFixed(2)} ${r}`;
18
19
  }
19
20
  }
20
- function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDate: p, documentLanguage: m, showInvoiceMeta: h = !0, showTotalsSection: g = !0, showNotesSection: _ = !0, showAcceptanceSection: v = !0, documentQrCodeUrl: y }) {
21
- let { t: b } = a(), x = (t, n = {}) => e(b, m, t, n), S = (e, n = {}) => t(b, m, e, n), C = (e, t = {}) => {
22
- let n = x(e, t), a = n.indexOf(" / ");
21
+ function c(e, t, n) {
22
+ let r = e instanceof Date ? e : new Date(e);
23
+ if (Number.isNaN(r.getTime())) return "-";
24
+ try {
25
+ return new Intl.DateTimeFormat(t, {
26
+ dateStyle: "long",
27
+ timeStyle: "short",
28
+ ...n ? { timeZone: n } : {}
29
+ }).format(r);
30
+ } catch {
31
+ return new Intl.DateTimeFormat(t, {
32
+ dateStyle: "long",
33
+ timeStyle: "short"
34
+ }).format(r);
35
+ }
36
+ }
37
+ function l({ saleDocument: l, items: u, subtotal: d, tax: f, total: p, formatDate: m, documentLanguage: h, showInvoiceMeta: g = !0, showTotalsSection: _ = !0, showNotesSection: v = !0, showAcceptanceSection: y = !0, documentQrCodeUrl: b }) {
38
+ let { t: x } = a(), S = (t, n = {}) => e(x, h, t, n), C = (e, n = {}) => t(x, h, e, n), w = (e, t = {}) => {
39
+ let n = S(e, t), a = n.indexOf(" / ");
23
40
  return a === -1 ? /* @__PURE__ */ r("span", { children: n }) : /* @__PURE__ */ i("span", {
24
41
  className: "inline-flex flex-col text-left leading-snug",
25
42
  children: [/* @__PURE__ */ r("span", { children: n.slice(0, a) }), /* @__PURE__ */ r("span", {
@@ -27,23 +44,23 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
27
44
  children: n.slice(a + 3)
28
45
  })]
29
46
  });
30
- }, w = !g && !_ && !v, T = o(c.issuer.address), E = o(c.recipient.address), D = c.recipient.email?.trim() ?? "", O = c.acceptance?.mode === "signature" ? c.acceptance : null, k = c.acceptance?.mode === "acceptance" ? c.acceptance : null, A = c.acceptanceLevel === "signature" || O !== null, j = c.kind === "credit_note", M = x(j ? "docs_contract_sale_credit_note_title" : c.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), N = x(j ? "docs_contract_sale_credit_note_date_label" : c.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), P = x(j ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), F = j ? -1 : 1, I = c.taxRate == null ? 1 : 1 + c.taxRate;
47
+ }, T = !_ && !v && !y, E = o(l.issuer.address), D = o(l.recipient.address), O = l.recipient.email?.trim() ?? "", k = l.kind === "credit_note", A = S(k ? "docs_contract_sale_credit_note_title" : l.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), j = S(k ? "docs_contract_sale_credit_note_date_label" : l.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), M = S(k ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), N = k ? -1 : 1;
31
48
  return /* @__PURE__ */ i("main", {
32
49
  className: "flex flex-grow flex-col px-4 md:px-8",
33
50
  children: [
34
- h && /* @__PURE__ */ i("header", {
51
+ g && /* @__PURE__ */ i("header", {
35
52
  className: "mb-8 grid gap-6",
36
53
  children: [/* @__PURE__ */ i("div", {
37
54
  className: "grid gap-6 md:grid-cols-2 md:gap-8",
38
55
  children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("h1", {
39
56
  className: "flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xl font-semibold text-foreground",
40
- children: [/* @__PURE__ */ r("span", { children: M }), /* @__PURE__ */ i("span", {
57
+ children: [/* @__PURE__ */ r("span", { children: A }), /* @__PURE__ */ i("span", {
41
58
  className: "font-normal text-muted-foreground",
42
- children: ["#", c.saleDocumentNumber]
59
+ children: ["#", l.saleDocumentNumber]
43
60
  })]
44
- }), y ? /* @__PURE__ */ r("img", {
45
- src: y,
46
- alt: b("docs_contract_sale_qr_alt"),
61
+ }), b ? /* @__PURE__ */ r("img", {
62
+ src: b,
63
+ alt: x("docs_contract_sale_qr_alt"),
47
64
  className: "mt-4 block h-24 w-24",
48
65
  "data-testid": "contract-sale-document-public-url-qr"
49
66
  }) : null] }), /* @__PURE__ */ i("div", {
@@ -52,98 +69,146 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
52
69
  className: "mb-2",
53
70
  children: [/* @__PURE__ */ r("p", {
54
71
  className: "font-semibold text-foreground",
55
- children: N
72
+ children: j
56
73
  }), /* @__PURE__ */ r("p", {
57
74
  className: "text-muted-foreground",
58
- children: p(c.date)
75
+ children: m(l.date)
59
76
  })]
60
77
  }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("p", {
61
78
  className: "font-semibold text-foreground",
62
- children: x("docs_contract_sale_due_date_label")
79
+ children: S("docs_contract_sale_due_date_label")
63
80
  }), /* @__PURE__ */ r("p", {
64
81
  className: "text-muted-foreground",
65
- children: p(c.dueDate)
82
+ children: m(l.dueDate)
66
83
  })] })]
67
84
  })]
68
85
  }), /* @__PURE__ */ i("div", {
69
86
  className: "grid gap-6 md:grid-cols-2 md:gap-8",
70
87
  children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("h2", {
71
88
  className: "text-xl font-semibold text-primary",
72
- children: c.issuer.name
73
- }), T ? /* @__PURE__ */ r("p", {
89
+ children: l.issuer.name
90
+ }), E ? /* @__PURE__ */ r("p", {
74
91
  className: "text-muted-foreground whitespace-pre-line",
75
- children: T
92
+ children: E
76
93
  }) : null] }), /* @__PURE__ */ i("div", {
77
94
  className: "md:text-right",
78
95
  children: [
79
96
  /* @__PURE__ */ r("h3", {
80
97
  className: "mb-2 font-semibold text-foreground",
81
- children: P
98
+ children: M
82
99
  }),
83
100
  /* @__PURE__ */ r("p", {
84
101
  className: "font-bold text-foreground",
85
- children: c.recipient.name
102
+ children: l.recipient.name
86
103
  }),
87
- E ? /* @__PURE__ */ r("p", {
104
+ D ? /* @__PURE__ */ r("p", {
88
105
  className: "text-muted-foreground whitespace-pre-line",
89
- children: E
106
+ children: D
90
107
  }) : null,
91
- D ? /* @__PURE__ */ r("p", {
108
+ O ? /* @__PURE__ */ r("p", {
92
109
  className: "text-muted-foreground",
93
- children: D
110
+ children: O
94
111
  }) : null
95
112
  ]
96
113
  })]
97
114
  })]
98
115
  }),
116
+ g && l.rental ? /* @__PURE__ */ i("section", {
117
+ className: "mb-6 border-y border-border py-3",
118
+ "data-testid": "contract-sale-document-rental-details",
119
+ children: [/* @__PURE__ */ i("div", {
120
+ className: "mb-2 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",
121
+ children: [/* @__PURE__ */ r("h3", {
122
+ className: "font-semibold text-foreground",
123
+ children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_rental_details_title") })
124
+ }), /* @__PURE__ */ r("p", {
125
+ className: "text-xs text-muted-foreground",
126
+ children: /* @__PURE__ */ i("span", { children: [
127
+ S("docs_contract_sale_booking_number_label"),
128
+ ": ",
129
+ l.rental.bookingNumber
130
+ ] })
131
+ })]
132
+ }), /* @__PURE__ */ i("dl", {
133
+ className: "grid gap-3 text-sm md:grid-cols-2 md:gap-6",
134
+ children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("dt", {
135
+ className: "font-medium text-foreground",
136
+ children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_rental_start_label") })
137
+ }), /* @__PURE__ */ i("dd", {
138
+ className: "text-muted-foreground",
139
+ children: [/* @__PURE__ */ r("span", { children: c(l.rental.start, h.legal, l.rental.timeZone) }), l.rental.pickupAddress ? /* @__PURE__ */ r("span", {
140
+ className: "block whitespace-pre-line",
141
+ children: l.rental.pickupAddress
142
+ }) : null]
143
+ })] }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("dt", {
144
+ className: "font-medium text-foreground",
145
+ children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_rental_end_label") })
146
+ }), /* @__PURE__ */ i("dd", {
147
+ className: "text-muted-foreground",
148
+ children: [/* @__PURE__ */ r("span", { children: c(l.rental.end, h.legal, l.rental.timeZone) }), l.rental.returnAddress ? /* @__PURE__ */ r("span", {
149
+ className: "block whitespace-pre-line",
150
+ children: l.rental.returnAddress
151
+ }) : null]
152
+ })] })]
153
+ })]
154
+ }) : null,
99
155
  /* @__PURE__ */ i("section", {
100
- className: w ? "mb-0 flex flex-grow flex-col" : "mb-8",
156
+ className: T ? "mb-0 flex flex-grow flex-col" : "mb-8",
101
157
  children: [/* @__PURE__ */ i("div", {
102
158
  className: "flex bg-muted p-2 text-xs font-semibold text-muted-foreground md:p-3 md:text-base",
103
159
  children: [
104
160
  /* @__PURE__ */ r("div", {
105
161
  className: "w-5/12 pr-2 md:w-1/2",
106
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_description_label") })
162
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_description_label") })
107
163
  }),
108
164
  /* @__PURE__ */ r("div", {
109
165
  className: "w-1/6 text-center",
110
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_quantity_label") })
166
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_quantity_label") })
111
167
  }),
112
168
  /* @__PURE__ */ r("div", {
113
169
  className: "w-3/12 text-right md:w-1/6",
114
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_unit_price_label") })
170
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_unit_price_label") })
115
171
  }),
116
172
  /* @__PURE__ */ r("div", {
117
173
  className: "w-1/6 text-right",
118
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_line_total_label") })
174
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_line_total_label") })
119
175
  })
120
176
  ]
121
177
  }), /* @__PURE__ */ r("div", {
122
- className: w ? "flex flex-1 flex-col" : "flex flex-col",
123
- children: l.map((e) => /* @__PURE__ */ i("div", {
124
- className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base",
125
- children: [
126
- /* @__PURE__ */ r("div", {
127
- className: "w-5/12 pr-2 md:w-1/2",
128
- children: /* @__PURE__ */ r("span", { children: e.description })
129
- }),
130
- /* @__PURE__ */ r("div", {
131
- className: "w-1/6 text-center",
132
- children: /* @__PURE__ */ r("span", { children: e.quantity })
133
- }),
134
- /* @__PURE__ */ r("div", {
135
- className: "w-3/12 text-right md:w-1/6",
136
- children: /* @__PURE__ */ r("span", { children: s(e.unitPrice / I * F, c.currency, m.customer) })
137
- }),
138
- /* @__PURE__ */ r("div", {
139
- className: "w-1/6 text-right",
140
- children: /* @__PURE__ */ r("span", { children: s(e.quantity * e.unitPrice / I * F, c.currency, m.customer) })
141
- })
142
- ]
143
- }, e.id))
178
+ className: T ? "flex flex-1 flex-col" : "flex flex-col",
179
+ children: u.map((e) => {
180
+ let t = 1 + (e.taxRate ?? l.taxRate ?? 0);
181
+ return /* @__PURE__ */ i("div", {
182
+ className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base",
183
+ children: [
184
+ /* @__PURE__ */ r("div", {
185
+ className: "w-5/12 pr-2 md:w-1/2",
186
+ children: /* @__PURE__ */ i("span", {
187
+ className: "grid gap-0.5",
188
+ children: [/* @__PURE__ */ r("span", { children: e.description }), e.taxExemptionReason ? /* @__PURE__ */ r("span", {
189
+ className: "text-[10px] leading-tight text-muted-foreground",
190
+ children: e.taxExemptionReason
191
+ }) : null]
192
+ })
193
+ }),
194
+ /* @__PURE__ */ r("div", {
195
+ className: "w-1/6 text-center",
196
+ children: /* @__PURE__ */ r("span", { children: e.quantity })
197
+ }),
198
+ /* @__PURE__ */ r("div", {
199
+ className: "w-3/12 text-right md:w-1/6",
200
+ children: /* @__PURE__ */ r("span", { children: s(e.unitPrice / t * N, l.currency, h.customer) })
201
+ }),
202
+ /* @__PURE__ */ r("div", {
203
+ className: "w-1/6 text-right",
204
+ children: /* @__PURE__ */ r("span", { children: s(e.quantity * e.unitPrice / t * N, l.currency, h.customer) })
205
+ })
206
+ ]
207
+ }, e.id);
208
+ })
144
209
  })]
145
210
  }),
146
- g && /* @__PURE__ */ r("section", {
211
+ _ && /* @__PURE__ */ r("section", {
147
212
  className: "mb-16 flex justify-end",
148
213
  children: /* @__PURE__ */ i("div", {
149
214
  className: "w-full md:w-1/3",
@@ -152,140 +217,52 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
152
217
  className: "mb-2 flex items-start justify-between gap-4",
153
218
  children: [/* @__PURE__ */ r("span", {
154
219
  className: "text-muted-foreground",
155
- children: C("docs_contract_sale_subtotal_label")
220
+ children: w("docs_contract_sale_subtotal_label")
156
221
  }), /* @__PURE__ */ r("span", {
157
222
  className: "shrink-0 text-right font-semibold",
158
- children: s(u, c.currency, m.customer)
223
+ children: s(d, l.currency, h.customer)
159
224
  })]
160
225
  }),
161
- c.taxRate != null && /* @__PURE__ */ i("div", {
226
+ f !== 0 && /* @__PURE__ */ i("div", {
162
227
  className: "mb-2 flex items-start justify-between gap-4",
163
228
  children: [/* @__PURE__ */ r("span", {
164
229
  className: "text-muted-foreground",
165
- children: C("docs_contract_sale_tax_label", { rate: (c.taxRate * 100).toFixed(0) })
230
+ children: w("docs_contract_sale_tax_label", { rate: ((l.taxRate ?? 0) * 100).toFixed(0) })
166
231
  }), /* @__PURE__ */ r("span", {
167
232
  className: "shrink-0 text-right font-semibold",
168
- children: s(d, c.currency, m.customer)
233
+ children: s(f, l.currency, h.customer)
169
234
  })]
170
235
  }),
171
236
  /* @__PURE__ */ i("div", {
172
237
  className: "mt-2 flex items-start justify-between gap-4 border-t border-border pt-2",
173
238
  children: [/* @__PURE__ */ r("span", {
174
239
  className: "text-xl font-bold",
175
- children: C("docs_contract_sale_total_label")
240
+ children: w("docs_contract_sale_total_label")
176
241
  }), /* @__PURE__ */ r("span", {
177
242
  className: "shrink-0 text-right text-xl font-bold",
178
- children: s(f, c.currency, m.customer)
243
+ children: s(p, l.currency, h.customer)
179
244
  })]
180
245
  })
181
246
  ]
182
247
  })
183
248
  }),
184
- _ && c.notes && /* @__PURE__ */ i("section", {
249
+ v && l.notes && /* @__PURE__ */ i("section", {
185
250
  className: "mb-16",
186
251
  children: [/* @__PURE__ */ r("h3", {
187
252
  className: "mb-4 border-b border-border pb-2 font-semibold text-foreground",
188
- children: x("docs_contract_sale_notes_title")
253
+ children: S("docs_contract_sale_notes_title")
189
254
  }), /* @__PURE__ */ r("div", {
190
255
  className: "gap-8 text-sm text-muted-foreground md:columns-2",
191
- children: /* @__PURE__ */ r("p", { children: c.notes })
256
+ children: /* @__PURE__ */ r("p", { children: l.notes })
192
257
  })]
193
258
  }),
194
- v && (c.acceptanceLevel !== "none" || c.acceptance) ? /* @__PURE__ */ r("section", {
195
- className: "mt-auto border-t border-border pt-8",
196
- children: A ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("p", {
197
- className: "mb-12 text-center text-sm text-muted-foreground",
198
- children: /* @__PURE__ */ r("span", { children: x("docs_contract_sale_signature_acknowledgement") })
199
- }), O ? /* @__PURE__ */ i("div", {
200
- className: "flex flex-col justify-between md:flex-row",
201
- children: [/* @__PURE__ */ i("div", {
202
- className: "mb-8 w-full md:mb-0 md:w-2/5",
203
- children: [
204
- /* @__PURE__ */ r("p", {
205
- className: "font-semibold text-foreground",
206
- children: x("docs_contract_sale_signature_issuer_label")
207
- }),
208
- /* @__PURE__ */ r("p", {
209
- className: "mb-2 mt-2 text-sm text-muted-foreground",
210
- children: /* @__PURE__ */ i("span", { children: [x("docs_contract_sale_signature_date_label"), ": ___________________"] })
211
- }),
212
- /* @__PURE__ */ r("div", { className: "h-24 rounded-lg bg-muted/40" })
213
- ]
214
- }), /* @__PURE__ */ i("div", {
215
- className: "w-full text-left md:w-2/5",
216
- children: [
217
- /* @__PURE__ */ r("p", {
218
- className: "font-semibold text-foreground",
219
- children: x("docs_contract_sale_signature_customer_label")
220
- }),
221
- /* @__PURE__ */ r("p", {
222
- className: "mb-2 mt-2 text-sm text-muted-foreground",
223
- children: /* @__PURE__ */ i("span", { children: [
224
- x("docs_contract_sale_signature_date_label"),
225
- ": ",
226
- p(O.date)
227
- ] })
228
- }),
229
- /* @__PURE__ */ r("div", {
230
- className: "flex h-24 items-center justify-center rounded-lg bg-muted/40 p-2",
231
- children: /* @__PURE__ */ r("img", {
232
- src: O.signature,
233
- alt: x("docs_contract_sale_signature_image_alt"),
234
- className: "max-h-full max-w-full"
235
- })
236
- }),
237
- /* @__PURE__ */ r("p", {
238
- className: "mt-2 text-sm text-foreground",
239
- children: O.name
240
- }),
241
- /* @__PURE__ */ r("p", {
242
- className: "text-sm text-muted-foreground",
243
- children: O.phone
244
- })
245
- ]
246
- })]
247
- }) : /* @__PURE__ */ i("div", {
248
- className: "flex flex-col justify-between md:flex-row",
249
- children: [/* @__PURE__ */ i("div", {
250
- className: "mb-8 w-full md:mb-0 md:w-2/5",
251
- children: [
252
- /* @__PURE__ */ r("p", {
253
- className: "font-semibold text-foreground",
254
- children: x("docs_contract_sale_signature_issuer_label")
255
- }),
256
- /* @__PURE__ */ r("p", {
257
- className: "mb-2 mt-2 text-sm text-muted-foreground",
258
- children: /* @__PURE__ */ i("span", { children: [x("docs_contract_sale_signature_date_label"), ": ___________________"] })
259
- }),
260
- /* @__PURE__ */ r("div", { className: "h-24 rounded-lg bg-muted/40" })
261
- ]
262
- }), /* @__PURE__ */ i("div", {
263
- className: "w-full md:w-2/5",
264
- children: [
265
- /* @__PURE__ */ r("p", {
266
- className: "font-semibold text-foreground",
267
- children: x("docs_contract_sale_signature_customer_label")
268
- }),
269
- /* @__PURE__ */ r("p", {
270
- className: "mb-2 mt-2 text-sm text-muted-foreground",
271
- children: /* @__PURE__ */ i("span", { children: [x("docs_contract_sale_signature_date_label"), ": ___________________"] })
272
- }),
273
- /* @__PURE__ */ r("div", { className: "h-24 rounded-lg bg-muted/40" })
274
- ]
275
- })]
276
- })] }) : /* @__PURE__ */ i("div", {
277
- className: "rounded-lg border border-border bg-muted/30 p-4",
278
- children: [/* @__PURE__ */ r("p", {
279
- className: "text-sm font-medium text-foreground",
280
- children: x(k ? "docs_contract_sale_acceptance_section_accepted_title" : "docs_contract_sale_acceptance_section_required_title")
281
- }), /* @__PURE__ */ r("p", {
282
- className: "mt-1 text-sm text-muted-foreground",
283
- children: k ? x("docs_contract_sale_acceptance_section_accepted_date", { date: p(k.date) }) : x("docs_contract_sale_acceptance_section_required_description")
284
- })]
285
- })
259
+ y ? /* @__PURE__ */ r(n, {
260
+ saleDocument: l,
261
+ documentLanguage: h,
262
+ formatDate: m
286
263
  }) : null
287
264
  ]
288
265
  });
289
266
  }
290
267
  //#endregion
291
- export { c as InvoiceDetails };
268
+ export { l as InvoiceDetails };
@@ -1,6 +1,4 @@
1
1
  import { ContractSaleDocumentTermArticle } from '../../lib/contractSaleDocument';
2
- export declare const DEFAULT_TERMS_TITLE = "Conditions Generales de Vente";
3
- export declare const DEFAULT_TERMS_ARTICLES: ContractSaleDocumentTermArticle[];
4
2
  type TermsAndConditionsContentProps = {
5
3
  title: string;
6
4
  articles: ContractSaleDocumentTermArticle[];
@@ -1 +1 @@
1
- {"version":3,"file":"TermsAndConditionsContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/TermsAndConditionsContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAGrF,eAAO,MAAM,mBAAmB,kCAAkC,CAAA;AAElE,eAAO,MAAM,sBAAsB,EAAE,+BAA+B,EA4BnE,CAAA;AAED,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,+BAA+B,EAAE,CAAA;IAC3C,sBAAsB,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,yDAKvC,8BAA8B,4CA4BhC,CAAA"}
1
+ {"version":3,"file":"TermsAndConditionsContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/TermsAndConditionsContent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAGrF,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,+BAA+B,EAAE,CAAA;IAC3C,sBAAsB,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAoDD,eAAO,MAAM,yBAAyB,GAAI,yDAKvC,8BAA8B,4CAoChC,CAAA"}
@@ -1,54 +1,49 @@
1
1
  import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { cn as r } from "@rpcbase/ui";
2
3
  //#region src/components/ContractSaleDocument/TermsAndConditionsContent.tsx
3
- var r = "Conditions Generales de Vente", i = [
4
- {
5
- id: "article-1",
6
- title: "Article 1: Objet",
7
- body: "Le present contrat a pour objet la location du materiel decrit dans la presente facture. Le locataire reconnait avoir recu le materiel en parfait etat de fonctionnement.",
8
- translationTitle: "Article 1: Purpose",
9
- translationBody: "The purpose of this contract is the rental of the equipment described in this invoice. The lessee acknowledges having received the equipment in perfect working order."
10
- },
11
- {
12
- id: "article-2",
13
- title: "Article 2: Duree",
14
- body: "La location prend effet a la date de signature du present contrat et se termine a la date de restitution du materiel. Toute journee commencee est due.",
15
- translationTitle: "Article 2: Duration",
16
- translationBody: "The rental takes effect on the date of signature of this contract and ends on the date of return of the equipment. Any day started is due."
17
- },
18
- {
19
- id: "article-3",
20
- title: "Article 3: Obligations du locataire",
21
- body: "Le locataire s'engage a utiliser le materiel en bon pere de famille et a le restituer dans le meme etat que celui ou il l'a recu. Il est responsable de tout dommage ou perte.",
22
- translationTitle: "Article 3: Lessee's Obligations",
23
- translationBody: "The lessee agrees to use the equipment with due care and to return it in the same condition as received. The lessee is responsible for any damage or loss."
24
- }
25
- ], a = ({ title: r, articles: i, withEnglishTranslation: a, showTitle: o = !0 }) => /* @__PURE__ */ n(e, { children: [o && /* @__PURE__ */ t("h1", {
4
+ var i = r("grid gap-2 text-sm leading-relaxed text-muted-foreground", "[&_a]:underline [&_a]:underline-offset-2", "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3", "[&_code]:rounded [&_code]:bg-muted [&_code]:px-1", "[&_img]:max-h-56 [&_img]:max-w-full [&_img]:object-contain", "[&_ol]:list-decimal [&_ol]:space-y-1 [&_ol]:pl-5", "[&_p]:whitespace-pre-wrap", "[&_table]:w-full [&_table]:border-collapse [&_td]:border [&_td]:border-border [&_td]:p-1.5", "[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-1.5 [&_th]:font-semibold", "[&_ul]:list-disc [&_ul]:space-y-1 [&_ul]:pl-5");
5
+ function a({ body: e, bodyHtml: n }) {
6
+ return n ? /* @__PURE__ */ t("div", {
7
+ className: i,
8
+ dangerouslySetInnerHTML: { __html: n }
9
+ }) : /* @__PURE__ */ t("p", {
10
+ className: "whitespace-pre-wrap text-sm leading-relaxed text-muted-foreground",
11
+ children: /* @__PURE__ */ t("span", { children: e })
12
+ });
13
+ }
14
+ function o(e) {
15
+ return e.translationBodyHtml === void 0 ? e.translationBody === void 0 ? {
16
+ body: e.body,
17
+ bodyHtml: e.bodyHtml
18
+ } : { body: e.translationBody } : {
19
+ body: e.translationBody ?? e.body,
20
+ bodyHtml: e.translationBodyHtml
21
+ };
22
+ }
23
+ var s = ({ title: r, articles: i, withEnglishTranslation: s, showTitle: c = !0 }) => /* @__PURE__ */ n(e, { children: [c && /* @__PURE__ */ t("h1", {
26
24
  className: "mb-8 text-center text-xl font-serif font-bold text-foreground",
27
25
  children: r
28
26
  }), /* @__PURE__ */ n("div", {
29
- className: `text-sm ${a ? "grid grid-cols-1 gap-8 md:grid-cols-2" : ""}`,
27
+ className: `text-sm ${s ? "grid grid-cols-1 gap-8 md:grid-cols-2" : ""}`,
30
28
  children: [/* @__PURE__ */ t("div", { children: i.map((e) => /* @__PURE__ */ n("section", {
31
29
  className: "mb-4",
32
- children: [/* @__PURE__ */ t("h3", {
30
+ children: [e.title ? /* @__PURE__ */ t("h3", {
33
31
  className: "mb-2 text-left text-lg font-serif font-semibold text-foreground",
34
- children: e.title
35
- }), /* @__PURE__ */ t("p", {
36
- className: "text-muted-foreground",
37
- children: e.body
32
+ children: /* @__PURE__ */ t("span", { children: e.title })
33
+ }) : null, /* @__PURE__ */ t(a, {
34
+ body: e.body,
35
+ bodyHtml: e.bodyHtml
38
36
  })]
39
- }, `fr-${e.id}`)) }), a && /* @__PURE__ */ t("div", {
37
+ }, `fr-${e.id}`)) }), s && /* @__PURE__ */ t("div", {
40
38
  className: "border-t border-border pt-8 md:border-l md:border-t-0 md:pl-8 md:pt-0",
41
39
  children: i.map((e) => /* @__PURE__ */ n("section", {
42
40
  className: "mb-4",
43
- children: [/* @__PURE__ */ t("h3", {
41
+ children: [e.translationTitle ?? e.title ? /* @__PURE__ */ t("h3", {
44
42
  className: "mb-2 text-left text-lg font-serif font-semibold text-foreground",
45
- children: e.translationTitle ?? e.title
46
- }), /* @__PURE__ */ t("p", {
47
- className: "text-muted-foreground",
48
- children: e.translationBody ?? e.body
49
- })]
43
+ children: /* @__PURE__ */ t("span", { children: e.translationTitle ?? e.title })
44
+ }) : null, /* @__PURE__ */ t(a, { ...o(e) })]
50
45
  }, `en-${e.id}`))
51
46
  })]
52
47
  })] });
53
48
  //#endregion
54
- export { i as DEFAULT_TERMS_ARTICLES, r as DEFAULT_TERMS_TITLE, a as TermsAndConditionsContent };
49
+ export { s as TermsAndConditionsContent };
package/dist/i18n/en.d.ts CHANGED
@@ -157,6 +157,10 @@ export declare const storefront: {
157
157
  checkout_estimated_total: string;
158
158
  checkout_form_title: string;
159
159
  checkout_form_description: string;
160
+ checkout_first_name_label: string;
161
+ checkout_first_name_placeholder: string;
162
+ checkout_last_name_label: string;
163
+ checkout_last_name_placeholder: string;
160
164
  checkout_full_name_label: string;
161
165
  checkout_full_name_placeholder: string;
162
166
  checkout_email_label: string;
@@ -178,6 +182,13 @@ export declare const storefront: {
178
182
  checkout_payment_total_excluding_tax: string;
179
183
  checkout_payment_vat: string;
180
184
  checkout_payment_deposit_amount: string;
185
+ checkout_insurance_title: string;
186
+ checkout_insurance_description: string;
187
+ checkout_insurance_deductible: string;
188
+ checkout_insurance_total_one: string;
189
+ checkout_insurance_total_other: string;
190
+ checkout_insurance_exempt_line: string;
191
+ checkout_insurance_tax_notice: string;
181
192
  checkout_coupon_title: string;
182
193
  checkout_coupon_label: string;
183
194
  checkout_coupon_placeholder: string;
@@ -236,6 +247,10 @@ export declare const storefront: {
236
247
  docs_contract_sale_due_date_label: string;
237
248
  docs_contract_sale_invoice_recipient_label: string;
238
249
  docs_contract_sale_credit_note_recipient_label: string;
250
+ docs_contract_sale_rental_details_title: string;
251
+ docs_contract_sale_booking_number_label: string;
252
+ docs_contract_sale_rental_start_label: string;
253
+ docs_contract_sale_rental_end_label: string;
239
254
  docs_contract_sale_description_label: string;
240
255
  docs_contract_sale_quantity_label: string;
241
256
  docs_contract_sale_unit_price_label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwbtB,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuctB,CAAA"}
package/dist/i18n/en.js CHANGED
@@ -158,6 +158,10 @@ var e = {
158
158
  checkout_estimated_total: "Booking total",
159
159
  checkout_form_title: "Your details",
160
160
  checkout_form_description: "Enter your details for this booking, and add any useful information in the notes.",
161
+ checkout_first_name_label: "First name",
162
+ checkout_first_name_placeholder: "Jane",
163
+ checkout_last_name_label: "Last name",
164
+ checkout_last_name_placeholder: "Doe",
161
165
  checkout_full_name_label: "Full name",
162
166
  checkout_full_name_placeholder: "Jane Doe",
163
167
  checkout_email_label: "Email",
@@ -179,6 +183,13 @@ var e = {
179
183
  checkout_payment_total_excluding_tax: "Subtotal (excl. tax)",
180
184
  checkout_payment_vat: "VAT ({{rate}})",
181
185
  checkout_payment_deposit_amount: "Deposit amount",
186
+ checkout_insurance_title: "Insure all eligible bikes",
187
+ checkout_insurance_description: "Optional cover at {{amount}} per day. Discounts do not apply to insurance.",
188
+ checkout_insurance_deductible: "Maximum deductible: {{amount}}",
189
+ checkout_insurance_total_one: "Insurance: {{amount}} for {{count}} day",
190
+ checkout_insurance_total_other: "Insurance: {{amount}} for {{count}} days",
191
+ checkout_insurance_exempt_line: "Insurance (VAT exempt)",
192
+ checkout_insurance_tax_notice: "Assurance exonérée de TVA – article 261 C, 2° du CGI",
182
193
  checkout_coupon_title: "Coupon",
183
194
  checkout_coupon_label: "Coupon code",
184
195
  checkout_coupon_placeholder: "Coupon code",
@@ -237,6 +248,10 @@ var e = {
237
248
  docs_contract_sale_due_date_label: "Due Date:",
238
249
  docs_contract_sale_invoice_recipient_label: "Bill To:",
239
250
  docs_contract_sale_credit_note_recipient_label: "Issued To:",
251
+ docs_contract_sale_rental_details_title: "Rental details",
252
+ docs_contract_sale_booking_number_label: "Booking",
253
+ docs_contract_sale_rental_start_label: "Start",
254
+ docs_contract_sale_rental_end_label: "Return",
240
255
  docs_contract_sale_description_label: "Description",
241
256
  docs_contract_sale_quantity_label: "Qty",
242
257
  docs_contract_sale_unit_price_label: "Unit price excl. tax",
package/dist/i18n/fr.d.ts CHANGED
@@ -158,6 +158,10 @@ export declare const storefront: {
158
158
  checkout_estimated_total: string;
159
159
  checkout_form_title: string;
160
160
  checkout_form_description: string;
161
+ checkout_first_name_label: string;
162
+ checkout_first_name_placeholder: string;
163
+ checkout_last_name_label: string;
164
+ checkout_last_name_placeholder: string;
161
165
  checkout_full_name_label: string;
162
166
  checkout_full_name_placeholder: string;
163
167
  checkout_email_label: string;
@@ -179,6 +183,13 @@ export declare const storefront: {
179
183
  checkout_payment_total_excluding_tax: string;
180
184
  checkout_payment_vat: string;
181
185
  checkout_payment_deposit_amount: string;
186
+ checkout_insurance_title: string;
187
+ checkout_insurance_description: string;
188
+ checkout_insurance_deductible: string;
189
+ checkout_insurance_total_one: string;
190
+ checkout_insurance_total_other: string;
191
+ checkout_insurance_exempt_line: string;
192
+ checkout_insurance_tax_notice: string;
182
193
  checkout_coupon_title: string;
183
194
  checkout_coupon_label: string;
184
195
  checkout_coupon_placeholder: string;
@@ -237,6 +248,10 @@ export declare const storefront: {
237
248
  docs_contract_sale_due_date_label: string;
238
249
  docs_contract_sale_invoice_recipient_label: string;
239
250
  docs_contract_sale_credit_note_recipient_label: string;
251
+ docs_contract_sale_rental_details_title: string;
252
+ docs_contract_sale_booking_number_label: string;
253
+ docs_contract_sale_rental_start_label: string;
254
+ docs_contract_sale_rental_end_label: string;
240
255
  docs_contract_sale_description_label: string;
241
256
  docs_contract_sale_quantity_label: string;
242
257
  docs_contract_sale_unit_price_label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAybtB,CAAA"}
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwctB,CAAA"}